User: patriot1burke Date: 01/10/31 20:14:33 Modified: src/main/org/jboss/ha/framework/server DistributedReplicantManagerImpl.java Log: DRM is no longer a remote object. It shouldn't be. Revision Changes Path 1.6 +7 -85 jbossmx/src/main/org/jboss/ha/framework/server/DistributedReplicantManagerImpl.java Index: DistributedReplicantManagerImpl.java =================================================================== RCS file: /cvsroot/jboss/jbossmx/src/main/org/jboss/ha/framework/server/DistributedReplicantManagerImpl.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- DistributedReplicantManagerImpl.java 2001/10/20 20:51:46 1.5 +++ DistributedReplicantManagerImpl.java 2001/11/01 04:14:33 1.6 @@ -7,11 +7,6 @@ import java.util.Iterator; import java.util.Collection; -import java.rmi.server.RemoteStub; -import java.rmi.server.RemoteServer; -import java.rmi.server.UnicastRemoteObject; -import java.rmi.RemoteException; - import java.io.Serializable; import org.jboss.logging.Logger; @@ -25,13 +20,17 @@ * * @author [EMAIL PROTECTED] * @author [EMAIL PROTECTED] - * @version $Revision: 1.5 $ + * @version $Revision: 1.6 $ * * <p><b>Revisions:</b><br> + * <p><b>2001/10/31: marcf</b> + * <ol> + * <li>DRM is no longer remote + * <li>DRM no longer is part of state transfer protocol + * </ol> */ public class DistributedReplicantManagerImpl implements DistributedReplicantManager, - HAPartition.HAPartitionStateTransfer, HAPartition.HAMembershipListener { protected HashMap localReplicants = new HashMap(); @@ -44,7 +43,7 @@ protected Logger log = null; - public DistributedReplicantManagerImpl(HAPartition partition) throws RemoteException + public DistributedReplicantManagerImpl(HAPartition partition) { this.partition = partition; this.log = Logger.create(partition.getPartitionName() + ":ReplicantManager"); @@ -56,96 +55,22 @@ partition.registerRPCHandler(SERVICE_NAME, this); log.debug("registerMembershipListener"); partition.registerMembershipListener(this); - /* - log.debug ("subscribeToStateTransferEvents"); - partition.subscribeToStateTransferEvents (SERVICE_NAME, this); - */ } public void start() throws Exception { - log.info("Export myself as an RMI server"); - RemoteStub stub = UnicastRemoteObject.exportObject(this); log.info("mergemembers"); mergeMembers(); - log.info("Register myself as a replicant of DistributedReplicantManager"); - add(SERVICE_NAME, stub); } public void stop() throws Exception { - UnicastRemoteObject.unexportObject(this, true); - partition.unsubscribeFromStateTransferEvents(SERVICE_NAME, this); - } - - ///////////////////// - // State transfer API - ///////////////////// - - /** - * State Transfer protocol required method. Merges localReplicants with replicants and - * returns this hashmap. - */ - public Serializable getCurrentState() - { - try - { - HashMap rtn = new HashMap(); - synchronized (replicants) - { - rtn.putAll(replicants); - synchronized (localReplicants) - { - Iterator keys = localReplicants.keySet().iterator(); - while (keys.hasNext()) - { - String key = (String)keys.next(); - Serializable rep = (Serializable)localReplicants.get(key); - addReplicant(rtn, key, partition.getNodeName(), rep); - } - } - } - return rtn; - } - catch (Exception ex) - { - log.error("getCurrentState failed", ex); - } - return null; } - public void setCurrentState(Serializable newState) - { - if (newState == null) return; - try - { - synchronized (replicants) - { - replicants.clear (); - replicants.putAll ((HashMap)newState); - if (keyListeners.size () > 0) - cleanupKeyListeners (); - } - Iterator keys = replicants.keySet().iterator(); - while (keys.hasNext()) - { - String key = (String)keys.next(); - notifyKeyListeners(key, lookupReplicants(key)); - } - } - catch (Exception ex) - { - log.error("setCurrentState failed", ex); - } - } - //////////////////// // Group membership API //////////////////// - /** - * This is deprecated for now. We may resurrect it. - */ protected class MergeMembers extends Thread { public void run() @@ -154,9 +79,6 @@ } } - /** - * This is deprecated for now. We may resurrect it. - */ protected void mergeMembers() { try
_______________________________________________ Jboss-development mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-development