|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.cuny.cat.comm.QueueBasedCatpConnection
public class QueueBasedCatpConnection
The implementation of Connection
when
QueueBasedInfrastructureImpl
is used.
Field Summary | |
---|---|
protected java.lang.Object |
connector
the Connector that requested to create this connection |
protected java.lang.String |
id
an identifier for this connection |
protected org.apache.commons.collections15.Buffer<CatpMessage> |
messages
the queue buffering incoming messages |
protected QueueBasedCatpConnection |
peer
the other side of the connection that may call relayMessage(CatpMessage) to transmit messages. |
Constructor Summary | |
---|---|
QueueBasedCatpConnection(java.lang.Object connector,
java.lang.String id)
|
Method Summary | |
---|---|
void |
close()
closes this connection. |
java.lang.Object |
getConnector()
|
java.lang.String |
getLocalAddressInfo()
|
CatpMessage |
getMessage()
reads a Message from this connection. |
QueueBasedCatpConnection |
getPeer()
|
java.lang.String |
getRemoteAddressInfo()
|
boolean |
isClosed()
checks whether the connection is closed or not. |
void |
open()
opens the connection before sending or receiving any message. |
void |
relayMessage(CatpMessage msg)
|
void |
sendMessage(CatpMessage msg)
sends a Message through this connection. |
void |
setConnector(java.lang.Object connector)
|
void |
setPeer(QueueBasedCatpConnection peer)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.lang.Object connector
Connector
that requested to create this connection
protected QueueBasedCatpConnection peer
relayMessage(CatpMessage)
to transmit messages.
protected org.apache.commons.collections15.Buffer<CatpMessage> messages
protected java.lang.String id
Constructor Detail |
---|
public QueueBasedCatpConnection(java.lang.Object connector, java.lang.String id)
Method Detail |
---|
public java.lang.Object getConnector()
public void setConnector(java.lang.Object connector)
public QueueBasedCatpConnection getPeer()
public void setPeer(QueueBasedCatpConnection peer)
public void sendMessage(CatpMessage msg) throws CatException
Connection
Message
through this connection.
sendMessage
in interface Connection<CatpMessage>
msg
- message to be sent.
CatException
public void relayMessage(CatpMessage msg) throws CatException
CatException
public CatpMessage getMessage() throws CatException
ProactiveConnection
Message
from this connection. It blocks if no messages are
available.
getMessage
in interface ProactiveConnection<CatpMessage>
MessageException
CatException
public void open() throws ConnectionException
Connection
open
in interface Connection<CatpMessage>
ConnectionException
public void close() throws ConnectionException
Connection
close
in interface Connection<CatpMessage>
ConnectionException
public boolean isClosed()
Connection
isClosed
in interface Connection<CatpMessage>
public java.lang.String getLocalAddressInfo()
getLocalAddressInfo
in interface Connection<CatpMessage>
public java.lang.String getRemoteAddressInfo()
getRemoteAddressInfo
in interface Connection<CatpMessage>
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |