Class JmxRegistration
- java.lang.Object
-
- com.github.benmanes.caffeine.jcache.management.JmxRegistration
-
public final class JmxRegistration extends java.lang.Object
Jmx cache utilities.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
JmxRegistration.MBeanType
-
Constructor Summary
Constructors Modifier Constructor Description private
JmxRegistration()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description private static javax.management.ObjectName
getObjectName(javax.cache.Cache<?,?> cache, JmxRegistration.MBeanType type)
Returns the object name of the management bean.private static void
register(javax.management.ObjectName objectName, java.lang.Object mbean)
Registers the management bean with the given object name.static void
registerMXBean(javax.cache.Cache<?,?> cache, java.lang.Object mxbean, JmxRegistration.MBeanType type)
Registers the JMX management bean for the cache.private static java.lang.String
sanitize(java.lang.String name)
Returns a sanatized string for use as a management bean name.private static void
unregister(javax.management.ObjectName objectName)
Unregisters the management bean(s) with the given object name.static void
unregisterMXBean(CacheProxy<?,?> cache, JmxRegistration.MBeanType type)
Unregisters the JMX management bean for the cache.
-
-
-
Method Detail
-
registerMXBean
public static void registerMXBean(javax.cache.Cache<?,?> cache, java.lang.Object mxbean, JmxRegistration.MBeanType type)
Registers the JMX management bean for the cache.- Parameters:
cache
- the cache to registermxbean
- the management beantype
- the mxbean type
-
unregisterMXBean
public static void unregisterMXBean(CacheProxy<?,?> cache, JmxRegistration.MBeanType type)
Unregisters the JMX management bean for the cache.- Parameters:
cache
- the cache to unregistertype
- the mxbean type
-
register
private static void register(javax.management.ObjectName objectName, java.lang.Object mbean)
Registers the management bean with the given object name.
-
unregister
private static void unregister(javax.management.ObjectName objectName)
Unregisters the management bean(s) with the given object name.
-
getObjectName
private static javax.management.ObjectName getObjectName(javax.cache.Cache<?,?> cache, JmxRegistration.MBeanType type)
Returns the object name of the management bean.
-
sanitize
private static java.lang.String sanitize(java.lang.String name)
Returns a sanatized string for use as a management bean name.
-
-