[jboss-cvs] JBossAS SVN: r77985 - in branches/JBPAPP_4_2_0_GA_CP: cluster/src/main/org/jboss/invocation/jrmp/interfaces and 2 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Sep 4 11:51:21 EDT 2008


Author: galder.zamarreno at jboss.com
Date: 2008-09-04 11:51:21 -0400 (Thu, 04 Sep 2008)
New Revision: 77985

Modified:
   branches/JBPAPP_4_2_0_GA_CP/cluster/src/main/org/jboss/ha/framework/interfaces/TransactionSticky.java
   branches/JBPAPP_4_2_0_GA_CP/cluster/src/main/org/jboss/invocation/jrmp/interfaces/JRMPInvokerProxyHA.java
   branches/JBPAPP_4_2_0_GA_CP/cluster/src/main/org/jboss/invocation/unified/interfaces/UnifiedInvokerHAProxy.java
   branches/JBPAPP_4_2_0_GA_CP/testsuite/src/main/org/jboss/test/cluster/invokerha/AbstractInvokerHaTransactionSticky.java
   branches/JBPAPP_4_2_0_GA_CP/testsuite/src/main/org/jboss/test/cluster/invokerha/InvokerHaInfrastructure.java
   branches/JBPAPP_4_2_0_GA_CP/testsuite/src/main/org/jboss/test/cluster/invokerha/JRMPInvokerHaMockUtils.java
   branches/JBPAPP_4_2_0_GA_CP/testsuite/src/main/org/jboss/test/cluster/invokerha/JRMPInvokerHaTransactionStickyUnitTestCase.java
   branches/JBPAPP_4_2_0_GA_CP/testsuite/src/main/org/jboss/test/cluster/invokerha/UnifiedInvokerHaMockUtils.java
   branches/JBPAPP_4_2_0_GA_CP/testsuite/src/main/org/jboss/test/cluster/invokerha/UnifiedInvokerHaTransactionStickyUnitTestCase.java
   branches/JBPAPP_4_2_0_GA_CP/testsuite/src/main/org/jboss/test/cluster/invokerha/UnifiedInvokerHaUnitTestCase.java
Log:
[JBPAPP-1154] If a sticky target is not available any more, we fail now because failover is not allowed (transaction already active in one node). Added tests that check behaivour when nodes are shutdown while in the middle of a transaction sticky invocation.

Modified: branches/JBPAPP_4_2_0_GA_CP/cluster/src/main/org/jboss/ha/framework/interfaces/TransactionSticky.java
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/cluster/src/main/org/jboss/ha/framework/interfaces/TransactionSticky.java	2008-09-04 15:43:52 UTC (rev 77984)
+++ branches/JBPAPP_4_2_0_GA_CP/cluster/src/main/org/jboss/ha/framework/interfaces/TransactionSticky.java	2008-09-04 15:51:21 UTC (rev 77985)
@@ -49,7 +49,7 @@
       
       if (trace)
       {
-         log.trace("transaction sticky load balance policy delegates to: " + delegateLoadBalancePolicy);
+         log.trace("Transaction sticky load balance policy delegates to: " + delegateLoadBalancePolicy);
       }
    }
 
@@ -66,11 +66,11 @@
    {
       trace = log.isTraceEnabled();
       Object txStickyTarget = routingDecision.getTransientValue("TX_STICKY_TARGET");
-      if (txStickyTarget != null && clusterFamily.getTargets().contains(txStickyTarget))
+      if (txStickyTarget != null)
       {
          if (trace) 
          {
-            log.trace("transaction bound target exists: " + txStickyTarget);
+            log.trace("Transaction bound target exists: " + txStickyTarget);
          } 
          
          return txStickyTarget;
@@ -102,7 +102,7 @@
       
       if (trace) 
       {
-         log.trace("new target chosen: " + newTarget);
+         log.trace("New target chosen: " + newTarget);
       }
       
       invocation.getTransientPayload().put("TX_STICKY_TARGET", newTarget);

Modified: branches/JBPAPP_4_2_0_GA_CP/cluster/src/main/org/jboss/invocation/jrmp/interfaces/JRMPInvokerProxyHA.java
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/cluster/src/main/org/jboss/invocation/jrmp/interfaces/JRMPInvokerProxyHA.java	2008-09-04 15:43:52 UTC (rev 77984)
+++ branches/JBPAPP_4_2_0_GA_CP/cluster/src/main/org/jboss/invocation/jrmp/interfaces/JRMPInvokerProxyHA.java	2008-09-04 15:51:21 UTC (rev 77985)
@@ -138,11 +138,24 @@
          {
             if (trace)
             {
-               log.trace("checking tx failover authorisation map with tpc " + tpc);
+               log.trace("Checking tx failover authorisation map with tpc " + tpc);
             }
             
-            /* if the map contains the tpc, then we can't allow a failover */
-            return ! txFailoverAuthorizations.containsKey (tpc);               
+            /* If the map contains the tpc, then we can't allow a failover */
+            boolean failoverAuthorised = ! txFailoverAuthorizations.containsKey(tpc);
+            
+            if (failoverAuthorised)
+            {
+               if (trace) 
+               {
+                  log.trace("Failover authorised, so we remove the sticky target associated with tpc " + tpc);
+               }
+               
+               txFailoverAuthorizations.put(tpc, null);
+               invocation.getTransientPayload().put("TX_STICKY_TARGET", null);
+            }
+            
+            return failoverAuthorised;            
          }
       }
       else
@@ -160,14 +173,14 @@
          {
             if (trace)
             {
-               log.trace("after reaching the server, transaction propagation context (tpc) is " + tpc);
+               log.trace("After reaching the server, transaction propagation context (tpc) is " + tpc);
             }
             
             Object stickyTarget = invocation.getTransientValue("TX_STICKY_TARGET");
             
             if (trace && stickyTarget != null)
             {
-               log.trace("remember transaction bound target[" + stickyTarget + "] for tpc[" + tpc + "]");
+               log.trace("Remember transaction bound target[" + stickyTarget + "] for tpc[" + tpc + "]");
             }
             
             txFailoverAuthorizations.put(tpc, stickyTarget);
@@ -398,7 +411,7 @@
     * target associated to it and add it to the invocation transient payload so 
     * that the load balance policy can choose the right target.
     */
-   protected void putIfExistsTransactionTarget(Invocation invocation, Object tpc)
+   protected void putIfExistsTransactionTarget(Invocation invocation, Object tpc) throws GenericClusteringException
    {
       if (tpc != null)
       {
@@ -406,19 +419,27 @@
          {
             if (trace)
             {
-               log.trace("in the proxy, transaction propagation context (tpc) is " + tpc);
+               log.trace("In the proxy, transaction propagation context (tpc) is " + tpc);
             }
 
             Object stickyTarget = txFailoverAuthorizations.get(tpc);
                
             if (stickyTarget != null)
             {
-               if (trace)
+               if (familyClusterInfo.getTargets().contains(stickyTarget))
                {
-                  log.trace("put transaction bound target [" + stickyTarget + "] into transient payload");
+                  if (trace) 
+                  {
+                     log.trace("Put transaction bound target into transient payload: " + stickyTarget);                  
+                  }
+                  
+                  invocation.getTransientPayload().put("TX_STICKY_TARGET", stickyTarget);                  
                }
-               
-               invocation.getTransientPayload().put("TX_STICKY_TARGET", stickyTarget);
+               else
+               {
+                  throw new GenericClusteringException(GenericClusteringException.COMPLETED_YES, 
+                     "Transaction sticky target is no longer available, so invocation needs to be halted");
+               }
             }
          }
       }

Modified: branches/JBPAPP_4_2_0_GA_CP/cluster/src/main/org/jboss/invocation/unified/interfaces/UnifiedInvokerHAProxy.java
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/cluster/src/main/org/jboss/invocation/unified/interfaces/UnifiedInvokerHAProxy.java	2008-09-04 15:43:52 UTC (rev 77984)
+++ branches/JBPAPP_4_2_0_GA_CP/cluster/src/main/org/jboss/invocation/unified/interfaces/UnifiedInvokerHAProxy.java	2008-09-04 15:51:21 UTC (rev 77985)
@@ -49,7 +49,6 @@
 import org.jboss.remoting.serialization.IMarshalledValue;
 import org.jboss.tm.TransactionPropagationContextFactory;
 import org.jboss.tm.TransactionPropagationContextUtil;
-import org.jboss.util.Strings;
 
 
 /**
@@ -112,8 +111,27 @@
             log.trace("Checking tx failover authorisation map with tpc " + tpc);
          }
 
-         /* if the map contains the tpc, then we can't allow a failover */
-         return ! txFailoverAuthorizations.containsKey(tpc);
+         /* Synchronise on tpc because we're updating the map if it doesn't 
+          * contain tpc upon failover (putIfAbsent type of operation). This is 
+          * still needed even if the collection is synchronized. */
+         synchronized(tpc)
+         {
+            /* If the map contains the tpc, then we can't allow a failover */
+            boolean failoverAuthorised = ! txFailoverAuthorizations.containsKey(tpc);
+            
+            if (failoverAuthorised)
+            {
+               if (trace) 
+               {
+                  log.trace("Failover authorised, so we remove the sticky target associated with tpc " + tpc);
+               }
+               
+               txFailoverAuthorizations.put(tpc, null);
+               invocation.getTransientPayload().put("TX_STICKY_TARGET", null);
+            }
+            
+            return failoverAuthorised;         
+         }
       }
       
       return true;
@@ -193,9 +211,6 @@
       int failoverCounter = 0;
       invocation.setValue("FAILOVER_COUNTER", new Integer(failoverCounter), PayloadKey.AS_IS);
 
-      // If transaction sticky, put chosen target
-      putIfExistsTransactionTarget(invocation, getTransactionPropagationContext());      
-      
       Object response = null;
       Exception lastException = null;
 
@@ -213,6 +228,9 @@
                log.trace("Client cluster view id: " + familyClusterInfo.getCurrentViewId());
                log.trace(printPossibleTargets());
             }
+            
+            // If transaction sticky, put chosen target
+            putIfExistsTransactionTarget(invocation, getTransactionPropagationContext());      
 
             Client clientInstance = getClient(invocation);
 
@@ -537,9 +555,12 @@
     * Called at the beginning of the invocation to check whether the current tpc
     * is already present in the tx failover map. If it is, get the chosen 
     * target associated to it and add it to the invocation transient payload so 
-    * that the load balance policy can choose the right target.
+    * that the load balance policy can choose the right target  as long as the 
+    * target is available in the cluster family. Otherwise, invocation needs to 
+    * be halted because a previous invocation within the transaction succeeded 
+    * (tx sticky target was set), so we can't failover to a different node.
     */
-   protected void putIfExistsTransactionTarget(Invocation invocation, Object tpc)
+   protected void putIfExistsTransactionTarget(Invocation invocation, Object tpc) throws GenericClusteringException
    {
       if (tpc != null)
       {
@@ -553,12 +574,20 @@
             
          if (stickyTarget != null)
          {
-            if (trace)
+            if (familyClusterInfo.getTargets().contains(stickyTarget))
             {
-               log.trace("Put transaction bound target [" + stickyTarget + "] into transient payload");
+               if (trace) 
+               {
+                  log.trace("Put transaction bound target into transient payload: " + stickyTarget);                  
+               }
+               
+               invocation.getTransientPayload().put("TX_STICKY_TARGET", stickyTarget);                  
             }
-            
-            invocation.getTransientPayload().put("TX_STICKY_TARGET", stickyTarget);
+            else
+            {
+               throw new GenericClusteringException(GenericClusteringException.COMPLETED_YES, 
+                  "Transaction sticky target is no longer available, so invocation needs to be halted");
+            }
          }
       }
    }

Modified: branches/JBPAPP_4_2_0_GA_CP/testsuite/src/main/org/jboss/test/cluster/invokerha/AbstractInvokerHaTransactionSticky.java
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/testsuite/src/main/org/jboss/test/cluster/invokerha/AbstractInvokerHaTransactionSticky.java	2008-09-04 15:43:52 UTC (rev 77984)
+++ branches/JBPAPP_4_2_0_GA_CP/testsuite/src/main/org/jboss/test/cluster/invokerha/AbstractInvokerHaTransactionSticky.java	2008-09-04 15:51:21 UTC (rev 77985)
@@ -22,17 +22,21 @@
 package org.jboss.test.cluster.invokerha;
 
 import java.rmi.server.UID;
+import java.util.ArrayList;
 import java.util.HashSet;
+import java.util.List;
 import java.util.Set;
 
 import javax.transaction.Transaction;
 
+import org.jboss.ha.framework.interfaces.GenericClusteringException;
 import org.jboss.ha.framework.interfaces.LoadBalancePolicy;
 import org.jboss.ha.framework.interfaces.TransactionStickyFirstAvailable;
 import org.jboss.ha.framework.interfaces.TransactionStickyFirstAvailableIdenticalAllProxies;
 import org.jboss.ha.framework.interfaces.TransactionStickyRandomRobin;
 import org.jboss.ha.framework.interfaces.TransactionStickyRoundRobin;
 import org.jboss.invocation.Invocation;
+import org.jboss.invocation.InvokerProxyHA;
 import org.jboss.logging.Logger;
 import org.jboss.test.cluster.invokerha.InvokerHaTransactionalMockUtils.MockTransaction;
 
@@ -41,7 +45,7 @@
  * 
  * @author <a href="mailto:galder.zamarreno at jboss.com">Galder Zamarreno</a>
  */
-public class AbstractInvokerHaTransactionSticky extends AbstractInvokerHa
+public abstract class AbstractInvokerHaTransactionSticky extends AbstractInvokerHa
 {
    private static final Logger log = Logger.getLogger(AbstractInvokerHaTransactionSticky.class);
    
@@ -83,6 +87,11 @@
       transactionalSuccessfulCalls(TransactionStickyRandomRobin.class, true);
    }
    
+   public void testTransactionalCallsWithNodeShutdown() throws Exception
+   {
+      transactionalCallsWithNodeShutdown(TransactionStickyRandomRobin.class);
+   }
+   
    public void testSuccessfulCallsRoundRobin() throws Exception
    {
       /* test transaction sticky round robin lbp without transactions, should 
@@ -189,6 +198,26 @@
       
    }
    
+   protected void transactionalCallsWithNodeShutdown(Class<? extends LoadBalancePolicy> policyClass)
+   {
+      log.debug("transactional calls with node shutdown [policy=" + policyClass + "]");
+      
+      try
+      {
+         UID uid = new UID();
+         createNewProxies(0, policyClass, true);
+         transactionalMockUtils.getTpcf().setUid(uid);
+         performTransactionalCallsWithNodeShutdown(null, policyClass);
+      }
+      catch(Exception e)
+      {
+         /* catching to log the error properly (JUnit in eclipse does not show 
+          * correctly exceptions from invokers) and fail */
+         log.error("Error", e);
+         fail();
+      }      
+   }
+   
    protected void successfulCalls(Class<? extends LoadBalancePolicy> policyClass)
    {
       log.debug("successfull calls [policy=" + policyClass);
@@ -252,6 +281,42 @@
       return chosenTargets;
    }
    
+   protected void performTransactionalCallsWithNodeShutdown(Transaction tx,
+         Class<? extends LoadBalancePolicy> policyClass) throws Exception
+   {
+      Invocation inv;
+      
+      Set<Object> chosenTargetsDateTimeTeller = new HashSet<Object>(1);
+      
+      /* create invocation to date time teller */
+      inv = infrastructure.createDateTimeTellerInvocation(tx, null);
+      /* invoke on proxy passing the invocation */
+      log.debug(timeTellerProxy.invoke(inv));
+      /* assert post conditions after invocation */
+      chosenTargetsDateTimeTeller = assertSuccessfulPostConditions(inv, chosenTargetsDateTimeTeller);
+      
+      List<Object> newReplicants = undeployChosenTargetNode(chosenTargetsDateTimeTeller.toArray()[0]);      
+      ((InvokerProxyHA)timeTellerProxy).updateClusterInfo((ArrayList<Object>)newReplicants, 3);
+      
+      inv = infrastructure.createDateTimeTellerInvocation(tx, null);
+      try
+      {
+         log.debug(timeTellerProxy.invoke(inv));
+         fail("Should have thrown an exception because sticky target is no longer available");
+      }
+      catch(Exception e)
+      {
+         log.debug("Expected exception", e);
+         assertTrue(e instanceof GenericClusteringException || e.getCause() instanceof GenericClusteringException);
+      }
+   }
+   
+   /**
+    * Undeploy chosen target from the cluster and return the list of remaining 
+    * targets in cluster.
+    */
+   protected abstract List undeployChosenTargetNode(Object chosenTarget);   
+   
    protected void assertChosenTargetsInBetweenTx(Class<? extends LoadBalancePolicy> policyClass, Set<?> chosenTargetsTx1, Set<?> chosenTargetsTx2, boolean newProxiesInBetweenTransactions)
    {
       if (policyClass.equals(TransactionStickyRoundRobin.class))

Modified: branches/JBPAPP_4_2_0_GA_CP/testsuite/src/main/org/jboss/test/cluster/invokerha/InvokerHaInfrastructure.java
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/testsuite/src/main/org/jboss/test/cluster/invokerha/InvokerHaInfrastructure.java	2008-09-04 15:43:52 UTC (rev 77984)
+++ branches/JBPAPP_4_2_0_GA_CP/testsuite/src/main/org/jboss/test/cluster/invokerha/InvokerHaInfrastructure.java	2008-09-04 15:51:21 UTC (rev 77985)
@@ -286,6 +286,11 @@
       }
    }
    
+   public List<? extends InvokerHA> getReplicants()
+   {
+      return replicants;
+   }
+   
    /**
     * Simulate the deployment of an mbean in a list of invoker endpoints.
     * 

Modified: branches/JBPAPP_4_2_0_GA_CP/testsuite/src/main/org/jboss/test/cluster/invokerha/JRMPInvokerHaMockUtils.java
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/testsuite/src/main/org/jboss/test/cluster/invokerha/JRMPInvokerHaMockUtils.java	2008-09-04 15:43:52 UTC (rev 77984)
+++ branches/JBPAPP_4_2_0_GA_CP/testsuite/src/main/org/jboss/test/cluster/invokerha/JRMPInvokerHaMockUtils.java	2008-09-04 15:51:21 UTC (rev 77985)
@@ -23,6 +23,7 @@
 
 import java.util.ArrayList;
 
+import org.jboss.ha.framework.interfaces.GenericClusteringException;
 import org.jboss.ha.framework.interfaces.LoadBalancePolicy;
 import org.jboss.invocation.Invocation;
 import org.jboss.invocation.Invoker;
@@ -124,7 +125,7 @@
       }
       
       @Override
-      protected void putIfExistsTransactionTarget(Invocation invocation, Object tpc)
+      protected void putIfExistsTransactionTarget(Invocation invocation, Object tpc) throws GenericClusteringException
       {
          InvokerHaFailureType failureType = (InvokerHaFailureType)invocation.getValue("FAILURE_TYPE");
          if (failureType != null)

Modified: branches/JBPAPP_4_2_0_GA_CP/testsuite/src/main/org/jboss/test/cluster/invokerha/JRMPInvokerHaTransactionStickyUnitTestCase.java
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/testsuite/src/main/org/jboss/test/cluster/invokerha/JRMPInvokerHaTransactionStickyUnitTestCase.java	2008-09-04 15:43:52 UTC (rev 77984)
+++ branches/JBPAPP_4_2_0_GA_CP/testsuite/src/main/org/jboss/test/cluster/invokerha/JRMPInvokerHaTransactionStickyUnitTestCase.java	2008-09-04 15:51:21 UTC (rev 77985)
@@ -21,6 +21,9 @@
  */
 package org.jboss.test.cluster.invokerha;
 
+import java.util.List;
+
+import org.jboss.invocation.InvokerHA;
 import org.jboss.test.cluster.invokerha.JRMPInvokerHaUnitTestCase.JRMPInvokerHaFactory;
 import org.jboss.test.cluster.invokerha.AbstractInvokerHaTransactionSticky;
 
@@ -43,6 +46,14 @@
       super.tearDown();
    }   
    
+   @Override
+   protected List undeployChosenTargetNode(Object chosenTarget)
+   {
+      List<? extends InvokerHA> replicants = infrastructure.getReplicants();
+      replicants.remove(chosenTarget);
+      return replicants;
+   }
+   
    public static class JRMPInvokerHaTransactionStickyFactory extends JRMPInvokerHaFactory
    {
       @Override

Modified: branches/JBPAPP_4_2_0_GA_CP/testsuite/src/main/org/jboss/test/cluster/invokerha/UnifiedInvokerHaMockUtils.java
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/testsuite/src/main/org/jboss/test/cluster/invokerha/UnifiedInvokerHaMockUtils.java	2008-09-04 15:43:52 UTC (rev 77984)
+++ branches/JBPAPP_4_2_0_GA_CP/testsuite/src/main/org/jboss/test/cluster/invokerha/UnifiedInvokerHaMockUtils.java	2008-09-04 15:51:21 UTC (rev 77985)
@@ -30,6 +30,7 @@
 import javax.management.MBeanServer;
 import javax.net.SocketFactory;
 
+import org.jboss.ha.framework.interfaces.GenericClusteringException;
 import org.jboss.ha.framework.interfaces.LoadBalancePolicy;
 import org.jboss.invocation.Invocation;
 import org.jboss.invocation.Invoker;
@@ -144,7 +145,7 @@
       }
 
       @Override
-      protected void putIfExistsTransactionTarget(Invocation invocation, Object tpc)
+      protected void putIfExistsTransactionTarget(Invocation invocation, Object tpc) throws GenericClusteringException
       {
          InvokerHaFailureType failureType = (InvokerHaFailureType)invocation.getValue("FAILURE_TYPE");
          if (failureType != null)

Modified: branches/JBPAPP_4_2_0_GA_CP/testsuite/src/main/org/jboss/test/cluster/invokerha/UnifiedInvokerHaTransactionStickyUnitTestCase.java
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/testsuite/src/main/org/jboss/test/cluster/invokerha/UnifiedInvokerHaTransactionStickyUnitTestCase.java	2008-09-04 15:43:52 UTC (rev 77984)
+++ branches/JBPAPP_4_2_0_GA_CP/testsuite/src/main/org/jboss/test/cluster/invokerha/UnifiedInvokerHaTransactionStickyUnitTestCase.java	2008-09-04 15:51:21 UTC (rev 77985)
@@ -21,7 +21,11 @@
  */
 package org.jboss.test.cluster.invokerha;
 
+import java.util.List;
+
+import org.jboss.remoting.InvokerLocator;
 import org.jboss.test.cluster.invokerha.UnifiedInvokerHaUnitTestCase.UnifiedInvokerHaFactory;
+import org.jboss.test.cluster.invokerha.UnifiedInvokerHaUnitTestCase.UnifiedInvokerHaInfrastructure;
 import org.jboss.test.cluster.invokerha.AbstractInvokerHaTransactionSticky;
 
 /**
@@ -43,6 +47,14 @@
       super.tearDown();
    }   
    
+   @Override
+   protected List undeployChosenTargetNode(Object chosenTarget)
+   {
+      List<? extends InvokerLocator> locators = ((UnifiedInvokerHaInfrastructure)infrastructure).getLocators();
+      locators.remove(chosenTarget);
+      return locators;
+   }
+   
    public static class UnifiedInvokerHaTransactionStickyFactory extends UnifiedInvokerHaFactory
    {
       @Override

Modified: branches/JBPAPP_4_2_0_GA_CP/testsuite/src/main/org/jboss/test/cluster/invokerha/UnifiedInvokerHaUnitTestCase.java
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/testsuite/src/main/org/jboss/test/cluster/invokerha/UnifiedInvokerHaUnitTestCase.java	2008-09-04 15:43:52 UTC (rev 77984)
+++ branches/JBPAPP_4_2_0_GA_CP/testsuite/src/main/org/jboss/test/cluster/invokerha/UnifiedInvokerHaUnitTestCase.java	2008-09-04 15:51:21 UTC (rev 77985)
@@ -112,6 +112,8 @@
     */
    public static class UnifiedInvokerHaInfrastructure extends InvokerHaInfrastructure
    {
+      private List<InvokerLocator> locators;
+      
       public UnifiedInvokerHaInfrastructure(int serverCount, InvokerHaFactory invokerHaFactory)
       {
          super(serverCount, invokerHaFactory);
@@ -122,7 +124,7 @@
             throws Exception
       {
          /* convert replicant list into an InvokerLocator list */
-         List<InvokerLocator> locators = new ArrayList<InvokerLocator>(replicants.size());
+         locators = new ArrayList<InvokerLocator>(replicants.size());
          for (InvokerHA replicant : replicants)
          {
             locators.add(((MockUnifiedInvokerHA)replicant).getLocator());
@@ -137,5 +139,10 @@
             replicant.registerBean(targetName, target);         
          }
       }
+      
+      public List<InvokerLocator> getLocators()
+      {
+         return locators;
+      }
    }   
 }
\ No newline at end of file




More information about the jboss-cvs-commits mailing list