private void replaceLockManager(ComponentRegistry componentRegistry) { LockManager oldLockManager = componentRegistry.getComponent(LockManager.class); LockManager newLockManager = new ExtendedStatisticLockManager(oldLockManager, cacheStatisticManager, timeService); log.replaceComponent("LockManager", oldLockManager, newLockManager); componentRegistry.registerComponent(newLockManager, LockManager.class); }
private void replaceRpcManager(ComponentRegistry componentRegistry) { RpcManager oldRpcManager = componentRegistry.getComponent(RpcManager.class); if (oldRpcManager == null) { // local mode return; } RpcManager newRpcManager = new ExtendedStatisticRpcManager(oldRpcManager, cacheStatisticManager, timeService); log.replaceComponent("RpcManager", oldRpcManager, newRpcManager); componentRegistry.registerComponent(newRpcManager, RpcManager.class); this.rpcManager = newRpcManager; }
@Override protected void start() { super.start(); log.startStreamSummaryInterceptor(); streamSummaryContainer = StreamSummaryContainer.getOrCreateStreamLibContainer(cache); streamSummaryContainer.setEnabled(true); distributionManager = cache.getAdvancedCache().getDistributionManager(); ComponentRegistry componentRegistry = cache.getAdvancedCache().getComponentRegistry(); LockManager oldLockManager = componentRegistry.getComponent(LockManager.class); LockManager newLockManager = new TopKeyLockManager(oldLockManager, streamSummaryContainer); log.replaceComponent("LockManager", oldLockManager, newLockManager); componentRegistry.registerComponent(newLockManager, LockManager.class); componentRegistry.rewire(); }