org.ehcache.management.registry
Class AbstractManagementRegistry

java.lang.Object
  extended by org.ehcache.management.registry.AbstractManagementRegistry
All Implemented Interfaces:
ManagementRegistry, Service
Direct Known Subclasses:
DefaultManagementRegistry

public abstract class AbstractManagementRegistry
extends java.lang.Object
implements ManagementRegistry


Constructor Summary
protected AbstractManagementRegistry()
           
 
Method Summary
protected  void addSupportFor(ManagementProvider<?> managementProvider)
           
<T> T
callAction(java.util.Map<java.lang.String,java.lang.String> context, java.lang.String capabilityName, java.lang.String methodName, java.lang.String[] argClassNames, java.lang.Object[] args)
          Call an action of a managed object's capability.
<T> java.util.Collection<T>
capabilities()
          Get the management capabilities of the registered objects.
<T> java.util.Collection<T>
collectStatistics(java.util.Map<java.lang.String,java.lang.String> context, java.lang.String capabilityName, java.lang.String... statisticNames)
          Collect statistics from a managed object's capability.
<T> java.util.Collection<T>
contexts()
          Get the management contexts required to make use of the registered objects' capabilities.
<T> void
register(java.lang.Class<T> managedType, T managedObject)
          Register an object in the management registry.
 void start(ServiceProvider serviceProvider)
          Start this service using the provided configuration and ServiceProvider.
 void stop()
          Stops this service.
<T> void
unregister(java.lang.Class<T> managedType, T managedObject)
          Unregister an object from the management registry.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractManagementRegistry

protected AbstractManagementRegistry()
Method Detail

addSupportFor

protected void addSupportFor(ManagementProvider<?> managementProvider)

contexts

public <T> java.util.Collection<T> contexts()
Description copied from interface: ManagementRegistry
Get the management contexts required to make use of the registered objects' capabilities.

Specified by:
contexts in interface ManagementRegistry
Type Parameters:
T - the context type.
Returns:
a collection of contexts.

collectStatistics

public <T> java.util.Collection<T> collectStatistics(java.util.Map<java.lang.String,java.lang.String> context,
                                                     java.lang.String capabilityName,
                                                     java.lang.String... statisticNames)
Description copied from interface: ManagementRegistry
Collect statistics from a managed object's capability.

Specified by:
collectStatistics in interface ManagementRegistry
Type Parameters:
T - the statistics' type.
Parameters:
context - the capability's context.
capabilityName - the capability name.
statisticNames - the statistic names.
Returns:
a collection of statistics.

callAction

public <T> T callAction(java.util.Map<java.lang.String,java.lang.String> context,
                        java.lang.String capabilityName,
                        java.lang.String methodName,
                        java.lang.String[] argClassNames,
                        java.lang.Object[] args)
Description copied from interface: ManagementRegistry
Call an action of a managed object's capability.

Specified by:
callAction in interface ManagementRegistry
Type Parameters:
T - the returned type.
Parameters:
context - the capability's context.
capabilityName - the capability name.
methodName - the action's method name.
argClassNames - the action method's argument class names.
args - the action method's arguments.
Returns:
the action method's return value.

register

public <T> void register(java.lang.Class<T> managedType,
                         T managedObject)
Description copied from interface: ManagementRegistry
Register an object in the management registry.

Specified by:
register in interface ManagementRegistry
Type Parameters:
T - the type.
Parameters:
managedType - the managed object's class.
managedObject - the managed object.

unregister

public <T> void unregister(java.lang.Class<T> managedType,
                           T managedObject)
Description copied from interface: ManagementRegistry
Unregister an object from the management registry.

Specified by:
unregister in interface ManagementRegistry
Type Parameters:
T - the type.
Parameters:
managedType - the managed object's class.
managedObject - the managed object.

capabilities

public <T> java.util.Collection<T> capabilities()
Description copied from interface: ManagementRegistry
Get the management capabilities of the registered objects.

Specified by:
capabilities in interface ManagementRegistry
Type Parameters:
T - the capability type.
Returns:
a collection of capabilities.

start

public void start(ServiceProvider serviceProvider)
Description copied from interface: Service
Start this service using the provided configuration and ServiceProvider.

The goal of the service provider is to allow a service to use other services.

Specified by:
start in interface Service
Parameters:
serviceProvider - the service provider.

stop

public void stop()
Description copied from interface: Service
Stops this service.

Specified by:
stop in interface Service