|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.commsen.stopwatch.engines.DefaultStopwatchEngine
public class DefaultStopwatchEngine
Default stopwatch engine. This engine simply measures how many times measured code was executed and how long it take.
Constructor Summary | |
---|---|
DefaultStopwatchEngine()
|
Method Summary | |
---|---|
long |
begin(java.lang.String group,
java.lang.String label)
Method called when mensuration is started. |
void |
end(long id)
Method called when mensuration is stopped. |
protected org.apache.log4j.Logger |
getLogger()
|
int |
getPersistenceMode()
|
java.util.Properties |
getProperties()
Returns engine properties. |
StopwatchStorage |
getStorage()
Allows clients to get reference to the stopwatch's storage. |
java.lang.String |
getStorageClass()
Method called to obtain the current storage class |
StorageManager |
getStorageManager()
|
protected boolean |
isDebug()
|
boolean |
isDebugEnabled()
|
void |
pause()
Called when Stopwatch is disabled or for any other reason it will not use this engine for some time. |
void |
resume()
Called when Stopwatch is enabled and before attepting to use paused engine. |
void |
setDebugEnabled(boolean debugEnabled)
Instructs engine to disable/enable debug information. |
void |
setPersistenceMode(int persistenceMode)
Method called to instruct engine in what mode persistence manager should work in. |
void |
setProperties(java.util.Properties properties)
Called by Stopwatch to set engine properties . |
void |
setStorage(StopwatchStorage storage)
Method called to instruct engine to use user defined storage |
void |
skip(long id)
Method called when mensuration with id id is to be skipped. |
void |
start()
Method called by Stopwatch when initilializing Stopwatch engine. |
void |
stop()
Called when Stopwatch's engine is changed or for any other reason Stopwatch will no longer use this engine. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DefaultStopwatchEngine()
Method Detail |
---|
public void start()
StopwatchEngine
start
in interface StopwatchEngine
StopwatchEngine.start()
public void pause()
StopwatchEngine
pause
in interface StopwatchEngine
StopwatchEngine.pause()
public void resume()
StopwatchEngine
resume
in interface StopwatchEngine
StopwatchEngine.resume()
public void stop()
StopwatchEngine
stop
in interface StopwatchEngine
StopwatchEngine.stop()
public long begin(java.lang.String group, java.lang.String label)
StopwatchEngine
begin
in interface StopwatchEngine
group
- the name of the group this measurment should be placed inlabel
- how this measurment should be labeled
StopwatchEngine.begin(java.lang.String, java.lang.String)
public void end(long id)
StopwatchEngine
end
in interface StopwatchEngine
id
- Unique ID representing the actual measurment that need to be stopped.StopwatchEngine.end(long)
public void skip(long id)
StopwatchEngine
id
is to be skipped. It is possible to
call this method multiple times with the same id, however the engine should process only the
first call.
skip
in interface StopwatchEngine
id
- Unique ID representing the actual measurment that need to be stopped.StopwatchEngine.skip(long)
public boolean isDebugEnabled()
public void setDebugEnabled(boolean debugEnabled)
StopwatchEngine
setDebugEnabled
in interface StopwatchEngine
debugEnabled
- should debug information be generatedStopwatchEngine.setDebugEnabled(boolean)
protected org.apache.log4j.Logger getLogger()
protected boolean isDebug()
public StopwatchStorage getStorage()
StopwatchEngine
getStorage
in interface StopwatchEngine
StopwatchEngine.getStorage()
public void setStorage(StopwatchStorage storage)
StopwatchEngine
setStorage
in interface StopwatchEngine
storage
- The storage to set.public java.lang.String getStorageClass()
StopwatchEngine
getStorageClass
in interface StopwatchEngine
public StorageManager getStorageManager()
public int getPersistenceMode()
public void setPersistenceMode(int persistenceMode)
StopwatchEngine
setPersistenceMode
in interface StopwatchEngine
persistenceMode
- The persistenceMode to set.StorageManager.NORMAL_MODE
,
StorageManager.THREAD_MODE
,
StorageManager.DELAYED_MODE
public java.util.Properties getProperties()
StopwatchEngine
getProperties
in interface StopwatchEngine
public void setProperties(java.util.Properties properties)
StopwatchEngine
setProperties
in interface StopwatchEngine
properties
- the properties
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |