| org.jgroups.stack.ProtocolObserver
All known Subclasses: org.jgroups.blocks.TotalTokenProtocolObserver, org.jgroups.debug.ProtocolView,
ProtocolObserver | public interface ProtocolObserver (Code) | | Interface for the Debugger to receive notifications about a protocol layer. Defines the
hooks called by Protocol when significant events occur, e.g. an event has been received.
Every ProtocolObserver should have a reference to the protocol it monitors.
author: Bela Ban, July 22 2000 |
Method Summary | |
boolean | down(Event evt, int num_evts) Called when an event is about to be dispatched to the protocol (before it is dispatched).
The down handler thread will block until this method returns. | boolean | passDown(Event evt) Called when an event is about to be passed down to the next lower protocol.
Parameters: evt - The event to be processed by the protocol. | boolean | passUp(Event evt) Called when an event is about to be passed up to the next higher protocol.
Parameters: evt - The event to be processed by the protocol. | void | setProtocol(Protocol prot) Called when a ProtocolObserver is attached to a protcol. | boolean | up(Event evt, int num_evts) Called when an event is about to be dispatched to the protocol (before it is dispatched).
The up handler thread will block until this method returns. |
down | boolean down(Event evt, int num_evts)(Code) | | Called when an event is about to be dispatched to the protocol (before it is dispatched).
The down handler thread will block until this method returns. This allows an implementor
to block indefinitely, and only process single events at a time, e.g. for single-stepping.
For example, upon clicking on a button "Step" in the Debugger GUI, the method would unblock
(waiting on a mutex, GUI thread notifies mutex).
Parameters: evt - The event to be processed by the protocol. This is not a copy, so changesto the event will be seen by the protocol ! Parameters: num_evts - The number of events currently in the down-queue (including this event).This number may increase while we're in the callback as the down-handler thread in theupper protocol layer puts new events into the down queue. boolean If true the event is processed, else it will be discarded (not be givento the protocol layer to process). |
passDown | boolean passDown(Event evt)(Code) | | Called when an event is about to be passed down to the next lower protocol.
Parameters: evt - The event to be processed by the protocol. This is not a copy, so changesto the event will be seen by the protocol ! boolean If true the event is passed down, else it will be discarded (not be givento the protocol layer below to process). |
passUp | boolean passUp(Event evt)(Code) | | Called when an event is about to be passed up to the next higher protocol.
Parameters: evt - The event to be processed by the protocol. This is not a copy, so changesto the event will be seen by the protocol ! boolean If true the event is passed up, else it will be discarded (not be givento the protocol layer above to process). |
setProtocol | void setProtocol(Protocol prot)(Code) | | Called when a ProtocolObserver is attached to a protcol. This reference can be used to
modify the up-/down-queues, reorder events, inject new events etc.
|
up | boolean up(Event evt, int num_evts)(Code) | | Called when an event is about to be dispatched to the protocol (before it is dispatched).
The up handler thread will block until this method returns. This allows an implementor
to block indefinitely, and only process single events at a time, e.g. for single-stepping.
For example, upon clicking on a button "Step" in the Debugger GUI, the method would unblock
(waiting on a mutex, GUI thread notifies mutex).
Parameters: evt - The event to be processed by the protocol. This is not a copy, so changesto the event will be seen by the protocol ! Parameters: num_evts - The number of events currently in the up-queue (including this event).This number may increase while we're in the callback as the up-handler thread in theupper protocol layer puts new events into the up queue. boolean If true the event is processed, else it will be discarded (not be givento the protocol layer to process). |
|
|