/** * Associates this target with the given partition, registering * with the partition's {@link DistributedReplicantManager}. * * @param partition the partition * @throws Exception */ protected void updateHAPartition(HAPartition partition) throws Exception { cleanExistenceInCurrentHAPartition(); this.partition = partition; DistributedReplicantManager drm = partition.getDistributedReplicantManager(); drm.registerListener(this.replicantName, this); drm.add(this.replicantName, this.target); }
protected void registerDRMListener() throws Exception { if (log.isDebugEnabled()) { log.debug("HAServiceImpl.registerDRMListener for service=" + getHAServiceKey()); } DistributedReplicantManager drm = this.partition.getDistributedReplicantManager(); String key = this.getHAServiceKey(); drm.registerListener(key, this); // this ensures that the DRM knows that this node has the MBean deployed drm.add(key, this.getReplicant()); }
@Override public void startService() throws Exception { if (this.partition == null) throw new IllegalStateException("HAPartition property must be set before starting InvalidationBridge service"); this.RPC_HANDLER_NAME = "DCacheBridge-" + this.bridgeName; DistributedReplicantManager drm = this.partition.getDistributedReplicantManager(); DistributedState ds = this.partition.getDistributedStateService(); drm.add(this.RPC_HANDLER_NAME, ""); drm.registerListener(this.RPC_HANDLER_NAME, this); ds.registerDSListenerEx(this.RPC_HANDLER_NAME, this); this.partition.registerRPCHandler(this.RPC_HANDLER_NAME, this); // we now publish the list of caches we have access to if (this.invalMgr == null) { throw new IllegalStateException("Failed to find an InvalidationManagerMBean, ensure one is injected"); } this.publishLocalInvalidationGroups(); this.updatedBridgedInvalidationGroupsInfo(); this.invalidationSubscription = this.invalMgr.registerBridgeListener(this); }
drm.registerListener (replicantName, this);
drm.add(getServiceHAName(), this.partition.getClusterNode()); this.serviceView = drm.lookupReplicantsNodes(getServiceHAName()); drm.registerListener(getServiceHAName(), drmListener);
drm.registerListener (replicantName, this);
drm.registerListener(key, listener); drm.registerListener(key, this);
/** * Bring the service into active operation. * * @throws Exception */ public void start() throws Exception { partition.registerRPCHandler(getServiceHAName(), rpcTarget); DistributedReplicantManager drm = partition.getDistributedReplicantManager(); drm.add(getServiceHAName(), partition.getClusterNode()); coordinator = drm.isMasterReplica(getServiceHAName()); drm.registerListener(getServiceHAName(), drmListener); statusCheck(); }