Class UdpMessageQueueServiceImpl

    • Nested Class Summary

      • Nested classes/interfaces inherited from interface com.google.common.util.concurrent.Service

        com.google.common.util.concurrent.Service.Listener, com.google.common.util.concurrent.Service.State
    • Method Detail

      • setUdpBinding

        public void setUdpBinding​(UdpBindingService udpBinding)
        Description copied from interface: UdpMessageQueueService
        Injects the UDP binding service.

        Without a UDP binding service the message queue cannot send and receive messages. Make sure the UDP binding is injected before the service is started.

        Specified by:
        setUdpBinding in interface UdpMessageQueueService
        Parameters:
        udpBinding - the UDP binding service to inject.
      • sendMessage

        public boolean sendMessage​(UdpMessage message)
        Description copied from interface: UdpMessageQueueService
        Queues an outgoing UDP message.
        Specified by:
        sendMessage in interface UdpMessageQueueService
        Parameters:
        message - the message to be send.
        Returns:
        true if the message could be queued, otherwise false (queue overflow).
      • startUp

        protected void startUp()
                        throws Exception
        Specified by:
        startUp in class com.google.common.util.concurrent.AbstractIdleService
        Throws:
        Exception
      • shutDown

        protected void shutDown()
        Specified by:
        shutDown in class com.google.common.util.concurrent.AbstractIdleService
      • receive

        public void receive​(UdpMessage udpMessage)
        Description copied from interface: UdpMessageReceiverCallback
        Receive one incoming UDP message.
        Specified by:
        receive in interface UdpMessageReceiverCallback
        Parameters:
        udpMessage - UDP data as received from the network. The message contains the payload as well as the sender's address and port.