|
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. |
String |
getConnectionId()
|
String |
getHostAddress()
|
String |
getHostName()
|
org.springframework.commons.serializer.InputStreamingConverter<?> |
getInputConverter()
|
TcpListener |
getListener()
|
org.springframework.commons.serializer.OutputStreamingConverter<?> |
getOutputConverter()
|
Object |
getPayload()
Uses the input converter to obtain the message payload from the connection's input stream. |
int |
getPort()
|
TcpConnection |
getTheConnection()
Returns the underlying connection (or next interceptor) |
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 |
setInputConverter(org.springframework.commons.serializer.InputStreamingConverter<?> inputConverter)
|
void |
setMapper(TcpMessageMapper mapper)
|
void |
setOutputConverter(org.springframework.commons.serializer.OutputStreamingConverter<?> outputConverter)
|
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 Object getPayload() throws Exception
TcpConnection
getPayload
in interface TcpConnection
Exception
public String getHostName()
getHostName
in interface TcpConnection
public 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 String getConnectionId()
getConnectionId
in interface TcpConnection
public boolean isSingleUse()
isSingleUse
in interface TcpConnection
public void run()
run
in interface 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.commons.serializer.InputStreamingConverter<?> getInputConverter()
getInputConverter
in interface TcpConnection
public void setInputConverter(org.springframework.commons.serializer.InputStreamingConverter<?> inputConverter)
setInputConverter
in interface TcpConnection
inputConverter
- the inputConverter to setpublic org.springframework.commons.serializer.OutputStreamingConverter<?> getOutputConverter()
getOutputConverter
in interface TcpConnection
public void setOutputConverter(org.springframework.commons.serializer.OutputStreamingConverter<?> outputConverter)
setOutputConverter
in interface TcpConnection
outputConverter
- the outputConverter 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 Exception
TcpConnection
send
in interface TcpConnection
message
- The message
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.
|
Spring Integration | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |