Class MBeanServerRegistrationUtility
- java.lang.Object
-
- com.tangosol.coherence.jcache.common.MBeanServerRegistrationUtility
-
public final class MBeanServerRegistrationUtility extends Object
A convenience class for registering CacheStatisticsMBeans with an MBeanServer.- Since:
- Coherence 12.1.3
- Author:
- jf 2013.10.24
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
MBeanServerRegistrationUtility.ObjectNameType
The type of registered Object
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ObjectName
calculateObjectName(CoherenceBasedCacheManager mgr, JCacheIdentifier id, MBeanServerRegistrationUtility.ObjectNameType objectNameType)
Creates an object name using the scheme "javax.cache:type=Cache<Statistics|Configuration>,CacheManager=<cacheManagerName>,Cache=<cacheName>"static ObjectName
calculateObjectName(javax.cache.Cache cache, MBeanServerRegistrationUtility.ObjectNameType objectNameType)
Creates an object name using the scheme "javax.cache:type=Cache<Statistics|Configuration>,CacheManager=<cacheManagerName>,Cache=<cacheName>"static boolean
isRegistered(javax.cache.Cache cache, MBeanServerRegistrationUtility.ObjectNameType objectNameType)
Checks whether an ObjectName is already registered.static void
registerCacheObject(AbstractCoherenceBasedCache cache, MBeanServerRegistrationUtility.ObjectNameType objectNameType)
Utility method for registering CacheStatistics with the platform MBeanServerstatic void
unregisterCacheObject(CoherenceBasedCacheManager mgr, JCacheIdentifier id, MBeanServerRegistrationUtility.ObjectNameType objectNameType)
Removes registered JCache MBean for a Cachestatic void
unregisterCacheObject(javax.cache.Cache cache, MBeanServerRegistrationUtility.ObjectNameType objectNameType)
Removes registered JCache MBean for a Cache
-
-
-
Method Detail
-
registerCacheObject
public static void registerCacheObject(AbstractCoherenceBasedCache cache, MBeanServerRegistrationUtility.ObjectNameType objectNameType)
Utility method for registering CacheStatistics with the platform MBeanServer- Parameters:
cache
- the cache to register
-
isRegistered
public static boolean isRegistered(javax.cache.Cache cache, MBeanServerRegistrationUtility.ObjectNameType objectNameType)
Checks whether an ObjectName is already registered.- Throws:
javax.cache.CacheException
- - all exceptions are wrapped in CacheException
-
unregisterCacheObject
public static void unregisterCacheObject(javax.cache.Cache cache, MBeanServerRegistrationUtility.ObjectNameType objectNameType)
Removes registered JCache MBean for a Cache- Parameters:
cache
- remove registered JCache MBean for this cacheobjectNameType
- JCache MBean typeMBeanServerRegistrationUtility.ObjectNameType
- Throws:
javax.cache.CacheException
- - all exceptions are wrapped in CacheException
-
unregisterCacheObject
public static void unregisterCacheObject(CoherenceBasedCacheManager mgr, JCacheIdentifier id, MBeanServerRegistrationUtility.ObjectNameType objectNameType)
Removes registered JCache MBean for a Cache- Parameters:
mgr
- Coherence JCache CacheManager of JCache cache MBean to be unregisteredid
- JCache cache identifier of JCache cache MBean to be unregisteredobjectNameType
- JCache MBean typeMBeanServerRegistrationUtility.ObjectNameType
to be unregistered- Throws:
javax.cache.CacheException
- - all exceptions are wrapped in CacheException
-
calculateObjectName
public static ObjectName calculateObjectName(javax.cache.Cache cache, MBeanServerRegistrationUtility.ObjectNameType objectNameType)
Creates an object name using the scheme "javax.cache:type=Cache<Statistics|Configuration>,CacheManager=<cacheManagerName>,Cache=<cacheName>"MultiTenancy support: "javax.cache:type=Cache<Statistics|Configuration>,CacheManager=<cacheManagerName>,Cache=<cacheName>domainPartition=<domainPartition>"
- Parameters:
cache
- the JCache that this MBean ObjectName will representobjectNameType
- whether a Statistics or Configuration MBean type- Returns:
- computed MBean object name for
cache
withobjectNameType
-
calculateObjectName
public static ObjectName calculateObjectName(CoherenceBasedCacheManager mgr, JCacheIdentifier id, MBeanServerRegistrationUtility.ObjectNameType objectNameType)
Creates an object name using the scheme "javax.cache:type=Cache<Statistics|Configuration>,CacheManager=<cacheManagerName>,Cache=<cacheName>"MultiTenancy support: "javax.cache:type=Cache<Statistics|Configuration>,CacheManager=<cacheManagerName>,Cache=<cacheName>domainPartition=<domainPartition>"
- Parameters:
mgr
- CoherenceBasedCacheManagerid
- the JCache Identier that this MBean ObjectName will representobjectNameType
- whether a Statistics or Configuration MBean type- Returns:
- computed MBean object name for
cache
withobjectNameType
-
-