org.ehcache.management.providers
Interface ManagementProvider<T>

All Known Implementing Classes:
CacheBindingManagementProviderSkeleton, EhcacheActionProvider, EhcacheStatisticsProvider

public interface ManagementProvider<T>

Interface to a provider of management capabilities for certain object class.


Method Summary
<T> T
callAction(org.terracotta.management.context.Context context, java.lang.String methodName, java.lang.Class<T> returnType, org.terracotta.management.call.Parameter... parameters)
          Call an action, if the provider supports this.
 void close()
          Closes the management provider.
 java.util.Map<java.lang.String,org.terracotta.management.stats.Statistic<?,?>> collectStatistics(org.terracotta.management.context.Context context, java.util.Collection<java.lang.String> statisticNames, long since)
          Collect statistics, if the provider supports this.
 org.terracotta.management.capabilities.Capability getCapability()
           
 org.terracotta.management.capabilities.context.CapabilityContext getCapabilityContext()
          Get the context that the provided capabilities need to run.
 java.lang.String getCapabilityName()
           
 java.util.Collection<org.terracotta.management.capabilities.descriptors.Descriptor> getDescriptors()
          Get the set of capability descriptors the current provider provides.
 java.lang.Class<T> managedType()
          The class of managed objects.
 void register(T managedObject)
          Register an object for management in the current provider.
 boolean supports(org.terracotta.management.context.Context context)
          Check wheter this management provider supports the given context
 void unregister(T managedObject)
          Unregister a managed object from the current provider.
 

Method Detail

managedType

java.lang.Class<T> managedType()
The class of managed objects.

Returns:
a class.

register

void register(T managedObject)
Register an object for management in the current provider.

Parameters:
managedObject - the object to manage.

unregister

void unregister(T managedObject)
Unregister a managed object from the current provider.

Parameters:
managedObject - the managed object.

getDescriptors

java.util.Collection<org.terracotta.management.capabilities.descriptors.Descriptor> getDescriptors()
Get the set of capability descriptors the current provider provides.

Returns:
the set of capability descriptors.

getCapabilityContext

org.terracotta.management.capabilities.context.CapabilityContext getCapabilityContext()
Get the context that the provided capabilities need to run.

Returns:
the context requirements.

getCapability

org.terracotta.management.capabilities.Capability getCapability()
Returns:
The full capability of this management provider

getCapabilityName

java.lang.String getCapabilityName()
Returns:
The name of this capability

collectStatistics

java.util.Map<java.lang.String,org.terracotta.management.stats.Statistic<?,?>> collectStatistics(org.terracotta.management.context.Context context,
                                                                                                 java.util.Collection<java.lang.String> statisticNames,
                                                                                                 long since)
Collect statistics, if the provider supports this.

Parameters:
context - the context.
statisticNames - the statistic names to collect.
since - The unix time in ms from where to return the statistics for statistics based on samples.
Returns:
the statistic map, the key being the statistic namesø.

callAction

<T> T callAction(org.terracotta.management.context.Context context,
                 java.lang.String methodName,
                 java.lang.Class<T> returnType,
                 org.terracotta.management.call.Parameter... parameters)
Call an action, if the provider supports this.

Parameters:
context - the context.
methodName - the method name.
parameters - the action method's parameters (objects and class names)
returnType - The expected return type
Returns:
the action's return value.

supports

boolean supports(org.terracotta.management.context.Context context)
Check wheter this management provider supports the given context

Parameters:
context - The management context, passed from the ManagementRegistry methods
Returns:
true if the context is supported by this management provider

close

void close()
Closes the management provider. Called when cache manager is closing.