|
Oracle Fusion Middleware Java API Reference for Oracle ADF Share 11g Release 1 (11.1.1.6.0) E10686-07 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object oracle.adf.share.logging.internal.perf.ADFPerfSensor oracle.adf.share.perf.Timer
public class Timer
This class is a wrapper of DMS PhaseEvent sensor. It encapsulates sensor group name(Noun) and sensor name. It also contains a pair of functions to start()/stop() the timer, and a cleanup() function to abort the timer in the case of an exception so that we only count those PhaseEvents that are successfully stopped.
Field Summary | |
---|---|
static Timer |
DUMMY_TIMER
An empty Timer object. |
Fields inherited from class oracle.adf.share.logging.internal.perf.ADFPerfSensor |
---|
mEnableDms, mEnablePerfLog, mIndex, mLevel, mSensorFullName, sIdxLogger, sLogger |
Constructor Summary | |
---|---|
protected |
Timer()
creates an empty Timer object. |
Method Summary | |
---|---|
void |
cleanup()
Cleanup the timer. |
void |
cleanupWithToken(TimerToken token)
Cleanup the timer using token. |
static Timer |
createTimer(java.util.logging.Level level,
java.lang.String groupName,
java.lang.String name,
java.lang.String desc)
Create a Timer object identified by the groupName, the name, and the description. |
static Timer |
createTimer(java.util.logging.Level level,
java.lang.String groupName,
java.lang.String name,
java.lang.String type,
java.lang.String desc)
Create a Timer object identified by the groupName, the name, the type, and the description. |
static Timer |
createTimer(java.util.logging.Level level,
java.lang.String groupName,
java.lang.String name,
java.lang.String type,
java.lang.String desc,
TimerProvider provider)
Create a summerized Timer object identified by the groupName, the name, the type, the description, and a bunch of sub timers provided by the provider. |
static Timer |
createTimer(java.util.logging.Level level,
java.lang.String groupName,
java.lang.String name,
java.lang.String desc,
TimerProvider provider)
Create a composite timer object identified by the groupName, the name, the description, and a timer provider. |
void |
reset()
Clean up the metrics value |
void |
start()
Start the timer. |
TimerToken |
startWithToken()
Start the timer using Token. |
void |
stop()
Stop the timer. |
void |
stop(int returnValue)
Stop the timer with specified returnValue |
void |
stop(java.lang.Object returnValue)
Stop the timer with specified returnValue |
void |
stopWithToken(TimerToken token)
Stop the timer using token. |
void |
stopWithToken(TimerToken token,
int returnValue)
Stop the timer using token with specified returnValue |
void |
stopWithToken(TimerToken token,
java.lang.Object returnValue)
Stop the timer using token with specified returnValue |
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 |
---|
public static final Timer DUMMY_TIMER
Constructor Detail |
---|
protected Timer()
Method Detail |
---|
public static Timer createTimer(java.util.logging.Level level, java.lang.String groupName, java.lang.String name, java.lang.String desc)
Developers should then call Timer's start(), stop() and cleanup() functions to track the time. Please note start()/stop() funtions should always be put in a try or catch block, and the cleanup() function should always be called in a finally block to make sure the Timer object is aborted cleanly in case stop() is not called.
Internally, this method creates a DMS PhaseEvent sensor.
A DMS PhaseEvent sensor has following metrics: active, avg, completed, maxActive, maxTime, minTime and time.
When called inside the IDE, always returns DUMMY_TIMER.
level
- one of the message level identifiers, e.g. SEVEREgroupName
- the group name, which has the format of
/oracle/component_id/module/subModule/...
The component_id is also used as timer typename
- the timer namedesc
- the description for this timer.
public static Timer createTimer(java.util.logging.Level level, java.lang.String groupName, java.lang.String name, java.lang.String desc, TimerProvider provider)
Developers should then call Timer's start(), stop(returnValue) and cleanup() functions to track the time. Please note start()/stop(returnValue) funtions should always be put in a try or catch block, and the cleanup() function should always be called in a finally block to make sure the Timer object is aborted cleanly in case stop(returnValue) is not called.
Internally, this method creates one or more DMS PhaseEvent sensors depending on the implementation of TimerProvider.
A DMS PhaseEvent sensor has following metrics: active, avg, completed, maxActive, maxTime, minTime and time.
When called inside the IDE, always returns DUMMY_TIMER.
level
- one of the message level identifiers, e.g. SEVEREgroupName
- the group name, which has the format of
/oracle/component_id/module/subModule/...
The component_id is also used as timer typename
- the timer namedesc
- the description for this timer.provider
- the timer provider implements TimerProvider
public static Timer createTimer(java.util.logging.Level level, java.lang.String groupName, java.lang.String name, java.lang.String type, java.lang.String desc)
Developers should then call Timer's start(), stop() and cleanup() functions to track the time. Please note start()/stop() funtions should always be put in a try or catch block, and the cleanup() function should always be called in a finally block to make sure the Timer object is aborted cleanly in case stop() is not called.
Internally, this method creates a DMS PhaseEvent sensor.
A DMS PhaseEvent sensor has following metrics: active, avg, completed, maxActive, maxTime, minTime and time.
When called inside the IDE, always returns DUMMY_TIMER.
level
- one of the message level identifiers, e.g. SEVEREgroupName
- the group name, which has the format of
/oracle/component_id/module/subModule/...name
- the timer nametype
- the timer type which collects all sensors
with same type and display them together in a table
in AggreSpydesc
- the description for this timer.
public static Timer createTimer(java.util.logging.Level level, java.lang.String groupName, java.lang.String name, java.lang.String type, java.lang.String desc, TimerProvider provider)
Developers should then call Timer's start(), stop(returnValue) and cleanup() functions to track the time. Please note start()/stop(returnValue) funtions should always be put in a try or catch block, and the cleanup() function should always be called in a finally block to make sure the Timer object is aborted cleanly in case stop(returnValue) is not called.
Internally, this method creates one or more DMS PhaseEvent sensors depending on the implementation of TimerProvider.
A DMS PhaseEvent sensor has following metrics: active, avg, completed, maxActive, maxTime, minTime and time.
When called inside the IDE, always returns DUMMY_TIMER.
level
- one of the message level identifiers, e.g. SEVEREgroupName
- the group name, which has the format of
/oracle/component_id/module/subModule/...name
- the timer nametype
- the timer type which collects all sensors
with same type and display them together in a table
in AggreSpydesc
- the description for this timer.provider
- the timer provider implements TimerProvider
public void start()
After a timer is started, developers should call stop() function to stop the timer. start()/stop() funtions should be put in a try block, and the cleanup() function should be called in a finally block.
Internally, this method starts the DMS PhaseEvent sensor. The DMS PhaseEvent sensor has following metrics: active, avg, completed, maxActive, maxTime, minTime and time.
public TimerToken startWithToken()
After a timer is started, developer should call stopWithToken(token) and cleanupWithToekn(token) function to stop and cleanup the timer.
Internally, this method starts the DMS PhaseEvent sensor. The DMS PhaseEvent sensor has following metrics: active, avg, completed, maxActive, maxTime, minTime and time.
public void stop()
Developer should call start() function to start the timer. start()/stop() functions should be put in a try block, and the cleanup() function should be called in a finally block.
Internally, this method stops the DMS PhaseEvent sensor. The DMS PhaseEvent sensor has following metrics: active, avg, completed, maxActive, maxTime, minTime and time.
public void stopWithToken(TimerToken token)
Developer should call startWithToken() function to start the timer, and then call this method to stop the timer
Internally, this method stops the DMS PhaseEvent sensor. The DMS PhaseEvent sensor has following metrics: active, avg, completed, maxActive, maxTime, minTime and time.
token
- the TimerToken returned from startWithToken()public void stop(int returnValue)
Developer should call start() function to start the timer with TimerProvider, and stop(returnValue) to stop the timer. The returnValue decides which children timers to be updated.
Internally, this method stops the DMS PhaseEvent sensor for the parent sensor, and then update each children's PhaseEvent based on the result from TimerProvider.getTimers().
The DMS PhaseEvent sensor has following metrics: active, avg, completed, maxActive, maxTime, minTime and time.
returnValue
- the return code from a piece of code being monitored.public void stopWithToken(TimerToken token, int returnValue)
Developer should call startWithToken() function to start the timer with TimerProvider, and stopWithToken(token, returnValue) to stop the timer. The returnValue decides which children timers to be updated.
Internally, this method stops the DMS PhaseEvent sensor for the parent sensor, and then update each children's PhaseEvent based on the result from TimerProvider.getTimers().
The DMS PhaseEvent sensor has following metrics: active, avg, completed, maxActive, maxTime, minTime and time.
token
- the TimerToken returned from startWithToken()returnValue
- the return code from a piece of code being monitored.public void stop(java.lang.Object returnValue)
Developer should call start() function to start the timer with TimerProvider, and stop(returnValue) to stop the timer. The returnValue decides which children timers to be updated.
Internally, this method stops the DMS PhaseEvent sensor for the parent sensor, and then update each children's PhaseEvent based on the result from TimerProvider.getTimers().
The DMS PhaseEvent sensor has following metrics: active, avg, completed, maxActive, maxTime, minTime and time.
returnValue
- the return code from a piece of code being monitored.public void stopWithToken(TimerToken token, java.lang.Object returnValue)
Developer should call startWithToken() function to start the timer with TimerProvider, and stopWithToken(token, returnValue) to stop the timer. The returnValue decides which children timers to be updated.
Internally, this method stops the DMS PhaseEvent sensor for the parent sensor, and then update each children's PhaseEvent based on the result from TimerProvider.getTimers().
The DMS PhaseEvent sensor has following metrics: active, avg, completed, maxActive, maxTime, minTime and time.
token
- the TimerToken returned from startWithToken()returnValue
- the return code from a piece of code being monitored.public void cleanup()
This function should be called within a finally block. It either stops the timer if everything goes fine, or aborts the timer if an exception occurred.
public void cleanupWithToken(TimerToken token)
This function should be called within a finally block. It either stops the timer if everything goes fine, or aborts the timer if an exception occurred.
token
- the TimerToken returned from startWithToken()public void reset()
ADFPerfSensor
reset
in class ADFPerfSensor
|
Oracle Fusion Middleware Java API Reference for Oracle ADF Share 11g Release 1 (11.1.1.6.0) E10686-07 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |