|
||||||||||
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(Map env)
Establish the connection. |
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(Map env) throws 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.
IOException
- if the connection cannot be made.Message readMessage() throws IOException, ClassNotFoundException
Reads a Message
object from the other end of the
connection.
IOException
- if a message could not be read because
of a communication problem.
ClassNotFoundException
- If the class of a serialized
object cannot be found.void writeMessage(Message msg) throws IOException
Writes a Message
object to the other end of the
connection.
msg
- the message to be written.
IOException
- if the message could not be written
because of a communication problem.void close() throws IOException
Terminates this object connection. After calling this
method, any current or new call to readMessage
or writeMessage(Message)
should produce an
IOException
.
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
.String getConnectionId()
The ID for this connection.
|
Open Source build 02 opendmk-1.0-b02 2007.10.01_19:17:46_MEST |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |