Class UdpBindingServiceImpl

java.lang.Object
com.google.common.util.concurrent.AbstractIdleService
org.somda.sdc.dpws.udp.UdpBindingServiceImpl
All Implemented Interfaces:
com.google.common.util.concurrent.Service, UdpBindingService

public class UdpBindingServiceImpl extends com.google.common.util.concurrent.AbstractIdleService implements UdpBindingService
Default implementation of UdpBindingService.
  • 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 Summary

    Modifier and Type
    Method
    Description
    void
    Sends a UDP message given as parameter to the connected UDP socket.
    void
    Sets a message receiver callback to fetch any messages from the UDP socket.
    protected void
     
    protected void
     
     

    Methods inherited from class com.google.common.util.concurrent.AbstractIdleService

    addListener, awaitRunning, awaitRunning, awaitRunning, awaitTerminated, awaitTerminated, awaitTerminated, executor, failureCause, isRunning, serviceName, startAsync, state, stopAsync

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface com.google.common.util.concurrent.Service

    addListener, awaitRunning, awaitRunning, awaitRunning, awaitTerminated, awaitTerminated, awaitTerminated, failureCause, isRunning, startAsync, state, stopAsync
  • Method Details

    • startUp

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

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

      public void setMessageReceiver(UdpMessageReceiverCallback receiver)
      Description copied from interface: UdpBindingService
      Sets a message receiver callback to fetch any messages from the UDP socket.

      A received message contains the payload as well as sender address and port.

      Specified by:
      setMessageReceiver in interface UdpBindingService
      Parameters:
      receiver - the message receiver to set.
    • sendMessage

      public void sendMessage(UdpMessage message) throws IOException, TransportException
      Description copied from interface: UdpBindingService
      Sends a UDP message given as parameter to the connected UDP socket.

      The function blocks until the message is sent.

      Specified by:
      sendMessage in interface UdpBindingService
      Parameters:
      message - the message to send. The message shall contain host and port of the receiver in case of unicast; multicast does not need transport information as those are stored in the binding service.
      Throws:
      IOException - on any IO problem.
      TransportException - in case the message lacks address information and no multicast socket is found.
    • toString

      public String toString()
      Overrides:
      toString in class com.google.common.util.concurrent.AbstractIdleService