Class 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.
      • Fields inherited from class jadex.micro.features.impl.MicroMessageComponentFeature

        FACTORY
      • Fields inherited from class jadex.bridge.component.impl.MessageComponentFeature

        awaitingmessages, checker, EMPTY_HANDLER_ARRAY, EXCEPTION, execfeat, icons, messagehandlers, pcons, platformid, preprocessors, secservice, SENDREPLY, subscriptions
      • Fields inherited from class jadex.bridge.component.impl.AbstractComponentFeature

        cinfo, component, guesser
    • 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
      • Methods inherited from class jadex.bridge.component.impl.AbstractComponentFeature

        body, getClockService, getComponent, getExecutionService, getExternalFacade, getExternalFacadeType, getInternalAccess, getParameterGuesser, getValueFetcher, kill
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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 interface jadex.bridge.component.impl.IInternalMessageFeature
        Overrides:
        sendToTransports in class jadex.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 interface jadex.bridge.component.impl.IInternalMessageFeature
        Overrides:
        messageArrived in class jadex.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 class jadex.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 class jadex.bridge.component.impl.MessageComponentFeature
        Returns:
        All transports.