|
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.AbstractSocketWriter
org.springframework.integration.ip.tcp.NetSocketWriter
public class NetSocketWriter
A SocketWriter that writes to a Socket. The
data is wrapped in a wire protocol based on the messageFormat property.
| Field Summary | |
|---|---|
protected ObjectOutputStream |
objectOutputStream
|
protected Socket |
socket
|
| Fields inherited from class org.springframework.integration.ip.tcp.AbstractSocketWriter |
|---|
logger, messageFormat |
| 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 | |
|---|---|
NetSocketWriter(Socket socket)
Constructs a NetSocketWriter for the Socket. |
|
| Method Summary | |
|---|---|
protected void |
doClose()
Called when an IO error |
protected void |
writeCrLfFormat(byte[] bytes)
Write the data, followed by carriage return, line feed ('\r\n'). |
protected void |
writeCustomFormat(Object object)
Write the data using some custom protocol. |
protected void |
writeLengthFormat(byte[] bytes)
Write the length of the data in a 4 byte integer (in network byte order) before the data itself. |
protected void |
writeSerializedFormat(Object object)
Write the data, followed by carriage return, line feed ('\r\n'). |
protected void |
writeStxEtxFormat(byte[] bytes)
Write an STX (0x02) followed by the data, followed by ETX (0x03). |
| Methods inherited from class org.springframework.integration.ip.tcp.AbstractSocketWriter |
|---|
setMessageFormat, write |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected Socket socket
protected ObjectOutputStream objectOutputStream
| Constructor Detail |
|---|
public NetSocketWriter(Socket socket)
socket - The socket.| Method Detail |
|---|
protected void writeCrLfFormat(byte[] bytes)
throws IOException
AbstractSocketWriter
writeCrLfFormat in class AbstractSocketWriterIOException
protected void writeSerializedFormat(Object object)
throws IOException
AbstractSocketWriter
writeSerializedFormat in class AbstractSocketWriterIOException
protected void writeCustomFormat(Object object)
throws IOException
AbstractSocketWriter
writeCustomFormat in class AbstractSocketWriterIOException
protected void writeLengthFormat(byte[] bytes)
throws IOException
AbstractSocketWriter
writeLengthFormat in class AbstractSocketWriterbytes - The bytes to write.
IOException
protected void writeStxEtxFormat(byte[] bytes)
throws IOException
AbstractSocketWriter
writeStxEtxFormat in class AbstractSocketWriterbytes - The bytes to write.
IOExceptionprotected void doClose()
AbstractSocketWriter
doClose in class AbstractSocketWriter
|
Spring Integration | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||