public class JmxRegistrationManager extends Object
ManagementFactory.getPlatformMBeanServer()
is being used.
It is immutable: both cache instance and MBeanServer are being passed as arguments to the constructor.
Note that by default object names used are prefixed with jboss.cache:service=JBossCache. While this format works for and is consistent with JBoss AS and the JMX console, it has been known to cause problems with other JMX servers such as Websphere. To work around this, you can provide the following VM system property to override this prefix with a prefix of your choice: -Djbosscache.jmx.prefix=JBossCache
Modifier and Type | Field and Description |
---|---|
static String |
JMX_RESOURCE_KEY
Key for every Dynamic mbean added.
|
static String |
LOCAL_CACHE_PREFIX
default ObjectName for non clustered caches.
|
static String |
REPLICATED_CACHE_PREFIX
default ObjectName for clusterd caches.
|
Constructor and Description |
---|
JmxRegistrationManager(Cache cache) |
JmxRegistrationManager(Cache cache,
ObjectName objectNameBase)
Defaults to platform to platform MBeanServer.
|
JmxRegistrationManager(MBeanServer mBeanServer,
Cache cache,
ObjectName objectNameBase)
C-tor.
|
JmxRegistrationManager(MBeanServer mBeanServer,
Cache cache,
String objectNameBase) |
Modifier and Type | Method and Description |
---|---|
String |
getObjectName(String resourceName) |
String |
getObjectNameBase() |
void |
registerAllMBeans()
Performs the MBean registration.
|
void |
unregisterAllMBeans()
Unregisters all the MBeans registered through
registerAllMBeans() . |
public static final String REPLICATED_CACHE_PREFIX
public static final String LOCAL_CACHE_PREFIX
public static final String JMX_RESOURCE_KEY
public JmxRegistrationManager(MBeanServer mBeanServer, Cache cache, ObjectName objectNameBase)
mBeanServer
- the server where mbeans are being registeredcache
- cache that needs to be monitoredobjectNameBase
- path in the MBeanServer where to register cache MBeanspublic JmxRegistrationManager(MBeanServer mBeanServer, Cache cache, String objectNameBase)
IllegalArgumentException
- if the supplied objectNameBase name isn't validJmxRegistrationManager(javax.management.MBeanServer, org.jboss.cache.Cache, javax.management.ObjectName)
public JmxRegistrationManager(Cache cache, ObjectName objectNameBase)
public JmxRegistrationManager(Cache cache)
public void registerAllMBeans() throws CacheException
CacheException
public void unregisterAllMBeans() throws CacheException
registerAllMBeans()
.CacheException
public String getObjectNameBase()
Copyright © 2012 JBoss, a division of Red Hat. All Rights Reserved.