/** * @see org.jboss.ha.framework.interfaces.DistributedReplicantManager.ReplicantListener#replicantsChanged(java.lang.String, java.util.List, int, boolean) */ @Override public void replicantsChanged(String key, List<?> newReplicants, int newReplicantsViewId, boolean merge) { if (key.equals(this.getHAServiceKey())) { // This synchronized block was added when the internal behavior of // DistributedReplicantManagerImpl was changed so that concurrent // replicantsChanged notifications are possible. Synchronization // ensures that this change won't break non-thread-safe // subclasses of HAServiceMBeanSupport. synchronized (this) { // change in the topology callback this.partitionTopologyChanged(newReplicants, newReplicantsViewId, merge); } } }
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()); }
protected void unregisterRPCHandler() { this.partition.unregisterRPCHandler(this.getHAServiceKey(), this.getRpcHandler()); }
protected void registerRPCHandler() { String key = this.getHAServiceKey(); if (this.isRegisterThreadContextClassLoader()) { this.partition.registerRPCHandler(key, this.getRpcHandler(), Thread.currentThread().getContextClassLoader()); } else { this.partition.registerRPCHandler(key, this.getRpcHandler()); } }
protected void unregisterDRMListener() throws Exception { DistributedReplicantManager drm = this.partition.getDistributedReplicantManager(); String key = this.getHAServiceKey(); // remove replicant node drm.remove(key); // unregister drm.unregisterListener(key, this); }