Class EhcacheHibernateMBeanRegistrationImpl
- java.lang.Object
-
- net.sf.ehcache.hibernate.management.impl.EhcacheHibernateMBeanRegistrationImpl
-
- All Implemented Interfaces:
CacheManagerEventListener,EhcacheHibernateMBeanRegistration
public class EhcacheHibernateMBeanRegistrationImpl extends java.lang.Object implements EhcacheHibernateMBeanRegistration, CacheManagerEventListener
Implementation ofEhcacheHibernateMBeanRegistration. Also implementsCacheManagerEventListener. Deregisters mbeans when the associated cachemanager is shutdown.- Author:
- Abhishek Sanoujam
-
-
Constructor Summary
Constructors Constructor Description EhcacheHibernateMBeanRegistrationImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddispose()Stop the listener and free any resources.voidenableHibernateStatisticsSupport(org.hibernate.SessionFactory sessionFactory)Enable hibernate statistics in the mbean.StatusgetStatus()Returns the listener status.voidinit()No-op in this casevoidnotifyCacheAdded(java.lang.String cacheName)No-op in this casevoidnotifyCacheRemoved(java.lang.String cacheName)No-op in this casevoidregisterMBeanForCacheManager(CacheManager manager, java.util.Properties properties)Registers MBean for the input manager and session factory properties.
-
-
-
Method Detail
-
registerMBeanForCacheManager
public void registerMBeanForCacheManager(CacheManager manager, java.util.Properties properties) throws java.lang.Exception
Registers MBean for the input manager and session factory properties.MBeans will be registered based on the input session factory name. If the input name is null or blank, the name of the cache-manager is used
- Specified by:
registerMBeanForCacheManagerin interfaceEhcacheHibernateMBeanRegistration- Throws:
java.lang.Exception
-
enableHibernateStatisticsSupport
public void enableHibernateStatisticsSupport(org.hibernate.SessionFactory sessionFactory)
Enable hibernate statistics in the mbean.- Specified by:
enableHibernateStatisticsSupportin interfaceEhcacheHibernateMBeanRegistration
-
dispose
public void dispose() throws CacheExceptionStop the listener and free any resources.- Specified by:
disposein interfaceCacheManagerEventListener- Throws:
CacheException- - all exceptions are wrapped in CacheException
-
getStatus
public Status getStatus()
Returns the listener status.- Specified by:
getStatusin interfaceCacheManagerEventListener- Returns:
- the status at the point in time the method is called
-
init
public void init() throws CacheExceptionNo-op in this case- Specified by:
initin interfaceCacheManagerEventListener- Throws:
CacheException- - all exceptions are wrapped in CacheException
-
notifyCacheAdded
public void notifyCacheAdded(java.lang.String cacheName)
No-op in this case- Specified by:
notifyCacheAddedin interfaceCacheManagerEventListener- Parameters:
cacheName- the name of theCachethe operation relates to- See Also:
CacheEventListener
-
notifyCacheRemoved
public void notifyCacheRemoved(java.lang.String cacheName)
No-op in this case- Specified by:
notifyCacheRemovedin interfaceCacheManagerEventListener- Parameters:
cacheName- the name of theCachethe operation relates to
-
-