public class SampledMBeanRegistrationProvider extends Object implements MBeanRegistrationProvider, CacheManagerEventListener
MBeanRegistrationProvider which registers
sampled MBeans for the CacheManager and its Caches.
This also implements CacheManagerEventListener to add/remove/cleanup
MBeans for new caches added or removed
| Constructor and Description |
|---|
SampledMBeanRegistrationProvider()
Default constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
dispose()
Stop the listener and free any resources.
|
Status |
getStatus()
Returns the listener status.
|
void |
init()
CacheManagerEventListener.init() - no need to do anything here
|
void |
initialize(CacheManager cacheManagerParam,
ClusteredInstanceFactory clusteredInstanceFactory)
Initialize MBeanRegistration if necessary for the cacheManager
|
boolean |
isAlive()
Returns true if this
SampledMBeanRegistrationProvider is alive |
boolean |
isInitialized()
Returns
true if initialized otherwise false |
void |
notifyCacheAdded(String cacheName)
Called immediately after a cache has been added and activated.
|
void |
notifyCacheRemoved(String cacheName)
Called immediately after a cache has been disposed and removed.
|
void |
reinitialize(ClusteredInstanceFactory clusteredInstanceFactory)
Reinitialize the mbeans.
|
public SampledMBeanRegistrationProvider()
public void initialize(CacheManager cacheManagerParam, ClusteredInstanceFactory clusteredInstanceFactory)
initialize in interface MBeanRegistrationProviderpublic void reinitialize(ClusteredInstanceFactory clusteredInstanceFactory) throws MBeanRegistrationProviderException
CacheManager to re-register the mbeansreinitialize in interface MBeanRegistrationProviderMBeanRegistrationProviderExceptionpublic boolean isInitialized()
true if initialized otherwise falseisInitialized in interface MBeanRegistrationProvidertrue if initializedpublic void init()
throws CacheException
init in interface CacheManagerEventListenerCacheException - - all exceptions are wrapped in CacheExceptionpublic Status getStatus()
getStatus in interface CacheManagerEventListenerpublic void dispose()
throws CacheException
dispose in interface CacheManagerEventListenerCacheException - - all exceptions are wrapped in CacheExceptionpublic boolean isAlive()
SampledMBeanRegistrationProvider is alivepublic void notifyCacheAdded(String cacheName)
notifyCacheAdded in interface CacheManagerEventListenercacheName - the name of the Cache the operation relates toCacheEventListenerpublic void notifyCacheRemoved(String cacheName)
notifyCacheRemoved in interface CacheManagerEventListenercacheName - the name of the Cache the operation relates toCopyright © 2003-2014 Terracotta, Inc.. All Rights Reserved.