|
Spring Integration | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.integration.ip.tcp.connection.TcpConnectionSupport org.springframework.integration.ip.tcp.connection.TcpConnectionInterceptorSupport
public abstract class TcpConnectionInterceptorSupport
Base class for TcpConnectionIntercepters; passes all method calls through
to the underlying TcpConnection
.
Field Summary |
---|
Fields inherited from class org.springframework.integration.ip.tcp.connection.TcpConnectionSupport |
---|
logger |
Constructor Summary | |
---|---|
TcpConnectionInterceptorSupport()
|
Method Summary | |
---|---|
void |
addNewConnection(TcpConnection connection)
When we are using sockets owned by a TcpListener , this
method is called each time a new connection is made. |
void |
close()
Closes this 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()
|
TcpSender |
getSender()
|
org.springframework.core.serializer.Serializer<?> |
getSerializer()
|
TcpConnectionSupport |
getTheConnection()
Returns the underlying connection (or next interceptor) |
protected boolean |
hasRealSender()
|
long |
incrementAndGetConnectionSequence()
|
boolean |
isOpen()
|
boolean |
isServer()
|
boolean |
isSingleUse()
|
boolean |
onMessage(Message<?> message)
Called by a TCPConnection when a new message arrives. |
void |
registerListener(TcpListener listener)
Sets the listener that will receive incoming Messages. |
void |
registerSender(TcpSender sender)
Registers a sender. |
void |
removeDeadConnection(TcpConnection connection)
When we are using sockets owned by a TcpListener , this
method is called each time a connection is closed. |
void |
run()
|
void |
send(Message<?> message)
Converts and sends the message. |
void |
setDeserializer(org.springframework.core.serializer.Deserializer<?> deserializer)
|
void |
setMapper(TcpMessageMapper mapper)
|
void |
setSerializer(org.springframework.core.serializer.Serializer<?> serializer)
|
void |
setSingleUse(boolean singleUse)
|
void |
setTheConnection(TcpConnectionSupport theConnection)
Sets the underlying connection (or next interceptor) |
Methods inherited from class org.springframework.integration.ip.tcp.connection.TcpConnectionSupport |
---|
afterSend, closeConnection, getMapper, publishConnectionCloseEvent, publishConnectionExceptionEvent, publishConnectionOpenEvent, publishEvent |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TcpConnectionInterceptorSupport()
Method Detail |
---|
public void close()
TcpConnectionSupport
close
in interface TcpConnection
close
in class TcpConnectionSupport
public boolean isOpen()
isOpen
in interface TcpConnection
public java.lang.Object getPayload() throws java.lang.Exception
TcpConnection
getPayload
in interface TcpConnection
java.lang.Exception
public java.lang.String getHostName()
getHostName
in interface TcpConnection
getHostName
in class TcpConnectionSupport
public java.lang.String getHostAddress()
getHostAddress
in interface TcpConnection
getHostAddress
in class TcpConnectionSupport
public int getPort()
getPort
in interface TcpConnection
public java.lang.Object getDeserializerStateKey()
getDeserializerStateKey
in interface TcpConnection
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.public void registerListener(TcpListener listener)
TcpConnectionSupport
registerListener
in class TcpConnectionSupport
listener
- The listener.public void registerSender(TcpSender sender)
TcpConnectionSupport
registerSender
in class TcpConnectionSupport
sender
- the sender.public java.lang.String getConnectionId()
getConnectionId
in interface TcpConnection
getConnectionId
in class TcpConnectionSupport
public boolean isSingleUse()
isSingleUse
in interface TcpConnection
isSingleUse
in class TcpConnectionSupport
public void run()
run
in interface java.lang.Runnable
public void setSingleUse(boolean singleUse)
setSingleUse
in class TcpConnectionSupport
singleUse
- true if this socket is to used once and
discarded.public void setMapper(TcpMessageMapper mapper)
setMapper
in class TcpConnectionSupport
mapper
- the mapper to setpublic org.springframework.core.serializer.Deserializer<?> getDeserializer()
getDeserializer
in interface TcpConnection
getDeserializer
in class TcpConnectionSupport
public void setDeserializer(org.springframework.core.serializer.Deserializer<?> deserializer)
setDeserializer
in class TcpConnectionSupport
deserializer
- the deserializer to setpublic org.springframework.core.serializer.Serializer<?> getSerializer()
getSerializer
in interface TcpConnection
getSerializer
in class TcpConnectionSupport
public void setSerializer(org.springframework.core.serializer.Serializer<?> serializer)
setSerializer
in class TcpConnectionSupport
serializer
- the serializer to setpublic boolean isServer()
isServer
in interface TcpConnection
isServer
in class TcpConnectionSupport
public boolean onMessage(Message<?> message)
TcpListener
onMessage
in interface TcpListener
message
- The message.
public void send(Message<?> message) throws java.lang.Exception
TcpConnection
send
in interface TcpConnection
message
- The message
java.lang.Exception
public TcpConnectionSupport getTheConnection()
public void setTheConnection(TcpConnectionSupport theConnection)
theConnection
- the connectionpublic TcpListener getListener()
getListener
in interface TcpConnection
getListener
in class TcpConnectionSupport
public void addNewConnection(TcpConnection connection)
TcpSender
TcpListener
, this
method is called each time a new connection is made.
addNewConnection
in interface TcpSender
connection
- The connection.public void removeDeadConnection(TcpConnection connection)
TcpSender
TcpListener
, this
method is called each time a connection is closed.
removeDeadConnection
in interface TcpSender
connection
- The connection.public long incrementAndGetConnectionSequence()
incrementAndGetConnectionSequence
in interface TcpConnection
incrementAndGetConnectionSequence
in class TcpConnectionSupport
public TcpSender getSender()
getSender
in class TcpConnectionSupport
protected boolean hasRealSender()
|
Spring Integration | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |