public class DefaultClusteringManagementService extends java.lang.Object implements ClusteringManagementService, CacheManagerListener, CollectorService.Collector
EMPTY
Constructor and Description |
---|
DefaultClusteringManagementService() |
DefaultClusteringManagementService(ClusteringManagementServiceConfiguration<?> configuration) |
Modifier and Type | Method and Description |
---|---|
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 |
onNotification(org.terracotta.management.model.notification.ContextualNotification notification) |
void |
onStatistics(java.util.Collection<org.terracotta.management.model.stats.ContextualStatistics> statistics) |
void |
start(ServiceProvider<Service> 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.
|
public DefaultClusteringManagementService()
public DefaultClusteringManagementService(ClusteringManagementServiceConfiguration<?> configuration)
public void start(ServiceProvider<Service> serviceProvider)
Service
ServiceProvider
.
The service provider allows a service to retrieve and use other services.
A Service
retrieved at this stage may not yet be started. The recommended usage pattern therefore, is to keep a
reference to the dependent Service
but use it only when specific methods are invoked on subtypes.
public void stop()
Service
public void cacheAdded(java.lang.String alias, Cache<?,?> cache)
CacheManagerListener
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.cacheAdded
in interface CacheManagerListener
alias
- the alias the Cache
is being registered oncache
- the actual Cache
addedpublic void cacheRemoved(java.lang.String alias, Cache<?,?> cache)
CacheManagerListener
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 itcacheRemoved
in interface CacheManagerListener
alias
- the alias the Cache
is being deregisteredcache
- the actual Cache
being removedpublic void stateTransition(Status from, Status to)
StateChangeListener
stateTransition
in interface StateChangeListener
from
- previous stateto
- new statepublic void onNotification(org.terracotta.management.model.notification.ContextualNotification notification)
onNotification
in interface CollectorService.Collector
public void onStatistics(java.util.Collection<org.terracotta.management.model.stats.ContextualStatistics> statistics)
onStatistics
in interface CollectorService.Collector