Interface FlowContext
- All Superinterfaces:
BroadcastMulticastCommunicationDecorator, BroadcastUserCommunicationDecorator, BroadcastUserListCommunicationDecorator, CommonDecorator, ExternalCommunicationDecorator, FlowAttachmentCommunication, FlowBindingLogicServerCommunication, FlowBroadcastCommunication, FlowCommon, FlowCommunicationEventBus, FlowExternalCommunication, FlowExternalWriteCommunication, FlowLogicCallCollectCommunication, FlowLogicCallCommunication, FlowLogicSendCommunication, FLowUserIdSettingCommunication, LogicCallCollectCommunicationDecorator, LogicCallCommunicationDecorator, LogicCommunicationDecorator, LogicSendCommunicationDecorator
- All Known Implementing Classes:
DefaultFlowContext
public interface FlowContext
extends FlowAttachmentCommunication, FLowUserIdSettingCommunication, FlowExternalCommunication, FlowLogicCallCommunication, FlowLogicSendCommunication, FlowBroadcastCommunication, FlowCommunicationEventBus, FlowExternalWriteCommunication, FlowLogicCallCollectCommunication, FlowBindingLogicServerCommunication
The FlowContext's lifecycle is limited to the duration of a single request flow.
- Author:
- 渔民小镇
- date:
- 2021-12-21
-
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.default intGet the merged command ID (cmd << 16 | subCmd).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.longGet the user ID associated with this request.default booleanhasError()Check if the flow context has an error.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.voidsetOriginalMethodResult(Object originalMethodResult) Set the original action method result.voidsetRequest(Request request) Set the request message.voidsetUserId(long userId) Set the user ID associated with this request.Methods 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 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, 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
-
Method Details
-
hasError
default boolean hasError()Check if the flow context has an error.- Returns:
trueif the error code is non-zero
-
getCmdMerge
default int getCmdMerge()Get the merged command ID (cmd << 16 | subCmd).- Returns:
- the merged command identifier
-
getNanoTime
long getNanoTime()Get the nano time when this flow context was created.- Returns:
- creation timestamp in nanoseconds
-
getUserId
long getUserId()Get the user ID associated with this request.- Specified by:
getUserIdin interfaceFlowCommon- Returns:
- the user ID
-
setUserId
void setUserId(long userId) Set the user ID associated with this request.- Specified by:
setUserIdin interfaceFlowCommon- Parameters:
userId- the user ID
-
getBarSkeleton
BarSkeleton getBarSkeleton()Get the BarSkeleton that is processing this flow.- Specified by:
getBarSkeletonin interfaceFlowCommon- Returns:
- the bar skeleton instance
-
setBarSkeleton
Set the BarSkeleton for this flow.- Parameters:
barSkeleton- the bar skeleton instance
-
getActionCommand
ActionCommand getActionCommand()Get the action command metadata for the current request.- Returns:
- the action command
-
setActionCommand
Set the action command metadata.- Parameters:
actionCommand- the action command
-
getActionController
Object getActionController()Get the action controller instance handling this request.- Returns:
- the controller instance
-
setActionController
Set the action controller instance.- Parameters:
actionController- the controller instance
-
getRequest
Request getRequest()Get the request message.- Specified by:
getRequestin interfaceFlowCommon- Returns:
- the request
-
setRequest
-
getMethodResult
-
setMethodResult
Set the action method result.- Specified by:
setMethodResultin interfaceFlowCommon- Parameters:
methodResult- the method result
-
getOriginalMethodResult
Object getOriginalMethodResult()Get the original unprocessed result from the action method.- Returns:
- the original method result
-
setOriginalMethodResult
Set the original action method result.- Parameters:
originalMethodResult- the original method result
-
getCommunicationType
CommunicationType getCommunicationType()Get the communication type for this flow.- Specified by:
getCommunicationTypein interfaceFlowCommon- Returns:
- the communication type
-
setCommunicationType
Set the communication type.- Parameters:
communicationType- the communication type
-
getErrorCode
int getErrorCode()Get the error code, 0 means no error.- Returns:
- the error code
-
setErrorCode
void setErrorCode(int errorCode) Set the error code.- Parameters:
errorCode- the error code
-
getErrorMessage
-
setErrorMessage
Set the error message.- Parameters:
errorMessage- the error message
-
getCommunicationAggregation
CommunicationAggregation getCommunicationAggregation()Get the communication aggregation for cross-service calls.- Specified by:
getCommunicationAggregationin interfaceCommonDecorator- Returns:
- the communication aggregation
-
setCommunicationAggregation
Set the communication aggregation.- Parameters:
communicationAggregation- the communication aggregation
-
getDataParam
-
setDataParam
Set the request data parameter.- Parameters:
dataParam- the data parameter
-
getCmdInfo
CmdInfo getCmdInfo()Get the command info (cmd, subCmd) for this request.- Specified by:
getCmdInfoin interfaceFlowCommon- Returns:
- the command info
-
setCmdInfo
-
getCurrentThreadExecutor
ThreadExecutor getCurrentThreadExecutor()Get the thread executor assigned to this flow.- Specified by:
getCurrentThreadExecutorin interfaceFlowCommon- Returns:
- the thread executor
-
setCurrentThreadExecutor
Set the thread executor for this flow.- Parameters:
currentThreadExecutor- the thread executor
-