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
  • Method Details

    • 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 cache
      objectNameType - JCache MBean type MBeanServerRegistrationUtility.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 unregistered
      id - JCache cache identifier of JCache cache MBean to be unregistered
      objectNameType - JCache MBean type MBeanServerRegistrationUtility.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 represent
      objectNameType - whether a Statistics or Configuration MBean type
      Returns:
      computed MBean object name for cache with objectNameType
    • 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 - CoherenceBasedCacheManager
      id - the JCache Identier that this MBean ObjectName will represent
      objectNameType - whether a Statistics or Configuration MBean type
      Returns:
      computed MBean object name for cache with objectNameType