org.springframework.integration.ip.tcp
Class TcpNioSendingMessageHandler
java.lang.Object
org.springframework.integration.ip.AbstractInternetProtocolSendingMessageHandler
org.springframework.integration.ip.tcp.AbstractTcpSendingMessageHandler
org.springframework.integration.ip.tcp.TcpNioSendingMessageHandler
- All Implemented Interfaces:
- MessageHandler, CommonSocketOptions
public class TcpNioSendingMessageHandler
- extends AbstractTcpSendingMessageHandler
TCP Sending Channel Adapter that that uses a SocketChannel
.
- Since:
- 2.0
- Author:
- Gary Russell
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
socketChannel
protected volatile SocketChannel socketChannel
usingDirectBuffers
protected boolean usingDirectBuffers
customSocketWriterClass
protected Class<NioSocketWriter> customSocketWriterClass
buffsPerConnection
protected int buffsPerConnection
TcpNioSendingMessageHandler
public TcpNioSendingMessageHandler(String host,
int port)
- Parameters:
host
- port
-
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 socket
setUsingDirectBuffers
public void setUsingDirectBuffers(boolean usingDirectBuffers)
- Parameters:
usingDirectBuffers
- Set true if you wish to use direct buffers
for NIO operations.
setCustomSocketWriterClassName
public void setCustomSocketWriterClassName(String customSocketWriterClassName)
throws ClassNotFoundException
- Parameters:
customSocketWriterClassName
- the customSocketWriterClassName to set
- Throws:
ClassNotFoundException
setBuffsPerConnection
public void setBuffsPerConnection(int buffsPerConnection)
- If direct buffers are being used, sets the max number of
buffers allowed per connection. Defaults to 5. It is unlikely
this would ever need to be changed. Each buffer is set at the
soSendBufferSize or, if not set, 2048 bytes.
- Parameters:
buffsPerConnection
- the buffsPerConnection to set
setLocalAddress
public void setLocalAddress(String localAddress)
- Description copied from interface:
CommonSocketOptions
- On a multi-homed system, specifies the ip address of the network interface used to communicate.
For inbound adapters and gateways, specifies the interface used to listed for incoming connections.
If omitted, the endpoint will listen on all available adapters. For the UDP multicast outbound adapter
specifies the interface to which multicast packets will be sent. For UDP unicast and multicast
adapters, specifies which interface to which the acknowledgment socket will be bound. Does not
apply to TCP outbound adapters and gateways.
Copyright © 2010. All Rights Reserved.