org.terracotta.management.registry
Interface ManagementProvider<T>

All Known Implementing Classes:
AbstractActionManagementProvider, AbstractManagementProvider, StatisticCollectorProvider

public interface ManagementProvider<T>

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

Author:
Ludovic Orban

Method Summary
<V> V
callAction(Context context, String methodName, Class<V> returnType, Parameter... parameters)
          Call an action, if the provider supports this.
 void callAction(Context context, String methodName, Parameter... parameters)
          Call an action, if the provider supports this.
 void close()
          Closes the management provider.
 Map<String,Statistic<?,?>> collectStatistics(Context context, Collection<String> statisticNames, long since)
          Collect statistics, if the provider supports this.
 Capability getCapability()
           
 CapabilityContext getCapabilityContext()
          Get the context that the provided capabilities need to run.
 String getCapabilityName()
           
 Collection<Descriptor> getDescriptors()
          Get the set of capability descriptors the current provider provides.
 Class<? extends T> getManagedType()
          The class of managed objects.
 void register(T managedObject)
          Register an object for management in the current provider.
 boolean supports(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

getManagedType

Class<? extends T> getManagedType()
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

Collection<Descriptor> getDescriptors()
Get the set of capability descriptors the current provider provides.

Returns:
the set of capability descriptors.

getCapabilityContext

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

Returns:
the context requirements.

getCapability

Capability getCapability()
Returns:
The full capability of this management provider

getCapabilityName

String getCapabilityName()
Returns:
The name of this capability

collectStatistics

Map<String,Statistic<?,?>> collectStatistics(Context context,
                                             Collection<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

<V> V callAction(Context context,
                 String methodName,
                 Class<V> returnType,
                 Parameter... parameters)
Call an action, if the provider supports this.

Type Parameters:
V - the expected response type
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.

callAction

void callAction(Context context,
                String methodName,
                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)

supports

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

Parameters:
context - The management context
Returns:
true if the context is supported by this management provider

close

void close()
Closes the management provider.



Copyright © 2016. All Rights Reserved.