edu.cuny.cat.comm
Interface ProactiveConnection<M extends Message>

Type Parameters:
M - the type of messages that can be transmitted through the connection.
All Superinterfaces:
Connection<M>
All Known Subinterfaces:
ProactiveCatpConnection
All Known Implementing Classes:
QueueBasedCatpConnection, SocketBasedCatpConnection, SocketBasedConnection, TelnetConnection

public interface ProactiveConnection<M extends Message>
extends Connection<M>

A proactive Message I/O interface for a plain-text message client or server to communicate with its peers, which need proactively retrieve messages from the communication channel.

Note that here proactive means this connection should be accessed proactively rather than reactively.

Version:
$Revision: 1.2 $
Author:
Jinzhong Niu
See Also:
ReactiveConnection

Method Summary
 M getMessage()
          reads a Message from this connection.
 
Methods inherited from interface edu.cuny.cat.comm.Connection
close, getLocalAddressInfo, getRemoteAddressInfo, isClosed, open, sendMessage
 

Method Detail

getMessage

M getMessage()
                             throws CatException
reads a Message from this connection. It blocks if no messages are available.

Returns:
message received over the connection.
Throws:
MessageException
CatException