Class LoopbackConnectionHandler
java.lang.Object
org.tentackle.trip.transport.ConnectionHandler
org.tentackle.trip.transport.LoopbackConnectionHandler
- All Implemented Interfaces:
Runnable
Loopback connection handler for testing purposes.
-
Constructor Summary
ConstructorsConstructorDescriptionLoopbackConnectionHandler(LoopbackTransport transport, String name, InputStream inputStream, OutputStream outputStream) Creates a new handler. -
Method Summary
Modifier and TypeMethodDescriptionprotected TripStreamcreateStream(UUID id) Creates a new stream for the given UUID.protected booleanChecks whether the connection is still alive.Methods inherited from class ConnectionHandler
getConnectionName, getInputStream, getOutputStream, getTransport, run
-
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-loopname- the name of the connectioninputStream- the input stream associated with this connectionoutputStream- the output stream associated with this connection
-
-
Method Details
-
createStream
Description copied from class:ConnectionHandlerCreates a new stream for the given UUID.- Overrides:
createStreamin classConnectionHandler- Parameters:
id- the UUID of the client's transport- Returns:
- the trip stream
-
isConnectionAlive
protected boolean isConnectionAlive()Description copied from class:ConnectionHandlerChecks whether the connection is still alive.- Overrides:
isConnectionAlivein classConnectionHandler- Returns:
- true if the connection is still alive, false to terminate the handler
-