MonitoringRegistry Interface

Provides for collection of monitoring statistics from JSR77 compliant Stats implementations through the JMX API. Various J2EE server components can expose their JSR 77 compliant Stats implementations to a JMX client with the help of this package.
The J2EE server components register their `Stats` implementations through the implementation of `MonitoringRegistry` interface class that provides the ability to register and unregister components to make them available (or unavailable) to JMX clients. The registration implementation would introspect the `Stats` implementation, create a `DynamicMBean` out of the introspected parts, and exposes this derived management interface to JMX clients by registering the `DynamicMBean` with the `MBeanServer.` Any calls to the MBean's public API is delegated to the `Stats` implementation and the underlying `Statistic`'s monitored attribute value is returned.
One can obtain an instance of this interface's implementation instance by using the following code as an example:

`import com.sun.enterprise.server.ApplicationServer;// (appserver-core module)
import com.sun.enterprise.server.ServerContext; // (appserv-core module)
import com.sun.enterprise.server.admin.monitor.registry.MonitoringRegistry;//(admin-core module -compile time dependency)
...
final MonitoringRegistry registry = ApplicationServer.getServerContext().getMonitoringRegistry(); // returns an implementation.
registry.registerEJBStats( ...);
`

The magnitude of monitoring and corresponding number of attributes involved in monitoring is dependent on the level at which monitoring of each component is set. A change in monitoring level to `OFF, LOW` or`HIGH` from a prior setting results in a change in the extent to which monitoring is performed for that component. Following each such change in state, the J2EE server component has to unregister its previous `Stats` implementation. The `MonitoringRegistrationHelper` unregisters the `DynamicMBean` from the `MBeanServer` as a result. If the change in state results in monitoring level being either `HIGH` or `LOW`(i.e. not `OFF`), the component will now register a `Stats` implementation that reflects the higher or lower set of attributes that are monitored. The `MonitoringRegistrationHelper` will now generate a new `DynamicMBean` that will expose the revised higher or lower level of observed attributes as a result of the change in setting.

## Package Specification

The registration interface and its related classes are defined in the `com.sun.enterprise.admin.monitor.registry` package. The following interfaces and classes are part of this package.

- `MonitoringRegistry` interface - declares methods to register, unregister and to find if a component's `Stats` implementation is already registered.
- `MonitoringRegistrationException` class - reports exceptions that may occur during registration or unregistration process.
- `MonitoringLevelListener` interface - interface provides `setLevel` method. Implementations will be notified of changes in monitoring level through this method.
- `MonitoringLevel` class - describes various recognized monitoring levels

## Related Documentation

The implementations and associated helper classes are defined in the
`com.sun.enterprise.admin.monitor.stats.spi` and
`com.sun.enterprise.admin.monitor.stats.util` packages
See the associated package file for information on how client will access the stats implementations.