From 970be2db6117c8727e7757e062c9694dda1e4542 Mon Sep 17 00:00:00 2001 From: Robert Godfrey Date: Sat, 14 Mar 2015 23:26:24 +0000 Subject: QPID-6428 : Remove explicit call to update store from within AbstractQueue git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1666767 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/qpid/server/queue/AbstractQueue.java | 43 +++++++++------------- 1 file changed, 17 insertions(+), 26 deletions(-) (limited to 'qpid/java') diff --git a/qpid/java/broker-core/src/main/java/org/apache/qpid/server/queue/AbstractQueue.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/queue/AbstractQueue.java index 33b4d59878..486c501772 100644 --- a/qpid/java/broker-core/src/main/java/org/apache/qpid/server/queue/AbstractQueue.java +++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/queue/AbstractQueue.java @@ -3008,40 +3008,31 @@ public abstract class AbstractQueue> @Override public boolean changeAttribute(String name, Object expected, Object desired) throws IllegalStateException, AccessControlException, IllegalArgumentException { - try + if(EXCLUSIVE.equals(name)) { - if(EXCLUSIVE.equals(name)) + ExclusivityPolicy existingPolicy = getExclusive(); + if(super.changeAttribute(name, expected, desired)) { - ExclusivityPolicy existingPolicy = getExclusive(); - if(super.changeAttribute(name, expected, desired)) + try { - try - { - if(existingPolicy != _exclusive) - { - ExclusivityPolicy newPolicy = _exclusive; - _exclusive = existingPolicy; - updateExclusivityPolicy(newPolicy); - } - return true; - } - catch (ExistingConsumerPreventsExclusive existingConsumerPreventsExclusive) + if(existingPolicy != _exclusive) { - throw new IllegalArgumentException("Unable to set exclusivity policy to " + desired + " as an existing combinations of consumers prevents this"); + ExclusivityPolicy newPolicy = _exclusive; + _exclusive = existingPolicy; + updateExclusivityPolicy(newPolicy); } + return true; + } + catch (ExistingConsumerPreventsExclusive existingConsumerPreventsExclusive) + { + throw new IllegalArgumentException("Unable to set exclusivity policy to " + desired + " as an existing combinations of consumers prevents this"); } - return false; - } - - return super.changeAttribute(name, expected, desired); - } - finally - { - if (isDurable() && getState() != State.DELETED) - { - this.getVirtualHost().getDurableConfigurationStore().update(false, asObjectRecord()); } + return false; } + + return super.changeAttribute(name, expected, desired); + } int getMaxAsyncDeliveries() -- cgit v1.2.1