|
Spring Integration | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.springframework.integration.ip.tcp.connection.AbstractTcpConnectionInterceptor
public abstract class AbstractTcpConnectionInterceptor
Base class for TcpConnectionIntercepters; passes all method calls through
to the underlying TcpConnection.
| Constructor Summary | |
|---|---|
AbstractTcpConnectionInterceptor()
|
|
| 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 the connection. |
java.lang.String |
getConnectionId()
|
org.springframework.core.serializer.Deserializer<?> |
getDeserializer()
|
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()
|
TcpConnection |
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)
When true, the socket is used once and discarded. |
void |
setTheConnection(TcpConnection theConnection)
Sets the underlying connection (or next interceptor) |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AbstractTcpConnectionInterceptor()
| Method Detail |
|---|
public void close()
TcpConnection
close in interface TcpConnectionpublic boolean isOpen()
isOpen in interface TcpConnection
public java.lang.Object getPayload()
throws java.lang.Exception
TcpConnection
getPayload in interface TcpConnectionjava.lang.Exceptionpublic java.lang.String getHostName()
getHostName in interface TcpConnectionpublic java.lang.String getHostAddress()
getHostAddress in interface TcpConnectionpublic int getPort()
getPort in interface TcpConnectionpublic void registerListener(TcpListener listener)
TcpConnection
registerListener in interface TcpConnectionlistener - The listenerpublic void registerSender(TcpSender sender)
TcpConnection
registerSender in interface TcpConnectionsender - the senderpublic java.lang.String getConnectionId()
getConnectionId in interface TcpConnectionpublic boolean isSingleUse()
isSingleUse in interface TcpConnectionpublic void run()
run in interface java.lang.Runnablepublic void setSingleUse(boolean singleUse)
TcpConnection
setSingleUse in interface TcpConnectionsingleUse - the singleUsepublic void setMapper(TcpMessageMapper mapper)
setMapper in interface TcpConnectionmapper - the mapperpublic org.springframework.core.serializer.Deserializer<?> getDeserializer()
getDeserializer in interface TcpConnectionpublic void setDeserializer(org.springframework.core.serializer.Deserializer<?> deserializer)
setDeserializer in interface TcpConnectiondeserializer - the deserializer to setpublic org.springframework.core.serializer.Serializer<?> getSerializer()
getSerializer in interface TcpConnectionpublic void setSerializer(org.springframework.core.serializer.Serializer<?> serializer)
setSerializer in interface TcpConnectionserializer - the serializer to setpublic boolean isServer()
isServer in interface TcpConnectionpublic boolean onMessage(Message<?> message)
TcpListener
onMessage in interface TcpListenermessage - The message.
public void send(Message<?> message)
throws java.lang.Exception
TcpConnection
send in interface TcpConnectionmessage - The message
java.lang.Exceptionpublic TcpConnection getTheConnection()
public void setTheConnection(TcpConnection theConnection)
setTheConnection in interface TcpConnectionInterceptortheConnection - the connectionpublic TcpListener getListener()
getListener in interface TcpConnectionpublic void addNewConnection(TcpConnection connection)
TcpSenderTcpListener, this
method is called each time a new connection is made.
addNewConnection in interface TcpSenderconnection - The connection.public void removeDeadConnection(TcpConnection connection)
TcpSenderTcpListener, this
method is called each time a connection is closed.
removeDeadConnection in interface TcpSenderconnection - The connection.public long incrementAndGetConnectionSequence()
incrementAndGetConnectionSequence in interface TcpConnectionprotected boolean hasRealSender()
|
Spring Integration | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||