java.lang.isolate
Interface IsolateMessageDispatcher.Listener

Enclosing interface:
IsolateMessageDispatcher

public static interface IsolateMessageDispatcher.Listener

A listener interface for receiving messages and exceptions from an IsolateMessageDispatcher's managed links. When a listener is registered with a link on a dispatcher, the dispatcher will invoke the messageReceived method when messages arrive or the receiveFailed method when an error occurs on the link.

See Also:
IsolateMessageDispatcher.add(Link, Listener)

Method Summary
 void messageReceived(java.lang.isolate.IsolateMessageDispatcher dispatcher, java.lang.isolate.Link link, java.lang.isolate.IsolateMessage message)
          Invoked when a message is received on a Link managed by an IsolateMessageDispatcher.
 void receiveFailed(java.lang.isolate.IsolateMessageDispatcher dispatcher, java.lang.isolate.Link link, Throwable throwable)
          Invoked when an exception is thrown due to the given dispatcher attempting to receive from the link registered with this listener.
 

Method Detail

messageReceived

public void messageReceived(java.lang.isolate.IsolateMessageDispatcher dispatcher,
                            java.lang.isolate.Link link,
                            java.lang.isolate.IsolateMessage message)
Invoked when a message is received on a Link managed by an IsolateMessageDispatcher.

Parameters:
dispatcher - the IsolateMessageDispatcher that received the message
link - the Link the message was received on
message - the message received

receiveFailed

public void receiveFailed(java.lang.isolate.IsolateMessageDispatcher dispatcher,
                          java.lang.isolate.Link link,
                          Throwable throwable)
Invoked when an exception is thrown due to the given dispatcher attempting to receive from the link registered with this listener. All checked and run-time exceptions documented on Link.receive will be caught and passed to this method.

The given link will have been removed from the dispatcher's set of managed links before this callback is invoked. If the problem is temporary, the link may be added back to the dispatcher.

Parameters:
dispatcher - the dispatcher in which the link is registered
link - the link on which the exception occurred
throwable - the exception that occurred when receiving on the link