Package org.jboss.ha.framework.interfaces

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


         return;
      }

      Context context = bindings.getContext();

      FamilyClusterInfo fci = beanClusteringInfo.getFamilyWrapper().get();
      //JBPAPP-10211 hack -> targetsCopy
      final List targetsCopy = fci.getTargets();
      final long viewIDCopy = fci.getCurrentViewId();
      String familyName = fci.getFamilyName();
      log.debug("Cluster topology changed for family " + familyName + " new view id " + fci.getCurrentViewId()
            + " - Updating JNDI bindings for container " + beanClusteringInfo.getContainerName());

      for (JndiReferenceBinding binding : bindings.getDefaultRemoteBindings())
      {
         RefAddr refAddr = getFirstRefAddr(binding.getReference(),
               ClusteredProxyFactoryReferenceAddressTypes.REF_ADDR_TYPE_CLUSTER_FAMILY_NAME);
         if (refAddr != null && familyName.equals(refAddr.getContent()))
         {
            redecorateReferenceForClusteringTargets(binding.getReference(), fci);
            rebind(context, binding.getJndiName(), binding.getReference());
         }

         // The remote proxyfactory in JNDI too needs to be updated with the changes in the
         // clustering family. This involves unbinding the remote proxyfactory from JNDI,
         // creating a new proxy for the proxyfactory with this new FamilyCluster info
         // and finally binding this new proxy for the proxyfactory to the JNDI
         String proxyFactoryKey = this.getSingleRequiredRefAddr(binding.getReference(),
               ProxyFactoryReferenceAddressTypes.REF_ADDR_TYPE_PROXY_FACTORY_REGISTRY_KEY);
         // first create a new proxy. if we run into problems creating a new proxy,
         // let's NOT unbind the existing one since a change in topology should not
         // result in loss of proxy factory
         ProxyFactory existingProxyFactoryInJNDI = null;
         boolean gotJNDIRef = false;
         try
         {
            existingProxyFactoryInJNDI = (ProxyFactory) context.lookup(proxyFactoryKey);
            gotJNDIRef = true;
         }
         catch (NamingException ne)
         {
            // ignore and skip. If there is not proxyfactory bound or if there is some other
            // issue related to naming, let's not try to "update" the proxy factory.
            log.debug("Could not update the cluster topology changes to proxyfactory at key " + proxyFactoryKey);
            continue;
         } finally{
             if(gotJNDIRef){
                 List currentTargets = fci.getTargets();
                 if(currentTargets.containsAll(targetsCopy) && targetsCopy.containsAll(currentTargets)){
                     //no nothing?
                 } else {
                     ClusteringTargetsRepository.initTarget(fci.getFamilyName(), targetsCopy, viewIDCopy);
                 }
             }
         }
         // create a new proxy to proxyfactory with the available information in JNDI Reference,
         // the previously bound proxy to the proxyfactory and the beanClusteringInfo which has
View Full Code Here


         throw new RuntimeException("Could not load loadbalancer policy " + lbpClass
               + " while creating a proxy to remote proxyfactory", e);
      }

      FamilyWrapper wrapper = bci.getFamilyWrapper();
      FamilyClusterInfo familyClusterInfo = wrapper.get();
      log.debug("Remote proxyfactory for key " + proxyFactoryKey + " will be associated with family name "
            + familyClusterInfo.getFamilyName() + " view id " + familyClusterInfo.getCurrentViewId()
            + " with available targets " + familyClusterInfo.getTargets());

      Class<ProxyFactory>[] interfaces = this.getAllProxyFactoryInterfaces((Class<ProxyFactory>) proxyFactory
            .getClass());
      Interceptor[] interceptors =
      {IsLocalProxyFactoryInterceptor.singleton, ClusterChooserInterceptor.singleton, InvokeRemoteInterceptor.singleton};
View Full Code Here

      addRefAddrToReference(ref, partitionRef);
      RefAddr lbpRef = new StringRefAddr(
            ClusteredProxyFactoryReferenceAddressTypes.REF_ADDR_TYPE_CLUSTER_PROXY_FACTORY_LOAD_BALANCE_POLICY, bci
                  .getHomeLoadBalancePolicy().getName());
      addRefAddrToReference(ref, lbpRef);
      FamilyClusterInfo fci = bci.getFamilyWrapper().get();
      RefAddr familyNameRef = new StringRefAddr(
            ClusteredProxyFactoryReferenceAddressTypes.REF_ADDR_TYPE_CLUSTER_FAMILY_NAME, fci.getFamilyName());
      addRefAddrToReference(ref, familyNameRef);

      decorateReferenceForClusteringTargets(ref, fci);
   }
View Full Code Here

         return;
      }
     
      Context context = bindings.getContext();
     
      FamilyClusterInfo fci = beanClusteringInfo.getFamilyWrapper().get();    
      String familyName = fci.getFamilyName();
     
      for (JndiReferenceBinding binding : bindings.getDefaultRemoteBindings())
      {
         RefAddr refAddr = getFirstRefAddr(binding.getReference(), ClusteredProxyFactoryReferenceAddressTypes.REF_ADDR_TYPE_CLUSTER_FAMILY_NAME);
         if (refAddr != null && familyName.equals(refAddr.getContent()))
View Full Code Here

     
      RefAddr partitionRef = new StringRefAddr(ClusteredProxyFactoryReferenceAddressTypes.REF_ADDR_TYPE_CLUSTER_PARTITION_NAME, bci.getPartitionName());
      addRefAddrToReference(ref, partitionRef);
      RefAddr lbpRef = new StringRefAddr(ClusteredProxyFactoryReferenceAddressTypes.REF_ADDR_TYPE_CLUSTER_PROXY_FACTORY_LOAD_BALANCE_POLICY, bci.getHomeLoadBalancePolicy().getName());
      addRefAddrToReference(ref, lbpRef);
      FamilyClusterInfo fci = bci.getFamilyWrapper().get();
      RefAddr familyNameRef = new StringRefAddr(ClusteredProxyFactoryReferenceAddressTypes.REF_ADDR_TYPE_CLUSTER_FAMILY_NAME,
                                                fci.getFamilyName());
      addRefAddrToReference(ref, familyNameRef);
     
      decorateReferenceForClusteringTargets(ref, fci);
   }
View Full Code Here

         return;
      }
     
      Context context = bindings.getContext();
     
      FamilyClusterInfo fci = beanClusteringInfo.getFamilyWrapper().get();    
      String familyName = fci.getFamilyName();
     
      for (JndiReferenceBinding binding : bindings.getDefaultRemoteBindings())
      {
         RefAddr refAddr = getFirstRefAddr(binding.getReference(), ClusteredProxyFactoryReferenceAddressTypes.REF_ADDR_TYPE_CLUSTER_FAMILY_NAME);
         if (refAddr != null && familyName.equals(refAddr.getContent()))
View Full Code Here

     
      RefAddr partitionRef = new StringRefAddr(ClusteredProxyFactoryReferenceAddressTypes.REF_ADDR_TYPE_CLUSTER_PARTITION_NAME, bci.getPartitionName());
      addRefAddrToReference(ref, partitionRef);
      RefAddr lbpRef = new StringRefAddr(ClusteredProxyFactoryReferenceAddressTypes.REF_ADDR_TYPE_CLUSTER_PROXY_FACTORY_LOAD_BALANCE_POLICY, bci.getHomeLoadBalancePolicy().getName());
      addRefAddrToReference(ref, lbpRef);
      FamilyClusterInfo fci = bci.getFamilyWrapper().get();
      RefAddr familyNameRef = new StringRefAddr(ClusteredProxyFactoryReferenceAddressTypes.REF_ADDR_TYPE_CLUSTER_FAMILY_NAME,
                                                fci.getFamilyName());
      addRefAddrToReference(ref, familyNameRef);
     
      decorateReferenceForClusteringTargets(ref, fci);
   }
View Full Code Here

         return;
      }
     
      Context context = bindings.getContext();
     
      FamilyClusterInfo fci = beanClusteringInfo.getFamilyWrapper().get();    
      String familyName = fci.getFamilyName();
     
      for (JndiReferenceBinding binding : bindings.getDefaultRemoteBindings())
      {
         RefAddr refAddr = getFirstRefAddr(binding.getReference(), ClusteredProxyFactoryReferenceAddressTypes.REF_ADDR_TYPE_CLUSTER_FAMILY_NAME);
         if (refAddr != null && familyName.equals(refAddr.getContent()))
View Full Code Here

     
      RefAddr partitionRef = new StringRefAddr(ClusteredProxyFactoryReferenceAddressTypes.REF_ADDR_TYPE_CLUSTER_PARTITION_NAME, bci.getPartitionName());
      addRefAddrToReference(ref, partitionRef);
      RefAddr lbpRef = new StringRefAddr(ClusteredProxyFactoryReferenceAddressTypes.REF_ADDR_TYPE_CLUSTER_PROXY_FACTORY_LOAD_BALANCE_POLICY, bci.getHomeLoadBalancePolicy().getName());
      addRefAddrToReference(ref, lbpRef);
      FamilyClusterInfo fci = bci.getFamilyWrapper().get();
      RefAddr familyNameRef = new StringRefAddr(ClusteredProxyFactoryReferenceAddressTypes.REF_ADDR_TYPE_CLUSTER_FAMILY_NAME,
                                                fci.getFamilyName());
      addRefAddrToReference(ref, familyNameRef);
     
      decorateReferenceForClusteringTargets(ref, fci);
   }
View Full Code Here

         {
            proxyFamilyName = getProxyFamilyName(mi);
         }
        
         // Clear the targets to simulate exhausting them all
         FamilyClusterInfo info = ClusteringTargetsRepository.getFamilyClusterInfo(proxyFamilyName);
         List targets = info.getTargets();
         for (Iterator it = targets.iterator(); it.hasNext(); )
            info.removeDeadTarget(it.next());
        
         throw new ServiceUnavailableException("Service unavailable",
                                               new Exception("Test"));
      }
View Full Code Here

TOP

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

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.