com.ibm.wsspi.timedoperations

Class TimedOperationService

  1. java.lang.Object
  2. extended bycom.ibm.wsspi.timedoperations.TimedOperationService

  1. public class TimedOperationService
  2. 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
  1. static
  2. int
getMaxNumberTimedOperations()
Returns the configured maximum number of timed operations that the system allows.
  1. static
  2. int
getReportFrequency()
Indicates how often the report to the logs detailing the ten longest timed operations is generated.
  1. static
  2. TimedOperation
getTimedOperation(java.lang.String type,java.lang.String pattern)
Returns a TimedOperation configured for the specified type and pattern.
  1. static
  2. java.util.Collection<TimedOperation>
getTimedOperations()
Lists all known timed operations.
  1. static
  2. java.util.HashMap<java.lang.String,java.util.ArrayList<TimedOperation>>
getTimedOperationsByType()
Lists all known timed operations, grouped by type.
  1. static
  2. boolean
isEnabled()
Indicates whether or not the TimedOperationService is enabled.
  1. static
  2. boolean
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

  1. public TimedOperationService()

Method Detail

isEnabled

  1. public static boolean isEnabled( )
Indicates whether or not the TimedOperationService is enabled. When the TimedOperationService is enabled, all TimedOperations are enabled. When the TimedOperationService is disabled, all TimedOperations are disabled.

getMaxNumberTimedOperations

  1. public static int getMaxNumberTimedOperations( )
Returns the configured maximum number of timed operations that the system allows. When the maximum number is reached, new timed operations will not be created until some of the existing ones are removed once they not in used anymore.
Returns:
the configured maximum number of timed operations.

isReportEnabled

  1. public static boolean 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.
Returns:
true if generating a report is enabled and false otherwise.
See Also:

getReportFrequency

  1. public static int getReportFrequency( )
Indicates how often the report to the logs detailing the ten longest timed operations is generated.
Returns:
frequency of generating report in hours.
See Also:

getTimedOperation

  1. public static TimedOperation getTimedOperation( java.lang.String type,
  2. java.lang.String pattern)
Returns a TimedOperation configured for the specified type and pattern.
Parameters:
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.
Returns:
the TimedOperation identified by the type and pattern.

getTimedOperations

  1. public static java.util.Collection<TimedOperation> getTimedOperations( )
Lists all known timed operations.
Returns:
all known TimedOperations.

getTimedOperationsByType

  1. public static java.util.HashMap<java.lang.String,java.util.ArrayList<TimedOperation>> getTimedOperationsByType( )
Lists all known timed operations, grouped by type.
Returns:
all known TimedOperations.