Class RelayMessageComponentFeature
- java.lang.Object
-
- jadex.bridge.component.impl.AbstractComponentFeature
-
- jadex.bridge.component.impl.MessageComponentFeature
-
- jadex.micro.features.impl.MicroMessageComponentFeature
-
- jadex.platform.service.message.relaytransport.RelayMessageComponentFeature
-
- All Implemented Interfaces:
IComponentFeature
,IMessageFeature
,jadex.bridge.component.impl.IInternalMessageFeature
public class RelayMessageComponentFeature extends jadex.micro.features.impl.MicroMessageComponentFeature
Message feature for relay component, skips body decryption on forwarded messages.
-
-
Field Summary
Fields Modifier and Type Field Description IMessageHandler
relaymessagehandler
Handler for relay messages.java.util.Map<IComponentIdentifier,Tuple2<ITransportService,java.lang.Integer>>
relaytransportcache
Transport cache for the relay, excludes itself.
-
Constructor Summary
Constructors Constructor Description RelayMessageComponentFeature(IInternalAccess component, ComponentCreationInfo cinfo)
Create the feature.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.util.Collection<ITransportService>
getAllTransports()
Gets all transports on the platform except the relay.protected java.util.Map<IComponentIdentifier,Tuple2<ITransportService,java.lang.Integer>>
getTransportCache(IComponentIdentifier platformid)
Gets the transport cache services.void
messageArrived(IMsgHeader header, byte[] bodydata)
Inform the component that a message has arrived.IFuture<java.lang.Void>
sendToTransports(IMsgHeader header, byte[] encryptedheader, byte[] encryptedbody)
Forwards the prepared message to the transport layer.void
setRelayMessageHandler(IMessageHandler handler)
Sets the handler for relay messages.-
Methods inherited from class jadex.micro.features.impl.MicroMessageComponentFeature
processUnhandledMessage, streamArrived
-
Methods inherited from class jadex.bridge.component.impl.MessageComponentFeature
addInputConnection, addMessageHandler, addOutputConnection, createInputConnection, createOutputConnection, deserializeMessage, doSendMessage, findPreprocessor, generateConversationId, getInitiatorConnections, getInputConnection, getMessageEvents, getMinLeaseTime, getOutputConnection, getParticipantConnections, getParticipantInputConnection, getParticipantOutputConnection, getPreprocessor, getSecurityService, getSerializationServices, getStreamCount, handleMessage, handleStreamPacket, hasUserBody, init, initInputConnection, initOutputConnection, internalCreateInputConnection, internalCreateOutputConnection, isSecurityMessage, isTrusted, messageArrived, notifyMessageReceived, notifyMessageSent, preprocessMessage, removeInputConnection, removeMessageHandler, removeOutputConnection, sendMessage, sendMessage, sendMessage, sendMessageAndWait, sendMessageAndWait, sendReply, sendToAllTransports, shutdown, startStreamCheckAliveBehavior, stopStreamCheckAliveBehavior
-
-
-
-
Field Detail
-
relaytransportcache
public java.util.Map<IComponentIdentifier,Tuple2<ITransportService,java.lang.Integer>> relaytransportcache
Transport cache for the relay, excludes itself.
-
relaymessagehandler
public IMessageHandler relaymessagehandler
Handler for relay messages.
-
-
Constructor Detail
-
RelayMessageComponentFeature
public RelayMessageComponentFeature(IInternalAccess component, ComponentCreationInfo cinfo)
Create the feature.
-
-
Method Detail
-
sendToTransports
public IFuture<java.lang.Void> sendToTransports(IMsgHeader header, byte[] encryptedheader, byte[] encryptedbody)
Forwards the prepared message to the transport layer.- Specified by:
sendToTransports
in interfacejadex.bridge.component.impl.IInternalMessageFeature
- Overrides:
sendToTransports
in classjadex.bridge.component.impl.MessageComponentFeature
- Parameters:
header
- The message header.encryptedheader
- The encrypted header.encryptedbody
- The encrypted message body.- Returns:
- Null, when done, exception if failed.
-
messageArrived
public void messageArrived(IMsgHeader header, byte[] bodydata)
Inform the component that a message has arrived. Called from transports (i.e. remote messages).- Specified by:
messageArrived
in interfacejadex.bridge.component.impl.IInternalMessageFeature
- Overrides:
messageArrived
in classjadex.bridge.component.impl.MessageComponentFeature
- Parameters:
header
- The message header.bodydata
- The encrypted message that arrived.
-
setRelayMessageHandler
public void setRelayMessageHandler(IMessageHandler handler)
Sets the handler for relay messages.- Parameters:
handler
- The handler.
-
getTransportCache
protected java.util.Map<IComponentIdentifier,Tuple2<ITransportService,java.lang.Integer>> getTransportCache(IComponentIdentifier platformid)
Gets the transport cache services.- Overrides:
getTransportCache
in classjadex.bridge.component.impl.MessageComponentFeature
- Parameters:
platformid
- The platform ID.- Returns:
- The transport cache.
-
getAllTransports
protected java.util.Collection<ITransportService> getAllTransports()
Gets all transports on the platform except the relay.- Overrides:
getAllTransports
in classjadex.bridge.component.impl.MessageComponentFeature
- Returns:
- All transports.
-
-