[hornetq-commits] JBoss hornetq SVN: r10575 - in branches/Branch_2_2_EAP/src/main/org/hornetq/core: transaction and 1 other directories.

do-not-reply at jboss.org do-not-reply at jboss.org
Fri Apr 29 09:42:39 EDT 2011


Author: clebert.suconic at jboss.com
Date: 2011-04-29 09:42:38 -0400 (Fri, 29 Apr 2011)
New Revision: 10575

Modified:
   branches/Branch_2_2_EAP/src/main/org/hornetq/core/client/impl/ClientSessionFactoryImpl.java
   branches/Branch_2_2_EAP/src/main/org/hornetq/core/client/impl/Topology.java
   branches/Branch_2_2_EAP/src/main/org/hornetq/core/transaction/Transaction.java
   branches/Branch_2_2_EAP/src/main/org/hornetq/core/transaction/impl/TransactionImpl.java
Log:
Several fixes for testsuite = ClientSessionFActoryImpl = JBPAPP-6420, Topology = JBPAPP-6421, Transaction = JBPAPP-6422

Modified: branches/Branch_2_2_EAP/src/main/org/hornetq/core/client/impl/ClientSessionFactoryImpl.java
===================================================================
--- branches/Branch_2_2_EAP/src/main/org/hornetq/core/client/impl/ClientSessionFactoryImpl.java	2011-04-28 23:03:27 UTC (rev 10574)
+++ branches/Branch_2_2_EAP/src/main/org/hornetq/core/client/impl/ClientSessionFactoryImpl.java	2011-04-29 13:42:38 UTC (rev 10575)
@@ -358,20 +358,13 @@
    // inconsistencies
    public void removeSession(final ClientSessionInternal session, boolean failingOver)
    {
-      if (!failingOver)
+      synchronized (createSessionLock)
       {
-         synchronized (createSessionLock)
+         synchronized (failoverLock)
          {
-            synchronized (failoverLock)
-            {
-               sessions.remove(session);
-            }
+            sessions.remove(session);
          }
       }
-      else
-      {
-         sessions.remove(session);
-      }
    }
 
    public void connectionReadyForWrites(final Object connectionID, final boolean ready)

Modified: branches/Branch_2_2_EAP/src/main/org/hornetq/core/client/impl/Topology.java
===================================================================
--- branches/Branch_2_2_EAP/src/main/org/hornetq/core/client/impl/Topology.java	2011-04-28 23:03:27 UTC (rev 10574)
+++ branches/Branch_2_2_EAP/src/main/org/hornetq/core/client/impl/Topology.java	2011-04-29 13:42:38 UTC (rev 10575)
@@ -103,7 +103,11 @@
    public void sendTopology(ClusterTopologyListener listener)
    {
       int count = 0;
-      Map<String, TopologyMember> copy = new HashMap<String, TopologyMember>(topology);
+      Map<String, TopologyMember> copy;
+      synchronized (this)
+      {
+         copy = new HashMap<String, TopologyMember>(topology);
+      }
       for (Map.Entry<String, TopologyMember> entry : copy.entrySet())
       {
          listener.nodeUP(entry.getKey(), entry.getValue().getConnector(), ++count == copy.size());

Modified: branches/Branch_2_2_EAP/src/main/org/hornetq/core/transaction/Transaction.java
===================================================================
--- branches/Branch_2_2_EAP/src/main/org/hornetq/core/transaction/Transaction.java	2011-04-28 23:03:27 UTC (rev 10574)
+++ branches/Branch_2_2_EAP/src/main/org/hornetq/core/transaction/Transaction.java	2011-04-29 13:42:38 UTC (rev 10575)
@@ -59,8 +59,6 @@
 
    void addOperation(TransactionOperation sync);
 
-   void removeOperation(TransactionOperation sync);
-
    public List<TransactionOperation> getAllOperations();
    
    boolean hasTimedOut(long currentTime, int defaultTimeout);

Modified: branches/Branch_2_2_EAP/src/main/org/hornetq/core/transaction/impl/TransactionImpl.java
===================================================================
--- branches/Branch_2_2_EAP/src/main/org/hornetq/core/transaction/impl/TransactionImpl.java	2011-04-28 23:03:27 UTC (rev 10574)
+++ branches/Branch_2_2_EAP/src/main/org/hornetq/core/transaction/impl/TransactionImpl.java	2011-04-29 13:42:38 UTC (rev 10575)
@@ -436,20 +436,14 @@
       operations.add(operation);
    }
 
-   public void removeOperation(final TransactionOperation operation)
-   {
-      checkCreateOperations();
-
-      operations.remove(operation);
-   }
-
    public int getOperationsCount()
    {
       return operations.size();
    }
 
-   public List<TransactionOperation> getAllOperations() {
-      return operations;
+   public synchronized List<TransactionOperation> getAllOperations() 
+   {
+      return new ArrayList<TransactionOperation>(operations);
    }
    
    public void putProperty(final int index, final Object property)
@@ -495,7 +489,7 @@
       return new TransactionImpl(this);
    }
 
-   public void afterCommit()
+   public synchronized void afterCommit()
    {
       if (operations != null)
       {



More information about the hornetq-commits mailing list