Author: clebert.suconic(a)jboss.com
Date: 2011-04-29 09:43:08 -0400 (Fri, 29 Apr 2011)
New Revision: 10576
Modified:
trunk/hornetq-core/src/main/java/org/hornetq/core/client/impl/ClientSessionFactoryImpl.java
trunk/hornetq-core/src/main/java/org/hornetq/core/client/impl/Topology.java
trunk/hornetq-core/src/main/java/org/hornetq/core/transaction/Transaction.java
trunk/hornetq-core/src/main/java/org/hornetq/core/transaction/impl/TransactionImpl.java
Log:
Several fixes for testsuite = ClientSessionFActoryImpl = JBPAPP-6420, Topology =
JBPAPP-6421, Transaction = JBPAPP-6422
Modified:
trunk/hornetq-core/src/main/java/org/hornetq/core/client/impl/ClientSessionFactoryImpl.java
===================================================================
---
trunk/hornetq-core/src/main/java/org/hornetq/core/client/impl/ClientSessionFactoryImpl.java 2011-04-29
13:42:38 UTC (rev 10575)
+++
trunk/hornetq-core/src/main/java/org/hornetq/core/client/impl/ClientSessionFactoryImpl.java 2011-04-29
13:43:08 UTC (rev 10576)
@@ -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: trunk/hornetq-core/src/main/java/org/hornetq/core/client/impl/Topology.java
===================================================================
--- trunk/hornetq-core/src/main/java/org/hornetq/core/client/impl/Topology.java 2011-04-29
13:42:38 UTC (rev 10575)
+++ trunk/hornetq-core/src/main/java/org/hornetq/core/client/impl/Topology.java 2011-04-29
13:43:08 UTC (rev 10576)
@@ -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: trunk/hornetq-core/src/main/java/org/hornetq/core/transaction/Transaction.java
===================================================================
---
trunk/hornetq-core/src/main/java/org/hornetq/core/transaction/Transaction.java 2011-04-29
13:42:38 UTC (rev 10575)
+++
trunk/hornetq-core/src/main/java/org/hornetq/core/transaction/Transaction.java 2011-04-29
13:43:08 UTC (rev 10576)
@@ -59,8 +59,6 @@
void addOperation(TransactionOperation sync);
- void removeOperation(TransactionOperation sync);
-
public List<TransactionOperation> getAllOperations();
boolean hasTimedOut(long currentTime, int defaultTimeout);
Modified:
trunk/hornetq-core/src/main/java/org/hornetq/core/transaction/impl/TransactionImpl.java
===================================================================
---
trunk/hornetq-core/src/main/java/org/hornetq/core/transaction/impl/TransactionImpl.java 2011-04-29
13:42:38 UTC (rev 10575)
+++
trunk/hornetq-core/src/main/java/org/hornetq/core/transaction/impl/TransactionImpl.java 2011-04-29
13:43:08 UTC (rev 10576)
@@ -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)
{
Show replies by date