|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.derby.impl.store.replication.net.SocketConnection
public class SocketConnection
This class encapsulates a Socket
connection and has
methods that allow to read and write into the Object streams
created from this connection.
Field Summary | |
---|---|
private java.io.ObjectInputStream |
objInputStream
used to read message objects sent in the socket connection. |
private java.io.ObjectOutputStream |
objOutputStream
used to write message objects into the socket connection. |
private java.net.Socket |
socket
Contains the Socket connection between the Replication master and the slave. |
Constructor Summary | |
---|---|
SocketConnection(java.net.Socket socket)
Constructor creates the streams from the socket object passed as parameter. |
Method Summary | |
---|---|
java.lang.Object |
readMessage()
Used to read the object messages that are sent. |
void |
tearDown()
Closes the Socket and the object streams obtained
from it. |
void |
writeMessage(java.lang.Object message)
Used to send the object messages across the socket conection. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private final java.net.Socket socket
private final java.io.ObjectOutputStream objOutputStream
private final java.io.ObjectInputStream objInputStream
Constructor Detail |
---|
public SocketConnection(java.net.Socket socket) throws java.io.IOException
socket
- the Socket
object that this class
encapsulates.
java.io.IOException
- If an exception occurs while creating the
streams from the socket object.Method Detail |
---|
public java.lang.Object readMessage() throws java.lang.ClassNotFoundException, java.io.IOException
java.lang.ClassNotFoundException
- Class of a serialized object cannot
be found.
java.io.IOException
- if an exception occurs while reading from the
stream.public void writeMessage(java.lang.Object message) throws java.io.IOException
message
- the data to be written into the connection.
java.io.IOException
- if an exception occurs while writing into the
stream.public void tearDown() throws java.io.IOException
Socket
and the object streams obtained
from it.
java.io.IOException
- if an exception occurs while trying to close
the socket or the streams.
|
Built on Thu 2011-03-10 11:54:14+0000, from revision ??? | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |