summaryrefslogtreecommitdiff
path: root/qpid/java
diff options
context:
space:
mode:
authorRobert Godfrey <rgodfrey@apache.org>2015-04-12 15:09:38 +0000
committerRobert Godfrey <rgodfrey@apache.org>2015-04-12 15:09:38 +0000
commit7fba002cd5acb236c7417a44ed7ef330eba84529 (patch)
tree25bb29997175c3443c1cc50530a6dac2e67bfc48 /qpid/java
parent3a7a946e952545d34966a5569839b631df92e448 (diff)
downloadqpid-python-7fba002cd5acb236c7417a44ed7ef330eba84529.tar.gz
QPID-5818 : [Java Broker] creating children from within the configuration thread leads to deadlock as the configuration thread blocks waiting for a task which cannot be executed because it needs the config thread. Instead use asynchronous child creation.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1673017 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/java')
-rw-r--r--qpid/java/bdbstore/src/main/java/org/apache/qpid/server/virtualhost/berkeleydb/BDBHAReplicaVirtualHostImpl.java8
-rw-r--r--qpid/java/bdbstore/src/main/java/org/apache/qpid/server/virtualhostnode/berkeleydb/BDBHAVirtualHostNodeImpl.java6
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/AbstractConfiguredObject.java5
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/virtualhostnode/RedirectingVirtualHostImpl.java8
4 files changed, 13 insertions, 14 deletions
diff --git a/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/virtualhost/berkeleydb/BDBHAReplicaVirtualHostImpl.java b/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/virtualhost/berkeleydb/BDBHAReplicaVirtualHostImpl.java
index b1444d0f17..f68532b1d8 100644
--- a/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/virtualhost/berkeleydb/BDBHAReplicaVirtualHostImpl.java
+++ b/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/virtualhost/berkeleydb/BDBHAReplicaVirtualHostImpl.java
@@ -27,6 +27,8 @@ import java.util.Set;
import java.util.UUID;
import java.util.concurrent.ScheduledFuture;
+import com.google.common.util.concurrent.ListenableFuture;
+
import org.apache.qpid.server.connection.IConnectionRegistry;
import org.apache.qpid.server.exchange.ExchangeImpl;
import org.apache.qpid.server.logging.EventLogger;
@@ -121,9 +123,9 @@ public class BDBHAReplicaVirtualHostImpl extends AbstractConfiguredObject<BDBHAR
}
@Override
- protected <C extends ConfiguredObject> C addChild(final Class<C> childClass,
- final Map<String, Object> attributes,
- final ConfiguredObject... otherParents)
+ protected <C extends ConfiguredObject> ListenableFuture<C> addChildAsync(final Class<C> childClass,
+ final Map<String, Object> attributes,
+ final ConfiguredObject... otherParents)
{
throwUnsupportedForReplica();
return null;
diff --git a/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/virtualhostnode/berkeleydb/BDBHAVirtualHostNodeImpl.java b/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/virtualhostnode/berkeleydb/BDBHAVirtualHostNodeImpl.java
index 20c59ddf6a..9b5aef5405 100644
--- a/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/virtualhostnode/berkeleydb/BDBHAVirtualHostNodeImpl.java
+++ b/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/virtualhostnode/berkeleydb/BDBHAVirtualHostNodeImpl.java
@@ -276,14 +276,14 @@ public class BDBHAVirtualHostNodeImpl extends AbstractVirtualHostNode<BDBHAVirtu
@SuppressWarnings({ "rawtypes", "unchecked" })
@Override
- protected <C extends ConfiguredObject> C addChild(Class<C> childClass, Map<String, Object> attributes,
+ protected <C extends ConfiguredObject> ListenableFuture<C> addChildAsync(Class<C> childClass, Map<String, Object> attributes,
ConfiguredObject... otherParents)
{
if(childClass == VirtualHost.class)
{
- return (C) getObjectFactory().create(VirtualHost.class, attributes, this);
+ return getObjectFactory().createAsync(childClass, attributes, this);
}
- return super.addChild(childClass, attributes, otherParents);
+ return super.addChildAsync(childClass, attributes, otherParents);
}
@Override
diff --git a/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/AbstractConfiguredObject.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/AbstractConfiguredObject.java
index 731cfd0895..262b0c2e9c 100644
--- a/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/AbstractConfiguredObject.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/AbstractConfiguredObject.java
@@ -1696,11 +1696,6 @@ public abstract class AbstractConfiguredObject<X extends ConfiguredObject<X>> im
}
- protected <C extends ConfiguredObject> C addChild(Class<C> childClass, Map<String, Object> attributes, ConfiguredObject... otherParents)
- {
- throw new UnsupportedOperationException();
- }
-
protected <C extends ConfiguredObject> ListenableFuture<C> addChildAsync(Class<C> childClass, Map<String, Object> attributes, ConfiguredObject... otherParents)
{
throw new UnsupportedOperationException();
diff --git a/qpid/java/broker-core/src/main/java/org/apache/qpid/server/virtualhostnode/RedirectingVirtualHostImpl.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/virtualhostnode/RedirectingVirtualHostImpl.java
index b6ace28dd2..8f48a8dc57 100644
--- a/qpid/java/broker-core/src/main/java/org/apache/qpid/server/virtualhostnode/RedirectingVirtualHostImpl.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/virtualhostnode/RedirectingVirtualHostImpl.java
@@ -28,6 +28,8 @@ import java.util.Set;
import java.util.UUID;
import java.util.concurrent.ScheduledFuture;
+import com.google.common.util.concurrent.ListenableFuture;
+
import org.apache.qpid.server.connection.IConnectionRegistry;
import org.apache.qpid.server.exchange.ExchangeImpl;
import org.apache.qpid.server.logging.EventLogger;
@@ -121,9 +123,9 @@ class RedirectingVirtualHostImpl
}
@Override
- protected <C extends ConfiguredObject> C addChild(final Class<C> childClass,
- final Map<String, Object> attributes,
- final ConfiguredObject... otherParents)
+ protected <C extends ConfiguredObject> ListenableFuture<C> addChildAsync(final Class<C> childClass,
+ final Map<String, Object> attributes,
+ final ConfiguredObject... otherParents)
{
throwUnsupportedForRedirector();
return null;