|
|||||||||
| 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 java.net.Socket |
socket
|
| Fields inherited from class org.springframework.integration.ip.tcp.AbstractSocketReader |
|---|
assembledData, maxMessageSize, messageFormat |
| Fields inherited from interface org.springframework.integration.ip.tcp.MessageFormats |
|---|
ETX, FORMAT_CRLF, FORMAT_CUSTOM, FORMAT_LENGTH_HEADER, FORMAT_STX_ETX, STX |
| Constructor Summary | |
|---|---|
NetSocketReader(java.net.Socket socket)
Constructs a NetsocketReader which reads from the Socket. |
|
| Method Summary | |
|---|---|
protected boolean |
assembleDataCrLfFormat()
Assembles data in format MessageFormats.FORMAT_CRLF. |
protected boolean |
assembleDataCustomFormat()
Throws UnsupportedOperationException; custom implementations can
subclass this class and provide an implementation for this method. |
protected boolean |
assembleDataLengthFormat()
Assembles data in format MessageFormats.FORMAT_LENGTH_HEADER. |
protected boolean |
assembleDataStxEtxFormat()
Assembles data in format MessageFormats.FORMAT_STX_ETX. |
protected void |
doClose()
Called after an exception; close the transport. |
java.net.InetAddress |
getAddress()
Returns the InetAddress of the underlying socket. |
byte[] |
getAssembledData()
Retrieves the assembled tcp data or null if the data is not yet assembled. |
java.net.Socket |
getSocket()
|
protected void |
read(byte[] buffer)
Reads data from the socket and puts the data in buffer. |
| Methods inherited from class org.springframework.integration.ip.tcp.AbstractSocketReader |
|---|
assembleData, 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 java.net.Socket socket
| Constructor Detail |
|---|
public NetSocketReader(java.net.Socket socket)
socket - The socket.| Method Detail |
|---|
protected boolean assembleDataLengthFormat()
throws java.io.IOException
AbstractSocketReaderMessageFormats.FORMAT_LENGTH_HEADER.
assembleDataLengthFormat in class AbstractSocketReaderjava.io.IOException
protected boolean assembleDataStxEtxFormat()
throws java.io.IOException
AbstractSocketReaderMessageFormats.FORMAT_STX_ETX.
assembleDataStxEtxFormat in class AbstractSocketReaderjava.io.IOException
protected boolean assembleDataCrLfFormat()
throws java.io.IOException
AbstractSocketReaderMessageFormats.FORMAT_CRLF.
assembleDataCrLfFormat in class AbstractSocketReaderjava.io.IOException
protected boolean assembleDataCustomFormat()
throws java.io.IOException
UnsupportedOperationException; custom implementations can
subclass this class and provide an implementation for this method.
assembleDataCustomFormat in class AbstractSocketReaderjava.io.IOExceptionAbstractSocketReader.assembleDataCustomFormat().public byte[] getAssembledData()
SocketReader
protected void read(byte[] buffer)
throws java.io.IOException
buffer -
java.io.IOExceptionprotected void doClose()
AbstractSocketReader
doClose in class AbstractSocketReaderpublic java.net.InetAddress getAddress()
SocketReader
public java.net.Socket getSocket()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||