public interface TcpConnection
extends java.lang.Runnable
Socket
and SocketChannel
that
sends Message
objects by serializing the payload
and streaming it to the destination. Requires a TcpListener
to receive incoming messages.Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the connection.
|
java.lang.String |
getConnectionId() |
org.springframework.core.serializer.Deserializer<?> |
getDeserializer() |
java.lang.Object |
getDeserializerStateKey() |
java.lang.String |
getHostAddress() |
java.lang.String |
getHostName() |
TcpListener |
getListener() |
java.lang.Object |
getPayload()
Uses the deserializer to obtain the message payload
from the connection's input stream.
|
int |
getPort() |
org.springframework.core.serializer.Serializer<?> |
getSerializer() |
long |
incrementAndGetConnectionSequence() |
boolean |
isOpen() |
boolean |
isServer() |
boolean |
isSingleUse() |
void |
send(Message<?> message)
Converts and sends the message.
|
void close()
boolean isOpen()
void send(Message<?> message) throws java.lang.Exception
message
- The messagejava.lang.Exception
java.lang.Object getPayload() throws java.lang.Exception
java.lang.Exception
java.lang.String getHostName()
java.lang.String getHostAddress()
int getPort()
java.lang.String getConnectionId()
boolean isSingleUse()
boolean isServer()
org.springframework.core.serializer.Deserializer<?> getDeserializer()
org.springframework.core.serializer.Serializer<?> getSerializer()
TcpListener getListener()
long incrementAndGetConnectionSequence()
java.lang.Object getDeserializerStateKey()
Deserializer
that
maintains state for this connection. Currently, this would be the InputStream
associated with the connection, but the object should be treated as opaque
and ONLY used as a key.