|
Spring Integration | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.springframework.integration.ip.tcp.AbstractSocketReader
org.springframework.integration.ip.tcp.NetSocketReader
public class NetSocketReader
A SocketReader that reads from a Socket. Threads
calling AbstractSocketReader.assembledData will block until a message
is completely assembled.
| Field Summary | |
|---|---|
protected org.apache.commons.logging.Log |
logger
|
protected ObjectInputStream |
objectInputStream
|
protected Socket |
socket
|
| Fields inherited from class org.springframework.integration.ip.tcp.AbstractSocketReader |
|---|
assembledData, maxMessageSize, messageFormat |
| Fields inherited from interface org.springframework.integration.ip.tcp.SocketReader |
|---|
MESSAGE_COMPLETE, MESSAGE_INCOMPLETE, SOCKET_CLOSED |
| Fields inherited from interface org.springframework.integration.ip.tcp.MessageFormats |
|---|
ETX, FORMAT_CRLF, FORMAT_CUSTOM, FORMAT_IMPLICIT, FORMAT_JAVA_SERIALIZED, FORMAT_LENGTH_HEADER, FORMAT_STX_ETX, STX |
| Constructor Summary | |
|---|---|
NetSocketReader(Socket socket)
Constructs a NetsocketReader which reads from the Socket. |
|
| Method Summary | |
|---|---|
protected int |
assembleDataCrLfFormat()
Assembles data in format MessageFormats.FORMAT_CRLF. |
protected int |
assembleDataCustomFormat()
Throws UnsupportedOperationException; custom implementations can
subclass this class and provide an implementation for this method. |
protected int |
assembleDataLengthFormat()
Assembles data in format MessageFormats.FORMAT_LENGTH_HEADER. |
protected int |
assembleDataSerializedFormat()
Assembles data in format MessageFormats.FORMAT_JAVA_SERIALIZED |
protected int |
assembleDataStxEtxFormat()
Assembles data in format MessageFormats.FORMAT_STX_ETX. |
protected void |
doClose()
Called after an exception; close the transport. |
InetAddress |
getAddress()
Returns the InetAddress of the underlying socket. |
Socket |
getSocket()
|
protected int |
read(byte[] buffer,
boolean header)
Reads data from the socket and puts the data in buffer. |
| Methods inherited from class org.springframework.integration.ip.tcp.AbstractSocketReader |
|---|
assembleData, getAssembledData, setMaxMessageSize, setMessageFormat |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final org.apache.commons.logging.Log logger
protected Socket socket
protected ObjectInputStream objectInputStream
| Constructor Detail |
|---|
public NetSocketReader(Socket socket)
socket - The socket.| Method Detail |
|---|
protected int assembleDataLengthFormat()
throws IOException
AbstractSocketReaderMessageFormats.FORMAT_LENGTH_HEADER.
assembleDataLengthFormat in class AbstractSocketReaderIOException
protected int assembleDataStxEtxFormat()
throws IOException
AbstractSocketReaderMessageFormats.FORMAT_STX_ETX.
assembleDataStxEtxFormat in class AbstractSocketReaderIOException
protected int assembleDataCrLfFormat()
throws IOException
AbstractSocketReaderMessageFormats.FORMAT_CRLF.
assembleDataCrLfFormat in class AbstractSocketReaderIOException
protected int assembleDataSerializedFormat()
throws IOException
AbstractSocketReaderMessageFormats.FORMAT_JAVA_SERIALIZED
assembleDataSerializedFormat in class AbstractSocketReaderIOException
protected int assembleDataCustomFormat()
throws IOException
UnsupportedOperationException; custom implementations can
subclass this class and provide an implementation for this method.
assembleDataCustomFormat in class AbstractSocketReaderIOExceptionAbstractSocketReader.assembleDataCustomFormat()
protected int read(byte[] buffer,
boolean header)
throws IOException
buffer - header - true if we are reading the header
IOExceptionprotected void doClose()
AbstractSocketReader
doClose in class AbstractSocketReaderpublic InetAddress getAddress()
SocketReader
public Socket getSocket()
|
Spring Integration | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||