|
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.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 TcpConnection
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
public java.lang.String getHostAddress()
getHostAddress
in interface TcpConnection
public int getPort()
getPort
in interface TcpConnection
public void registerListener(TcpListener listener)
TcpConnection
registerListener
in interface TcpConnection
listener
- The listenerpublic void registerSender(TcpSender sender)
TcpConnection
registerSender
in interface TcpConnection
sender
- the senderpublic java.lang.String getConnectionId()
getConnectionId
in interface TcpConnection
public boolean isSingleUse()
isSingleUse
in interface TcpConnection
public void run()
run
in interface java.lang.Runnable
public void setSingleUse(boolean singleUse)
TcpConnection
setSingleUse
in interface TcpConnection
singleUse
- the singleUsepublic void setMapper(TcpMessageMapper mapper)
setMapper
in interface TcpConnection
mapper
- the mapperpublic org.springframework.core.serializer.Deserializer<?> getDeserializer()
getDeserializer
in interface TcpConnection
public void setDeserializer(org.springframework.core.serializer.Deserializer<?> deserializer)
setDeserializer
in interface TcpConnection
deserializer
- the deserializer to setpublic org.springframework.core.serializer.Serializer<?> getSerializer()
getSerializer
in interface TcpConnection
public void setSerializer(org.springframework.core.serializer.Serializer<?> serializer)
setSerializer
in interface TcpConnection
serializer
- the serializer to setpublic boolean isServer()
isServer
in interface TcpConnection
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 TcpConnection getTheConnection()
public void setTheConnection(TcpConnection theConnection)
setTheConnection
in interface TcpConnectionInterceptor
theConnection
- the connectionpublic TcpListener getListener()
getListener
in interface TcpConnection
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
protected boolean hasRealSender()
|
Spring Integration | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |