Class StdoutMessageSender

  • All Implemented Interfaces:
    IMessageSender

    public class StdoutMessageSender
    extends java.lang.Object
    implements IMessageSender
    this is a dummy IMessageSender implementation for test purpose only.
    • Constructor Detail

      • StdoutMessageSender

        public StdoutMessageSender()
    • Method Detail

      • connect

        public void connect()
                     throws java.io.IOException
        Specified by:
        connect in interface IMessageSender
        Throws:
        java.io.IOException
      • initReceiver

        public void initReceiver()
                          throws java.net.SocketTimeoutException
        Description copied from interface: IMessageSender
        Initialize the receiver. the underlying socket server will be polling until a first client connect.
        Specified by:
        initReceiver in interface IMessageSender
        Throws:
        java.net.SocketTimeoutException
      • stopReceiver

        public void stopReceiver()
        Description copied from interface: IMessageSender
        Stop the receiver. it provides a way that allow the API invoker to stop the receiver, e.g. break from a dead while loop
        Specified by:
        stopReceiver in interface IMessageSender
      • sendMessage

        public void sendMessage​(IMessage message)
                         throws java.lang.Exception
        Specified by:
        sendMessage in interface IMessageSender
        Throws:
        java.lang.Exception
      • receiveMessage

        public IMessage receiveMessage()
                                throws java.lang.Exception
        Description copied from interface: IMessageSender
        Will return null or throw EOFException when the connection has been severed.
        Specified by:
        receiveMessage in interface IMessageSender
        Throws:
        java.lang.Exception