Oracle Fusion Middleware Java API Reference for Oracle ADF Share
11g Release 2 (11.1.2.0.0)

E17486-01

oracle.adf.share.perf
Class Counter

java.lang.Object
  extended by oracle.adf.share.logging.internal.perf.ADFPerfSensor
      extended by oracle.adf.share.perf.Counter

public class Counter
extends ADFPerfSensor

This class is a wrapper of DMS Event sensor.


Field Summary
static Counter DUMMY_COUNTER
          A dummy Counter object that does nothing.
 
Fields inherited from class oracle.adf.share.logging.internal.perf.ADFPerfSensor
mEnableDms, mEnablePerfLog, mIndex, mLevel, mSensorFullName, sIdxLogger, sLogger
 
Constructor Summary
protected Counter()
          creates an empty Counter object.
 
Method Summary
static Counter createCounter(java.util.logging.Level level, java.lang.String groupName, java.lang.String name, java.lang.String desc)
          Create a Counter object identified by the sensorGroupName and the sensorName.
static Counter createCounter(java.util.logging.Level level, java.lang.String groupName, java.lang.String name, java.lang.String type, java.lang.String desc)
          Create a Counter object identified by the sensorGroupName and the sensorName.
 long getValue()
          Get counter current value
 void increase()
          Increase the counter to indicate an event occurred.
 void reset()
          Clean up the counter value
 
Methods inherited from class oracle.adf.share.logging.internal.perf.ADFPerfSensor
isActive, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DUMMY_COUNTER

public static final Counter DUMMY_COUNTER
A dummy Counter object that does nothing. Allows client code to be written in a generic way without knowing whether the code is executing in the IDE or in a deployed application.

Constructor Detail

Counter

protected Counter()
creates an empty Counter object.

Method Detail

increase

public void increase()
Increase the counter to indicate an event occurred.


getValue

public long getValue()
Get counter current value

Returns:
counter value. When the sensor is not enabled or the value is not integer, it return -1 to indicate a problem.

reset

public void reset()
Clean up the counter value

Overrides:
reset in class ADFPerfSensor

createCounter

public static Counter createCounter(java.util.logging.Level level,
                                    java.lang.String groupName,
                                    java.lang.String name,
                                    java.lang.String desc)
Create a Counter object identified by the sensorGroupName and the sensorName.

Developers should then call Counter's increase(), reset() methods to track the counter object.

Internally, this method creates a DMS Event sensor.

When running inside the IDE, this methods returns DUMMY_COUNTER.

Parameters:
level - one of the message level identifiers, e.g. SEVERE
groupName - the group name, which has the format of /oracle/component_id/module/subModule/... The component_id is also used as Counter type
name - the counter name.
desc - the description for this Counter.
Returns:
the new Counter

createCounter

public static Counter createCounter(java.util.logging.Level level,
                                    java.lang.String groupName,
                                    java.lang.String name,
                                    java.lang.String type,
                                    java.lang.String desc)
Create a Counter object identified by the sensorGroupName and the sensorName.

Developers should then call Counter's increase(), reset() methods to track the counter object.

Internally, this method creates a DMS Event sensor.

When running inside the IDE, this methods returns DUMMY_COUNTER.

Parameters:
level - one of the message level identifiers, e.g. SEVERE
groupName - the group name, which has the format of /oracle/component_id/module/subModule/...
name - the counter name.
type - the Counter type which collects all sensors with same type and display them together in a table in AggreSpy
desc - the description for this Counter.
Returns:
the new Counter

Oracle Fusion Middleware Java API Reference for Oracle ADF Share
11g Release 2 (11.1.2.0.0)

E17486-01

Copyright © 1997, 2011, Oracle. All rights reserved.