org.ehcache.management.registry
Class DefaultCollectorService

java.lang.Object
  extended by org.ehcache.management.registry.DefaultCollectorService
All Implemented Interfaces:
CacheManagerListener, StateChangeListener, CollectorService, Service, org.terracotta.management.registry.collect.StatisticCollector

public class DefaultCollectorService
extends java.lang.Object
implements CollectorService, CacheManagerListener


Constructor Summary
DefaultCollectorService(org.terracotta.management.registry.MessageConsumer messageConsumer)
           
 
Method Summary
 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.
 void start(ServiceProvider<Service> serviceProvider)
          Start this service using the provided configuration and ServiceProvider.
 void startStatisticCollector()
           
 void stateTransition(Status from, Status to)
          Is notified when a state transition occurred.
 void stop()
          Stops this service.
 void stopStatisticCollector()
           
 void updateCollectedStatistics(java.lang.String capabilityName, java.util.Collection<java.lang.String> statisticNames)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultCollectorService

public DefaultCollectorService(org.terracotta.management.registry.MessageConsumer messageConsumer)
Method Detail

start

public void start(ServiceProvider<Service> 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

startStatisticCollector

public void startStatisticCollector()
Specified by:
startStatisticCollector in interface org.terracotta.management.registry.collect.StatisticCollector

stopStatisticCollector

public void stopStatisticCollector()
Specified by:
stopStatisticCollector in interface org.terracotta.management.registry.collect.StatisticCollector

updateCollectedStatistics

public void updateCollectedStatistics(java.lang.String capabilityName,
                                      java.util.Collection<java.lang.String> statisticNames)
Specified by:
updateCollectedStatistics in interface org.terracotta.management.registry.collect.StatisticCollector