org.jboss.cache.pojo.jmx
Class PojoCacheJmxWrapper

java.lang.Object
  extended by org.jboss.cache.pojo.jmx.PojoCacheJmxWrapper
All Implemented Interfaces:
MBeanRegistration, NotificationBroadcaster, NotificationEmitter, org.jboss.cache.jmx.LegacyConfiguration, PojoCacheJmxWrapperMBean

public class PojoCacheJmxWrapper
extends Object
implements PojoCacheJmxWrapperMBean, MBeanRegistration, NotificationEmitter


Field Summary
 
Fields inherited from interface org.jboss.cache.pojo.jmx.PojoCacheJmxWrapperMBean
CREATED, DESTROYED, FAILED, REGISTERED, STARTED, STARTING, STOPPED, STOPPING, UNREGISTERED
 
Constructor Summary
PojoCacheJmxWrapper()
          Default constructor.
PojoCacheJmxWrapper(PojoCache toWrap)
          Creates a PojoCacheJmxWrapper that wraps the given PojoCache.
 
Method Summary
 void addNotificationListener(NotificationListener listener, NotificationFilter filter, Object handback)
           
 void create()
          Lifecycle method to start PojoCache.
 void destroy()
          Lifecycle method to destroy PojoCache.
 Element getBuddyReplicationConfig()
           
 Element getCacheLoaderConfig()
           
 Element getCacheLoaderConfiguration()
           
 String getCacheMode()
           
 org.jboss.cache.CacheStatus getCacheStatus()
          Gets where this object is in its lifecycle transitions.
 Element getClusterConfig()
           
 String getClusterName()
           
 String getClusterProperties()
           
 org.jboss.cache.config.Configuration getConfiguration()
          Retrieves an immutable configuration.
 Element getEvictionPolicyConfig()
           
 boolean getExposeManagementStatistics()
           
 boolean getFetchInMemoryState()
           
 long getInitialStateRetrievalTimeout()
          Deprecated. 
 String getInternalLocation(Object pojo)
          Obtain the internal location of this pojo stored under PojoCache.
 String getIsolationLevel()
           
 long getLockAcquisitionTimeout()
           
 MBeanServer getMBeanServer()
           
 org.jgroups.jmx.JChannelFactoryMBean getMultiplexerService()
           
 String getMultiplexerStack()
           
 org.jgroups.ChannelFactory getMuxChannelFactory()
           
 String getNodeLockingScheme()
           
 MBeanNotificationInfo[] getNotificationInfo()
           
 PojoCache getPojoCache()
          Returns the PojoCache.
 boolean getRegisterInterceptors()
          Gets whether this object should register the cache's interceptors with JMX.
 boolean getRegisterPlainCache()
          Gets whether this object should register a PojoCacheJmxWrapperMBean for the underlying PojoCache with JMX.
 String getReplicationVersion()
           
 long getReplQueueInterval()
           
 int getReplQueueMaxElements()
           
 int getState()
          Legacy attribute to expose the cache status in terms of the JBoss AS ServiceMBean values.
 long getStateRetrievalTimeout()
           
 boolean getSyncCommitPhase()
           
 long getSyncReplTimeout()
           
 boolean getSyncRollbackPhase()
           
 TransactionManager getTransactionManager()
           
 String getTransactionManagerLookupClass()
           
 String getUnderlyingCacheObjectName()
          Get the MBean object name that the underlying replicated cache is using.
 boolean getUseInterceptorMbeans()
           
 boolean getUseRegionBasedMarshalling()
           
 boolean getUseReplQueue()
           
 boolean isInactiveOnStartup()
           
 void postDeregister()
          Unregisters the CacheJmxWrapper, if getRegisterPlainCache() is true.
 void postRegister(Boolean registrationDone)
          Registers the CacheJmxWrapperMBean, if getRegisterPlainCache() is true.
 void preDeregister()
          No-op.
 ObjectName preRegister(MBeanServer server, ObjectName objName)
          Caches the provided server and objName.
 void removeNotificationListener(NotificationListener listener)
           
 void removeNotificationListener(NotificationListener listener, NotificationFilter filter, Object handback)
           
 void setBuddyReplicationConfig(Element config)
           
 void setCacheLoaderConfig(Element cache_loader_config)
           
 void setCacheLoaderConfiguration(Element config)
           
 void setCacheMode(String mode)
           
 void setClusterConfig(Element config)
           
 void setClusterName(String name)
           
 void setClusterProperties(String cluster_props)
           
 void setConfiguration(org.jboss.cache.config.Configuration config)
          Sets the configuration that the underlying cache should use.
 void setEvictionPolicyConfig(Element config)
           
 void setExposeManagementStatistics(boolean expose)
           
 void setFetchInMemoryState(boolean flag)
           
 void setInactiveOnStartup(boolean inactiveOnStartup)
           
 void setInitialStateRetrievalTimeout(long timeout)
          Deprecated. 
 void setIsolationLevel(String level)
           
 void setLockAcquisitionTimeout(long timeout)
           
 void setMultiplexerService(org.jgroups.jmx.JChannelFactoryMBean muxService)
           
 void setMultiplexerStack(String stackName)
           
 void setMuxChannelFactory(org.jgroups.ChannelFactory factory)
           
 void setNodeLockingScheme(String nodeLockingScheme)
           
 void setPojoCache(PojoCache cache)
           
 void setRegisterInterceptors(boolean register)
          Sets whether this object should register the cache's interceptors with JMX.
 void setRegisterPlainCache(boolean registerPlainCache)
          Sets whether this object should register a PojoCacheJmxWrapperMBean for the underlying PojoCache with JMX.
 void setReplicationVersion(String version)
           
 void setReplQueueInterval(long interval)
           
 void setReplQueueMaxElements(int max_elements)
           
 void setStateRetrievalTimeout(long timeout)
           
 void setSyncCommitPhase(boolean sync_commit_phase)
           
 void setSyncReplTimeout(long timeout)
           
 void setSyncRollbackPhase(boolean sync_rollback_phase)
           
 void setTransactionManager(TransactionManager manager)
           
 void setTransactionManagerLookupClass(String cl)
           
 void setUseInterceptorMbeans(boolean use)
           
 void setUseRegionBasedMarshalling(boolean isTrue)
           
 void setUseReplQueue(boolean flag)
           
 void start()
          Lifecycle method to start PojoCache.
 void stop()
          Lifecycle method to stop PojoCache.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PojoCacheJmxWrapper

public PojoCacheJmxWrapper()
Default constructor.


PojoCacheJmxWrapper

public PojoCacheJmxWrapper(PojoCache toWrap)
Creates a PojoCacheJmxWrapper that wraps the given PojoCache.

Parameters:
toWrap - the cache
Method Detail

getPojoCache

public PojoCache getPojoCache()
Description copied from interface: PojoCacheJmxWrapperMBean
Returns the PojoCache.

Specified by:
getPojoCache in interface PojoCacheJmxWrapperMBean
Returns:
the PojoCache

getConfiguration

public org.jboss.cache.config.Configuration getConfiguration()
Description copied from interface: PojoCacheJmxWrapperMBean
Retrieves an immutable configuration.

Specified by:
getConfiguration in interface PojoCacheJmxWrapperMBean

getInternalLocation

public String getInternalLocation(Object pojo)
                           throws PojoCacheAlreadyDetachedException
Description copied from interface: PojoCacheJmxWrapperMBean
Obtain the internal location of this pojo stored under PojoCache.

Specified by:
getInternalLocation in interface PojoCacheJmxWrapperMBean
Parameters:
pojo - That is associated with this POJO. If null, it means all POJOs in this cache system.
Returns:
String that indicates the location.
Throws:
PojoCacheAlreadyDetachedException - if pojo has been detached already.

getUnderlyingCacheObjectName

public String getUnderlyingCacheObjectName()
Description copied from interface: PojoCacheJmxWrapperMBean
Get the MBean object name that the underlying replicated cache is using.

Specified by:
getUnderlyingCacheObjectName in interface PojoCacheJmxWrapperMBean

create

public void create()
            throws PojoCacheException
Description copied from interface: PojoCacheJmxWrapperMBean
Lifecycle method to start PojoCache.

Specified by:
create in interface PojoCacheJmxWrapperMBean
Throws:
PojoCacheException

start

public void start()
           throws PojoCacheException
Description copied from interface: PojoCacheJmxWrapperMBean
Lifecycle method to start PojoCache.

Specified by:
start in interface PojoCacheJmxWrapperMBean
Throws:
PojoCacheException

stop

public void stop()
Description copied from interface: PojoCacheJmxWrapperMBean
Lifecycle method to stop PojoCache. Note that PojoCache can be stopped and started repeatedly.

Specified by:
stop in interface PojoCacheJmxWrapperMBean

destroy

public void destroy()
Description copied from interface: PojoCacheJmxWrapperMBean
Lifecycle method to destroy PojoCache.

Specified by:
destroy in interface PojoCacheJmxWrapperMBean

getCacheStatus

public org.jboss.cache.CacheStatus getCacheStatus()
Description copied from interface: PojoCacheJmxWrapperMBean
Gets where this object is in its lifecycle transitions.

Specified by:
getCacheStatus in interface PojoCacheJmxWrapperMBean
Returns:
the current status. Will not return null

getState

public int getState()
Description copied from interface: PojoCacheJmxWrapperMBean
Legacy attribute to expose the cache status in terms of the JBoss AS ServiceMBean values. This interface does not extend ServiceMBean, but this attribute is retained to provide compatibility with the JBoss AS JSR-77 integration layer.

Specified by:
getState in interface PojoCacheJmxWrapperMBean
Returns:
the current status, e.g. PojoCacheJmxWrapperMBean.STARTED.

getRegisterPlainCache

public boolean getRegisterPlainCache()
Description copied from interface: PojoCacheJmxWrapperMBean
Gets whether this object should register a PojoCacheJmxWrapperMBean for the underlying PojoCache with JMX.

Default is true.

Specified by:
getRegisterPlainCache in interface PojoCacheJmxWrapperMBean

setRegisterPlainCache

public void setRegisterPlainCache(boolean registerPlainCache)
Description copied from interface: PojoCacheJmxWrapperMBean
Sets whether this object should register a PojoCacheJmxWrapperMBean for the underlying PojoCache with JMX.

Default is true.

If true, the PojoCacheJmxWrapperMBean will be instantiated and registered either as part of the registration of this object, or during the call to PojoCacheJmxWrapperMBean.create().

Specified by:
setRegisterPlainCache in interface PojoCacheJmxWrapperMBean

getRegisterInterceptors

public boolean getRegisterInterceptors()
Description copied from interface: PojoCacheJmxWrapperMBean
Gets whether this object should register the cache's interceptors with JMX.

This property is only relevant if registerPlainCache is true.

Default is true.

Specified by:
getRegisterInterceptors in interface PojoCacheJmxWrapperMBean

setRegisterInterceptors

public void setRegisterInterceptors(boolean register)
Description copied from interface: PojoCacheJmxWrapperMBean
Sets whether this object should register the cache's interceptors with JMX.

This property is only relevant if registerPlainCache is true.

Default is true.

Specified by:
setRegisterInterceptors in interface PojoCacheJmxWrapperMBean

getBuddyReplicationConfig

public Element getBuddyReplicationConfig()
Specified by:
getBuddyReplicationConfig in interface org.jboss.cache.jmx.LegacyConfiguration

getCacheLoaderConfig

public Element getCacheLoaderConfig()
Specified by:
getCacheLoaderConfig in interface org.jboss.cache.jmx.LegacyConfiguration

getCacheLoaderConfiguration

public Element getCacheLoaderConfiguration()
Specified by:
getCacheLoaderConfiguration in interface org.jboss.cache.jmx.LegacyConfiguration

getCacheMode

public String getCacheMode()
Specified by:
getCacheMode in interface org.jboss.cache.jmx.LegacyConfiguration

getClusterName

public String getClusterName()
Specified by:
getClusterName in interface org.jboss.cache.jmx.LegacyConfiguration

getClusterProperties

public String getClusterProperties()
Specified by:
getClusterProperties in interface org.jboss.cache.jmx.LegacyConfiguration

getClusterConfig

public Element getClusterConfig()
Specified by:
getClusterConfig in interface org.jboss.cache.jmx.LegacyConfiguration

getEvictionPolicyConfig

public Element getEvictionPolicyConfig()
Specified by:
getEvictionPolicyConfig in interface org.jboss.cache.jmx.LegacyConfiguration

getExposeManagementStatistics

public boolean getExposeManagementStatistics()
Specified by:
getExposeManagementStatistics in interface org.jboss.cache.jmx.LegacyConfiguration

getUseInterceptorMbeans

public boolean getUseInterceptorMbeans()
Specified by:
getUseInterceptorMbeans in interface org.jboss.cache.jmx.LegacyConfiguration

getFetchInMemoryState

public boolean getFetchInMemoryState()
Specified by:
getFetchInMemoryState in interface org.jboss.cache.jmx.LegacyConfiguration

getStateRetrievalTimeout

public long getStateRetrievalTimeout()
Specified by:
getStateRetrievalTimeout in interface org.jboss.cache.jmx.LegacyConfiguration

setInitialStateRetrievalTimeout

@Deprecated
public void setInitialStateRetrievalTimeout(long timeout)
Deprecated. 

Specified by:
setInitialStateRetrievalTimeout in interface org.jboss.cache.jmx.LegacyConfiguration

getIsolationLevel

public String getIsolationLevel()
Specified by:
getIsolationLevel in interface org.jboss.cache.jmx.LegacyConfiguration

getLockAcquisitionTimeout

public long getLockAcquisitionTimeout()
Specified by:
getLockAcquisitionTimeout in interface org.jboss.cache.jmx.LegacyConfiguration

getMultiplexerService

public org.jgroups.jmx.JChannelFactoryMBean getMultiplexerService()
Specified by:
getMultiplexerService in interface org.jboss.cache.jmx.LegacyConfiguration

getMultiplexerStack

public String getMultiplexerStack()
Specified by:
getMultiplexerStack in interface org.jboss.cache.jmx.LegacyConfiguration

getMuxChannelFactory

public org.jgroups.ChannelFactory getMuxChannelFactory()
Specified by:
getMuxChannelFactory in interface org.jboss.cache.jmx.LegacyConfiguration

getNodeLockingScheme

public String getNodeLockingScheme()
Specified by:
getNodeLockingScheme in interface org.jboss.cache.jmx.LegacyConfiguration

getReplQueueInterval

public long getReplQueueInterval()
Specified by:
getReplQueueInterval in interface org.jboss.cache.jmx.LegacyConfiguration

getReplQueueMaxElements

public int getReplQueueMaxElements()
Specified by:
getReplQueueMaxElements in interface org.jboss.cache.jmx.LegacyConfiguration

getReplicationVersion

public String getReplicationVersion()
Specified by:
getReplicationVersion in interface org.jboss.cache.jmx.LegacyConfiguration

getSyncCommitPhase

public boolean getSyncCommitPhase()
Specified by:
getSyncCommitPhase in interface org.jboss.cache.jmx.LegacyConfiguration

getSyncReplTimeout

public long getSyncReplTimeout()
Specified by:
getSyncReplTimeout in interface org.jboss.cache.jmx.LegacyConfiguration

getSyncRollbackPhase

public boolean getSyncRollbackPhase()
Specified by:
getSyncRollbackPhase in interface org.jboss.cache.jmx.LegacyConfiguration

getTransactionManager

public TransactionManager getTransactionManager()
Specified by:
getTransactionManager in interface org.jboss.cache.jmx.LegacyConfiguration

getTransactionManagerLookupClass

public String getTransactionManagerLookupClass()
Specified by:
getTransactionManagerLookupClass in interface org.jboss.cache.jmx.LegacyConfiguration

getUseRegionBasedMarshalling

public boolean getUseRegionBasedMarshalling()
Specified by:
getUseRegionBasedMarshalling in interface org.jboss.cache.jmx.LegacyConfiguration

getUseReplQueue

public boolean getUseReplQueue()
Specified by:
getUseReplQueue in interface org.jboss.cache.jmx.LegacyConfiguration

isInactiveOnStartup

public boolean isInactiveOnStartup()
Specified by:
isInactiveOnStartup in interface org.jboss.cache.jmx.LegacyConfiguration

setBuddyReplicationConfig

public void setBuddyReplicationConfig(Element config)
Specified by:
setBuddyReplicationConfig in interface org.jboss.cache.jmx.LegacyConfiguration

setCacheLoaderConfig

public void setCacheLoaderConfig(Element cache_loader_config)
Specified by:
setCacheLoaderConfig in interface org.jboss.cache.jmx.LegacyConfiguration

setCacheLoaderConfiguration

public void setCacheLoaderConfiguration(Element config)
Specified by:
setCacheLoaderConfiguration in interface org.jboss.cache.jmx.LegacyConfiguration

setCacheMode

public void setCacheMode(String mode)
                  throws Exception
Specified by:
setCacheMode in interface org.jboss.cache.jmx.LegacyConfiguration
Throws:
Exception

setClusterConfig

public void setClusterConfig(Element config)
Specified by:
setClusterConfig in interface org.jboss.cache.jmx.LegacyConfiguration

getInitialStateRetrievalTimeout

@Deprecated
public long getInitialStateRetrievalTimeout()
Deprecated. 

Specified by:
getInitialStateRetrievalTimeout in interface org.jboss.cache.jmx.LegacyConfiguration

setClusterName

public void setClusterName(String name)
Specified by:
setClusterName in interface org.jboss.cache.jmx.LegacyConfiguration

setClusterProperties

public void setClusterProperties(String cluster_props)
Specified by:
setClusterProperties in interface org.jboss.cache.jmx.LegacyConfiguration

setEvictionPolicyConfig

public void setEvictionPolicyConfig(Element config)
Specified by:
setEvictionPolicyConfig in interface org.jboss.cache.jmx.LegacyConfiguration

setExposeManagementStatistics

public void setExposeManagementStatistics(boolean expose)
Specified by:
setExposeManagementStatistics in interface org.jboss.cache.jmx.LegacyConfiguration

setUseInterceptorMbeans

public void setUseInterceptorMbeans(boolean use)
Specified by:
setUseInterceptorMbeans in interface org.jboss.cache.jmx.LegacyConfiguration

setFetchInMemoryState

public void setFetchInMemoryState(boolean flag)
Specified by:
setFetchInMemoryState in interface org.jboss.cache.jmx.LegacyConfiguration

setInactiveOnStartup

public void setInactiveOnStartup(boolean inactiveOnStartup)
Specified by:
setInactiveOnStartup in interface org.jboss.cache.jmx.LegacyConfiguration

setStateRetrievalTimeout

public void setStateRetrievalTimeout(long timeout)
Specified by:
setStateRetrievalTimeout in interface org.jboss.cache.jmx.LegacyConfiguration

setIsolationLevel

public void setIsolationLevel(String level)
Specified by:
setIsolationLevel in interface org.jboss.cache.jmx.LegacyConfiguration

setLockAcquisitionTimeout

public void setLockAcquisitionTimeout(long timeout)
Specified by:
setLockAcquisitionTimeout in interface org.jboss.cache.jmx.LegacyConfiguration

setMultiplexerService

public void setMultiplexerService(org.jgroups.jmx.JChannelFactoryMBean muxService)
Specified by:
setMultiplexerService in interface org.jboss.cache.jmx.LegacyConfiguration

setMultiplexerStack

public void setMultiplexerStack(String stackName)
Specified by:
setMultiplexerStack in interface org.jboss.cache.jmx.LegacyConfiguration

setMuxChannelFactory

public void setMuxChannelFactory(org.jgroups.ChannelFactory factory)
Specified by:
setMuxChannelFactory in interface org.jboss.cache.jmx.LegacyConfiguration

setNodeLockingScheme

public void setNodeLockingScheme(String nodeLockingScheme)
Specified by:
setNodeLockingScheme in interface org.jboss.cache.jmx.LegacyConfiguration

setReplQueueInterval

public void setReplQueueInterval(long interval)
Specified by:
setReplQueueInterval in interface org.jboss.cache.jmx.LegacyConfiguration

setReplQueueMaxElements

public void setReplQueueMaxElements(int max_elements)
Specified by:
setReplQueueMaxElements in interface org.jboss.cache.jmx.LegacyConfiguration

setReplicationVersion

public void setReplicationVersion(String version)
Specified by:
setReplicationVersion in interface org.jboss.cache.jmx.LegacyConfiguration

setSyncCommitPhase

public void setSyncCommitPhase(boolean sync_commit_phase)
Specified by:
setSyncCommitPhase in interface org.jboss.cache.jmx.LegacyConfiguration

setSyncReplTimeout

public void setSyncReplTimeout(long timeout)
Specified by:
setSyncReplTimeout in interface org.jboss.cache.jmx.LegacyConfiguration

setSyncRollbackPhase

public void setSyncRollbackPhase(boolean sync_rollback_phase)
Specified by:
setSyncRollbackPhase in interface org.jboss.cache.jmx.LegacyConfiguration

setTransactionManager

public void setTransactionManager(TransactionManager manager)
Specified by:
setTransactionManager in interface org.jboss.cache.jmx.LegacyConfiguration

setTransactionManagerLookupClass

public void setTransactionManagerLookupClass(String cl)
                                      throws Exception
Specified by:
setTransactionManagerLookupClass in interface org.jboss.cache.jmx.LegacyConfiguration
Throws:
Exception

setUseRegionBasedMarshalling

public void setUseRegionBasedMarshalling(boolean isTrue)
Specified by:
setUseRegionBasedMarshalling in interface org.jboss.cache.jmx.LegacyConfiguration

setUseReplQueue

public void setUseReplQueue(boolean flag)
Specified by:
setUseReplQueue in interface org.jboss.cache.jmx.LegacyConfiguration

preRegister

public ObjectName preRegister(MBeanServer server,
                              ObjectName objName)
                       throws Exception
Caches the provided server and objName.

Specified by:
preRegister in interface MBeanRegistration
Throws:
Exception

postRegister

public void postRegister(Boolean registrationDone)
Registers the CacheJmxWrapperMBean, if getRegisterPlainCache() is true.

Specified by:
postRegister in interface MBeanRegistration

preDeregister

public void preDeregister()
                   throws Exception
No-op.

Specified by:
preDeregister in interface MBeanRegistration
Throws:
Exception

postDeregister

public void postDeregister()
Unregisters the CacheJmxWrapper, if getRegisterPlainCache() is true.

Specified by:
postDeregister in interface MBeanRegistration

removeNotificationListener

public void removeNotificationListener(NotificationListener listener,
                                       NotificationFilter filter,
                                       Object handback)
                                throws ListenerNotFoundException
Specified by:
removeNotificationListener in interface NotificationEmitter
Throws:
ListenerNotFoundException

addNotificationListener

public void addNotificationListener(NotificationListener listener,
                                    NotificationFilter filter,
                                    Object handback)
                             throws IllegalArgumentException
Specified by:
addNotificationListener in interface NotificationBroadcaster
Throws:
IllegalArgumentException

getNotificationInfo

public MBeanNotificationInfo[] getNotificationInfo()
Specified by:
getNotificationInfo in interface NotificationBroadcaster

removeNotificationListener

public void removeNotificationListener(NotificationListener listener)
                                throws ListenerNotFoundException
Specified by:
removeNotificationListener in interface NotificationBroadcaster
Throws:
ListenerNotFoundException

getMBeanServer

public MBeanServer getMBeanServer()

setConfiguration

public void setConfiguration(org.jboss.cache.config.Configuration config)
Sets the configuration that the underlying cache should use.

Parameters:
config - the configuration

setPojoCache

public void setPojoCache(PojoCache cache)


Copyright © 2008 JBoss, a division of Red Hat. All Rights Reserved.