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 MBeanRegistrationProvider
public void reinitialize(ClusteredInstanceFactory clusteredInstanceFactory) throws MBeanRegistrationProviderException
CacheManager
to re-register the mbeansreinitialize
in interface MBeanRegistrationProvider
MBeanRegistrationProviderException
public boolean isInitialized()
true
if initialized otherwise falseisInitialized
in interface MBeanRegistrationProvider
true
if initializedpublic void init() throws CacheException
init
in interface CacheManagerEventListener
CacheException
- - all exceptions are wrapped in CacheExceptionpublic Status getStatus()
getStatus
in interface CacheManagerEventListener
public void dispose() throws CacheException
dispose
in interface CacheManagerEventListener
CacheException
- - all exceptions are wrapped in CacheExceptionpublic boolean isAlive()
SampledMBeanRegistrationProvider
is alivepublic void notifyCacheAdded(String cacheName)
notifyCacheAdded
in interface CacheManagerEventListener
cacheName
- the name of the Cache
the operation relates toCacheEventListener
public void notifyCacheRemoved(String cacheName)
notifyCacheRemoved
in interface CacheManagerEventListener
cacheName
- the name of the Cache
the operation relates toCopyright © 2003–2016 Terracotta, Inc.. All rights reserved.