org.springframework.integration.ip.tcp
Class TcpNetSendingMessageHandler

java.lang.Object
  extended by org.springframework.integration.ip.AbstractInternetProtocolSendingMessageHandler
      extended by org.springframework.integration.ip.tcp.AbstractTcpSendingMessageHandler
          extended by org.springframework.integration.ip.tcp.TcpNetSendingMessageHandler
All Implemented Interfaces:
CommonSocketOptions, MessageHandler

public class TcpNetSendingMessageHandler
extends AbstractTcpSendingMessageHandler

TCP Sending Channel Adapter that that uses a Socket.

Author:
Gary Russell

Field Summary
protected  java.lang.Class<NetSocketWriter> customSocketWriterClass
           
protected  java.net.Socket socket
           
 
Fields inherited from class org.springframework.integration.ip.tcp.AbstractTcpSendingMessageHandler
mapper, messageFormat, soKeepAlive, soLinger, soTcpNoDelay, soTrafficClass, writer
 
Fields inherited from class org.springframework.integration.ip.AbstractInternetProtocolSendingMessageHandler
destinationAddress, executorService, host, logger, port, soSendBufferSize, soTimeout
 
Constructor Summary
TcpNetSendingMessageHandler(java.lang.String host, int port)
          Constructs a TcpNetSendingMessageHandler that sends data to the specified host and port.
 
Method Summary
protected  java.net.Socket getSocket()
           
protected  SocketWriter getWriter()
          Returns the socket writer after instantiating it, if necessary.
 void setCustomSocketWriterClassName(java.lang.String customSocketWriterClassName)
           
 
Methods inherited from class org.springframework.integration.ip.tcp.AbstractTcpSendingMessageHandler
doWrite, handleMessage, setMessageFormat, setSocketAttributes, setSoKeepAlive, setSoLinger, setSoTcpNoDelay, setSoTrafficClass
 
Methods inherited from class org.springframework.integration.ip.AbstractInternetProtocolSendingMessageHandler
getPort, setSoReceiveBufferSize, setSoSendBufferSize, setSoTimeout
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

customSocketWriterClass

protected java.lang.Class<NetSocketWriter> customSocketWriterClass

socket

protected volatile java.net.Socket socket
Constructor Detail

TcpNetSendingMessageHandler

public TcpNetSendingMessageHandler(java.lang.String host,
                                   int port)
Constructs a TcpNetSendingMessageHandler that sends data to the specified host and port.

Parameters:
host - The host.
port - The port.
Method Detail

getSocket

protected java.net.Socket getSocket()
Returns:
the socket

getWriter

protected SocketWriter getWriter()
Description copied from class: AbstractTcpSendingMessageHandler
Returns the socket writer after instantiating it, if necessary.

Specified by:
getWriter in class AbstractTcpSendingMessageHandler
Returns:
the writer

setCustomSocketWriterClassName

public void setCustomSocketWriterClassName(java.lang.String customSocketWriterClassName)
                                    throws java.lang.ClassNotFoundException
Parameters:
customSocketWriterClassName - the customSocketWriterClassName to set
Throws:
java.lang.ClassNotFoundException