public class EhcacheHibernateMBeanRegistrationImpl extends java.lang.Object implements EhcacheHibernateMBeanRegistration, CacheManagerEventListener
EhcacheHibernateMBeanRegistration
.
Also implements CacheManagerEventListener
. Deregisters mbeans when the associated cachemanager is shutdown.
Modifier and Type | Field and Description |
---|---|
private java.lang.String |
cacheManagerClusterUUID |
private javax.management.ObjectName |
cacheManagerObjectName |
private EhcacheHibernate |
ehcacheHibernate |
private static org.slf4j.Logger |
LOG |
private static int |
MAX_MBEAN_REGISTRATION_RETRIES |
private java.lang.String |
registeredCacheManagerName |
private Status |
status |
Constructor and Description |
---|
EhcacheHibernateMBeanRegistrationImpl() |
Modifier and Type | Method and Description |
---|---|
void |
dispose()
Stop the listener and free any resources.
|
void |
enableHibernateStatisticsSupport(org.hibernate.SessionFactory sessionFactory)
Enable hibernate statistics in the mbean.
|
private javax.management.MBeanServer |
getMBeanServer() |
Status |
getStatus()
Returns the listener status.
|
void |
init()
No-op in this case
|
void |
notifyCacheAdded(java.lang.String cacheName)
No-op in this case
|
void |
notifyCacheRemoved(java.lang.String cacheName)
No-op in this case
|
private void |
registerBean(java.lang.String name,
CacheManager manager) |
void |
registerMBeanForCacheManager(CacheManager manager,
java.util.Properties properties)
Registers MBean for the input manager and session factory properties.
|
private static final org.slf4j.Logger LOG
private static final int MAX_MBEAN_REGISTRATION_RETRIES
private java.lang.String cacheManagerClusterUUID
private java.lang.String registeredCacheManagerName
private Status status
private volatile EhcacheHibernate ehcacheHibernate
private volatile javax.management.ObjectName cacheManagerObjectName
public EhcacheHibernateMBeanRegistrationImpl()
public void registerMBeanForCacheManager(CacheManager manager, java.util.Properties properties) throws java.lang.Exception
registerMBeanForCacheManager
in interface EhcacheHibernateMBeanRegistration
java.lang.Exception
private void registerBean(java.lang.String name, CacheManager manager) throws java.lang.Exception
java.lang.Exception
private javax.management.MBeanServer getMBeanServer()
public void enableHibernateStatisticsSupport(org.hibernate.SessionFactory sessionFactory)
enableHibernateStatisticsSupport
in interface EhcacheHibernateMBeanRegistration
public void dispose() throws CacheException
dispose
in interface CacheManagerEventListener
CacheException
- - all exceptions are wrapped in CacheExceptionpublic Status getStatus()
getStatus
in interface CacheManagerEventListener
public void init() throws CacheException
init
in interface CacheManagerEventListener
CacheException
- - all exceptions are wrapped in CacheExceptionpublic void notifyCacheAdded(java.lang.String cacheName)
notifyCacheAdded
in interface CacheManagerEventListener
cacheName
- the name of the Cache
the operation relates toCacheEventListener
public void notifyCacheRemoved(java.lang.String cacheName)
notifyCacheRemoved
in interface CacheManagerEventListener
cacheName
- the name of the Cache
the operation relates to