|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
An ITunnel is responsible for sending messages between clients and a server. It hides the underlying protocol that is used for the communication and presents a clean interface for sending and receiving messages. It also handles the transformation of messages into sendable data and makes it possible to add any number of transformation of the data before it is sent.
Incoming messages are handled by IMessageConsumers. The ITunnel maintains a list of IMessageConsumers. When a message is received they are asked in order if they accept the message. The first IMessgeConsumer that accepts the message becomes the conumer for that message.
The ITunnel also maintains a list of ITunnelPackers. These packers a responsible for packing messages that are sent and unpacking messages that are received.
Method Summary | |
void |
addMessageConsumer(IMessageConsumer consumer)
Adds the consumer to the end of this ITunnels message consumer list. |
void |
addPacker(ITunnelPacker packer)
Adds the packer to the end of this ITunnels packer list. |
void |
addStatusCallback(IStatusCallback callback)
Adds the callback to the list of IStatusCallbacks that receives status messages from this ITunnel. |
void |
addTunnelListener(ITunnelListener listener)
|
java.lang.Object |
ask(java.lang.Object message)
Sends a request/reply message over this ITunnel. |
void |
finalize()
Performs cleanup for this ITunnel. |
java.lang.String |
getDescription()
Returns a humanly readably text that describes the ITunnel. |
int |
getLogLevel()
Gets the log level for this ITunnel. |
void |
initialize()
Initializes the ITunnel. |
boolean |
isActive()
Returns true if this tunnel is active, that is, if it is
correctly initialized. |
int |
ping()
Sends a ping message over this ITunnel. |
void |
remomveMessageConsumer(IMessageConsumer consumer)
Removes the consumer from this ITunnels message consumer list. |
void |
remomvePacker(ITunnelPacker packer)
Removes the packer from this ITunnels packer list. |
void |
removeStatusCallback(IStatusCallback callback)
Removes the callback from the list of IStatusCallbacks. |
void |
removeTunnelListener(ITunnelListener listener)
|
void |
send(java.lang.Object message)
Sends a message over this ITunnel. |
void |
setCodec(ITunnelCodec codec)
Sets the ITunnelCodec that should be used by this ITunnel. |
void |
setLogLevel(int level)
Sets the log level for this ITunnel. |
Method Detail |
public void initialize() throws java.lang.IllegalStateException, TunnelException
java.lang.IllegalStateException
TunnelException
public void finalize() throws java.lang.IllegalStateException, TunnelException
java.lang.IllegalStateException
TunnelException
public boolean isActive()
true
if this tunnel is active, that is, if it is
correctly initialized. If this method returns true
then
a call to finalize must not throw an IllegalStateException.
public int ping() throws TunnelException
TunnelException
public void send(java.lang.Object message) throws TunnelException
TunnelException
public java.lang.Object ask(java.lang.Object message) throws TunnelException
TunnelException
public void addMessageConsumer(IMessageConsumer consumer)
public void remomveMessageConsumer(IMessageConsumer consumer)
public void setCodec(ITunnelCodec codec) throws java.lang.IllegalStateException
java.lang.IllegalStateException
public void addPacker(ITunnelPacker packer) throws java.lang.IllegalStateException
java.lang.IllegalStateException
public void remomvePacker(ITunnelPacker packer) throws java.lang.IllegalStateException
java.lang.IllegalStateException
public void addStatusCallback(IStatusCallback callback)
public void removeStatusCallback(IStatusCallback callback)
public void setLogLevel(int level)
public int getLogLevel()
public void addTunnelListener(ITunnelListener listener)
public void removeTunnelListener(ITunnelListener listener)
public java.lang.String getDescription()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |