/** * Removes the local node from the distributed registry of nodes providing * the service and causes {@link #invocationsAllowed()} to return * <code>false</code>. */ public void destroy() { try { this.cleanExistenceInCurrentHAPartition(); // maybe some threads are blocked: we let them go here: // setInvocationsAuthorization (HATarget.DISABLE_INVOCATIONS); } catch (Exception e) { log.error("failed to destroy", e); } }
/** * 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); }