|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface MessageConnection
Interface specifying the full-duplex transport used by each end of a Generic Connector connection to communicate with the other end.
An instance of this interface can be communicated to the Generic
Connector using the attribute GenericConnector.MESSAGE_CONNECTION
in the Map
passed
to the constructor or the connect
method.
Method Summary | |
---|---|
void |
close()
Terminates this object connection. |
void |
connect(java.util.Map env)
Establish the connection. |
java.lang.String |
getConnectionId()
The ID for this connection. |
Message |
readMessage()
Reads a Message object from the other end of the
connection. |
void |
writeMessage(Message msg)
Writes a Message object to the other end of the
connection. |
Method Detail |
---|
void connect(java.util.Map env) throws java.io.IOException
Establish the connection. This method must be called before any other method of this interface. The behavior is unspecified if not.
env
- the properties of the connection.
java.io.IOException
- if the connection cannot be made.Message readMessage() throws java.io.IOException, java.lang.ClassNotFoundException
Reads a Message
object from the other end of the
connection.
java.io.IOException
- if a message could not be read because
of a communication problem.
java.lang.ClassNotFoundException
- If the class of a serialized
object cannot be found.void writeMessage(Message msg) throws java.io.IOException
Writes a Message
object to the other end of the
connection.
msg
- the message to be written.
java.io.IOException
- if the message could not be written
because of a communication problem.void close() throws java.io.IOException
Terminates this object connection. After calling this
method, any current or new call to readMessage
or writeMessage(Message)
should produce an
IOException
.
java.io.IOException
- if an I/O error occurs when closing the
connection. A best effort will have been made to clean up the
connection's resources. The caller will not call any other
methods of this object after close()
, whether or
not it gets IOException
.java.lang.String getConnectionId()
The ID for this connection.
|
Open Source build 01-ea opendmk-1.0-b01-ea 2010.10.22_13:26:06_UTC |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |