Class DefaultCommunication
java.lang.Object
com.iohao.net.framework.communication.DefaultCommunication
- All Implemented Interfaces:
BroadcastMulticastCommunicationDecorator, BroadcastUserCommunicationDecorator, BroadcastUserListCommunicationDecorator, CommonDecorator, Communication, ExternalCommunicationDecorator, LogicCallCollectCommunicationDecorator, LogicCallCommunicationDecorator, LogicCommunicationDecorator, LogicSendCommunicationDecorator
Default implementation of
Communication that delegates to the global CommunicationAggregation.
Creates protocol messages (ExternalRequestMessage and RequestMessage) by populating
them with trace IDs, network IDs, and source server metadata from the current FlowContext.
- Since:
- 25.1
- Author:
- 渔民小镇
- date:
- 2025-09-28
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionofExternalRequestMessage(int templateId, byte[] payload) Create anExternalRequestMessagefor communicating with external servers.ofRequestMessage(CmdInfo cmdInfo, byte[] dataBytes) Create aRequestMessagefor inter-logic-server communication.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 CommonDecorator
getCommunicationAggregation, getCurrentExecutor, getTraceIdMethods 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 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, ofSendMessage, ofSendMessageListBool, ofSendMessageListInt, ofSendMessageListLong, ofSendMessageListString, send, send, send, send, send, send, send, send, send, sendListBool, sendListInt, sendListLong, sendListString
-
Constructor Details
-
DefaultCommunication
public DefaultCommunication()
-
-
Method Details
-
ofExternalRequestMessage
Create anExternalRequestMessagefor communicating with external servers.Populates the message with the given template ID, payload, current trace ID, and the global network ID from
CoreGlobalConfig.- Specified by:
ofExternalRequestMessagein interfaceExternalCommunicationDecorator- Parameters:
templateId- the external request template identifierpayload- the serialized request payload (may benull)- Returns:
- a fully populated external request message
-
ofRequestMessage
Create aRequestMessagefor inter-logic-server communication.Derives the current
FlowContextviaFlowContextKeys, copies routing metadata from the original request, and sets the network ID and source server ID.- Specified by:
ofRequestMessagein interfaceLogicCommunicationDecorator- Parameters:
cmdInfo- the command routing information (cmd + subCmd)dataBytes- the serialized request data- Returns:
- a fully populated request message ready for dispatch
-