org.jgroups.debug
Class ProtocolView

java.lang.Object
  extended byorg.jgroups.debug.ProtocolView
All Implemented Interfaces:
ProtocolObserver

public class ProtocolView
extends java.lang.Object
implements ProtocolObserver

Graphical view of a protocol instance

Author:
Bela Ban, created July 22 2000

Constructor Summary
ProtocolView(Protocol p, javax.swing.table.DefaultTableModel model, int my_index)
           
ProtocolView(Protocol p, javax.swing.table.DefaultTableModel model, int my_index, boolean cummulative)
           
 
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).
 boolean passDown(Event evt)
          Called when an event is about to be passed down to the next lower protocol.
 boolean passUp(Event evt)
          Called when an event is about to be passed up to the next higher protocol.
 void setProtocol(Protocol prot)
          Called when a ProtocolObserver is attached to a protcol.
 java.lang.String toString()
           
 boolean up(Event evt, int num_evts)
          Called when an event is about to be dispatched to the protocol (before it is dispatched).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ProtocolView

public ProtocolView(Protocol p,
                    javax.swing.table.DefaultTableModel model,
                    int my_index)

ProtocolView

public ProtocolView(Protocol p,
                    javax.swing.table.DefaultTableModel model,
                    int my_index,
                    boolean cummulative)
Method Detail

setProtocol

public void setProtocol(Protocol prot)
Description copied from interface: ProtocolObserver
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.

Specified by:
setProtocol in interface ProtocolObserver

up

public boolean up(Event evt,
                  int num_evts)
Description copied from interface: ProtocolObserver
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).

Specified by:
up in interface ProtocolObserver
Parameters:
evt - The event to be processed by the protocol. This is not a copy, so changes to the event will be seen by the protocol !
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 the upper protocol layer puts new events into the up queue.
Returns:
boolean If true the event is processed, else it will be discarded (not be given to the protocol layer to process).

passUp

public boolean passUp(Event evt)
Description copied from interface: ProtocolObserver
Called when an event is about to be passed up to the next higher protocol.

Specified by:
passUp in interface ProtocolObserver
Parameters:
evt - The event to be processed by the protocol. This is not a copy, so changes to the event will be seen by the protocol !
Returns:
boolean If true the event is passed up, else it will be discarded (not be given to the protocol layer above to process).

down

public boolean down(Event evt,
                    int num_evts)
Description copied from interface: ProtocolObserver
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).

Specified by:
down in interface ProtocolObserver
Parameters:
evt - The event to be processed by the protocol. This is not a copy, so changes to the event will be seen by the protocol !
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 the upper protocol layer puts new events into the down queue.
Returns:
boolean If true the event is processed, else it will be discarded (not be given to the protocol layer to process).

passDown

public boolean passDown(Event evt)
Description copied from interface: ProtocolObserver
Called when an event is about to be passed down to the next lower protocol.

Specified by:
passDown in interface ProtocolObserver
Parameters:
evt - The event to be processed by the protocol. This is not a copy, so changes to the event will be seen by the protocol !
Returns:
boolean If true the event is passed down, else it will be discarded (not be given to the protocol layer below to process).

toString

public java.lang.String toString()


Copyright ? 1998-2005 Bela Ban. All Rights Reserved.