|
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.AbstractInternetProtocolSendingMessageHandler org.springframework.integration.ip.tcp.AbstractTcpSendingMessageHandler
public abstract class AbstractTcpSendingMessageHandler
Abstract class for TCP sending message handlers. Implementations
for Socket
and SocketChannel
are provided.
Field Summary | |
---|---|
protected SocketMessageMapper |
mapper
|
protected int |
messageFormat
|
protected boolean |
soKeepAlive
|
protected int |
soLinger
|
protected boolean |
soTcpNoDelay
|
protected int |
soTrafficClass
|
protected AbstractSocketWriter |
writer
|
Fields inherited from class org.springframework.integration.ip.AbstractInternetProtocolSendingMessageHandler |
---|
destinationAddress, host, logger, port, soSendBufferSize, soTimeout |
Constructor Summary | |
---|---|
AbstractTcpSendingMessageHandler(String host,
int port)
Constructs a message handler that sends messages to the specified host and port. |
Method Summary | |
---|---|
protected void |
doWrite(Message<?> message)
Method that actually does the write. |
protected abstract SocketWriter |
getWriter()
Returns the socket writer after instantiating it, if necessary. |
void |
handleMessage(Message<?> message)
Writes the message payload to the underlying socket, using the specified message format. |
void |
setMessageFormat(int messageFormat)
|
protected void |
setSocketAttributes(Socket socket)
Sets socket attributes on the socket. |
void |
setSoKeepAlive(boolean soKeepAlive)
|
void |
setSoLinger(int soLinger)
Enables SO_LINGER on the underlying socket. |
void |
setSoTcpNoDelay(boolean soTcpNoDelay)
|
void |
setSoTrafficClass(int soTrafficClass)
|
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 |
Methods inherited from interface org.springframework.integration.ip.CommonSocketOptions |
---|
setLocalAddress |
Field Detail |
---|
protected SocketMessageMapper mapper
protected AbstractSocketWriter writer
protected boolean soTcpNoDelay
protected int soLinger
protected int soTrafficClass
protected boolean soKeepAlive
protected int messageFormat
Constructor Detail |
---|
public AbstractTcpSendingMessageHandler(String host, int port)
host
- The host.port
- The port.Method Detail |
---|
protected void setSocketAttributes(Socket socket) throws SocketException
socket
- The socket.
SocketException
protected abstract SocketWriter getWriter()
public void handleMessage(Message<?> message) throws MessageRejectedException, MessageHandlingException, MessageDeliveryException
message
- the message to be handled
MessageRejectedException
- if the handler doesn't select these
types of messages
MessageHandlingException
- when something went wrong during the
handling
MessageDeliveryException
- when this handler failed to deliver the
reply related to the handling of the messageMessageHandler.handleMessage(org.springframework.integration.Message)
protected void doWrite(Message<?> message)
message
- The message to write.public void setSoTcpNoDelay(boolean soTcpNoDelay)
soTcpNoDelay
- the soTcpNoDelay to setSocket.setTcpNoDelay(boolean)
public void setSoLinger(int soLinger)
soLinger
- the soLinger to setSocket.setSoLinger(boolean, int)
public void setSoTrafficClass(int soTrafficClass)
soTrafficClass
- the soTrafficClass to setSocket.setTrafficClass(int)
public void setSoKeepAlive(boolean soKeepAlive)
soKeepAlive
- the soKeepAlive to setSocket.setKeepAlive(boolean)
public void setMessageFormat(int messageFormat)
messageFormat
- the messageFormat to setMessageFormats
|
Spring Integration | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |