Spring Integration

org.springframework.integration.ip.tcp
Interface SocketReader

All Known Implementing Classes:
AbstractSocketReader, NetSocketReader, NioSocketReader

public interface SocketReader

General interface for assembling message data from a TCP/IP Socket. Implementations for Socket and SocketChannel are provided.

Since:
2.0
Author:
Gary Russell

Field Summary
static int MESSAGE_COMPLETE
           
static int MESSAGE_INCOMPLETE
           
static int SOCKET_CLOSED
           
 
Method Summary
 int assembleData()
          Reads the data the socket and assembles packets of data into a complete message, depending on the format of that data.
 InetAddress getAddress()
          Returns the InetAddress of the underlying socket.
 Object getAssembledData()
          Retrieves the assembled tcp data or null if the data is not yet assembled.
 Socket getSocket()
           
 

Field Detail

SOCKET_CLOSED

static final int SOCKET_CLOSED
See Also:
Constant Field Values

MESSAGE_INCOMPLETE

static final int MESSAGE_INCOMPLETE
See Also:
Constant Field Values

MESSAGE_COMPLETE

static final int MESSAGE_COMPLETE
See Also:
Constant Field Values
Method Detail

assembleData

int assembleData()
                 throws IOException
Reads the data the socket and assembles packets of data into a complete message, depending on the format of that data.

Returns:
MESSAGE_COMPLETE when message is assembled, otherwise MESSAGE_IMCOMPLETE, or < 0 if socket closed before any data for a message is received.
Throws:
IOException

getAssembledData

Object getAssembledData()
Retrieves the assembled tcp data or null if the data is not yet assembled. Once this method is called, the assembled data is again null until a new assembly is completed.

Returns:
The assembled data or null.

getAddress

InetAddress getAddress()
Returns the InetAddress of the underlying socket.

Returns:
The InetAddress.

getSocket

Socket getSocket()
Returns:
the Socket

Spring Integration

Copyright © 2010. All Rights Reserved.