Package org.jgroups.protocols
Class PERF_TP
java.lang.Object
org.jgroups.stack.Protocol
org.jgroups.protocols.PERF_TP
Measures the time for a message to travel from the channel to the transport
- Version:
- $Id: PERF_TP.java,v 1.20 2007/04/27 07:59:20 belaban Exp $
- Author:
- Bela Ban
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
done()
Caller by the layer above this layer.static PERF_TP
getName()
long
long
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 aChannel.connect(String)
.toString()
An event was received from the layer below.Methods inherited from class org.jgroups.stack.Protocol
destroy, downThreadEnabled, dumpStats, enableStats, getDownProtocol, getProperties, getProtocolStack, getThreadFactory, getTransport, getUpProtocol, printStats, providedDownServices, providedUpServices, requiredDownServices, requiredUpServices, resetStats, setDownProtocol, setProperties, setPropertiesInternal, setProtocolStack, setUpProtocol, statsEnabled, stop, upThreadEnabled
-
Constructor Details
-
PERF_TP
public PERF_TP()
-
-
Method Details
-
getInstance
-
toString
-
done
public boolean done() -
getNumMessages
public long getNumMessages() -
setExpectedMessages
public void setExpectedMessages(long m) -
reset
public void reset() -
getTotalTime
public long getTotalTime() -
getName
-
init
Description copied from class:Protocol
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. -
start
Description copied from class:Protocol
This method is called on aChannel.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 classProtocol
- Throws:
Exception
- Thrown if protocol cannot be started successfully. This will cause the ProtocolStack to fail, soChannel.connect(String)
will throw an exception
-
down
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). -
up
Description copied from class:Protocol
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 usingdown_prot.down()
or c) the event (or another event) is sent up the stack usingup_prot.up()
.
-