ehcache

net.sf.ehcache.hibernate.management.impl
Class EhcacheHibernateMBeanRegistrationImpl

java.lang.Object
  extended by net.sf.ehcache.hibernate.management.impl.EhcacheHibernateMBeanRegistrationImpl
All Implemented Interfaces:
CacheManagerEventListener, EhcacheHibernateMBeanRegistration

public class EhcacheHibernateMBeanRegistrationImpl
extends Object
implements EhcacheHibernateMBeanRegistration, CacheManagerEventListener

Implementation of EhcacheHibernateMBeanRegistration. Also implements CacheManagerEventListener. Deregisters mbeans when the associated cachemanager is shutdown.

Author:
Abhishek Sanoujam

Constructor Summary
EhcacheHibernateMBeanRegistrationImpl()
           
 
Method Summary
 void dispose()
          Stop the listener and free any resources.
 void enableHibernateStatisticsSupport(SessionFactory sessionFactory)
          Enable hibernate statistics in the mbean.
 Status getStatus()
          Returns the listener status.
 void init()
          No-op in this case
 void notifyCacheAdded(String cacheName)
          No-op in this case
 void notifyCacheRemoved(String cacheName)
          No-op in this case
 void registerMBeanForCacheManager(CacheManager manager, Properties properties)
          Registers MBean for the input manager and session factory properties.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EhcacheHibernateMBeanRegistrationImpl

public EhcacheHibernateMBeanRegistrationImpl()
Method Detail

registerMBeanForCacheManager

public void registerMBeanForCacheManager(CacheManager manager,
                                         Properties properties)
                                  throws 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:
registerMBeanForCacheManager in interface EhcacheHibernateMBeanRegistration
Throws:
Exception

enableHibernateStatisticsSupport

public void enableHibernateStatisticsSupport(SessionFactory sessionFactory)
Enable hibernate statistics in the mbean.

Specified by:
enableHibernateStatisticsSupport in interface EhcacheHibernateMBeanRegistration

dispose

public void dispose()
             throws CacheException
Stop the listener and free any resources.

Specified by:
dispose in interface CacheManagerEventListener
Throws:
CacheException - - all exceptions are wrapped in CacheException

getStatus

public Status getStatus()
Returns the listener status.

Specified by:
getStatus in interface CacheManagerEventListener
Returns:
the status at the point in time the method is called

init

public void init()
          throws CacheException
No-op in this case

Specified by:
init in interface CacheManagerEventListener
Throws:
CacheException - - all exceptions are wrapped in CacheException

notifyCacheAdded

public void notifyCacheAdded(String cacheName)
No-op in this case

Specified by:
notifyCacheAdded in interface CacheManagerEventListener
Parameters:
cacheName - the name of the Cache the operation relates to
See Also:
CacheEventListener

notifyCacheRemoved

public void notifyCacheRemoved(String cacheName)
No-op in this case

Specified by:
notifyCacheRemoved in interface CacheManagerEventListener
Parameters:
cacheName - the name of the Cache the operation relates to

ehcache

Copyright 2001-2014, Terracotta, Inc.