org.jboss.monitor
Class LockMonitor

java.lang.Object
  extended by org.jboss.monitor.LockMonitor
All Implemented Interfaces:
Serializable

public class LockMonitor
extends Object
implements 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.

Version:
$Revision: 57209 $
Author:
Bill Burke, Dimitris Andreadis
See Also:
Serialized Form

Constructor Summary
LockMonitor(EntityLockMonitor 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.
 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 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 String toString()
Overrides:
toString in class Object


Copyright © 2002 JBoss Group, LLC. All Rights Reserved.