Spring Integration

org.springframework.integration.ip.tcp.connection
Class AbstractTcpConnection

java.lang.Object
  extended by org.springframework.integration.ip.tcp.connection.AbstractTcpConnection
All Implemented Interfaces:
Runnable, TcpConnection
Direct Known Subclasses:
TcpNetConnection, TcpNioConnection

public abstract class AbstractTcpConnection
extends Object
implements TcpConnection

Base class for TcpConnections. TcpConnections are established by client connection factories (outgoing) or server connection factories (incoming).

Since:
2.0
Author:
Gary Russell

Field Summary
protected  InputStreamingConverter inputConverter
           
protected  TcpListener listener
           
protected  org.apache.commons.logging.Log logger
           
protected  TcpMessageMapper mapper
           
protected  OutputStreamingConverter outputConverter
           
protected  TcpSender sender
           
protected  boolean singleUse
           
 
Constructor Summary
AbstractTcpConnection()
           
 
Method Summary
 void close()
          Closes this connection.
 TcpListener getListener()
           
 TcpMessageMapper getMapper()
           
 boolean isSingleUse()
           
 void registerListener(TcpListener listener)
          Sets the listener that will receive incoming Messages.
 void registerSender(TcpSender sender)
          Registers a sender.
 void setInputConverter(InputStreamingConverter<?> inputConverter)
           
 void setMapper(TcpMessageMapper mapper)
           
 void setOutputConverter(OutputStreamingConverter<?> outputConverter)
           
 void setSingleUse(boolean singleUse)
          When true, the socket is used once and discarded.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.springframework.integration.ip.tcp.connection.TcpConnection
getConnectionId, getHostAddress, getHostName, getPayload, getPort, isOpen, send
 
Methods inherited from interface java.lang.Runnable
run
 

Field Detail

logger

protected org.apache.commons.logging.Log logger

inputConverter

protected InputStreamingConverter inputConverter

outputConverter

protected OutputStreamingConverter outputConverter

mapper

protected TcpMessageMapper mapper

listener

protected TcpListener listener

sender

protected TcpSender sender

singleUse

protected boolean singleUse
Constructor Detail

AbstractTcpConnection

public AbstractTcpConnection()
Method Detail

close

public void close()
Closes this connection.

Specified by:
close in interface TcpConnection

getMapper

public TcpMessageMapper getMapper()
Returns:
the mapper

setMapper

public void setMapper(TcpMessageMapper mapper)
Specified by:
setMapper in interface TcpConnection
Parameters:
mapper - the mapper to set

setInputConverter

public void setInputConverter(InputStreamingConverter<?> inputConverter)
Specified by:
setInputConverter in interface TcpConnection
Parameters:
inputConverter - the input converter to set

setOutputConverter

public void setOutputConverter(OutputStreamingConverter<?> outputConverter)
Specified by:
setOutputConverter in interface TcpConnection
Parameters:
outputConverter - the output converter to set

registerListener

public void registerListener(TcpListener listener)
Description copied from interface: TcpConnection
Sets the listener that will receive incoming Messages.

Specified by:
registerListener in interface TcpConnection
Parameters:
listener - the listener to set

registerSender

public void registerSender(TcpSender sender)
Description copied from interface: TcpConnection
Registers a sender. Used on server side sockets so a sender can determine which connection to send a reply to.

Specified by:
registerSender in interface TcpConnection
Parameters:
sender - the sender to set

getListener

public TcpListener getListener()
Returns:
the listener

setSingleUse

public void setSingleUse(boolean singleUse)
Description copied from interface: TcpConnection
When true, the socket is used once and discarded.

Specified by:
setSingleUse in interface TcpConnection
Parameters:
singleUse - true if this socket is to used once and discarded.

isSingleUse

public boolean isSingleUse()
Specified by:
isSingleUse in interface TcpConnection
Returns:
True if connection is used once.

Spring Integration

Copyright © 2010. All Rights Reserved.