org.opends.server.monitors
Class TraditionalWorkQueueMonitor

java.lang.Object
  extended by java.lang.Thread
      extended by org.opends.server.api.DirectoryThread
          extended by org.opends.server.api.MonitorProvider<MonitorProviderCfg>
              extended by org.opends.server.monitors.TraditionalWorkQueueMonitor
All Implemented Interfaces:
java.lang.Runnable

public class TraditionalWorkQueueMonitor
extends MonitorProvider<MonitorProviderCfg>

This class defines a Directory Server monitor that can be used to provide information about the state of the work queue.


Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
static java.lang.String ATTR_AVERAGE_BACKLOG
          The name to use for the monitor attribute that provides the average request backlog.
static java.lang.String ATTR_CURRENT_BACKLOG
          The name to use for the monitor attribute that provides the current request backlog.
static java.lang.String ATTR_MAX_BACKLOG
          The name to use for the monitor attribute that provides the maximum observed request backlog.
static java.lang.String ATTR_OPS_REJECTED_QUEUE_FULL
          The name to use for the monitor attribute that provides the total number of requests that have been rejected because the work queue was full.
static java.lang.String ATTR_OPS_SUBMITTED
          The name to use for the monitor attribute that provides the total number of operations submitted.
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
TraditionalWorkQueueMonitor(TraditionalWorkQueue workQueue)
          Initializes this monitor provider.
 
Method Summary
 java.util.ArrayList<Attribute> getMonitorData()
          Retrieves a set of attributes containing monitor data that should be returned to the client if the corresponding monitor entry is requested.
 java.lang.String getMonitorInstanceName()
          Retrieves the name of this monitor provider.
 long getUpdateInterval()
          Retrieves the length of time in milliseconds that should elapse between calls to the updateMonitorData() method.
 void initializeMonitorProvider(MonitorProviderCfg configuration)
          Initializes this monitor provider based on the information in the provided configuration entry.
 void updateMonitorData()
          Performs any processing periodic processing that may be desired to update the information associated with this monitor.
 
Methods inherited from class org.opends.server.api.MonitorProvider
finalizeMonitorProvider, getMonitorObjectClass, isConfigurationAcceptable, run
 
Methods inherited from class org.opends.server.api.DirectoryThread
getAssociatedTask, getCreationStackTrace, getDebugProperties, getParentThread, setAssociatedTask
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ATTR_CURRENT_BACKLOG

public static final java.lang.String ATTR_CURRENT_BACKLOG
The name to use for the monitor attribute that provides the current request backlog.

See Also:
Constant Field Values

ATTR_AVERAGE_BACKLOG

public static final java.lang.String ATTR_AVERAGE_BACKLOG
The name to use for the monitor attribute that provides the average request backlog.

See Also:
Constant Field Values

ATTR_MAX_BACKLOG

public static final java.lang.String ATTR_MAX_BACKLOG
The name to use for the monitor attribute that provides the maximum observed request backlog.

See Also:
Constant Field Values

ATTR_OPS_SUBMITTED

public static final java.lang.String ATTR_OPS_SUBMITTED
The name to use for the monitor attribute that provides the total number of operations submitted.

See Also:
Constant Field Values

ATTR_OPS_REJECTED_QUEUE_FULL

public static final java.lang.String ATTR_OPS_REJECTED_QUEUE_FULL
The name to use for the monitor attribute that provides the total number of requests that have been rejected because the work queue was full.

See Also:
Constant Field Values
Constructor Detail

TraditionalWorkQueueMonitor

public TraditionalWorkQueueMonitor(TraditionalWorkQueue workQueue)
Initializes this monitor provider. Note that no initialization should be done here, since it should be performed in the initializeMonitorProvider class.

Parameters:
workQueue - The work queue with which this monitor is associated.
Method Detail

initializeMonitorProvider

public void initializeMonitorProvider(MonitorProviderCfg configuration)
                               throws ConfigException,
                                      InitializationException
Initializes this monitor provider based on the information in the provided configuration entry.

Specified by:
initializeMonitorProvider in class MonitorProvider<MonitorProviderCfg>
Parameters:
configuration - The configuration to use to initialize this monitor provider.
Throws:
ConfigException - If an unrecoverable problem arises in the process of performing the initialization.
InitializationException - If a problem occurs during initialization that is not related to the server configuration.

getMonitorInstanceName

public java.lang.String getMonitorInstanceName()
Retrieves the name of this monitor provider. It should be unique among all monitor providers, including all instances of the same monitor provider.

Specified by:
getMonitorInstanceName in class MonitorProvider<MonitorProviderCfg>
Returns:
The name of this monitor provider.

getUpdateInterval

public long getUpdateInterval()
Retrieves the length of time in milliseconds that should elapse between calls to the updateMonitorData() method. A negative or zero return value indicates that the updateMonitorData() method should not be periodically invoked.

Specified by:
getUpdateInterval in class MonitorProvider<MonitorProviderCfg>
Returns:
The length of time in milliseconds that should elapse between calls to the updateMonitorData() method.

updateMonitorData

public void updateMonitorData()
Performs any processing periodic processing that may be desired to update the information associated with this monitor. Note that best-effort attempts will be made to ensure that calls to this method come getUpdateInterval() milliseconds apart, but no guarantees will be made.

Specified by:
updateMonitorData in class MonitorProvider<MonitorProviderCfg>

getMonitorData

public java.util.ArrayList<Attribute> getMonitorData()
Retrieves a set of attributes containing monitor data that should be returned to the client if the corresponding monitor entry is requested.

Specified by:
getMonitorData in class MonitorProvider<MonitorProviderCfg>
Returns:
A set of attributes containing monitor data that should be returned to the client if the corresponding monitor entry is requested.