com.ibm.wsspi.timedoperations
Class TimedOperationService
- java.lang.Object
com.ibm.wsspi.timedoperations.TimedOperationService
- public class TimedOperationService
- extends java.lang.Object
The TimedOperationService controls the enablement of all timed operations and manages the TimedOperation instances.
The TimedOperationService is disabled by default and is enabled when the "timedOperations-1.0" <feature> element is added into the server.xml file.
For example, you can add the following configuration snippet to enable the TimedOperationService: <server>
<featureManager>
<feature>timedOperations-1.0</feature>
</featureManager>
</server>
To disable the TimedOperationService, remove the "timedOperations-1.0" <feature> element
from server.xml.
Since features can be added to and removed from the server configuration without server restarts, the use of the TimedOperationService is supported only in the following scenario in order to make sure that your bundle resolution does not fail because of an unresolved import when the timedOperations-1.0 feature is not configured.
Your bundle provides the timed operations monitoring only when the timedOperations-1.0 is also enabled. Therefore you need to separate the code that provides the timed operations function into its own feature, and declare it to be an 'auto feature', which means that users don't directly configure it in their server.xml but it will be added by the feature manager if both your feature and the timedOperations-1.0 feature are configured. This way you ensure that all the required packages will be available in the framework.
Note that when the TimedOperationService is disabled all TimedOperation state objects will be erased.
Constructor Summary
Constructor and Description |
---|
TimedOperationService()
|
Method Summary
Modifier and Type | Method and Description |
---|---|
|
getMaxNumberTimedOperations()
Returns the configured maximum number of timed operations that the system allows.
|
|
getReportFrequency()
Indicates how often the report to the logs detailing the ten longest
timed operations is generated.
|
|
getTimedOperation(java.lang.String type,java.lang.String pattern)
Returns a TimedOperation configured for the specified type and pattern.
|
|
getTimedOperations()
Lists all known timed operations.
|
|
getTimedOperationsByType()
Lists all known timed operations, grouped by type.
|
|
isEnabled()
Indicates whether or not the TimedOperationService is enabled.
|
|
isReportEnabled()
Indicates if a report to the logs, which details the ten
longest timed operations, grouped by type, and sorted within
each group by expected duration, is periodically generated or not.
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail
TimedOperationService
- public TimedOperationService()
Method Detail
isEnabled
- public static boolean isEnabled( )
getMaxNumberTimedOperations
- public static int getMaxNumberTimedOperations( )
isReportEnabled
- public static boolean isReportEnabled( )
getReportFrequency
- public static int getReportFrequency( )
getTimedOperation
- public static TimedOperation getTimedOperation( java.lang.String type,
- java.lang.String pattern)
type
- the type of the timed operation. pattern
- optional pattern of the timed operation, which specifies a particular instance name to
indicate the specific operation being performed. getTimedOperations
- public static java.util.Collection<TimedOperation> getTimedOperations( )
getTimedOperationsByType
- public static java.util.HashMap<java.lang.String,java.util.ArrayList<TimedOperation>> getTimedOperationsByType( )