org.ehcache.management.registry
Class DefaultManagementRegistry

java.lang.Object
  extended by org.ehcache.management.registry.DefaultManagementRegistry
All Implemented Interfaces:
CacheManagerListener, StateChangeListener, CapabilityManagementSupport, ManagementRegistry, Service

public class DefaultManagementRegistry
extends java.lang.Object
implements ManagementRegistry, CacheManagerListener


Constructor Summary
DefaultManagementRegistry()
           
DefaultManagementRegistry(ManagementRegistryConfiguration configuration)
           
 
Method Summary
 void addManagementProvider(ManagementProvider<?> provider)
          Adds to this registry a specific management provider for object types T
 void cacheAdded(java.lang.String alias, Cache<?,?> cache)
          Fires just after the @{link Cache} was made Status.AVAILABLE, but wasn't yet made available to other threads by the CacheManager.
 void cacheRemoved(java.lang.String alias, Cache<?,?> cache)
          Fires just after the @{link Cache} was deregistered with the CacheManager, but wasn't yet made Status.UNINITIALIZED.
 java.util.Collection<org.terracotta.management.capabilities.Capability> getCapabilities()
          Get the management capabilities of the registered objects.
 ManagementRegistryConfiguration getConfiguration()
           
 org.terracotta.management.context.ContextContainer getContext()
          Get the management context required to make use of the registered objects' capabilities.
 java.util.List<ManagementProvider<?>> getManagementProvidersByCapability(java.lang.String capabilityName)
          List all management providers installed for a specific capability across all cache managers
 void register(java.lang.Object managedObject)
          Register an object in the management registry.
 void removeManagementProvider(ManagementProvider<?> provider)
          Removes from this registry a specific management provider for object types T
 void start(ServiceProvider serviceProvider)
          Start this service using the provided configuration and ServiceProvider.
 void stateTransition(Status from, Status to)
          Is notified when a state transition occurred.
 void stop()
          Stops this service.
 void unregister(java.lang.Object managedObject)
          Unregister an object from the management registry.
 CapabilityManagement withCapability(java.lang.String capabilityName)
          Query based on a capability of this management registry, such as collecting statistics or calling some actions
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultManagementRegistry

public DefaultManagementRegistry()

DefaultManagementRegistry

public DefaultManagementRegistry(ManagementRegistryConfiguration configuration)
Method Detail

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

cacheAdded

public void cacheAdded(java.lang.String alias,
                       Cache<?,?> cache)
Description copied from interface: CacheManagerListener
Fires just after the @{link Cache} was made Status.AVAILABLE, but wasn't yet made available to other threads by the CacheManager. Nonetheless, no other thread can add another Cache instance by the same alias.

Specified by:
cacheAdded in interface CacheManagerListener
Parameters:
alias - the alias the Cache is being registered on
cache - the actual Cache added

cacheRemoved

public void cacheRemoved(java.lang.String alias,
                         Cache<?,?> cache)
Description copied from interface: CacheManagerListener
Fires just after the @{link Cache} was deregistered with the CacheManager, but wasn't yet made Status.UNINITIALIZED. So that no other thread can get a handle to this Cache anymore, but the CacheManagerListener can still interact with it

Specified by:
cacheRemoved in interface CacheManagerListener
Parameters:
alias - the alias the Cache is being deregistered
cache - the actual Cache being removed

stateTransition

public void stateTransition(Status from,
                            Status to)
Description copied from interface: StateChangeListener
Is notified when a state transition occurred. Any exception thrown by this listener will not affect the transition.

Specified by:
stateTransition in interface StateChangeListener
Parameters:
from - previous state
to - new state

getConfiguration

public ManagementRegistryConfiguration getConfiguration()
Specified by:
getConfiguration in interface ManagementRegistry
Returns:
This registry configuration

addManagementProvider

public void addManagementProvider(ManagementProvider<?> provider)
Description copied from interface: ManagementRegistry
Adds to this registry a specific management provider for object types T

Specified by:
addManagementProvider in interface ManagementRegistry
Parameters:
provider - The management provider instance

removeManagementProvider

public void removeManagementProvider(ManagementProvider<?> provider)
Description copied from interface: ManagementRegistry
Removes from this registry a specific management provider for object types T

Specified by:
removeManagementProvider in interface ManagementRegistry
Parameters:
provider - The management provider instance

register

public void register(java.lang.Object managedObject)
Description copied from interface: ManagementRegistry
Register an object in the management registry.

Specified by:
register in interface ManagementRegistry
Parameters:
managedObject - the managed object.

unregister

public void unregister(java.lang.Object managedObject)
Description copied from interface: ManagementRegistry
Unregister an object from the management registry.

Specified by:
unregister in interface ManagementRegistry
Parameters:
managedObject - the managed object.

getContext

public org.terracotta.management.context.ContextContainer getContext()
Description copied from interface: ManagementRegistry
Get the management context required to make use of the registered objects' capabilities.

Specified by:
getContext in interface ManagementRegistry
Returns:
a this management registry context.

withCapability

public CapabilityManagement withCapability(java.lang.String capabilityName)
Description copied from interface: CapabilityManagementSupport
Query based on a capability of this management registry, such as collecting statistics or calling some actions

Specified by:
withCapability in interface CapabilityManagementSupport
Parameters:
capabilityName - The capability to work with
Returns:
An intermediary class enabling the access of methods based on a capability

getCapabilities

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

Specified by:
getCapabilities in interface ManagementRegistry
Returns:
a collection of capabilities.

getManagementProvidersByCapability

public java.util.List<ManagementProvider<?>> getManagementProvidersByCapability(java.lang.String capabilityName)
Description copied from interface: CapabilityManagementSupport
List all management providers installed for a specific capability across all cache managers

Specified by:
getManagementProvidersByCapability in interface CapabilityManagementSupport
Parameters:
capabilityName - The capability name
Returns:
The list of management providers installed