com.caucho.env.meter
Class SemaphoreMeter

java.lang.Object
  extended by com.caucho.env.meter.AbstractMeter
      extended by com.caucho.env.meter.SemaphoreMeter
All Implemented Interfaces:
Meter, SemaphoreSensor

public final class SemaphoreMeter
extends AbstractMeter
implements SemaphoreSensor


Constructor Summary
SemaphoreMeter(java.lang.String name)
           
 
Method Summary
 void acquire()
          Acquire a resource from the semaphore.
 AbstractMeter createCount(java.lang.String name)
           
 AbstractMeter createMax(java.lang.String name)
           
 AbstractMeter createMin(java.lang.String name)
           
 void release()
          Free a resource
 double sample()
          Return the probe's next average.
 double sampleCount()
          Return the probe's next sample.
 double sampleMax()
          Return the probe's next sample.
 double sampleMin()
          Return the probe's next sample.
 
Methods inherited from class com.caucho.env.meter.AbstractMeter
getName, peek, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SemaphoreMeter

public SemaphoreMeter(java.lang.String name)
Method Detail

createCount

public AbstractMeter createCount(java.lang.String name)

createMin

public AbstractMeter createMin(java.lang.String name)

createMax

public AbstractMeter createMax(java.lang.String name)

acquire

public final void acquire()
Description copied from interface: SemaphoreSensor
Acquire a resource from the semaphore.

Specified by:
acquire in interface SemaphoreSensor

release

public final void release()
Description copied from interface: SemaphoreSensor
Free a resource

Specified by:
release in interface SemaphoreSensor

sample

public final double sample()
Return the probe's next average.

Specified by:
sample in interface Meter
Specified by:
sample in class AbstractMeter

sampleCount

public final double sampleCount()
Return the probe's next sample.


sampleMax

public final double sampleMax()
Return the probe's next sample.


sampleMin

public final double sampleMin()
Return the probe's next sample.