Class LoopbackConnectionHandler

java.lang.Object
org.tentackle.trip.transport.ConnectionHandler
org.tentackle.trip.transport.LoopbackConnectionHandler
All Implemented Interfaces:
Runnable

public class LoopbackConnectionHandler extends ConnectionHandler
Loopback connection handler for testing purposes.
  • Constructor Details

    • LoopbackConnectionHandler

      public LoopbackConnectionHandler(LoopbackTransport transport, String name, InputStream inputStream, OutputStream outputStream)
      Creates a new handler.
      Parameters:
      transport - the transport associated with this accept-loop
      name - the name of the connection
      inputStream - the input stream associated with this connection
      outputStream - the output stream associated with this connection
  • Method Details

    • createStream

      protected TripStream createStream(UUID id)
      Description copied from class: ConnectionHandler
      Creates a new stream for the given UUID.
      Overrides:
      createStream in class ConnectionHandler
      Parameters:
      id - the UUID of the client's transport
      Returns:
      the trip stream
    • isConnectionAlive

      protected boolean isConnectionAlive()
      Description copied from class: ConnectionHandler
      Checks whether the connection is still alive.
      Overrides:
      isConnectionAlive in class ConnectionHandler
      Returns:
      true if the connection is still alive, false to terminate the handler