summaryrefslogtreecommitdiff
path: root/java
diff options
context:
space:
mode:
authorRobert Godfrey <rgodfrey@apache.org>2013-04-30 13:40:02 +0000
committerRobert Godfrey <rgodfrey@apache.org>2013-04-30 13:40:02 +0000
commit78a781a1fe5c37f1028dca13dc56ccedc4aec8a2 (patch)
tree51833050ea42a886e213dce521c3577da6f878da /java
parent938adb0e373377ae06c793cd4a3a3c0c001854f1 (diff)
downloadqpid-python-78a781a1fe5c37f1028dca13dc56ccedc4aec8a2.tar.gz
NO-JIRA : remove unused code from the Java Broker
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1477628 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java')
-rw-r--r--java/broker/src/main/java/org/apache/qpid/server/AMQChannel.java15
-rw-r--r--java/broker/src/main/java/org/apache/qpid/server/message/AbstractServerMessageImpl.java5
-rw-r--r--java/broker/src/main/java/org/apache/qpid/server/protocol/v1_0/Message_1_0.java5
-rw-r--r--java/broker/src/main/java/org/apache/qpid/server/protocol/v1_0/Subscription_1_0.java11
-rw-r--r--java/broker/src/main/java/org/apache/qpid/server/queue/FailedDequeueException.java50
-rw-r--r--java/broker/src/main/java/org/apache/qpid/server/queue/MessageCleanupException.java52
-rw-r--r--java/broker/src/main/java/org/apache/qpid/server/queue/QueueEntry.java32
-rw-r--r--java/broker/src/main/java/org/apache/qpid/server/queue/QueueEntryImpl.java52
-rw-r--r--java/broker/src/main/java/org/apache/qpid/server/queue/SimpleAMQQueue.java1
-rw-r--r--java/broker/src/main/java/org/apache/qpid/server/subscription/Subscription.java2
-rw-r--r--java/broker/src/main/java/org/apache/qpid/server/subscription/SubscriptionImpl.java7
-rw-r--r--java/broker/src/main/java/org/apache/qpid/server/subscription/Subscription_0_10.java8
-rw-r--r--java/broker/src/test/java/org/apache/qpid/server/exchange/AbstractHeadersExchangeTestBase.java10
-rw-r--r--java/broker/src/test/java/org/apache/qpid/server/queue/MockQueueEntry.java12
-rw-r--r--java/broker/src/test/java/org/apache/qpid/server/subscription/MockSubscription.java7
15 files changed, 4 insertions, 265 deletions
diff --git a/java/broker/src/main/java/org/apache/qpid/server/AMQChannel.java b/java/broker/src/main/java/org/apache/qpid/server/AMQChannel.java
index ab4ca81d05..fc58c7fb4d 100644
--- a/java/broker/src/main/java/org/apache/qpid/server/AMQChannel.java
+++ b/java/broker/src/main/java/org/apache/qpid/server/AMQChannel.java
@@ -1446,21 +1446,6 @@ public class AMQChannel implements AMQSessionModel, AsyncAutoCommitTransaction.F
return getProtocolSession().getVirtualHost();
}
- public int getChannel()
- {
- return getChannelId();
- }
-
- public boolean isDurable()
- {
- return false;
- }
-
- public long getCreateTime()
- {
- return _createTime;
- }
-
public void checkTransactionStatus(long openWarn, long openClose, long idleWarn, long idleClose) throws AMQException
{
_transactionTimeoutHelper.checkIdleOrOpenTimes(_transaction, openWarn, openClose, idleWarn, idleClose);
diff --git a/java/broker/src/main/java/org/apache/qpid/server/message/AbstractServerMessageImpl.java b/java/broker/src/main/java/org/apache/qpid/server/message/AbstractServerMessageImpl.java
index 587b76a12e..8311dbd5ff 100644
--- a/java/broker/src/main/java/org/apache/qpid/server/message/AbstractServerMessageImpl.java
+++ b/java/broker/src/main/java/org/apache/qpid/server/message/AbstractServerMessageImpl.java
@@ -66,9 +66,6 @@ public abstract class AbstractServerMessageImpl<T extends StorableMessageMetaDat
* Threadsafe. This will decrement the reference count and when it reaches zero will remove the message from the
* message store.
*
- *
- * @throws org.apache.qpid.server.queue.MessageCleanupException when an attempt was made to remove the message from the message store and that
- * failed
*/
public void decrementReference()
{
@@ -111,4 +108,4 @@ public abstract class AbstractServerMessageImpl<T extends StorableMessageMetaDat
{
return _referenceCount;
}
-} \ No newline at end of file
+}
diff --git a/java/broker/src/main/java/org/apache/qpid/server/protocol/v1_0/Message_1_0.java b/java/broker/src/main/java/org/apache/qpid/server/protocol/v1_0/Message_1_0.java
index d0000c8db6..c87028e190 100644
--- a/java/broker/src/main/java/org/apache/qpid/server/protocol/v1_0/Message_1_0.java
+++ b/java/broker/src/main/java/org/apache/qpid/server/protocol/v1_0/Message_1_0.java
@@ -208,11 +208,8 @@ public class Message_1_0 implements ServerMessage, InboundMessage
/**
* Threadsafe. This will decrement the reference count and when it reaches zero will remove the message from the
* message store.
- *
- *
- * @throws org.apache.qpid.server.queue.MessageCleanupException when an attempt was made to remove the message from the message store and that
- * failed
*/
+
public void decrementReference()
{
int count = _refCountUpdater.decrementAndGet(this);
diff --git a/java/broker/src/main/java/org/apache/qpid/server/protocol/v1_0/Subscription_1_0.java b/java/broker/src/main/java/org/apache/qpid/server/protocol/v1_0/Subscription_1_0.java
index f865837350..0559f2ed94 100644
--- a/java/broker/src/main/java/org/apache/qpid/server/protocol/v1_0/Subscription_1_0.java
+++ b/java/broker/src/main/java/org/apache/qpid/server/protocol/v1_0/Subscription_1_0.java
@@ -88,7 +88,6 @@ class Subscription_1_0 implements Subscription
private final AtomicReference<State> _state = new AtomicReference<State>(State.SUSPENDED);
private final QueueEntry.SubscriptionAcquiredState _owningState = new QueueEntry.SubscriptionAcquiredState(this);
- private final QueueEntry.SubscriptionAssignedState _assignedState = new QueueEntry.SubscriptionAssignedState(this);
private final long _id;
private final boolean _acquires;
private volatile AMQQueue.Context _queueContext;
@@ -147,11 +146,6 @@ class Subscription_1_0 implements Subscription
return _owningState;
}
- public QueueEntry.SubscriptionAssignedState getAssignedState()
- {
- return _assignedState;
- }
-
public void setQueue(final AMQQueue queue, final boolean exclusive)
{
//TODO
@@ -162,11 +156,6 @@ class Subscription_1_0 implements Subscription
_noLocal = noLocal;
}
- public boolean isNoLocal()
- {
- return _noLocal;
- }
-
public long getSubscriptionID()
{
return _id;
diff --git a/java/broker/src/main/java/org/apache/qpid/server/queue/FailedDequeueException.java b/java/broker/src/main/java/org/apache/qpid/server/queue/FailedDequeueException.java
deleted file mode 100644
index 6466e81dd2..0000000000
--- a/java/broker/src/main/java/org/apache/qpid/server/queue/FailedDequeueException.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-package org.apache.qpid.server.queue;
-
-import org.apache.qpid.AMQException;
-
-/**
- * Signals that the dequeue of a message from a queue failed.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Indicates the a message could not be dequeued from a queue.
- * <tr><td>
- * </table>
- *
- * @todo Not an AMQP exception as no status code.
- *
- * @todo Happens as a consequence of a message store failure, or reference counting error. Both of which migh become
- * runtime exceptions, as unrecoverable conditions? In which case this one might be dropped too.
- */
-public class FailedDequeueException extends AMQException
-{
- public FailedDequeueException(String queue)
- {
- super("Failed to dequeue message from " + queue);
- }
-
- public FailedDequeueException(String queue, AMQException e)
- {
- super("Failed to dequeue message from " + queue, e);
- }
-}
diff --git a/java/broker/src/main/java/org/apache/qpid/server/queue/MessageCleanupException.java b/java/broker/src/main/java/org/apache/qpid/server/queue/MessageCleanupException.java
deleted file mode 100644
index 090096d3c3..0000000000
--- a/java/broker/src/main/java/org/apache/qpid/server/queue/MessageCleanupException.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-package org.apache.qpid.server.queue;
-
-import org.apache.qpid.AMQException;
-
-/**
- * MessageCleanupException represents the failure to perform reference counting on messages correctly. This should not
- * happen, but there may be programming errors giving race conditions that cause the reference counting to go wrong.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Signals that the reference count of a message has gone below zero.
- * <tr><td> Indicates that a message store has lost a message which is still referenced.
- * </table>
- *
- * @todo Not an AMQP exception as no status code.
- *
- * @todo The race conditions leading to this error should be cleaned up, and a runtime exception used instead. If the
- * message store loses messages, then something is seriously wrong and it would be sensible to terminate the
- * broker. This may be disguising out of memory errors.
- */
-public class MessageCleanupException extends AMQException
-{
- public MessageCleanupException(long messageId, AMQException e)
- {
- super("Failed to cleanup message with id " + messageId, e);
- }
-
- public MessageCleanupException(String message)
- {
- super(message);
- }
-}
diff --git a/java/broker/src/main/java/org/apache/qpid/server/queue/QueueEntry.java b/java/broker/src/main/java/org/apache/qpid/server/queue/QueueEntry.java
index be2ab8b3ae..c44961c457 100644
--- a/java/broker/src/main/java/org/apache/qpid/server/queue/QueueEntry.java
+++ b/java/broker/src/main/java/org/apache/qpid/server/queue/QueueEntry.java
@@ -164,38 +164,10 @@ public interface QueueEntry extends Comparable<QueueEntry>, Filterable
}
}
- public final class SubscriptionAssignedState extends EntryState
- {
- private final Subscription _subscription;
-
- public SubscriptionAssignedState(Subscription subscription)
- {
- _subscription = subscription;
- }
-
-
- public State getState()
- {
- return State.AVAILABLE;
- }
-
- public Subscription getSubscription()
- {
- return _subscription;
- }
-
-
- public String toString()
- {
- return "{" + getState().name() + " : " + _subscription +"}";
- }
- }
-
final static EntryState AVAILABLE_STATE = new AvailableState();
final static EntryState DELETED_STATE = new DeletedState();
final static EntryState DEQUEUED_STATE = new DequeuedState();
- final static EntryState EXPIRED_STATE = new ExpiredState();
final static EntryState NON_SUBSCRIPTION_ACQUIRED_STATE = new NonSubscriptionAcquiredState();
@@ -225,10 +197,6 @@ public interface QueueEntry extends Comparable<QueueEntry>, Filterable
boolean isAcquiredBy(Subscription subscription);
void release();
- boolean releaseButRetain();
-
-
- boolean immediateAndNotDelivered();
void setRedelivered();
diff --git a/java/broker/src/main/java/org/apache/qpid/server/queue/QueueEntryImpl.java b/java/broker/src/main/java/org/apache/qpid/server/queue/QueueEntryImpl.java
index 9aa8d1da83..36feb27d86 100644
--- a/java/broker/src/main/java/org/apache/qpid/server/queue/QueueEntryImpl.java
+++ b/java/broker/src/main/java/org/apache/qpid/server/queue/QueueEntryImpl.java
@@ -176,23 +176,6 @@ public abstract class QueueEntryImpl implements QueueEntry
{
boolean acquired = _stateUpdater.compareAndSet(this,AVAILABLE_STATE, state);
- // deal with the case where the node has been assigned to a given subscription already
- // including the case that the node is assigned to a closed subscription
- if(!acquired)
- {
- if(state != NON_SUBSCRIPTION_ACQUIRED_STATE)
- {
- EntryState currentState = _state;
- if(currentState.getState() == State.AVAILABLE
- && ((currentState == AVAILABLE_STATE)
- || (((SubscriptionAcquiredState)state).getSubscription() ==
- ((SubscriptionAssignedState)currentState).getSubscription())
- || ((SubscriptionAssignedState)currentState).getSubscription().isClosed() ))
- {
- acquired = _stateUpdater.compareAndSet(this,currentState, state);
- }
- }
- }
if(acquired && _stateChangeListeners != null)
{
notifyStateChange(State.AVAILABLE, State.ACQUIRED);
@@ -258,41 +241,6 @@ public abstract class QueueEntryImpl implements QueueEntry
}
- public boolean releaseButRetain()
- {
- EntryState state = _state;
-
- boolean stateUpdated = false;
-
- if(state instanceof SubscriptionAcquiredState)
- {
- Subscription sub = ((SubscriptionAcquiredState) state).getSubscription();
- if(_stateUpdater.compareAndSet(this, state, sub.getAssignedState()))
- {
- getQueue().requeue(this);
- if(_stateChangeListeners != null)
- {
- notifyStateChange(QueueEntry.State.ACQUIRED, QueueEntry.State.AVAILABLE);
- }
- stateUpdated = true;
- }
- }
-
- return stateUpdated;
-
- }
-
- public boolean immediateAndNotDelivered()
- {
- return !getDeliveredToConsumer() && isImmediate();
- }
-
- private boolean isImmediate()
- {
- final ServerMessage message = getMessage();
- return message != null && message.isImmediate();
- }
-
public void setRedelivered()
{
_deliveryState |= REDELIVERED;
diff --git a/java/broker/src/main/java/org/apache/qpid/server/queue/SimpleAMQQueue.java b/java/broker/src/main/java/org/apache/qpid/server/queue/SimpleAMQQueue.java
index 73c2870b9b..b16af05883 100644
--- a/java/broker/src/main/java/org/apache/qpid/server/queue/SimpleAMQQueue.java
+++ b/java/broker/src/main/java/org/apache/qpid/server/queue/SimpleAMQQueue.java
@@ -181,7 +181,6 @@ public class SimpleAMQQueue implements AMQQueue, Subscription.StateListener, Mes
//TODO : persist creation time
private long _createTime = System.currentTimeMillis();
- private AbstractConfiguration _queueConfiguration;
/** the maximum delivery count for each message on this queue or 0 if maximum delivery count is not to be enforced. */
private int _maximumDeliveryCount;
diff --git a/java/broker/src/main/java/org/apache/qpid/server/subscription/Subscription.java b/java/broker/src/main/java/org/apache/qpid/server/subscription/Subscription.java
index 8911754a66..7a924abb3d 100644
--- a/java/broker/src/main/java/org/apache/qpid/server/subscription/Subscription.java
+++ b/java/broker/src/main/java/org/apache/qpid/server/subscription/Subscription.java
@@ -57,8 +57,6 @@ public interface Subscription
AMQSessionModel getSessionModel();
QueueEntry.SubscriptionAcquiredState getOwningState();
- QueueEntry.SubscriptionAssignedState getAssignedState();
-
void setQueue(AMQQueue queue, boolean exclusive);
diff --git a/java/broker/src/main/java/org/apache/qpid/server/subscription/SubscriptionImpl.java b/java/broker/src/main/java/org/apache/qpid/server/subscription/SubscriptionImpl.java
index a8acca51e9..f5b2dbbfec 100644
--- a/java/broker/src/main/java/org/apache/qpid/server/subscription/SubscriptionImpl.java
+++ b/java/broker/src/main/java/org/apache/qpid/server/subscription/SubscriptionImpl.java
@@ -78,7 +78,6 @@ public abstract class SubscriptionImpl implements Subscription, FlowCreditManage
private final RecordDeliveryMethod _recordMethod;
private final QueueEntry.SubscriptionAcquiredState _owningState = new QueueEntry.SubscriptionAcquiredState(this);
- private final QueueEntry.SubscriptionAssignedState _assignedState = new QueueEntry.SubscriptionAssignedState(this);
private final Map<String, Object> _properties = new ConcurrentHashMap<String, Object>();
@@ -707,12 +706,6 @@ public abstract class SubscriptionImpl implements Subscription, FlowCreditManage
return _owningState;
}
- public QueueEntry.SubscriptionAssignedState getAssignedState()
- {
- return _assignedState;
- }
-
-
public void confirmAutoClose()
{
ProtocolOutputConverter converter = getChannel().getProtocolSession().getProtocolOutputConverter();
diff --git a/java/broker/src/main/java/org/apache/qpid/server/subscription/Subscription_0_10.java b/java/broker/src/main/java/org/apache/qpid/server/subscription/Subscription_0_10.java
index b9bba49fab..b48082aade 100644
--- a/java/broker/src/main/java/org/apache/qpid/server/subscription/Subscription_0_10.java
+++ b/java/broker/src/main/java/org/apache/qpid/server/subscription/Subscription_0_10.java
@@ -86,7 +86,6 @@ public class Subscription_0_10 implements Subscription, FlowCreditManager.FlowCr
private final long _subscriptionID;
private final QueueEntry.SubscriptionAcquiredState _owningState = new QueueEntry.SubscriptionAcquiredState(this);
- private final QueueEntry.SubscriptionAssignedState _assignedState = new QueueEntry.SubscriptionAssignedState(this);
private static final Option[] BATCHED = new Option[] { Option.BATCH };
@@ -170,11 +169,6 @@ public class Subscription_0_10 implements Subscription, FlowCreditManager.FlowCr
return _owningState;
}
- public QueueEntry.SubscriptionAssignedState getAssignedState()
- {
- return _assignedState;
- }
-
public void setQueue(AMQQueue queue, boolean exclusive)
{
if(getQueue() != null)
@@ -201,7 +195,7 @@ public class Subscription_0_10 implements Subscription, FlowCreditManager.FlowCr
{
return _destination;
}
-
+
public boolean isSuspended()
{
return !isActive() || _deleted.get() || _session.isClosing(); // TODO check for Session suspension
diff --git a/java/broker/src/test/java/org/apache/qpid/server/exchange/AbstractHeadersExchangeTestBase.java b/java/broker/src/test/java/org/apache/qpid/server/exchange/AbstractHeadersExchangeTestBase.java
index 30459dcc3d..f4c0fec6c9 100644
--- a/java/broker/src/test/java/org/apache/qpid/server/exchange/AbstractHeadersExchangeTestBase.java
+++ b/java/broker/src/test/java/org/apache/qpid/server/exchange/AbstractHeadersExchangeTestBase.java
@@ -396,16 +396,6 @@ public class AbstractHeadersExchangeTestBase extends QpidTestCase
}
- public boolean releaseButRetain()
- {
- return false;
- }
-
- public boolean immediateAndNotDelivered()
- {
- return false;
- }
-
public void setRedelivered()
{
diff --git a/java/broker/src/test/java/org/apache/qpid/server/queue/MockQueueEntry.java b/java/broker/src/test/java/org/apache/qpid/server/queue/MockQueueEntry.java
index b3482f0599..525093ccbd 100644
--- a/java/broker/src/test/java/org/apache/qpid/server/queue/MockQueueEntry.java
+++ b/java/broker/src/test/java/org/apache/qpid/server/queue/MockQueueEntry.java
@@ -88,7 +88,7 @@ public class MockQueueEntry implements QueueEntry
public boolean isAvailable()
{
- return false;
+ return false;
}
public Subscription getDeliveredSubscription()
@@ -116,11 +116,6 @@ public class MockQueueEntry implements QueueEntry
return 0;
}
- public boolean immediateAndNotDelivered()
- {
- return false;
- }
-
public boolean isAcquired()
{
return false;
@@ -159,11 +154,6 @@ public class MockQueueEntry implements QueueEntry
}
- public boolean releaseButRetain()
- {
- return false;
- }
-
public boolean removeStateChangeListener(StateChangeListener listener)
{
diff --git a/java/broker/src/test/java/org/apache/qpid/server/subscription/MockSubscription.java b/java/broker/src/test/java/org/apache/qpid/server/subscription/MockSubscription.java
index a3552639d1..65dbf7bae1 100644
--- a/java/broker/src/test/java/org/apache/qpid/server/subscription/MockSubscription.java
+++ b/java/broker/src/test/java/org/apache/qpid/server/subscription/MockSubscription.java
@@ -55,8 +55,6 @@ public class MockSubscription implements Subscription
private List<QueueEntry> _acceptEntries = null;
private final QueueEntry.SubscriptionAcquiredState _owningState = new QueueEntry.SubscriptionAcquiredState(this);
- private final QueueEntry.SubscriptionAssignedState _assignedState = new QueueEntry.SubscriptionAssignedState(this);
-
private static final AtomicLong idGenerator = new AtomicLong(0);
// Create a simple ID that increments for ever new Subscription
@@ -102,11 +100,6 @@ public class MockSubscription implements Subscription
return _owningState;
}
- public QueueEntry.SubscriptionAssignedState getAssignedState()
- {
- return _assignedState;
- }
-
public LogActor getLogActor()
{
return null; //To change body of implemented methods use File | Settings | File Templates.