Package com.saperion.util
Class StartupTimer
- java.lang.Object
-
- com.saperion.util.StartupTimer
-
public final class StartupTimer extends java.lang.Object
A utility class intended to be used to monitor the startup behavior of a single process.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
finished()
Notifies this StartupTimer that the startup process was finished.static StartupTimer
getInstance()
void
start(java.lang.String id, java.lang.String description)
Notifies this StartupTimer that a new action in the startup process has begun.void
stop(java.lang.String id)
Notifies this StartupTimer that the action identified by the id was finished.
-
-
-
Method Detail
-
getInstance
public static StartupTimer getInstance()
- Returns:
- singleton instance
-
start
public void start(java.lang.String id, java.lang.String description)
Notifies this StartupTimer that a new action in the startup process has begun.- Parameters:
id
- id of the action. Must be used whenstop(String)
is calleddescription
- a human-readable description of the action that has begun
-
stop
public void stop(java.lang.String id)
Notifies this StartupTimer that the action identified by the id was finished.- Parameters:
id
- id of the action as used instart(String, String)
-
finished
public void finished()
Notifies this StartupTimer that the startup process was finished. If info-logging is enabled, the recorded times will be logged. Additionally, a newStartupTimerMBean
will be registered. All actions, that were not yet stopped by callingstop(String)
, will be stopped. After this method was called, further calls tostart(String, String)
orstop(String)
will have no effect.
-
-