Top Description Inners Fields Constructors Methods
net.sf.ehcache.hibernate.management.impl

public Class ProviderMBeanRegistrationHelper

extends Object
Class Inheritance
Imports
java.lang.reflect.Field, java.util.Iterator, .Map, .Properties, .TimerTask, java.util.concurrent.atomic.AtomicBoolean, net.sf.ehcache.CacheManager, org.hibernate.SessionFactory, org.hibernate.cache.CacheException, org.hibernate.cfg.Environment, org.hibernate.impl.SessionFactoryObjectFactory, org.slf4j.Logger, .LoggerFactory

Helper class for registering mbeans for ehcache backed hibernate second level cache

Author
Abhishek Sanoujam

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
ProviderMBeanRegistrationHelper.RegisterMBeansTask

Task for running mbean registration that can be scheduled in a timer

Field Summary

Modifier and TypeField and Description
private volatile EhcacheHibernateMBeanRegistrationImpl
private static final Logger
private static final int
private static final int

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private static Field
getField(Class<T> c, String fieldName)

public void
registerMBean(final CacheManager
the backing cachemanager
manager
,
final Properties
session factory config properties
properties
)

Registers mbean for the input cache manager and the session factory name

public void
unregisterMBean()

Unregisters previously registered mbean.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

ehcacheHibernateMBeanRegistrationback to summary
private volatile EhcacheHibernateMBeanRegistrationImpl ehcacheHibernateMBeanRegistration
LOGback to summary
private static final Logger LOG
MILLIS_PER_SECONDback to summary
private static final int MILLIS_PER_SECOND
SLEEP_MILLISback to summary
private static final int SLEEP_MILLIS

Constructor Detail

ProviderMBeanRegistrationHelperback to summary
public ProviderMBeanRegistrationHelper()

Method Detail

getFieldback to summary
private static Field getField(Class<T> c, String fieldName)
registerMBeanback to summary
public void registerMBean(final CacheManager manager, final Properties properties)

Registers mbean for the input cache manager and the session factory name

Parameters
manager:CacheManager

the backing cachemanager

properties:Properties

session factory config properties

unregisterMBeanback to summary
public void unregisterMBean()

Unregisters previously registered mbean.

net.sf.ehcache.hibernate.management.impl back to summary

private Class ProviderMBeanRegistrationHelper.RegisterMBeansTask

extends TimerTask
Class Inheritance

Task for running mbean registration that can be scheduled in a timer

Field Summary

Modifier and TypeField and Description
private final EhcacheHibernateMBeanRegistrationImpl
private final CacheManager
private final AtomicBoolean
private static final int
private final Properties
private long

Constructor Summary

AccessConstructor and Description
public
RegisterMBeansTask(EhcacheHibernateMBeanRegistrationImpl ehcacheHibernateMBeanRegistration, CacheManager manager, Properties properties)

Method Summary

Modifier and TypeMethod and Description
private SessionFactory
public void
run()

Implements abstract java.util.TimerTask.run.

Implements java.lang.Runnable.run.

The action to be performed by this timer task.
Inherited from java.util.TimerTask:
cancelscheduledExecutionTime

Field Detail

ehcacheHibernateMBeanRegistrationback to summary
private final EhcacheHibernateMBeanRegistrationImpl ehcacheHibernateMBeanRegistration
managerback to summary
private final CacheManager manager
mbeanRegisteredback to summary
private final AtomicBoolean mbeanRegistered
NUM_SECONDSback to summary
private static final int NUM_SECONDS
propertiesback to summary
private final Properties properties
startTimeback to summary
private long startTime

Constructor Detail

RegisterMBeansTaskback to summary
public RegisterMBeansTask(EhcacheHibernateMBeanRegistrationImpl ehcacheHibernateMBeanRegistration, CacheManager manager, Properties properties)

Method Detail

locateSessionFactoryback to summary
private SessionFactory locateSessionFactory()
runback to summary
public void run()

Implements abstract java.util.TimerTask.run.

Implements java.lang.Runnable.run.

Doc from java.util.TimerTask.run.

The action to be performed by this timer task.

Annotations
@Override