org.jboss.monitor
Class LockMonitor

java.lang.Object
  extended byorg.jboss.monitor.LockMonitor
All Implemented Interfaces:
java.io.Serializable

public class LockMonitor
extends java.lang.Object
implements java.io.Serializable

Simple thread-safe POJO encapsulating locking stats. Turned this class to Serializable to be able to return copies of instances of this class over RMI. In this case it becomes detached from the EntityLockMonitor factory.

See Also:
Serialized Form

Constructor Summary
LockMonitor(EntityLockMonitor (src)  parent)
           
 
Method Summary
 void contending()
          Adjust the counters to indicate a contetion conditions.
 void finishedContending(long time)
          Adjust the counters to indicate that contention is over If the parent EntityLockMonitor has been initialized the total stats will be updated, too.
 long getCurrentContenders()
           
 long getMaxContenders()
           
 long getNumContentions()
           
 long getTimeouts()
           
 long getTotalTime()
           
 void increaseTimeouts()
          Increase the timeouts on this lock
 void reset()
          Reset the counters.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LockMonitor

public LockMonitor(EntityLockMonitor (src)  parent)
Parameters:
parent - factory
Method Detail

getTotalTime

public long getTotalTime()

getNumContentions

public long getNumContentions()

getTimeouts

public long getTimeouts()

getMaxContenders

public long getMaxContenders()

getCurrentContenders

public long getCurrentContenders()

contending

public void contending()
Adjust the counters to indicate a contetion conditions. If the parent EntityLockMonitor has been initialized the total stats will be updated, as well.


finishedContending

public void finishedContending(long time)
Adjust the counters to indicate that contention is over If the parent EntityLockMonitor has been initialized the total stats will be updated, too.


increaseTimeouts

public void increaseTimeouts()
Increase the timeouts on this lock


reset

public void reset()
Reset the counters. CurrentContenders stays unchanged and MaxCondenders is set to CurrentContenders


toString

public java.lang.String toString()