Class DummyTransportTrx

java.lang.Object
net.messagevortex.AbstractDaemon
net.messagevortex.transport.dummy.DummyTransportTrx
All Implemented Interfaces:
RunningDaemon, Transport, TransportSender

public class DummyTransportTrx extends AbstractDaemon implements Transport
  • Constructor Details

    • DummyTransportTrx

      public DummyTransportTrx(String section) throws IOException

      Constructor to set up a dummy endpoint with named id and blender.

      Parameters:
      section - section containing data to set up endpoint
      Throws:
      IOException - if endpoint id is already defined
    • DummyTransportTrx

      public DummyTransportTrx(String id, TransportReceiver blender) throws IOException

      Constructor to set up a dummy endpoint with named id and blender.

      Parameters:
      id - ID of the endpoint
      blender - blender to be used for received messages
      Throws:
      IOException - if endpoint id is already defined
    • DummyTransportTrx

      public DummyTransportTrx(TransportReceiver blender) throws IOException
      Constructor to create an endpoint with a random id.
      Parameters:
      blender - reference to the respective blender layer
      Throws:
      IOException - if thread problems occur
  • Method Details

    • setClusterName

      public static void setClusterName(String newName) throws IOException

      Sets the name of the cluster instance.

      Parameters:
      newName - the new Name of the instance to connect to.
      Throws:
      IOException - if the cluster is already initialized
    • setLocalMode

      public static boolean setLocalMode(boolean lm) throws IOException

      Set local only mode for dummy transport.

      Parameters:
      lm - true if local mode should be set
      Returns:
      old state of local mode
      Throws:
      IOException - if cluster is already initialized
    • shutdownDaemon

      public void shutdownDaemon()
      Description copied from interface: RunningDaemon

      Shuts this class down.

      This frees all resources and ends all threads for an application or layer shutdown. It is not possible to call start() after running shutdown().

      Specified by:
      shutdownDaemon in interface RunningDaemon
      Overrides:
      shutdownDaemon in class AbstractDaemon
    • sendMessage

      public void sendMessage(String address, InputStream is) throws IOException

      send a message to another dummy endpoint.

      FIXME: This only works for local messages

      Specified by:
      sendMessage in interface TransportSender
      Parameters:
      address - the string representation of the target address on the transport layer
      is - the input stream to be sent
      Throws:
      IOException - if requested endpoint id is unknown
    • clearDummyEndpoints

      public static void clearDummyEndpoints()

      Remove all Dummy endpoints from the main listing.