Search in sources :

Example 1 with CacheManagerJmxRegistration

use of org.infinispan.jmx.CacheManagerJmxRegistration in project infinispan by infinispan.

the class ClusteredLockModuleLifecycle method registerClusteredLockManager.

private static void registerClusteredLockManager(BasicComponentRegistry registry, GlobalConfiguration globalConfig, ClusteredLockManagerConfiguration config) {
    ClusteredLockManager clusteredLockManager = new EmbeddedClusteredLockManager(config);
    registry.registerComponent(ClusteredLockManager.class, clusteredLockManager, true);
    if (globalConfig.jmx().enabled()) {
        try {
            CacheManagerJmxRegistration jmxRegistration = registry.getComponent(CacheManagerJmxRegistration.class).running();
            jmxRegistration.registerMBean(clusteredLockManager);
        } catch (Exception e) {
            throw log.jmxRegistrationFailed(e);
        }
    }
}
Also used : EmbeddedClusteredLockManager(org.infinispan.lock.impl.manager.EmbeddedClusteredLockManager) ClusteredLockManager(org.infinispan.lock.api.ClusteredLockManager) EmbeddedClusteredLockManager(org.infinispan.lock.impl.manager.EmbeddedClusteredLockManager) CacheManagerJmxRegistration(org.infinispan.jmx.CacheManagerJmxRegistration)

Example 2 with CacheManagerJmxRegistration

use of org.infinispan.jmx.CacheManagerJmxRegistration in project infinispan by infinispan.

the class CounterModuleLifecycle method registerCounterManager.

private static void registerCounterManager(EmbeddedCacheManager cacheManager, BasicComponentRegistry registry, GlobalConfiguration globalConfiguration) {
    if (log.isTraceEnabled())
        log.tracef("Registering counter manager.");
    EmbeddedCounterManager counterManager = new EmbeddedCounterManager(cacheManager);
    // This must happen before CacheManagerJmxRegistration starts
    registry.registerComponent(CounterManager.class, counterManager, true);
    if (globalConfiguration.jmx().enabled()) {
        try {
            CacheManagerJmxRegistration jmxRegistration = registry.getComponent(CacheManagerJmxRegistration.class).running();
            jmxRegistration.registerMBean(counterManager);
        } catch (Exception e) {
            throw log.jmxRegistrationFailed(e);
        }
    }
}
Also used : EmbeddedCounterManager(org.infinispan.counter.impl.manager.EmbeddedCounterManager) CacheManagerJmxRegistration(org.infinispan.jmx.CacheManagerJmxRegistration)

Aggregations

CacheManagerJmxRegistration (org.infinispan.jmx.CacheManagerJmxRegistration)2 EmbeddedCounterManager (org.infinispan.counter.impl.manager.EmbeddedCounterManager)1 ClusteredLockManager (org.infinispan.lock.api.ClusteredLockManager)1 EmbeddedClusteredLockManager (org.infinispan.lock.impl.manager.EmbeddedClusteredLockManager)1