|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.management.NotificationBroadcasterSupport org.jboss.cache.jmx.CacheJmxWrapper<K,V>
public class CacheJmxWrapper<K,V>
Wrapper class that exposes a
JMX management interface
Field Summary |
---|
Fields inherited from interface org.jboss.cache.jmx.CacheJmxWrapperMBean |
---|
CREATED, DESTROYED, FAILED, REGISTERED, STARTED, STARTING, STOPPED, STOPPING, UNREGISTERED |
Fields inherited from interface org.jboss.cache.jmx.CacheNotificationBroadcaster |
---|
NOTIF_CACHE_STARTED, NOTIF_CACHE_STOPPED, NOTIF_NODE_ACTIVATED, NOTIF_NODE_CREATED, NOTIF_NODE_EVICTED, NOTIF_NODE_LOADED, NOTIF_NODE_MODIFIED, NOTIF_NODE_MOVED, NOTIF_NODE_PASSIVATED, NOTIF_NODE_REMOVED, NOTIF_NODE_VISITED, NOTIF_VIEW_CHANGED |
Constructor Summary | |
---|---|
CacheJmxWrapper()
|
|
CacheJmxWrapper(Cache<K,V> cache)
|
Method Summary | |
---|---|
void |
addNotificationListener(NotificationListener notificationListener,
NotificationFilter notificationFilter,
Object object)
|
protected void |
constructCache()
|
void |
create()
|
void |
destroy()
|
static String |
formatHtml(String s)
Formats a given String for display as an HTML snippet. |
Element |
getBuddyReplicationConfig()
Retrieves the buddy replication configuration element |
Cache<K,V> |
getCache()
Retrieves a reference to the underlying Cache |
Element |
getCacheLoaderConfig()
Retrieves the cache loader configuration element |
Element |
getCacheLoaderConfiguration()
|
String |
getCacheMode()
Returns the current caching mode. |
String |
getCacheObjectName()
|
CacheStatus |
getCacheStatus()
Gets where this object is in its lifecycle transitions. |
Element |
getClusterConfig()
Gets the JGroups protocol stack config in W3C DOM Element form. |
String |
getClusterName()
Get the name of the replication group |
String |
getClusterProperties()
Get the cluster properties (e.g. |
Configuration |
getConfiguration()
|
Element |
getEvictionPolicyConfig()
|
boolean |
getExposeManagementStatistics()
Gets whether the cache should create interceptor mbeans that are used to capture and publish interceptor statistics. |
boolean |
getFetchInMemoryState()
Returns whether or not any initial state transfer or subsequent partial state transfer following an activateRegion call should
include in-memory state. |
long |
getInitialStateRetrievalTimeout()
Deprecated. |
String |
getIsolationLevel()
Returns the transaction isolation level. |
org.jgroups.Address |
getLocalAddress()
Returns the local address of this cache in a cluster, or null
if running in local mode. |
long |
getLockAcquisitionTimeout()
Default max time to wait for a lock. |
MBeanServer |
getMBeanServer()
|
List<org.jgroups.Address> |
getMembers()
Returns a list of members in the cluster, or null
if running in local mode. |
org.jgroups.jmx.JChannelFactoryMBean |
getMultiplexerService()
|
String |
getMultiplexerStack()
Retrieves the JGroups multiplexer stack name if defined. |
org.jgroups.ChannelFactory |
getMuxChannelFactory()
|
long |
getNextNotificationSequenceNumber()
Gets the sequence number for the next notification. |
String |
getNodeLockingScheme()
|
MBeanNotificationInfo[] |
getNotificationInfo()
|
String |
getNotificationServiceName()
|
int |
getNumberOfAttributes()
|
int |
getNumberOfNodes()
|
boolean |
getRegisterInterceptors()
Gets whether this object should register the cache's interceptors with JMX during {@link #create()}. |
String |
getReplicationVersion()
Gets the format version of the data transferred during an initial state transfer or a call to Region.activate() . |
long |
getReplQueueInterval()
|
int |
getReplQueueMaxElements()
|
int |
getState()
Legacy attribute to expose the cache status
in terms of the JBoss AS ServiceMBean values. |
long |
getStateRetrievalTimeout()
Get the max time to wait until the state is retrieved. |
boolean |
getSyncCommitPhase()
|
long |
getSyncReplTimeout()
Returns the default max timeout after which synchronous replication calls return. |
boolean |
getSyncRollbackPhase()
|
TransactionManager |
getTransactionManager()
|
String |
getTransactionManagerLookupClass()
|
boolean |
getUseInterceptorMbeans()
|
boolean |
getUseRegionBasedMarshalling()
Deprecated. |
boolean |
getUseReplQueue()
|
boolean |
isDisableStateChangeNotifications()
Gets whether sending of JMX notifications for this mbean's start/stop lifecycle changes is disabled. |
boolean |
isInactiveOnStartup()
Gets whether the entire tree is inactive upon startup, only responding to replication messages after activateRegion is called to activate one or more parts of the tree. |
boolean |
isUseLazyDeserialization()
|
void |
postDeregister()
Unregisters the interceptors, if getRegisterInterceptors() is
true . |
void |
postRegister(Boolean registrationDone)
Registers the cache's interceptors, if getRegisterInterceptors()
is true . |
void |
preDeregister()
No-op. |
ObjectName |
preRegister(MBeanServer server,
ObjectName objName)
Caches the provided server and objName . |
String |
printCacheDetails()
|
String |
printCacheDetailsAsHtml()
|
String |
printConfigurationAsHtmlString()
|
String |
printConfigurationAsString()
|
String |
printLockInfo()
|
String |
printLockInfoAsHtml()
|
protected boolean |
registerInterceptors()
|
void |
removeNotificationListener(NotificationListener notificationListener)
|
void |
removeNotificationListener(NotificationListener listener,
NotificationFilter filter,
Object handback)
|
void |
setBuddyReplicationConfig(Element config)
Sets the buddy replication configuration element |
void |
setCache(Cache<K,V> cache)
Allows direct injection of the underlying cache. |
void |
setCacheLoaderConfig(Element cache_loader_config)
|
void |
setCacheLoaderConfiguration(Element config)
|
void |
setCacheMode(String mode)
Sets the default caching mode) |
void |
setCacheObjectName(String name)
|
void |
setClusterConfig(Element config)
Convert a list of elements to the JG property string |
void |
setClusterName(String name)
Set the name of the replication group |
void |
setClusterProperties(String cluster_props)
Set the cluster properties. |
void |
setConfiguration(Configuration config)
Sets the configuration that the underlying cache should use. |
void |
setDisableStateChangeNotifications(boolean disableStateChangeNotifications)
Hook to allow PojoCacheJmxWrapper to suppress state change notifications from this mbean in lieu of its own. |
void |
setEvictionPolicyConfig(Element config)
Setup eviction policy configuration |
void |
setExposeManagementStatistics(boolean expose)
|
void |
setFetchInMemoryState(boolean flag)
Sets whether or not any initial or subsequent partial state transfer should include in-memory state. |
void |
setInactiveOnStartup(boolean inactiveOnStartup)
Sets whether the entire tree is inactive upon startup, only responding to replication messages after Region.activate() is
called to activate one or more parts of the tree. |
void |
setInitialStateRetrievalTimeout(long timeout)
Deprecated. |
void |
setIsolationLevel(String level)
Set the transaction isolation level. |
void |
setLockAcquisitionTimeout(long timeout)
Set the max time for lock acquisition. |
void |
setMultiplexerService(org.jgroups.jmx.JChannelFactoryMBean muxService)
|
void |
setMultiplexerStack(String stackName)
Used with JGroups multiplexer, specifies stack to be used (e.g., fc-fast-minimalthreads) This attribute is optional; if not provided, a default multiplexer stack will be used. |
void |
setMuxChannelFactory(org.jgroups.ChannelFactory factory)
|
void |
setNodeLockingScheme(String nodeLockingScheme)
|
void |
setNotificationServiceName(String notificationServiceName)
|
void |
setRegisterInterceptors(boolean register)
Sets whether this object should register the cache's interceptors with JMX during CacheJmxWrapperMBean.create() . |
void |
setReplicationVersion(String version)
Sets the format version of the data transferred during an initial state transfer or a call to Region.activate() . |
void |
setReplQueueInterval(long interval)
|
void |
setReplQueueMaxElements(int max_elements)
|
void |
setStateRetrievalTimeout(long timeout)
Set the state transfer timeout (see LegacyConfiguration.getStateRetrievalTimeout() ) |
void |
setSyncCommitPhase(boolean sync_commit_phase)
|
void |
setSyncReplTimeout(long timeout)
Sets the default maximum wait time for synchronous replication to receive all results |
void |
setSyncRollbackPhase(boolean sync_rollback_phase)
|
void |
setTransactionManager(TransactionManager manager)
|
void |
setTransactionManagerLookupClass(String cl)
Sets the class of the TransactionManagerLookup impl. |
void |
setUseInterceptorMbeans(boolean use)
|
void |
setUseRegionBasedMarshalling(boolean isTrue)
Sets whether marshalling uses scoped class loaders on a per region basis. |
void |
setUseReplQueue(boolean flag)
|
void |
start()
|
void |
stop()
|
protected void |
unregisterInterceptors()
|
Methods inherited from class javax.management.NotificationBroadcasterSupport |
---|
handleNotification, sendNotification |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.jboss.cache.jmx.CacheNotificationBroadcaster |
---|
sendNotification |
Constructor Detail |
---|
public CacheJmxWrapper()
public CacheJmxWrapper(Cache<K,V> cache)
Method Detail |
---|
public Cache<K,V> getCache()
CacheJmxWrapperMBean
Cache
getCache
in interface CacheJmxWrapperMBean<K,V>
public Configuration getConfiguration()
getConfiguration
in interface CacheJmxWrapperMBean<K,V>
public String printConfigurationAsString()
printConfigurationAsString
in interface CacheJmxWrapperMBean<K,V>
public String printConfigurationAsHtmlString()
printConfigurationAsHtmlString
in interface CacheJmxWrapperMBean<K,V>
public String printCacheDetails()
printCacheDetails
in interface CacheJmxWrapperMBean<K,V>
public String printCacheDetailsAsHtml()
printCacheDetailsAsHtml
in interface CacheJmxWrapperMBean<K,V>
public CacheStatus getCacheStatus()
CacheJmxWrapperMBean
getCacheStatus
in interface CacheJmxWrapperMBean<K,V>
null
public int getState()
CacheJmxWrapperMBean
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.
getState
in interface CacheJmxWrapperMBean<K,V>
CacheJmxWrapperMBean.STARTED
.public org.jgroups.Address getLocalAddress()
CacheJmxWrapperMBean
null
if running in local mode.
getLocalAddress
in interface CacheJmxWrapperMBean<K,V>
null
if running in local mode.public List<org.jgroups.Address> getMembers()
CacheJmxWrapperMBean
null
if running in local mode.
getMembers
in interface CacheJmxWrapperMBean<K,V>
List
of members in the cluster, or null
if running in local mode.public int getNumberOfNodes()
getNumberOfNodes
in interface CacheJmxWrapperMBean<K,V>
public int getNumberOfAttributes()
getNumberOfAttributes
in interface CacheJmxWrapperMBean<K,V>
public String printLockInfo()
printLockInfo
in interface CacheJmxWrapperMBean<K,V>
public String printLockInfoAsHtml()
printLockInfoAsHtml
in interface CacheJmxWrapperMBean<K,V>
public boolean getRegisterInterceptors()
CacheJmxWrapperMBean
true
.
getRegisterInterceptors
in interface CacheJmxWrapperMBean<K,V>
public void setRegisterInterceptors(boolean register)
CacheJmxWrapperMBean
CacheJmxWrapperMBean.create()
.
Default is true
.
setRegisterInterceptors
in interface CacheJmxWrapperMBean<K,V>
public Element getBuddyReplicationConfig()
LegacyConfiguration
getBuddyReplicationConfig
in interface LegacyConfiguration
LegacyConfiguration.setBuddyReplicationConfig(Element)
or null
if nothing waspublic Element getCacheLoaderConfig()
LegacyConfiguration
getCacheLoaderConfig
in interface LegacyConfiguration
LegacyConfiguration.setCacheLoaderConfig(Element)
or null
if nothing waspublic Element getCacheLoaderConfiguration()
getCacheLoaderConfiguration
in interface LegacyConfiguration
public String getCacheMode()
LegacyConfiguration
getCacheMode
in interface LegacyConfiguration
public String getClusterName()
LegacyConfiguration
getClusterName
in interface LegacyConfiguration
public String getClusterProperties()
LegacyConfiguration
getClusterProperties
in interface LegacyConfiguration
public Element getClusterConfig()
LegacyConfiguration
getClusterConfig
in interface LegacyConfiguration
null
if it was not
set via LegacyConfiguration.setClusterConfig(Element)
public Element getEvictionPolicyConfig()
getEvictionPolicyConfig
in interface LegacyConfiguration
LegacyConfiguration.setEvictionPolicyConfig(Element)
or null
if nothing waspublic boolean getExposeManagementStatistics()
LegacyConfiguration
getExposeManagementStatistics
in interface LegacyConfiguration
public boolean getUseInterceptorMbeans()
getUseInterceptorMbeans
in interface LegacyConfiguration
public boolean getFetchInMemoryState()
LegacyConfiguration
activateRegion
call should
include in-memory state. Allows for warm/hot caches (true/false). The
characteristics of a state transfer can be further defined by a cache
loader's FetchPersistentState property.
getFetchInMemoryState
in interface LegacyConfiguration
public long getStateRetrievalTimeout()
LegacyConfiguration
getStateRetrievalTimeout
in interface LegacyConfiguration
@Deprecated public void setInitialStateRetrievalTimeout(long timeout)
LegacyConfiguration
LegacyConfiguration.getInitialStateRetrievalTimeout()
)
setInitialStateRetrievalTimeout
in interface LegacyConfiguration
public String getIsolationLevel()
LegacyConfiguration
getIsolationLevel
in interface LegacyConfiguration
public long getLockAcquisitionTimeout()
LegacyConfiguration
getLockAcquisitionTimeout
in interface LegacyConfiguration
public org.jgroups.jmx.JChannelFactoryMBean getMultiplexerService()
getMultiplexerService
in interface LegacyConfiguration
public String getMultiplexerStack()
LegacyConfiguration
getMultiplexerStack
in interface LegacyConfiguration
public org.jgroups.ChannelFactory getMuxChannelFactory()
getMuxChannelFactory
in interface LegacyConfiguration
public String getNodeLockingScheme()
getNodeLockingScheme
in interface LegacyConfiguration
public long getReplQueueInterval()
getReplQueueInterval
in interface LegacyConfiguration
public int getReplQueueMaxElements()
getReplQueueMaxElements
in interface LegacyConfiguration
public String getReplicationVersion()
LegacyConfiguration
Region.activate()
. Different
releases of JBossCache may format this data differently; this property
identifies the format version being used by this cache instance.
The default value for this property is
Configuration.DEFAULT_REPLICATION_VERSION
.
getReplicationVersion
in interface LegacyConfiguration
124
for JBossCache 1.2.4public boolean getSyncCommitPhase()
getSyncCommitPhase
in interface LegacyConfiguration
public long getSyncReplTimeout()
LegacyConfiguration
getSyncReplTimeout
in interface LegacyConfiguration
public boolean getSyncRollbackPhase()
getSyncRollbackPhase
in interface LegacyConfiguration
public TransactionManager getTransactionManager()
getTransactionManager
in interface LegacyConfiguration
public String getTransactionManagerLookupClass()
getTransactionManagerLookupClass
in interface LegacyConfiguration
@Deprecated public boolean getUseRegionBasedMarshalling()
LegacyConfiguration
getUseRegionBasedMarshalling
in interface LegacyConfiguration
public boolean isUseLazyDeserialization()
public boolean getUseReplQueue()
getUseReplQueue
in interface LegacyConfiguration
public boolean isInactiveOnStartup()
LegacyConfiguration
Configuration.isUseRegionBasedMarshalling()
is
true
.
isInactiveOnStartup
in interface LegacyConfiguration
public void setBuddyReplicationConfig(Element config)
LegacyConfiguration
setBuddyReplicationConfig
in interface LegacyConfiguration
public void setCacheLoaderConfig(Element cache_loader_config)
setCacheLoaderConfig
in interface LegacyConfiguration
public void setCacheLoaderConfiguration(Element config)
setCacheLoaderConfiguration
in interface LegacyConfiguration
public void setCacheMode(String mode) throws Exception
LegacyConfiguration
setCacheMode
in interface LegacyConfiguration
Exception
public void setClusterConfig(Element config)
LegacyConfiguration
setClusterConfig
in interface LegacyConfiguration
@Deprecated public long getInitialStateRetrievalTimeout()
LegacyConfiguration
getInitialStateRetrievalTimeout
in interface LegacyConfiguration
public void setClusterName(String name)
LegacyConfiguration
setClusterName
in interface LegacyConfiguration
public void setClusterProperties(String cluster_props)
LegacyConfiguration
setClusterProperties
in interface LegacyConfiguration
cluster_props
- The properties for the cluster (JGroups)public void setEvictionPolicyConfig(Element config)
LegacyConfiguration
setEvictionPolicyConfig
in interface LegacyConfiguration
public void setExposeManagementStatistics(boolean expose)
setExposeManagementStatistics
in interface LegacyConfiguration
public void setUseInterceptorMbeans(boolean use)
setUseInterceptorMbeans
in interface LegacyConfiguration
public void setFetchInMemoryState(boolean flag)
LegacyConfiguration
setFetchInMemoryState
in interface LegacyConfiguration
public void setInactiveOnStartup(boolean inactiveOnStartup)
LegacyConfiguration
Region.activate()
is
called to activate one or more parts of the tree.
This property is only relevant if Configuration.isUseRegionBasedMarshalling()
is
true
.
setInactiveOnStartup
in interface LegacyConfiguration
public void setStateRetrievalTimeout(long timeout)
LegacyConfiguration
LegacyConfiguration.getStateRetrievalTimeout()
)
setStateRetrievalTimeout
in interface LegacyConfiguration
public void setIsolationLevel(String level)
LegacyConfiguration
setIsolationLevel
in interface LegacyConfiguration
public void setLockAcquisitionTimeout(long timeout)
LegacyConfiguration
setLockAcquisitionTimeout
in interface LegacyConfiguration
public void setMultiplexerService(org.jgroups.jmx.JChannelFactoryMBean muxService)
setMultiplexerService
in interface LegacyConfiguration
public void setMultiplexerStack(String stackName)
LegacyConfiguration
setMultiplexerStack
in interface LegacyConfiguration
stackName
- the name of the multiplexer stackpublic void setMuxChannelFactory(org.jgroups.ChannelFactory factory)
setMuxChannelFactory
in interface LegacyConfiguration
public void setNodeLockingScheme(String nodeLockingScheme)
setNodeLockingScheme
in interface LegacyConfiguration
public void setReplQueueInterval(long interval)
setReplQueueInterval
in interface LegacyConfiguration
public void setReplQueueMaxElements(int max_elements)
setReplQueueMaxElements
in interface LegacyConfiguration
public void setReplicationVersion(String version)
LegacyConfiguration
Region.activate()
. Different
releases of JBossCache may format this data differently; this property
identifies the format version being used by this cache instance. Setting
this property to a value other than the default allows a cache instance
from a later release to interoperate with a cache instance from an
earlier release.
setReplicationVersion
in interface LegacyConfiguration
version
- a short identifying JBossCache release;
e.g. 124
for JBossCache 1.2.4public void setSyncCommitPhase(boolean sync_commit_phase)
setSyncCommitPhase
in interface LegacyConfiguration
public void setSyncReplTimeout(long timeout)
LegacyConfiguration
setSyncReplTimeout
in interface LegacyConfiguration
public void setSyncRollbackPhase(boolean sync_rollback_phase)
setSyncRollbackPhase
in interface LegacyConfiguration
public void setTransactionManager(TransactionManager manager)
setTransactionManager
in interface LegacyConfiguration
public void setTransactionManagerLookupClass(String cl) throws Exception
LegacyConfiguration
setTransactionManagerLookupClass
in interface LegacyConfiguration
Exception
public void setUseRegionBasedMarshalling(boolean isTrue)
LegacyConfiguration
true
before any call to
Region.registerContextClassLoader(ClassLoader)
.
setUseRegionBasedMarshalling
in interface LegacyConfiguration
public void setUseReplQueue(boolean flag)
setUseReplQueue
in interface LegacyConfiguration
public void create() throws CacheException
create
in interface CacheJmxWrapperMBean<K,V>
CacheException
public void start() throws CacheException
start
in interface CacheJmxWrapperMBean<K,V>
CacheException
public void stop()
stop
in interface CacheJmxWrapperMBean<K,V>
public void destroy()
destroy
in interface CacheJmxWrapperMBean<K,V>
public ObjectName preRegister(MBeanServer server, ObjectName objName) throws Exception
server
and objName
.
preRegister
in interface MBeanRegistration
Exception
public void postRegister(Boolean registrationDone)
getRegisterInterceptors()
is true
.
postRegister
in interface MBeanRegistration
public void preDeregister() throws Exception
preDeregister
in interface MBeanRegistration
Exception
public void postDeregister()
getRegisterInterceptors()
is
true
.
postDeregister
in interface MBeanRegistration
public void setConfiguration(Configuration config)
config
- the configuration
IllegalArgumentException
- if config
is null
.public void setCache(Cache<K,V> cache)
cache
- public String getCacheObjectName()
public void setCacheObjectName(String name) throws MalformedObjectNameException
MalformedObjectNameException
public boolean isDisableStateChangeNotifications()
setDisableStateChangeNotifications(boolean)
public void setDisableStateChangeNotifications(boolean disableStateChangeNotifications)
disableStateChangeNotifications
- public MBeanServer getMBeanServer()
public static String formatHtml(String s)
s
- string to format
public String getNotificationServiceName()
public void setNotificationServiceName(String notificationServiceName)
public long getNextNotificationSequenceNumber()
CacheNotificationBroadcaster
getNextNotificationSequenceNumber
in interface CacheNotificationBroadcaster
public void addNotificationListener(NotificationListener notificationListener, NotificationFilter notificationFilter, Object object) throws IllegalArgumentException
addNotificationListener
in interface NotificationBroadcaster
addNotificationListener
in class NotificationBroadcasterSupport
IllegalArgumentException
public void removeNotificationListener(NotificationListener notificationListener) throws ListenerNotFoundException
removeNotificationListener
in interface NotificationBroadcaster
removeNotificationListener
in class NotificationBroadcasterSupport
ListenerNotFoundException
public void removeNotificationListener(NotificationListener listener, NotificationFilter filter, Object handback) throws ListenerNotFoundException
removeNotificationListener
in interface NotificationEmitter
removeNotificationListener
in class NotificationBroadcasterSupport
ListenerNotFoundException
public MBeanNotificationInfo[] getNotificationInfo()
getNotificationInfo
in interface NotificationBroadcaster
getNotificationInfo
in class NotificationBroadcasterSupport
protected void constructCache() throws ConfigurationException
ConfigurationException
protected boolean registerInterceptors() throws CacheException
CacheException
protected void unregisterInterceptors()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |