public class DefaultTimerService extends AbstractContexed implements TimerService
TimerService
conn
Constructor and Description |
---|
DefaultTimerService(AppContext conn) |
Modifier and Type | Method and Description |
---|---|
void |
cleanup()
AppContext is being closed. |
void |
closeAll() |
java.lang.String |
getPrefix() |
java.lang.Class<TimerService> |
getType()
Returns the type of service the class should be registered under.
|
void |
setPrefix(java.lang.String prefix) |
void |
startTimer(java.lang.String name)
Start a named timer
|
void |
stopTimer(java.lang.String name)
Stop a named timer
|
void |
timerStats()
Generate timer statistics to the log of the timer service.
|
void |
timerStats(java.lang.Class clazz)
Generate timer statistics to the log of the specified class.
|
void |
timerStats(java.lang.StringBuilder sb)
write stats to a
StringBuilder |
getContext, getLogger, resetLogger
public DefaultTimerService(AppContext conn)
public void cleanup()
AppContextCleanup
AppContext
is being closed.
Only use this for cleanup that can't be handled by
normal garbage collection or for state which is never returned by reference.cleanup
in interface AppContextCleanup
public void timerStats(java.lang.Class clazz)
TimerService
timerStats
in interface TimerService
clazz
- Class for loggingpublic void timerStats(java.lang.StringBuilder sb)
TimerService
StringBuilder
timerStats
in interface TimerService
public void closeAll()
public final void startTimer(java.lang.String name)
TimerService
startTimer
in interface TimerService
public final void stopTimer(java.lang.String name)
TimerService
stopTimer
in interface TimerService
public java.lang.Class<TimerService> getType()
AppContextService
getType
in interface AppContextService<TimerService>
public void timerStats()
TimerService
timerStats
in interface TimerService
public java.lang.String getPrefix()
public void setPrefix(java.lang.String prefix)
prefix
- the prefix to set