Class DefaultFlowContext
java.lang.Object
com.iohao.net.framework.core.flow.DefaultFlowContext
- All Implemented Interfaces:
BroadcastMulticastCommunicationDecorator, BroadcastUserCommunicationDecorator, BroadcastUserListCommunicationDecorator, CommonDecorator, ExternalCommunicationDecorator, LogicCallCollectCommunicationDecorator, LogicCallCommunicationDecorator, LogicCommunicationDecorator, LogicSendCommunicationDecorator, FlowAttachmentCommunication, FlowBindingLogicServerCommunication, FlowBroadcastCommunication, FlowCommon, FlowCommunicationEventBus, FlowContext, FlowExternalCommunication, FlowExternalWriteCommunication, FlowLogicCallCollectCommunication, FlowLogicCallCommunication, FlowLogicSendCommunication, FLowUserIdSettingCommunication
Default implementation of
FlowContext with Lombok-generated getters and setters.- Since:
- 25.1
- Author:
- 渔民小镇
- date:
- 2025-10-09
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet the action command metadata for the current request.Get the action controller instance handling this request.Get the BarSkeleton that is processing this flow.Get the command info (cmd, subCmd) for this request.Get the communication aggregation for cross-service calls.Get the communication type for this flow.Get the thread executor assigned to this flow.Get the deserialized request data parameter.intGet the error code, 0 means no error.Get the error message.Get the result returned by the action method.longGet the nano time when this flow context was created.Get the original unprocessed result from the action method.Get the request message.longWhen verifyIdentity is False, this value represents the userChannelId.ofRequestMessage(CmdInfo cmdInfo, byte[] dataBytes) Create a newRequestMessagefor cross-logic-server calls, copying routing fields from the current request.voidsetActionCommand(ActionCommand actionCommand) Set the action command metadata.voidsetActionController(Object actionController) Set the action controller instance.voidsetBarSkeleton(BarSkeleton barSkeleton) Set the BarSkeleton for this flow.voidsetCmdInfo(CmdInfo cmdInfo) Set the command info.voidsetCommunicationAggregation(CommunicationAggregation communicationAggregation) Set the communication aggregation.voidsetCommunicationType(CommunicationType communicationType) Set the communication type.voidsetCurrentThreadExecutor(ThreadExecutor currentThreadExecutor) Set the thread executor for this flow.voidsetDataParam(Object dataParam) Set the request data parameter.voidsetErrorCode(int errorCode) Set the error code.voidsetErrorMessage(String errorMessage) Set the error message.voidsetMethodResult(Object methodResult) Set the action method result.voidsetNanoTime(long nanoTime) voidsetOriginalMethodResult(Object originalMethodResult) Set the original action method result.voidsetRequest(Request request) Set the request message.voidsetUserId(long userId) When verifyIdentity is False, this value represents the userChannelId.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface BroadcastMulticastCommunicationDecorator
broadcast, broadcastMulticast, broadcastMulticast, broadcastMulticast, broadcastMulticast, broadcastMulticast, broadcastMulticast, broadcastMulticast, broadcastMulticast, broadcastMulticastListBool, broadcastMulticastListInt, broadcastMulticastListLong, broadcastMulticastListStringMethods inherited from interface BroadcastUserCommunicationDecorator
broadcast, broadcastUser, broadcastUser, broadcastUser, broadcastUser, broadcastUser, broadcastUser, broadcastUser, broadcastUser, broadcastUserListBool, broadcastUserListInt, broadcastUserListLong, broadcastUserListStringMethods inherited from interface BroadcastUserListCommunicationDecorator
broadcast, broadcastUsers, broadcastUsers, broadcastUsers, broadcastUsers, broadcastUsers, broadcastUsers, broadcastUsers, broadcastUsers, broadcastUsersListBool, broadcastUsersListInt, broadcastUsersListLong, broadcastUsersListStringMethods inherited from interface ExternalCommunicationDecorator
bindingLogicServer, callExternal, callExternal, callExternal, callExternalAsync, callExternalAsync, callExternalAsync, callExternalAsync, callExternalCollect, callExternalCollect, callExternalCollect, callExternalCollectAsync, callExternalCollectAsync, callExternalCollectAsync, callExternalCollectAsync, callExternalCollectFuture, callExternalCollectFuture, callExternalCollectFuture, callExternalFuture, callExternalFuture, callExternalFuture, ofExternalRequestMessageMethods inherited from interface FlowAttachmentCommunication
getAttachment, getAttachment, updateAttachment, updateAttachment, updateAttachmentAsync, updateAttachmentAsyncMethods inherited from interface FlowBindingLogicServerCommunication
bindingLogicServer, clearBindingLogicServerMethods inherited from interface FlowBroadcastCommunication
broadcastMe, broadcastMe, broadcastMe, broadcastMe, broadcastMe, broadcastMe, broadcastMe, broadcastMe, broadcastMe, broadcastMeListBool, broadcastMeListInt, broadcastMeListLong, broadcastMeListStringMethods inherited from interface FlowCommon
execute, executeUser, executeVirtual, getCurrentExecutor, getExecutorRegion, getServer, getServerId, getThreadIndex, getTraceId, getUserThreadExecutor, getVirtualThreadExecutorMethods inherited from interface FlowCommunicationEventBus
fire, fireAny, fireAnySync, fireLocal, fireLocalSync, fireMe, fireMeSync, fireSync, getEventBus, ofEventBusMessageMethods inherited from interface FlowContext
getCmdMerge, hasErrorMethods inherited from interface FlowExternalCommunication
ofExternalRequestMessageMethods inherited from interface FlowExternalWriteCommunication
writeMessage, writeMessage, writeMessage, writeMessage, writeMessage, writeMessageMethods inherited from interface FlowLogicSendCommunication
ofSendMessageMethods inherited from interface FLowUserIdSettingCommunication
bindingUserId, bindingUserIdAndGetResultMethods inherited from interface LogicCallCollectCommunicationDecorator
callCollect, callCollect, callCollect, callCollect, callCollect, callCollect, callCollect, callCollect, callCollect, callCollectAsync, callCollectAsync, callCollectAsync, callCollectAsync, callCollectAsync, callCollectAsync, callCollectAsync, callCollectAsync, callCollectAsync, callCollectAsync, callCollectAsyncListBool, callCollectAsyncListInt, callCollectAsyncListLong, callCollectAsyncListString, callCollectFuture, callCollectFuture, callCollectFuture, callCollectFuture, callCollectFuture, callCollectFuture, callCollectFuture, callCollectFuture, callCollectFuture, callCollectFutureListBool, callCollectFutureListInt, callCollectFutureListLong, callCollectFutureListString, callCollectListBool, callCollectListInt, callCollectListLong, callCollectListStringMethods inherited from interface LogicCallCommunicationDecorator
call, call, call, call, call, call, call, call, call, callAsync, callAsync, callAsync, callAsync, callAsync, callAsync, callAsync, callAsync, callAsync, callAsync, callAsyncListBool, callAsyncListInt, callAsyncListLong, callAsyncListString, callFuture, callFuture, callFuture, callFuture, callFuture, callFuture, callFuture, callFuture, callFuture, callFutureListBool, callFutureListInt, callFutureListLong, callFutureListString, callListBool, callListInt, callListLong, callListStringMethods inherited from interface LogicCommunicationDecorator
ofRequestMessage, ofRequestMessage, ofRequestMessage, ofRequestMessage, ofRequestMessage, ofRequestMessage, ofRequestMessageListBool, ofRequestMessageListInt, ofRequestMessageListLong, ofRequestMessageListStringMethods inherited from interface LogicSendCommunicationDecorator
ofSendMessage, ofSendMessage, ofSendMessage, ofSendMessage, ofSendMessage, ofSendMessage, ofSendMessageListBool, ofSendMessageListInt, ofSendMessageListLong, ofSendMessageListString, send, send, send, send, send, send, send, send, send, sendListBool, sendListInt, sendListLong, sendListString
-
Constructor Details
-
DefaultFlowContext
public DefaultFlowContext()
-
-
Method Details
-
getNanoTime
public long getNanoTime()Description copied from interface:FlowContextGet the nano time when this flow context was created.- Specified by:
getNanoTimein interfaceFlowContext- Returns:
- creation timestamp in nanoseconds
-
ofRequestMessage
Create a newRequestMessagefor cross-logic-server calls, copying routing fields from the current request.- Specified by:
ofRequestMessagein interfaceLogicCommunicationDecorator- Parameters:
cmdInfo- the target command routing infodataBytes- the serialized request payload- Returns:
- a new request message with source server and net ID populated
-
setUserId
public void setUserId(long userId) When verifyIdentity is False, this value represents the userChannelId.- Specified by:
setUserIdin interfaceFlowCommon- Specified by:
setUserIdin interfaceFlowContext- Parameters:
userId- the user ID
-
setBarSkeleton
Description copied from interface:FlowContextSet the BarSkeleton for this flow.- Specified by:
setBarSkeletonin interfaceFlowContext- Parameters:
barSkeleton- the bar skeleton instance
-
setActionCommand
Description copied from interface:FlowContextSet the action command metadata.- Specified by:
setActionCommandin interfaceFlowContext- Parameters:
actionCommand- the action command
-
setActionController
Description copied from interface:FlowContextSet the action controller instance.- Specified by:
setActionControllerin interfaceFlowContext- Parameters:
actionController- the controller instance
-
setRequest
Description copied from interface:FlowContextSet the request message.- Specified by:
setRequestin interfaceFlowContext- Parameters:
request- the request
-
setMethodResult
Description copied from interface:FlowContextSet the action method result.- Specified by:
setMethodResultin interfaceFlowCommon- Specified by:
setMethodResultin interfaceFlowContext- Parameters:
methodResult- the method result
-
setOriginalMethodResult
Description copied from interface:FlowContextSet the original action method result.- Specified by:
setOriginalMethodResultin interfaceFlowContext- Parameters:
originalMethodResult- the original method result
-
setCommunicationType
Description copied from interface:FlowContextSet the communication type.- Specified by:
setCommunicationTypein interfaceFlowContext- Parameters:
communicationType- the communication type
-
setErrorCode
public void setErrorCode(int errorCode) Description copied from interface:FlowContextSet the error code.- Specified by:
setErrorCodein interfaceFlowContext- Parameters:
errorCode- the error code
-
setErrorMessage
Description copied from interface:FlowContextSet the error message.- Specified by:
setErrorMessagein interfaceFlowContext- Parameters:
errorMessage- the error message
-
setCommunicationAggregation
Description copied from interface:FlowContextSet the communication aggregation.- Specified by:
setCommunicationAggregationin interfaceFlowContext- Parameters:
communicationAggregation- the communication aggregation
-
setNanoTime
public void setNanoTime(long nanoTime) -
setDataParam
Description copied from interface:FlowContextSet the request data parameter.- Specified by:
setDataParamin interfaceFlowContext- Parameters:
dataParam- the data parameter
-
setCmdInfo
Description copied from interface:FlowContextSet the command info.- Specified by:
setCmdInfoin interfaceFlowContext- Parameters:
cmdInfo- the command info
-
setCurrentThreadExecutor
Description copied from interface:FlowContextSet the thread executor for this flow.- Specified by:
setCurrentThreadExecutorin interfaceFlowContext- Parameters:
currentThreadExecutor- the thread executor
-
getUserId
public long getUserId()When verifyIdentity is False, this value represents the userChannelId.- Specified by:
getUserIdin interfaceFlowCommon- Specified by:
getUserIdin interfaceFlowContext- Returns:
- the user ID
-
getBarSkeleton
Description copied from interface:FlowContextGet the BarSkeleton that is processing this flow.- Specified by:
getBarSkeletonin interfaceFlowCommon- Specified by:
getBarSkeletonin interfaceFlowContext- Returns:
- the bar skeleton instance
-
getActionCommand
Description copied from interface:FlowContextGet the action command metadata for the current request.- Specified by:
getActionCommandin interfaceFlowContext- Returns:
- the action command
-
getActionController
Description copied from interface:FlowContextGet the action controller instance handling this request.- Specified by:
getActionControllerin interfaceFlowContext- Returns:
- the controller instance
-
getRequest
Description copied from interface:FlowContextGet the request message.- Specified by:
getRequestin interfaceFlowCommon- Specified by:
getRequestin interfaceFlowContext- Returns:
- the request
-
getMethodResult
Description copied from interface:FlowContextGet the result returned by the action method.- Specified by:
getMethodResultin interfaceFlowContext- Returns:
- the method result
-
getOriginalMethodResult
Description copied from interface:FlowContextGet the original unprocessed result from the action method.- Specified by:
getOriginalMethodResultin interfaceFlowContext- Returns:
- the original method result
-
getCommunicationType
Description copied from interface:FlowContextGet the communication type for this flow.- Specified by:
getCommunicationTypein interfaceFlowCommon- Specified by:
getCommunicationTypein interfaceFlowContext- Returns:
- the communication type
-
getErrorCode
public int getErrorCode()Description copied from interface:FlowContextGet the error code, 0 means no error.- Specified by:
getErrorCodein interfaceFlowContext- Returns:
- the error code
-
getErrorMessage
Description copied from interface:FlowContextGet the error message.- Specified by:
getErrorMessagein interfaceFlowContext- Returns:
- the error message, or
nullif none
-
getCommunicationAggregation
Description copied from interface:FlowContextGet the communication aggregation for cross-service calls.- Specified by:
getCommunicationAggregationin interfaceCommonDecorator- Specified by:
getCommunicationAggregationin interfaceFlowContext- Returns:
- the communication aggregation
-
getDataParam
Description copied from interface:FlowContextGet the deserialized request data parameter.- Specified by:
getDataParamin interfaceFlowContext- Returns:
- the data parameter
-
getCmdInfo
Description copied from interface:FlowContextGet the command info (cmd, subCmd) for this request.- Specified by:
getCmdInfoin interfaceFlowCommon- Specified by:
getCmdInfoin interfaceFlowContext- Returns:
- the command info
-
getCurrentThreadExecutor
Description copied from interface:FlowContextGet the thread executor assigned to this flow.- Specified by:
getCurrentThreadExecutorin interfaceFlowCommon- Specified by:
getCurrentThreadExecutorin interfaceFlowContext- Returns:
- the thread executor
-