From 80fcc568bbf013690af4d54925b46892461832a2 Mon Sep 17 00:00:00 2001 From: Robert Godfrey Date: Mon, 28 Apr 2014 15:45:08 +0000 Subject: QPID-5679 : Address review comments from Alex Rudyy git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1590686 13f79535-47bb-0310-9956-ffa450edef68 --- .../server/model/AbstractConfiguredObject.java | 3 +- .../org/apache/qpid/server/queue/AMQQueue.java | 56 +--------------------- .../apache/qpid/server/queue/AbstractQueue.java | 24 +++++----- 3 files changed, 15 insertions(+), 68 deletions(-) (limited to 'qpid/java') 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 73fc59e057..3c2763575f 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 @@ -514,8 +514,7 @@ public abstract class AbstractConfiguredObject> im } } - public void - validate() + public void validate() { } diff --git a/qpid/java/broker-core/src/main/java/org/apache/qpid/server/queue/AMQQueue.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/queue/AMQQueue.java index f516013c2d..4b59a0d923 100644 --- a/qpid/java/broker-core/src/main/java/org/apache/qpid/server/queue/AMQQueue.java +++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/queue/AMQQueue.java @@ -46,43 +46,24 @@ public interface AMQQueue> void removeBinding(BindingImpl binding); + @Override Collection getBindings(); - int getBindingCount(); - LogSubject getLogSubject(); - long getUnacknowledgedBytes(); - - long getTotalDequeuedMessages(); - - long getTotalEnqueuedMessages(); - VirtualHostImpl getVirtualHost(); + @Override public Collection> getConsumers(); - int getConsumerCount(); - - int getConsumerCountWithCredit(); - - boolean hasExclusiveConsumer(); - boolean isUnused(); boolean isEmpty(); - int getQueueDepthMessages(); - - - long getQueueDepthBytes(); - long getOldestMessageArrivalTime(); boolean isDeleted(); - int delete(); - void requeue(QueueEntry entry); void dequeue(QueueEntry entry); @@ -110,8 +91,6 @@ public interface AMQQueue> */ public List getMessagesRangeOnTheQueue(final long fromPosition, final long toPosition); - void visit(QueueEntryVisitor visitor); - long clearQueue(); /** @@ -126,39 +105,8 @@ public interface AMQQueue> void stop(); Collection getAvailableAttributes(); - Object getAttribute(String attrName); - - /** - * Gets the maximum delivery count. If a message on this queue - * is delivered more than maximumDeliveryCount, the message will be - * routed to the {@link #getAlternateExchange()} (if set), or otherwise - * discarded. 0 indicates that maximum deliver count should not be enforced. - * - * @return maximum delivery count - */ - int getMaximumDeliveryAttempts(); - - /** - * Sets the maximum delivery count. - * - * @param maximumDeliveryCount maximum delivery count - */ - public void setMaximumDeliveryAttempts(final int maximumDeliveryCount); void setNotificationListener(QueueNotificationListener listener); - long getPersistentDequeuedBytes(); - - long getPersistentDequeuedMessages(); - - long getPersistentEnqueuedBytes(); - - long getPersistentEnqueuedMessages(); - - long getTotalDequeuedBytes(); - - long getTotalEnqueuedBytes(); - - long getUnacknowledgedMessages(); } 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 9e1a350d73..041db03a09 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 @@ -171,7 +171,7 @@ public abstract class AbstractQueue> @ManagedAttributeField private ExclusivityPolicy _exclusive; - private Object _exclusiveOwner; // could be connection, session or Principal + private Object _exclusiveOwner; // could be connection, session, Principal or a String for the container name private final Set _notificationChecks = Collections.synchronizedSet(EnumSet.noneOf(NotificationCheck.class)); @@ -245,6 +245,16 @@ public abstract class AbstractQueue> } } + @Override + public void validate() + { + super.validate(); + if (_queueFlowResumeSizeBytes > _queueFlowControlSizeBytes) + { + throw new IllegalConfigurationException("Flow resume size can't be greater than flow control size"); + } + } + protected void onOpen() { super.onOpen(); @@ -360,11 +370,6 @@ public abstract class AbstractQueue> } - if (_queueFlowResumeSizeBytes > _queueFlowControlSizeBytes) - { - throw new IllegalConfigurationException("Flow resume size can't be greater than flow control size"); - } - // Log the creation of this Queue. // The priorities display is toggled on if we set priorities > 0 getEventLogger().message(_logSubject, @@ -1256,7 +1261,7 @@ public abstract class AbstractQueue> return _atomicQueueSize; } - public boolean hasExclusiveConsumer() + private boolean hasExclusiveConsumer() { return _exclusiveSubscriber != null; } @@ -2207,11 +2212,6 @@ public abstract class AbstractQueue> return _maximumDeliveryAttempts; } - public void setMaximumDeliveryAttempts(final int maximumDeliveryAttempts) - { - _maximumDeliveryAttempts = maximumDeliveryAttempts; - } - /** * Checks if there is any notification to send to the listeners */ -- cgit v1.2.1