Package org.jboss.ha.framework.interfaces

Examples of org.jboss.ha.framework.interfaces.DistributedState$DSListenerEx


     
      if (key.equals(this.RPC_HANDLER_NAME) && drm.isMasterReplica(this.RPC_HANDLER_NAME))
      {
         this.log.debug("The list of replicants for the JG bridge has changed, computing and updating local info...");

         DistributedState ds = this.partition.getDistributedStateService();
        
         // we remove any entry from the DS whose node is dead
         //
         Collection<?> coll = ds.getAllKeys(this.RPC_HANDLER_NAME);
         if (coll == null)
         {
            this.log.debug("... No bridge info was associated with this node");
            return;
         }

         // to avoid ConcurrentModificationException, we copy the list of keys in a new structure
         //
         ArrayList<?> collCopy = new ArrayList<Object>(coll);
         List<String> newReplicantsNodeNames = drm.lookupReplicantsNodeNames(this.RPC_HANDLER_NAME);

         for (int i = 0; i < collCopy.size(); i++)
         {
            String nodeEntry = (String) collCopy.get(i);
            if (!newReplicantsNodeNames.contains(nodeEntry))
            {
               // the list of bridged topic contains a dead member: we remove it
               //
               try
               {
                  this.log.debug("removing bridge information associated with this node from the DS");
                  ds.remove(this.RPC_HANDLER_NAME, nodeEntry, true);
               }
               catch (Exception e)
               {
                  this.log.info("Unable to remove a node entry from the distributed cache", e);
               }
View Full Code Here


         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)
      {
View Full Code Here

   @Override
   public void stopService()
   {
      DistributedReplicantManager drm = this.partition.getDistributedReplicantManager();
      DistributedState ds = this.partition.getDistributedStateService();
     
      try
      {
         this.partition.unregisterRPCHandler(this.RPC_HANDLER_NAME, this);
         ds.unregisterDSListenerEx(this.RPC_HANDLER_NAME, this);
         drm.unregisterListener(this.RPC_HANDLER_NAME, this);
         drm.remove(this.RPC_HANDLER_NAME);

         this.invalidationSubscription.unregister();

         ds.remove(this.RPC_HANDLER_NAME, this.partition.getNodeName(), true);

         //         this.invalMgr = null;
         //         partition = null;
         this.invalidationSubscription = null;
         this.RPC_HANDLER_NAME = null;
View Full Code Here

         String aGroup = content.get(i).getGroupName();
         result.add(aGroup);
      }

      String nodeName = this.partition.getNodeName();
      DistributedState ds = this.partition.getDistributedStateService();
     
      if (result.size() > 0)
      {
         NodeInfo info = new NodeInfo(result, nodeName);
         ds.set(this.RPC_HANDLER_NAME, nodeName, info, true);
      }
      else
      {
         ds.remove(this.RPC_HANDLER_NAME, nodeName, true);
      }
   }
View Full Code Here

    * @param value the distributed object
    *
    */
   public void setDistributedState(String key, Serializable value) throws Exception
   {
      DistributedState ds = this.getHAPartition().getDistributedStateService();
      ds.set(this.getHAServiceKey(), key, value);
   }
View Full Code Here

    * @return Serializable the distributed object
    *
    */
   public Serializable getDistributedState(String key)
   {
      DistributedState ds = this.getHAPartition().getDistributedStateService();
      return ds.get(this.getHAServiceKey(), key);
   }
View Full Code Here

     
      if (key.equals(this.RPC_HANDLER_NAME) && drm.isMasterReplica(this.RPC_HANDLER_NAME))
      {
         this.log.debug("The list of replicants for the JG bridge has changed, computing and updating local info...");

         DistributedState ds = this.partition.getDistributedStateService();
        
         // we remove any entry from the DS whose node is dead
         //
         java.util.Collection coll = ds.getAllKeys(this.RPC_HANDLER_NAME);
         if (coll == null)
         {
            this.log.debug("... No bridge info was associated with this node");
            return;
         }

         // to avoid ConcurrentModificationException, we copy the list of keys in a new structure
         //
         ArrayList collCopy = new java.util.ArrayList(coll);
         java.util.List newReplicantsNodeNames = drm.lookupReplicantsNodeNames(this.RPC_HANDLER_NAME);

         for (int i = 0; i < collCopy.size(); i++)
         {
            String nodeEntry = (String) collCopy.get(i);
            if (!newReplicantsNodeNames.contains(nodeEntry))
            {
               // the list of bridged topic contains a dead member: we remove it
               //
               try
               {
                  this.log.debug("removing bridge information associated with this node from the DS");
                  ds.remove(this.RPC_HANDLER_NAME, nodeEntry, true);
               }
               catch (Exception e)
               {
                  this.log.info("Unable to remove a node entry from the distributed cache", e);
               }
View Full Code Here

         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)
      {
View Full Code Here

   @Override
   public void stopService()
   {
      DistributedReplicantManager drm = this.partition.getDistributedReplicantManager();
      DistributedState ds = this.partition.getDistributedStateService();
     
      try
      {
         this.partition.unregisterRPCHandler(this.RPC_HANDLER_NAME, this);
         ds.unregisterDSListenerEx(this.RPC_HANDLER_NAME, this);
         drm.unregisterListener(this.RPC_HANDLER_NAME, this);
         drm.remove(this.RPC_HANDLER_NAME);

         this.invalidationSubscription.unregister();

         ds.remove(this.RPC_HANDLER_NAME, this.partition.getNodeName(), true);

         //         this.invalMgr = null;
         //         partition = null;
         this.invalidationSubscription = null;
         this.RPC_HANDLER_NAME = null;
View Full Code Here

         String aGroup = ((InvalidationGroup) content.get(i)).getGroupName();
         result.add(aGroup);
      }

      String nodeName = this.partition.getNodeName();
      DistributedState ds = this.partition.getDistributedStateService();
     
      if (result.size() > 0)
      {
         NodeInfo info = new NodeInfo(result, nodeName);
         ds.set(this.RPC_HANDLER_NAME, nodeName, info, true);
      }
      else
      {
         ds.remove(this.RPC_HANDLER_NAME, nodeName, true);
      }
   }
View Full Code Here

TOP

Related Classes of org.jboss.ha.framework.interfaces.DistributedState$DSListenerEx

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.