org.jgroups.protocols

Class PERF_TP


public class PERF_TP
extends Protocol

Measures the time for a message to travel from the channel to the transport
Version:
$Id: PERF_TP.java,v 1.11 2005/08/11 12:43:47 belaban Exp $
Author:
Bela Ban

Field Summary

Fields inherited from class org.jgroups.stack.Protocol

down_handler, down_prot, down_queue, down_thread, down_thread_prio, log, observer, props, stack, stats, trace, up_handler, up_prot, up_queue, up_thread, up_thread_prio, warn

Constructor Summary

PERF_TP()

Method Summary

boolean
done()
void
down(Event evt)
Caller by the layer above this layer.
static PERF_TP
getInstance()
String
getName()
long
getNumMessages()
long
getTotalTime()
void
init()
Called after instance has been created (null constructor) and before protocol is started.
void
reset()
void
setExpectedMessages(long m)
void
start()
This method is called on a Channel.connect(String).
String
toString()
void
up(Event evt)
An event was received from the layer below.

Methods inherited from class org.jgroups.stack.Protocol

destroy, down, downThreadEnabled, dumpStats, enableStats, getDownProtocol, getDownQueue, getName, getProperties, getUpProtocol, getUpQueue, handleSpecialDownEvent, init, isTrace, isWarn, passDown, passUp, printStats, providedDownServices, providedUpServices, receiveDownEvent, receiveUpEvent, requiredDownServices, requiredUpServices, resetStats, setDownProtocol, setObserver, setProperties, setPropertiesInternal, setProtocolStack, setTrace, setUpProtocol, setWarn, start, startDownHandler, startUpHandler, statsEnabled, stop, stopInternal, up, upThreadEnabled

Constructor Details

PERF_TP

public PERF_TP()

Method Details

done

public boolean done()

down

public void down(Event evt)
Caller by the layer above this layer. Usually we just put this Message into the send queue and let one or more worker threads handle it. A worker thread then removes the Message from the send queue, performs a conversion and adds the modified Message to the send queue of the layer below it, by calling Down).
Overrides:
down in interface Protocol

getInstance

public static PERF_TP getInstance()

getName

public String getName()
Overrides:
getName in interface Protocol

getNumMessages

public long getNumMessages()

getTotalTime

public long getTotalTime()

init

public void init()
            throws Exception
Called after instance has been created (null constructor) and before protocol is started. Properties are already set. Other protocols are not yet connected and events cannot yet be sent.
Overrides:
init in interface Protocol

reset

public void reset()

setExpectedMessages

public void setExpectedMessages(long m)

start

public void start()
            throws Exception
This method is called on a Channel.connect(String). Starts work. Protocols are connected and queues are ready to receive events. Will be called from bottom to top. This call will replace the START and START_OK events.
Overrides:
start in interface Protocol

toString

public String toString()

up

public void up(Event evt)
An event was received from the layer below. Usually the current layer will want to examine the event type and - depending on its type - perform some computation (e.g. removing headers from a MSG event type, or updating the internal membership list when receiving a VIEW_CHANGE event). Finally the event is either a) discarded, or b) an event is sent down the stack using passDown() or c) the event (or another event) is sent up the stack using passUp().
Overrides:
up in interface Protocol

Copyright B) 1998-2005 Bela Ban. All Rights Reserved.