Package org.jboss.ha.framework.interfaces

Examples of org.jboss.ha.framework.interfaces.ClusterNode


    * @return the discrepancy data. Will return <code>null</code> if no data
    *         for <code>node</code> is stored.
    */
   public TimestampDiscrepancy getTimestampDiscrepancy(String nodeName, boolean allowStatusCheck)
   {
      ClusterNode node = nodesByName.get(nodeName);
      return node == null ? null : getTimestampDiscrepancy(node, allowStatusCheck);
   }
View Full Code Here


      {
         try
         {
            DistributedReplicantManager drm = partition.getDistributedReplicantManager();
            List<ClusterNode> nodes = drm.lookupReplicantsNodes(getServiceHAName());
            ClusterNode coord = (nodes != null && nodes.size() > 0 ? nodes.get(0) : null);
            if (coord != null && coord.equals(partition.getClusterNode()) == false)
            {
               Object rsp = partition.callMethodOnNode(getServiceHAName(), "getDiscrepancies", NULL_ARGS, NULL_TYPES, 60000, coord);
               if (rsp instanceof RemoteDiscrepancies)
               {
                  handleRemoteDiscrepancies((RemoteDiscrepancies) rsp);
View Full Code Here

   /**
    * Handles a pushRemoteDiscrepancies call from a remote node.
    */
   private void handleRemoteDiscrepancies(RemoteDiscrepancies remote)
   {
      ClusterNode sender = remote.getSender();
      Map<Server, TimestampDiscrepancy> remoteDiscrepancies = remote.getDiscrepancies();
     
      synchronized (discrepancies)
      {
         TimestampDiscrepancy senderDiscrepancy = discrepancies.get(new Server(sender));
View Full Code Here

         if (discrepancies.get(key) == null)
         {
            // A node we didn't know about
            discrepancies.put(new Server(key, senderDiscrepancy),
                              new TimestampDiscrepancy(entry.getValue(), senderDiscrepancy));
            ClusterNode node = key.getNode();
            nodesByName.put(node.getName(), node);
         }
      }
   }
View Full Code Here

      return this.partition == null ? null : this.partition.getPartitionName();
   }

   public String getLocalNodeName()
   {
      ClusterNode localNode = this.partition == null ? null : this.partition.getClusterNode();
      return localNode == null ? null : localNode.getName();
   }
View Full Code Here

   @Override
   public ClusterNode elect(List<ClusterNode> candidates)
   {
      InetSocketAddress sockAddress = this.preferredMaster;
     
      ClusterNode master = null;
     
      // If preferred master is defined and contained in cluster, return it
      if (sockAddress != null)
      {
         InetAddress address = sockAddress.getAddress();
View Full Code Here

            }
         }
        
         if (merge)
         {
            ClusterNode master = (ClusterNode) (newReplicants.size() > 0 ? newReplicants.get(0) : null);
            inSync = (master != null && oldView.contains(master));
         }
      }     
View Full Code Here

  
   // ------------------------------------------------------------------ Public
  
   public void unlock(Serializable lockId)
   {
      ClusterNode myself = getLocalClusterNode();
      if (myself == null)
      {
         throw new IllegalStateException("Must call start() before first call to unlock()");
      }
     
      ClusterLockState lockState = getClusterLockState(lockId, false);
     
      if (lockState != null && myself.equals(lockState.getHolder()))
      {
         getLocalHandler().unlockFromCluster(lockId, myself);
         lockState.release();
        
         try
View Full Code Here

  
   // ------------------------------------------------------ ClusterLockManager
  
   public void unlock(Serializable lockId)
   {
      ClusterNode myself = getLocalClusterNode();
      if (myself == null)
      {
         throw new IllegalStateException("Must call start() before first call to unlock()");
      }
     
      ClusterLockState category = getClusterLockState(lockId, false);
     
      if (category != null && myself.equals(category.getHolder()))
      {
         category.invalidate();
         getLocalHandler().unlockFromCluster(lockId, myself);
         removeLockState(category);
      }
View Full Code Here

      long start = System.currentTimeMillis();
      while (left > 0)
      {
         // Another node we lost to who should take precedence
         // over ourself in competition for the lock
         ClusterNode superiorCompetitor = null;
        
         // Only continue if category is unlocked
         if (category.state.compareAndSet(ClusterLockState.State.UNLOCKED, ClusterLockState.State.REMOTE_LOCKING))
         {           
            // Category state is now REMOTE_LOCKING, so other nodes will fail
View Full Code Here

TOP

Related Classes of org.jboss.ha.framework.interfaces.ClusterNode

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.