You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ru...@apache.org on 2007/05/21 13:26:58 UTC
svn commit: r540119 [1/2] - in /incubator/qpid/trunk/qpid: ./
java/broker/src/main/java/org/apache/qpid/server/
java/broker/src/main/java/org/apache/qpid/server/exchange/
java/broker/src/main/java/org/apache/qpid/server/protocol/
java/broker/src/main/j...
Author: rupertlssmith
Date: Mon May 21 04:26:55 2007
New Revision: 540119
URL: http://svn.apache.org/viewvc?view=rev&rev=540119
Log:
Merged revisions 540107 via svnmerge from
https://svn.apache.org/repos/asf/incubator/qpid/branches/M2
........
r540107 | rupertlssmith | 2007-05-21 11:57:30 +0100 (Mon, 21 May 2007) | 1 line
Documented all exception.
........
Modified:
incubator/qpid/trunk/qpid/ (props changed)
incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/RequiredDeliveryException.java
incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/ExchangeInUseException.java
incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/NoRouteException.java
incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQNoMethodHandlerException.java
incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/UnknnownMessageTypeException.java
incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/AMQQueue.java
incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/FailedDequeueException.java
incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/MessageCleanupException.java
incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/NoConsumersException.java
incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/state/AMQStateManager.java
incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/state/IllegalStateTransitionException.java
incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/AMQAuthenticationException.java
incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/AMQNoConsumersException.java
incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/AMQNoRouteException.java
incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/message/UnexpectedBodyReceivedException.java
incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/message/UnprocessedMessage.java
incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/protocol/AMQProtocolSession.java
incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/state/AMQStateManager.java
incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/state/IllegalStateTransitionException.java
incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/transport/AMQNoTransportForProtocolException.java
incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/transport/AMQTransportConnectionException.java
incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/vmbroker/AMQVMBrokerCreationException.java
incubator/qpid/trunk/qpid/java/cluster/src/main/java/org/apache/qpid/server/cluster/AMQConnectionWaitException.java
incubator/qpid/trunk/qpid/java/cluster/src/main/java/org/apache/qpid/server/cluster/AMQUnexpectedBodyTypeException.java
incubator/qpid/trunk/qpid/java/cluster/src/main/java/org/apache/qpid/server/cluster/AMQUnexpectedFrameTypeException.java
incubator/qpid/trunk/qpid/java/cluster/src/main/java/org/apache/qpid/server/cluster/ClientHandlerRegistry.java
incubator/qpid/trunk/qpid/java/cluster/src/main/java/org/apache/qpid/server/cluster/ServerHandlerRegistry.java
incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/AMQChannelClosedException.java
incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/AMQChannelException.java
incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/AMQConnectionClosedException.java
incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/AMQConnectionException.java
incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/AMQConnectionFailureException.java
incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/AMQDisconnectedException.java
incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/AMQException.java
incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/AMQInvalidArgumentException.java
incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/AMQInvalidRoutingKeyException.java
incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/AMQTimeoutException.java
incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/AMQUndeliveredException.java
incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/AMQUnknownExchangeType.java
incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/AMQUnresolvedAddressException.java
incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/configuration/PropertyException.java
incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQFrameDecodingException.java
incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQProtocolClassException.java
incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQProtocolHeaderException.java
incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQProtocolInstanceException.java
incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQProtocolVersionException.java
incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/pool/PoolingFilter.java
Propchange: incubator/qpid/trunk/qpid/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.
Modified: incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/RequiredDeliveryException.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/RequiredDeliveryException.java?view=diff&rev=540119&r1=540118&r2=540119
==============================================================================
--- incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/RequiredDeliveryException.java (original)
+++ incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/RequiredDeliveryException.java Mon May 21 04:26:55 2007
@@ -25,9 +25,17 @@
import org.apache.qpid.server.queue.AMQMessage;
/**
- * Signals that a required delivery could not be made. This could be bacuse of
- * the immediate flag being set and the queue having no consumers, or the mandatory
- * flag being set and the exchange having no valid bindings.
+ * Signals that a required delivery could not be made. This could be bacuse of the immediate flag being set and the
+ * queue having no consumers, or the mandatory flag being set and the exchange having no valid bindings.
+ *
+ * <p/>The failed message is associated with this error condition, by taking a reference to it. This enables the
+ * correct compensating action to be taken against the message, for example, bouncing it back to the sender.
+ *
+ * <p/><table id="crc"><caption>CRC Card</caption>
+ * <tr><th> Responsibilities <th> Collaborations
+ * <tr><td> Represent failure to deliver a message that must be delivered.
+ * <tr><td> Associate the failed message with the error condition. <td> {@link AMQMessage}
+ * </table>
*/
public abstract class RequiredDeliveryException extends AMQException
{
@@ -40,10 +48,10 @@
// Increment the reference as this message is in the routing phase
// and so will have the ref decremented as routing fails.
// we need to keep this message around so we can return it in the
- // handler. So increment here.
- _amqMessage = payload.takeReference();
-
- //payload.incrementReference();
+ // handler. So increment here.
+ _amqMessage = payload.takeReference();
+
+ // payload.incrementReference();
}
public AMQMessage getAMQMessage()
Modified: incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/ExchangeInUseException.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/ExchangeInUseException.java?view=diff&rev=540119&r1=540118&r2=540119
==============================================================================
--- incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/ExchangeInUseException.java (original)
+++ incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/ExchangeInUseException.java Mon May 21 04:26:55 2007
@@ -7,9 +7,9 @@
* 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
@@ -22,6 +22,20 @@
import org.apache.qpid.AMQException;
+/**
+ * ExchangeInUseRegistry indicates that an exchange cannot be unregistered because it is currently being used.
+ *
+ * <p/><table id="crc"><caption>CRC Card</caption>
+ * <tr><th> Responsibilities <th> Collaborations
+ * <tr><td> Represents failure to unregister exchange that is in use.
+ * </table>
+ *
+ * @todo Not an AMQP exception as no status code.
+ *
+ * @todo This exception is not used. However, it is part of the ExchangeRegistry interface, and looks like code is
+ * going to need to be added to throw/deal with this. Alternatively ExchangeResitries may be able to handle the
+ * issue internally.
+ */
public class ExchangeInUseException extends AMQException
{
public ExchangeInUseException(String exchangeName)
Modified: incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/NoRouteException.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/NoRouteException.java?view=diff&rev=540119&r1=540118&r2=540119
==============================================================================
--- incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/NoRouteException.java (original)
+++ incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/NoRouteException.java Mon May 21 04:26:55 2007
@@ -7,9 +7,9 @@
* 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
@@ -25,8 +25,14 @@
import org.apache.qpid.server.queue.AMQMessage;
/**
- * Thrown by an exchange if there is no way to route a message with the
- * mandatory flag set.
+ * NoRouteException is a {@link RequiredDeliveryException} that represents the failure case where a manadatory message
+ * cannot be delivered because there is no route for the message. The AMQP status code, 312, is always used to report
+ * this condition.
+ *
+ * <p/><table id="crc"><caption>CRC Card</caption>
+ * <tr><th> Responsibilities <th> Collaborations
+ * <tr><td> Represent failure to deliver a message that must be delivered.
+ * </table>
*/
public class NoRouteException extends RequiredDeliveryException
{
Modified: incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQNoMethodHandlerException.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQNoMethodHandlerException.java?view=diff&rev=540119&r1=540118&r2=540119
==============================================================================
--- incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQNoMethodHandlerException.java (original)
+++ incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQNoMethodHandlerException.java Mon May 21 04:26:55 2007
@@ -20,13 +20,25 @@
*/
package org.apache.qpid.server.protocol;
+import org.apache.qpid.AMQException;
import org.apache.qpid.framing.AMQMethodBody;
import org.apache.qpid.protocol.AMQMethodEvent;
-import org.apache.qpid.AMQException;
+/**
+ * AMQNoMethodHandlerException represents the case where no method handler exists to handle an AQMP method.
+ *
+ * <p/><table id="crc"><caption>CRC Card</caption>
+ * <tr><th> Responsibilities <th> Collaborations
+ * <tr><td> Represents failure to handle an AMQP method.
+ * </table>
+ *
+ * @todo Not an AMQP exception as no status code.
+ *
+ * @todo Missing method handler. Unlikely to ever happen, and if it does its a coding error. Consider replacing with a
+ * Runtime.
+ */
public class AMQNoMethodHandlerException extends AMQException
{
-
public AMQNoMethodHandlerException(AMQMethodEvent<AMQMethodBody> evt)
{
super("AMQMethodEvent " + evt + " was not processed by any listener on Broker.");
Modified: incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/UnknnownMessageTypeException.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/UnknnownMessageTypeException.java?view=diff&rev=540119&r1=540118&r2=540119
==============================================================================
--- incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/UnknnownMessageTypeException.java (original)
+++ incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/UnknnownMessageTypeException.java Mon May 21 04:26:55 2007
@@ -20,14 +20,27 @@
*/
package org.apache.qpid.server.protocol;
-import org.apache.qpid.framing.AMQDataBlock;
import org.apache.qpid.AMQException;
+import org.apache.qpid.framing.AMQDataBlock;
+/**
+ * UnknnownMessageTypeException represents a failure when Mina passes an unexpected frame type.
+ *
+ * <p/><table id="crc"><caption>CRC Card</caption>
+ * <tr><th> Responsibilities <th> Collaborations
+ * <tr><td> Represents failure to cast a frame to its expected type.
+ * </table>
+ *
+ * @todo Not an AMQP exception as no status code.
+ *
+ * @todo Seems like this exception was created to handle an unsafe type cast that will never happen in practice. Would
+ * be better just to leave that as a ClassCastException. However, check the framing layer catches this error
+ * first.
+ */
public class UnknnownMessageTypeException extends AMQException
{
public UnknnownMessageTypeException(AMQDataBlock message)
{
super("Unknown message type: " + message.getClass().getName() + ": " + message);
-
}
}
Modified: incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/AMQQueue.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/AMQQueue.java?view=diff&rev=540119&r1=540118&r2=540119
==============================================================================
--- incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/AMQQueue.java (original)
+++ incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/AMQQueue.java Mon May 21 04:26:55 2007
@@ -33,6 +33,7 @@
import javax.management.JMException;
import org.apache.log4j.Logger;
+
import org.apache.qpid.AMQException;
import org.apache.qpid.configuration.Configured;
import org.apache.qpid.framing.AMQShortString;
@@ -54,7 +55,19 @@
*/
public class AMQQueue implements Managable, Comparable, StorableQueue
{
-
+ /**
+ * ExistingExclusiveSubscription signals a failure to create a subscription, because an exclusive subscription
+ * already exists.
+ *
+ * <p/><table id="crc"><caption>CRC Card</caption>
+ * <tr><th> Responsibilities <th> Collaborations
+ * <tr><td> Represent failure to create a subscription, because an exclusive subscription already exists.
+ * </table>
+ *
+ * @todo Not an AMQP exception as no status code.
+ *
+ * @todo Move to top level, used outside this class.
+ */
public static int s_queueID =0;
public static final class ExistingExclusiveSubscription extends AMQException
{
@@ -65,19 +78,27 @@
}
}
+ /**
+ * ExistingSubscriptionPreventsExclusive signals a failure to create an exclusize subscription, as a subscription
+ * already exists.
+ *
+ * <p/><table id="crc"><caption>CRC Card</caption>
+ * <tr><th> Responsibilities <th> Collaborations
+ * <tr><td> Represent failure to create an exclusize subscription, as a subscription already exists.
+ * </table>
+ *
+ * @todo Not an AMQP exception as no status code.
+ *
+ * @todo Move to top level, used outside this class.
+ */
public static final class ExistingSubscriptionPreventsExclusive extends AMQException
{
-
public ExistingSubscriptionPreventsExclusive()
{
super("");
}
}
- private static final ExistingExclusiveSubscription EXISTING_EXCLUSIVE = new ExistingExclusiveSubscription();
- private static final ExistingSubscriptionPreventsExclusive EXISTING_SUBSCRIPTION = new ExistingSubscriptionPreventsExclusive();
-
-
private static final Logger _logger = Logger.getLogger(AMQQueue.class);
private final AMQShortString _name;
@@ -134,7 +155,6 @@
private final VirtualHost _virtualHost;
-
/**
* max allowed size(KB) of a single message
*/
@@ -175,40 +195,34 @@
return _name.compareTo(((AMQQueue) o).getName());
}
- public AMQQueue(AMQShortString name, boolean durable, AMQShortString owner,
- boolean autoDelete, VirtualHost virtualHost)
- throws
- AMQException
+ public AMQQueue(AMQShortString name, boolean durable, AMQShortString owner, boolean autoDelete, VirtualHost virtualHost)
+ throws AMQException
{
- this(name, durable, owner, autoDelete, virtualHost,
- AsyncDeliveryConfig.getAsyncDeliveryExecutor(), new SubscriptionSet(), new SubscriptionImpl.Factory());
+ this(name, durable, owner, autoDelete, virtualHost, AsyncDeliveryConfig.getAsyncDeliveryExecutor(),
+ new SubscriptionSet(), new SubscriptionImpl.Factory());
}
-
- protected AMQQueue(AMQShortString name, boolean durable, AMQShortString owner,
- boolean autoDelete, VirtualHost virtualHost,
- SubscriptionSet subscribers)
- throws
- AMQException
+ protected AMQQueue(AMQShortString name, boolean durable, AMQShortString owner, boolean autoDelete,
+ VirtualHost virtualHost, SubscriptionSet subscribers) throws AMQException
{
- this(name, durable, owner, autoDelete, virtualHost,
- AsyncDeliveryConfig.getAsyncDeliveryExecutor(), subscribers, new SubscriptionImpl.Factory());
+ this(name, durable, owner, autoDelete, virtualHost, AsyncDeliveryConfig.getAsyncDeliveryExecutor(), subscribers,
+ new SubscriptionImpl.Factory());
}
- protected AMQQueue(AMQShortString name, boolean durable, AMQShortString owner,
- boolean autoDelete, VirtualHost virtualHost,
- Executor asyncDelivery, SubscriptionSet subscribers, SubscriptionFactory subscriptionFactory)
- throws
- AMQException
+ protected AMQQueue(AMQShortString name, boolean durable, AMQShortString owner, boolean autoDelete,
+ VirtualHost virtualHost, Executor asyncDelivery, SubscriptionSet subscribers,
+ SubscriptionFactory subscriptionFactory) throws AMQException
{
if (name == null)
{
throw new IllegalArgumentException("Queue name must not be null");
}
+
if (virtualHost == null)
{
throw new IllegalArgumentException("Virtual Host must not be null");
}
+
_name = name;
_durable = durable;
_owner = owner;
@@ -304,10 +318,11 @@
public AMQMessage getMessageOnTheQueue(long messageId)
{
List<AMQMessage> list = getMessagesOnTheQueue(messageId, messageId);
- if (list == null || list.size() == 0)
+ if ((list == null) || (list.size() == 0))
{
return null;
}
+
return list.get(0);
}
@@ -324,7 +339,7 @@
* @param storeContext
*/
public synchronized void moveMessagesToAnotherQueue(long fromMessageId, long toMessageId, String queueName,
- StoreContext storeContext)
+ StoreContext storeContext)
{
// prepare the delivery manager for moving messages by stopping the async delivery and creating a lock
AMQQueue anotherQueue = getVirtualHost().getQueueRegistry().getQueue(new AMQShortString(queueName));
@@ -460,6 +475,7 @@
throw new AMQException("Problem binding queue ", e);
}
}
+
_bindings.addBinding(routingKey, arguments, exchange);
}
@@ -478,25 +494,23 @@
throw new AMQException("problem unbinding queue", e);
}
}
+
_bindings.remove(routingKey, arguments, exchange);
}
-
public void registerProtocolSession(AMQProtocolSession ps, int channel, AMQShortString consumerTag, boolean acks,
- FieldTable filters, boolean noLocal, boolean exclusive)
- throws
- AMQException
+ FieldTable filters, boolean noLocal, boolean exclusive) throws AMQException
{
if (incrementSubscriberCount() > 1)
{
if (isExclusive())
{
decrementSubscriberCount();
- throw EXISTING_EXCLUSIVE;
+ throw new ExistingExclusiveSubscription();
} else if (exclusive)
{
decrementSubscriberCount();
- throw EXISTING_SUBSCRIPTION;
+ throw new ExistingSubscriptionPreventsExclusive();
}
} else if (exclusive)
@@ -506,12 +520,13 @@
if (_logger.isDebugEnabled())
{
- _logger.debug(MessageFormat.format("Registering protocol session {0} with channel {1} and " +
- "consumer tag {2} with {3}", ps, channel, consumerTag, this));
+ _logger.debug(MessageFormat.format(
+ "Registering protocol session {0} with channel {1} and " + "consumer tag {2} with {3}", ps, channel,
+ consumerTag, this));
}
- Subscription subscription = _subscriptionFactory.createSubscription(channel, ps, consumerTag, acks,
- filters, noLocal, this);
+ Subscription subscription =
+ _subscriptionFactory.createSubscription(channel, ps, consumerTag, acks, filters, noLocal, this);
if (subscription.filtersMessages())
{
@@ -524,7 +539,6 @@
_subscribers.addSubscriber(subscription);
}
-
private boolean isExclusive()
{
return _isExclusive.get();
@@ -545,25 +559,25 @@
return _subscriberCount.decrementAndGet();
}
-
public void unregisterProtocolSession(AMQProtocolSession ps, int channel, AMQShortString consumerTag)
throws
AMQException
{
if (_logger.isDebugEnabled())
{
- _logger.debug(MessageFormat.format("Unregistering protocol session {0} with channel {1} and consumer tag {2} from {3}", ps, channel, consumerTag,
- this));
+ _logger.debug(MessageFormat.format(
+ "Unregistering protocol session {0} with channel {1} and consumer tag {2} from {3}", ps, channel,
+ consumerTag, this));
}
Subscription removedSubscription;
- if ((removedSubscription = _subscribers.removeSubscriber(_subscriptionFactory.createSubscription(channel,
- ps,
- consumerTag)))
+
+ if ((removedSubscription =
+ _subscribers.removeSubscriber(_subscriptionFactory.createSubscription(channel, ps, consumerTag)))
== null)
{
- throw new AMQException("Protocol session with channel " + channel + " and consumer tag " + consumerTag +
- " and protocol session key " + ps.getKey() + " not registered with queue " + this);
+ throw new AMQException("Protocol session with channel " + channel + " and consumer tag " + consumerTag
+ + " and protocol session key " + ps.getKey() + " not registered with queue " + this);
}
removedSubscription.close();
@@ -577,6 +591,7 @@
{
_logger.info("Auto-deleteing queue:" + this);
}
+
autodelete();
// we need to manually fire the event to the removed subscription (which was the last one left for this
// queue. This is because the delete method uses the subscription set which has just been cleared
@@ -594,7 +609,6 @@
return !_deliveryMgr.hasQueuedMessages();
}
-
public int delete(boolean checkUnused, boolean checkEmpty)
throws
AMQException
@@ -602,14 +616,17 @@
if (checkUnused && !_subscribers.isEmpty())
{
_logger.info("Will not delete " + this + " as it is in use.");
+
return 0;
} else if (checkEmpty && _deliveryMgr.hasQueuedMessages())
{
_logger.info("Will not delete " + this + " as it is not empty.");
+
return 0;
} else
{
delete();
+
return _deliveryMgr.getQueueMessageCount();
}
}
@@ -628,6 +645,7 @@
{
task.doTask(this);
}
+
_deleteTaskList.clear();
}
}
@@ -640,6 +658,7 @@
{
_logger.debug(MessageFormat.format("autodeleting {0}", this));
}
+
delete();
}
@@ -647,7 +666,7 @@
throws
AMQException
{
- //fixme not sure what this is doing. should we be passing deliverFirst through here?
+ // fixme not sure what this is doing. should we be passing deliverFirst through here?
// This code is not used so when it is perhaps it should
_deliveryMgr.deliver(storeContext, getName(), msg, deliverFirst);
try
@@ -663,10 +682,10 @@
}
}
-// public DeliveryManager getDeliveryManager()
-// {
-// return _deliveryMgr;
-// }
+ // public DeliveryManager getDeliveryManager()
+ // {
+ // return _deliveryMgr;
+ // }
public void process(StoreContext storeContext, AMQMessage msg, boolean deliverFirst)
throws
@@ -696,10 +715,10 @@
}
catch (MessageCleanupException e)
{
- //Message was dequeued, but could not then be deleted
- //though it is no longer referenced. This should be very
- //rare and can be detected and cleaned up on recovery or
- //done through some form of manual intervention.
+ // Message was dequeued, but could not then be deleted
+ // though it is no longer referenced. This should be very
+ // rare and can be detected and cleaned up on recovery or
+ // done through some form of manual intervention.
_logger.error(e, e);
}
catch (AMQException e)
@@ -743,7 +762,8 @@
{
return true;
}
- if (o == null || getClass() != o.getClass())
+
+ if ((o == null) || (getClass() != o.getClass()))
{
return false;
}
Modified: incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/FailedDequeueException.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/FailedDequeueException.java?view=diff&rev=540119&r1=540118&r2=540119
==============================================================================
--- incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/FailedDequeueException.java (original)
+++ incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/FailedDequeueException.java Mon May 21 04:26:55 2007
@@ -7,9 +7,9 @@
* 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
@@ -23,7 +23,18 @@
import org.apache.qpid.AMQException;
/**
- * Signals that the dequeue of a message from a queue failed
+ * 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
{
Modified: incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/MessageCleanupException.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/MessageCleanupException.java?view=diff&rev=540119&r1=540118&r2=540119
==============================================================================
--- incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/MessageCleanupException.java (original)
+++ incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/MessageCleanupException.java Mon May 21 04:26:55 2007
@@ -7,9 +7,9 @@
* 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
@@ -23,8 +23,20 @@
import org.apache.qpid.AMQException;
/**
- * Signals that the removal of a message once its refcount reached
- * zero failed.
+ * 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
{
@@ -32,6 +44,7 @@
{
super("Failed to cleanup message with id " + messageId, e);
}
+
public MessageCleanupException(String message)
{
super(message);
Modified: incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/NoConsumersException.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/NoConsumersException.java?view=diff&rev=540119&r1=540118&r2=540119
==============================================================================
--- incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/NoConsumersException.java (original)
+++ incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/NoConsumersException.java Mon May 21 04:26:55 2007
@@ -7,9 +7,9 @@
* 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
@@ -24,9 +24,14 @@
import org.apache.qpid.server.RequiredDeliveryException;
/**
- * Signals that no consumers exist for a message at a given point in time.
- * Used if a message has immediate=true and there are no consumers registered
- * with the queue.
+ * NoConsumersException is a {@link RequiredDeliveryException} that represents the failure case where an immediate
+ * message cannot be delivered because there are presently no consumers for the message. The AMQP status code, 313, is
+ * always used to report this condition.
+ *
+ * <p/><table id="crc"><caption>CRC Card</caption>
+ * <tr><th> Responsibilities <th> Collaborations
+ * <tr><td> Represent failure to deliver a message that must be delivered.
+ * </table>
*/
public class NoConsumersException extends RequiredDeliveryException
{
Modified: incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/state/AMQStateManager.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/state/AMQStateManager.java?view=diff&rev=540119&r1=540118&r2=540119
==============================================================================
--- incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/state/AMQStateManager.java (original)
+++ incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/state/AMQStateManager.java Mon May 21 04:26:55 2007
@@ -26,6 +26,7 @@
import java.util.concurrent.CopyOnWriteArraySet;
import org.apache.log4j.Logger;
+
import org.apache.qpid.AMQException;
import org.apache.qpid.framing.AMQMethodBody;
import org.apache.qpid.framing.BasicAckBody;
@@ -35,6 +36,7 @@
import org.apache.qpid.framing.BasicPublishBody;
import org.apache.qpid.framing.BasicQosBody;
import org.apache.qpid.framing.BasicRecoverBody;
+import org.apache.qpid.framing.BasicRejectBody;
import org.apache.qpid.framing.ChannelCloseBody;
import org.apache.qpid.framing.ChannelCloseOkBody;
import org.apache.qpid.framing.ChannelFlowBody;
@@ -55,7 +57,6 @@
import org.apache.qpid.framing.TxCommitBody;
import org.apache.qpid.framing.TxRollbackBody;
import org.apache.qpid.framing.TxSelectBody;
-import org.apache.qpid.framing.BasicRejectBody;
import org.apache.qpid.protocol.AMQMethodEvent;
import org.apache.qpid.protocol.AMQMethodListener;
import org.apache.qpid.server.handler.BasicAckMethodHandler;
@@ -65,6 +66,7 @@
import org.apache.qpid.server.handler.BasicPublishMethodHandler;
import org.apache.qpid.server.handler.BasicQosHandler;
import org.apache.qpid.server.handler.BasicRecoverMethodHandler;
+import org.apache.qpid.server.handler.BasicRejectMethodHandler;
import org.apache.qpid.server.handler.ChannelCloseHandler;
import org.apache.qpid.server.handler.ChannelCloseOkHandler;
import org.apache.qpid.server.handler.ChannelFlowHandler;
@@ -83,9 +85,8 @@
import org.apache.qpid.server.handler.QueueDeleteHandler;
import org.apache.qpid.server.handler.QueuePurgeHandler;
import org.apache.qpid.server.handler.TxCommitHandler;
-import org.apache.qpid.server.handler.BasicRejectMethodHandler;
-import org.apache.qpid.server.handler.TxSelectHandler;
import org.apache.qpid.server.handler.TxRollbackHandler;
+import org.apache.qpid.server.handler.TxSelectHandler;
import org.apache.qpid.server.protocol.AMQProtocolSession;
import org.apache.qpid.server.virtualhost.VirtualHostRegistry;
@@ -107,18 +108,18 @@
* AMQFrame.
*/
private final EnumMap<AMQState, Map<Class<? extends AMQMethodBody>, StateAwareMethodListener<? extends AMQMethodBody>>> _state2HandlersMap =
- new EnumMap<AMQState, Map<Class<? extends AMQMethodBody>, StateAwareMethodListener<? extends AMQMethodBody>>>(AMQState.class);
-
+ new EnumMap<AMQState, Map<Class<? extends AMQMethodBody>, StateAwareMethodListener<? extends AMQMethodBody>>>(
+ AMQState.class);
private CopyOnWriteArraySet<StateListener> _stateListeners = new CopyOnWriteArraySet<StateListener>();
-
public AMQStateManager(VirtualHostRegistry virtualHostRegistry, AMQProtocolSession protocolSession)
{
this(AMQState.CONNECTION_NOT_STARTED, true, virtualHostRegistry, protocolSession);
}
- protected AMQStateManager(AMQState initial, boolean register, VirtualHostRegistry virtualHostRegistry, AMQProtocolSession protocolSession)
+ protected AMQStateManager(AMQState initial, boolean register, VirtualHostRegistry virtualHostRegistry,
+ AMQProtocolSession protocolSession)
{
_virtualHostRegistry = virtualHostRegistry;
_protocolSession = protocolSession;
@@ -220,37 +221,38 @@
checkChannel(evt, _protocolSession);
handler.methodReceived(this, evt);
+
return true;
}
+
return false;
}
private <B extends AMQMethodBody> void checkChannel(AMQMethodEvent<B> evt, AMQProtocolSession protocolSession)
- throws AMQException
+ throws AMQException
{
- if (evt.getChannelId() != 0
- && !(evt.getMethod() instanceof ChannelOpenBody)
- && (protocolSession.getChannel(evt.getChannelId()) == null)
- && !protocolSession.channelAwaitingClosure(evt.getChannelId()))
+ if ((evt.getChannelId() != 0) && !(evt.getMethod() instanceof ChannelOpenBody)
+ && (protocolSession.getChannel(evt.getChannelId()) == null)
+ && !protocolSession.channelAwaitingClosure(evt.getChannelId()))
{
throw evt.getMethod().getChannelNotFoundException(evt.getChannelId());
}
}
protected <B extends AMQMethodBody> StateAwareMethodListener<B> findStateTransitionHandler(AMQState currentState,
- B frame)
- throws IllegalStateTransitionException
+ B frame)
+ // throws IllegalStateTransitionException
{
- final Map<Class<? extends AMQMethodBody>, StateAwareMethodListener<? extends AMQMethodBody>>
- classToHandlerMap = _state2HandlersMap.get(currentState);
+ final Map<Class<? extends AMQMethodBody>, StateAwareMethodListener<? extends AMQMethodBody>> classToHandlerMap =
+ _state2HandlersMap.get(currentState);
- final StateAwareMethodListener<B> handler = classToHandlerMap == null
- ? null
- : (StateAwareMethodListener<B>) classToHandlerMap.get(frame.getClass());
+ final StateAwareMethodListener<B> handler =
+ (classToHandlerMap == null) ? null : (StateAwareMethodListener<B>) classToHandlerMap.get(frame.getClass());
if (handler == null)
{
_logger.debug("No state transition handler defined for receiving frame " + frame);
+
return null;
}
else
Modified: incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/state/IllegalStateTransitionException.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/state/IllegalStateTransitionException.java?view=diff&rev=540119&r1=540118&r2=540119
==============================================================================
--- incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/state/IllegalStateTransitionException.java (original)
+++ incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/state/IllegalStateTransitionException.java Mon May 21 04:26:55 2007
@@ -7,9 +7,9 @@
* 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
@@ -22,6 +22,11 @@
import org.apache.qpid.AMQException;
+/**
+ * @todo Not an AMQP exception as no status code.
+ *
+ * @todo Not used! Delete.
+ */
public class IllegalStateTransitionException extends AMQException
{
private AMQState _originalState;
@@ -30,8 +35,7 @@
public IllegalStateTransitionException(AMQState originalState, Class frame)
{
- super("No valid state transition defined for receiving frame " + frame +
- " from state " + originalState);
+ super("No valid state transition defined for receiving frame " + frame + " from state " + originalState);
_originalState = originalState;
_frame = frame;
}
Modified: incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/AMQAuthenticationException.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/AMQAuthenticationException.java?view=diff&rev=540119&r1=540118&r2=540119
==============================================================================
--- incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/AMQAuthenticationException.java (original)
+++ incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/AMQAuthenticationException.java Mon May 21 04:26:55 2007
@@ -7,9 +7,9 @@
* 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
@@ -23,10 +23,20 @@
import org.apache.qpid.AMQException;
import org.apache.qpid.protocol.AMQConstant;
+/**
+ * AMQAuthenticationException represents all failures to authenticate access to a broker.
+ *
+ * <p/><table id="crc"><caption>CRC Card</caption>
+ * <tr><th> Responsibilities <th> Collaborations
+ * <tr><td> Represent failure to authenticate the client.
+ * </table>
+ *
+ * @todo Will this alwyas have the same status code, NOT_ALLOWED 530? Might set this up to always use that code.
+ */
public class AMQAuthenticationException extends AMQException
{
public AMQAuthenticationException(AMQConstant error, String msg)
{
- super(error,msg);
+ super(error, msg);
}
}
Modified: incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/AMQNoConsumersException.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/AMQNoConsumersException.java?view=diff&rev=540119&r1=540118&r2=540119
==============================================================================
--- incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/AMQNoConsumersException.java (original)
+++ incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/AMQNoConsumersException.java Mon May 21 04:26:55 2007
@@ -7,9 +7,9 @@
* 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
@@ -23,15 +23,18 @@
import org.apache.qpid.AMQUndeliveredException;
import org.apache.qpid.protocol.AMQConstant;
-
+/**
+ * AMQNoConsumersException indicates failure to pass an immediate message to a consumer.
+ *
+ * <p/><table id="crc"><caption>CRC Card</caption>
+ * <tr><th> Responsibilities <th> Collaborations
+ * <tr><td> Represents failure to pass an immediate message to a consumer.
+ * <tr><td>
+ */
public class AMQNoConsumersException extends AMQUndeliveredException
{
public AMQNoConsumersException(String msg, Object bounced)
{
super(AMQConstant.NO_CONSUMERS, msg, bounced);
}
-
-
}
-
-
Modified: incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/AMQNoRouteException.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/AMQNoRouteException.java?view=diff&rev=540119&r1=540118&r2=540119
==============================================================================
--- incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/AMQNoRouteException.java (original)
+++ incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/AMQNoRouteException.java Mon May 21 04:26:55 2007
@@ -7,9 +7,9 @@
* 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
@@ -23,15 +23,18 @@
import org.apache.qpid.AMQUndeliveredException;
import org.apache.qpid.protocol.AMQConstant;
-
+/**
+ * AMQNoRouteException indicates that a mandatory message could not be routed.
+ *
+ * <p/><table id="crc"><caption>CRC Card</caption>
+ * <tr><th> Responsibilities <th> Collaborations
+ * <tr><td> Represents failure to route a mandatory message.
+ * <tr><td>
+ */
public class AMQNoRouteException extends AMQUndeliveredException
{
public AMQNoRouteException(String msg, Object bounced)
{
super(AMQConstant.NO_ROUTE, msg, bounced);
}
-
-
}
-
-
Modified: incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/message/UnexpectedBodyReceivedException.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/message/UnexpectedBodyReceivedException.java?view=diff&rev=540119&r1=540118&r2=540119
==============================================================================
--- incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/message/UnexpectedBodyReceivedException.java (original)
+++ incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/message/UnexpectedBodyReceivedException.java Mon May 21 04:26:55 2007
@@ -23,6 +23,9 @@
import org.apache.qpid.AMQException;
import org.apache.qpid.protocol.AMQConstant;
+/**
+ * @todo Not used! Delete!
+ */
public class UnexpectedBodyReceivedException extends AMQException
{
public UnexpectedBodyReceivedException(String msg, Throwable t)
Modified: incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/message/UnprocessedMessage.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/message/UnprocessedMessage.java?view=diff&rev=540119&r1=540118&r2=540119
==============================================================================
--- incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/message/UnprocessedMessage.java (original)
+++ incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/message/UnprocessedMessage.java Mon May 21 04:26:55 2007
@@ -63,7 +63,7 @@
_bounceBody = bounceBody;
}
- public void receiveBody(ContentBody body) throws UnexpectedBodyReceivedException
+ public void receiveBody(ContentBody body) //throws UnexpectedBodyReceivedException
{
if (body.payload != null)
Modified: incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/protocol/AMQProtocolSession.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/protocol/AMQProtocolSession.java?view=diff&rev=540119&r1=540118&r2=540119
==============================================================================
--- incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/protocol/AMQProtocolSession.java (original)
+++ incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/protocol/AMQProtocolSession.java Mon May 21 04:26:55 2007
@@ -39,7 +39,7 @@
import org.apache.qpid.client.AMQConnection;
import org.apache.qpid.client.AMQSession;
import org.apache.qpid.client.ConnectionTuneParameters;
-import org.apache.qpid.client.message.UnexpectedBodyReceivedException;
+// import org.apache.qpid.client.message.UnexpectedBodyReceivedException;
import org.apache.qpid.client.message.UnprocessedMessage;
import org.apache.qpid.client.state.AMQStateManager;
import org.apache.qpid.framing.AMQDataBlock;
@@ -106,10 +106,9 @@
private final AMQConnection _connection;
-
public AMQProtocolSession(AMQProtocolHandler protocolHandler, IoSession protocolSession, AMQConnection connection)
{
- this(protocolHandler,protocolSession,connection, new AMQStateManager());
+ this(protocolHandler, protocolSession, connection, new AMQStateManager());
}
@@ -269,15 +268,15 @@
throw new AMQException("Error: received content body without having received a ContentHeader frame first");
}
- try
- {
- msg.receiveBody(contentBody);
- }
+ /*try
+ {*/
+ msg.receiveBody(contentBody);
+ /*}
catch (UnexpectedBodyReceivedException e)
{
_channelId2UnprocessedMsgMap.remove(channelId);
throw e;
- }
+ }*/
if (msg.isAllBodyDataReceived())
{
@@ -327,7 +326,6 @@
_lastWriteFuture = f;
}
}
-
/**
* Starts the process of closing a session
Modified: incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/state/AMQStateManager.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/state/AMQStateManager.java?view=diff&rev=540119&r1=540118&r2=540119
==============================================================================
--- incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/state/AMQStateManager.java (original)
+++ incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/state/AMQStateManager.java Mon May 21 04:26:55 2007
@@ -186,7 +186,7 @@
protected StateAwareMethodListener findStateTransitionHandler(AMQState currentState,
AMQMethodBody frame)
- throws IllegalStateTransitionException
+ // throws IllegalStateTransitionException
{
final Class clazz = frame.getClass();
if (_logger.isDebugEnabled())
Modified: incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/state/IllegalStateTransitionException.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/state/IllegalStateTransitionException.java?view=diff&rev=540119&r1=540118&r2=540119
==============================================================================
--- incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/state/IllegalStateTransitionException.java (original)
+++ incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/state/IllegalStateTransitionException.java Mon May 21 04:26:55 2007
@@ -22,6 +22,11 @@
import org.apache.qpid.AMQException;
+/**
+ * @todo Not an AMQP exception as no status code.
+ *
+ * @todo Not used! Delete.
+ */
public class IllegalStateTransitionException extends AMQException
{
private AMQState _originalState;
Modified: incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/transport/AMQNoTransportForProtocolException.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/transport/AMQNoTransportForProtocolException.java?view=diff&rev=540119&r1=540118&r2=540119
==============================================================================
--- incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/transport/AMQNoTransportForProtocolException.java (original)
+++ incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/transport/AMQNoTransportForProtocolException.java Mon May 21 04:26:55 2007
@@ -22,6 +22,16 @@
import org.apache.qpid.jms.BrokerDetails;
+/**
+ * AMQNoTransportForProtocolException represents a connection failure where there is no transport medium to connect
+ * to the broker available. This may be the case if their is a error in the connection url, or an unsupported transport
+ * type is specified.
+ *
+ * <p/><table id="crc"><caption>CRC Card</caption>
+ * <tr><th> Responsibilities <th> Collaborations
+ * <tr><td> Represent absence of a transport medium.
+ * </table>
+ */
public class AMQNoTransportForProtocolException extends AMQTransportConnectionException
{
BrokerDetails _details;
Modified: incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/transport/AMQTransportConnectionException.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/transport/AMQTransportConnectionException.java?view=diff&rev=540119&r1=540118&r2=540119
==============================================================================
--- incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/transport/AMQTransportConnectionException.java (original)
+++ incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/transport/AMQTransportConnectionException.java Mon May 21 04:26:55 2007
@@ -23,6 +23,15 @@
import org.apache.qpid.AMQException;
import org.apache.qpid.protocol.AMQConstant;
+/**
+ * AMQTransportConnectionException indicates a failure to establish a connection through the transporting medium, to
+ * an AMQP broker.
+ *
+ * <p/><table id="crc"><caption>CRC Card</caption>
+ * <tr><th> Responsibilities <th> Collaborations
+ * <tr><td> Represent failure to connect through the transport medium.
+ * </table>
+ */
public class AMQTransportConnectionException extends AMQException
{
public AMQTransportConnectionException(AMQConstant errorCode, String message, Throwable cause)
Modified: incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/vmbroker/AMQVMBrokerCreationException.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/vmbroker/AMQVMBrokerCreationException.java?view=diff&rev=540119&r1=540118&r2=540119
==============================================================================
--- incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/vmbroker/AMQVMBrokerCreationException.java (original)
+++ incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/vmbroker/AMQVMBrokerCreationException.java Mon May 21 04:26:55 2007
@@ -23,6 +23,14 @@
import org.apache.qpid.client.transport.AMQTransportConnectionException;
import org.apache.qpid.protocol.AMQConstant;
+/**
+ * AMQVMBrokerCreationException represents failure to create an in VM broker on the vm transport medium.
+ *
+ * <p/><table id="crc"><caption>CRC Card</caption>
+ * <tr><th> Responsibilities <th> Collaborations
+ * <tr><td> Represent failure to create an in VM broker.
+ * </table>
+ */
public class AMQVMBrokerCreationException extends AMQTransportConnectionException
{
private int _port;
Modified: incubator/qpid/trunk/qpid/java/cluster/src/main/java/org/apache/qpid/server/cluster/AMQConnectionWaitException.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/cluster/src/main/java/org/apache/qpid/server/cluster/AMQConnectionWaitException.java?view=diff&rev=540119&r1=540118&r2=540119
==============================================================================
--- incubator/qpid/trunk/qpid/java/cluster/src/main/java/org/apache/qpid/server/cluster/AMQConnectionWaitException.java (original)
+++ incubator/qpid/trunk/qpid/java/cluster/src/main/java/org/apache/qpid/server/cluster/AMQConnectionWaitException.java Mon May 21 04:26:55 2007
@@ -22,6 +22,16 @@
import org.apache.qpid.AMQException;
+/**
+ * AMQConnectionWaitException represents a failure to connect to a cluster peer in a timely manner.
+ *
+ * <p/><table id="crc"><caption>CRC Card</caption>
+ * <tr><th> Responsibilities <th> Collaborations
+ * <tr><td> Represents failure to connect to a cluster peer in a timely manner.
+ * </table>
+ *
+ * @todo Not an AMQP exception as no status code.
+ */
public class AMQConnectionWaitException extends AMQException
{
public AMQConnectionWaitException(String s, Throwable e)
Modified: incubator/qpid/trunk/qpid/java/cluster/src/main/java/org/apache/qpid/server/cluster/AMQUnexpectedBodyTypeException.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/cluster/src/main/java/org/apache/qpid/server/cluster/AMQUnexpectedBodyTypeException.java?view=diff&rev=540119&r1=540118&r2=540119
==============================================================================
--- incubator/qpid/trunk/qpid/java/cluster/src/main/java/org/apache/qpid/server/cluster/AMQUnexpectedBodyTypeException.java (original)
+++ incubator/qpid/trunk/qpid/java/cluster/src/main/java/org/apache/qpid/server/cluster/AMQUnexpectedBodyTypeException.java Mon May 21 04:26:55 2007
@@ -23,9 +23,22 @@
import org.apache.qpid.AMQException;
import org.apache.qpid.framing.AMQBody;
+/**
+ * AMQUnexpectedBodyTypeException represents a failure where a message body does not match its expected type. For example,
+ * and AMQP method should have a method body.
+ *
+ * <p/><table id="crc"><caption>CRC Card</caption>
+ * <tr><th> Responsibilities <th> Collaborations
+ * <tr><td> Represents a failure where a message body does not match its expected type.
+ * </table>
+ *
+ * @todo Not an AMQP exception as no status code.
+ *
+ * @todo Seems like this exception was created to handle an unsafe type cast that will never happen in practice. Would
+ * be better just to leave that as a ClassCastException. Check that the framing layer will pick up the error first.
+ */
public class AMQUnexpectedBodyTypeException extends AMQException
{
-
public AMQUnexpectedBodyTypeException(Class<? extends AMQBody> expectedClass, AMQBody body)
{
super("Unexpected body type. Expected: " + expectedClass.getName() + "; got: " + body.getClass().getName());
Modified: incubator/qpid/trunk/qpid/java/cluster/src/main/java/org/apache/qpid/server/cluster/AMQUnexpectedFrameTypeException.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/cluster/src/main/java/org/apache/qpid/server/cluster/AMQUnexpectedFrameTypeException.java?view=diff&rev=540119&r1=540118&r2=540119
==============================================================================
--- incubator/qpid/trunk/qpid/java/cluster/src/main/java/org/apache/qpid/server/cluster/AMQUnexpectedFrameTypeException.java (original)
+++ incubator/qpid/trunk/qpid/java/cluster/src/main/java/org/apache/qpid/server/cluster/AMQUnexpectedFrameTypeException.java Mon May 21 04:26:55 2007
@@ -22,6 +22,20 @@
import org.apache.qpid.AMQException;
+/**
+ * AMQUnexpectedFrameTypeException represents a failure when Mina passes an unexpected frame type.
+ *
+ * <p/><table id="crc"><caption>CRC Card</caption>
+ * <tr><th> Responsibilities <th> Collaborations
+ * <tr><td> Represents failure to cast a frame to its expected type.
+ * </table>
+ *
+ * @todo Not an AMQP exception as no status code.
+ *
+ * @todo Seems like this exception was created to handle an unsafe type cast that will never happen in practice. Would
+ * be better just to leave that as a ClassCastException. However, check the framing layer catches this error
+ * first.
+ */
public class AMQUnexpectedFrameTypeException extends AMQException
{
public AMQUnexpectedFrameTypeException(String s)
Modified: incubator/qpid/trunk/qpid/java/cluster/src/main/java/org/apache/qpid/server/cluster/ClientHandlerRegistry.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/cluster/src/main/java/org/apache/qpid/server/cluster/ClientHandlerRegistry.java?view=diff&rev=540119&r1=540118&r2=540119
==============================================================================
--- incubator/qpid/trunk/qpid/java/cluster/src/main/java/org/apache/qpid/server/cluster/ClientHandlerRegistry.java (original)
+++ incubator/qpid/trunk/qpid/java/cluster/src/main/java/org/apache/qpid/server/cluster/ClientHandlerRegistry.java Mon May 21 04:26:55 2007
@@ -27,7 +27,7 @@
import org.apache.qpid.client.handler.ConnectionTuneMethodHandler;
import org.apache.qpid.client.state.AMQState;
import org.apache.qpid.client.state.AMQStateManager;
-import org.apache.qpid.client.state.IllegalStateTransitionException;
+// import org.apache.qpid.client.state.IllegalStateTransitionException;
import org.apache.qpid.client.state.StateAwareMethodListener;
import org.apache.qpid.client.protocol.AMQProtocolSession;
import org.apache.qpid.framing.*;
@@ -78,7 +78,7 @@
return registry;
}
- protected StateAwareMethodListener findStateTransitionHandler(AMQState state, AMQMethodBody frame) throws IllegalStateTransitionException
+ protected StateAwareMethodListener findStateTransitionHandler(AMQState state, AMQMethodBody frame) //throws IllegalStateTransitionException
{
ClientRegistry registry = _handlers.get(state);
return registry == null ? null : registry.getHandler(frame);
Modified: incubator/qpid/trunk/qpid/java/cluster/src/main/java/org/apache/qpid/server/cluster/ServerHandlerRegistry.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/cluster/src/main/java/org/apache/qpid/server/cluster/ServerHandlerRegistry.java?view=diff&rev=540119&r1=540118&r2=540119
==============================================================================
--- incubator/qpid/trunk/qpid/java/cluster/src/main/java/org/apache/qpid/server/cluster/ServerHandlerRegistry.java (original)
+++ incubator/qpid/trunk/qpid/java/cluster/src/main/java/org/apache/qpid/server/cluster/ServerHandlerRegistry.java Mon May 21 04:26:55 2007
@@ -24,7 +24,7 @@
import org.apache.qpid.framing.AMQMethodBody;
import org.apache.qpid.server.state.AMQState;
import org.apache.qpid.server.state.AMQStateManager;
-import org.apache.qpid.server.state.IllegalStateTransitionException;
+//import org.apache.qpid.server.state.IllegalStateTransitionException;
import org.apache.qpid.server.state.StateAwareMethodListener;
import org.apache.qpid.server.cluster.util.LogMessage;
import org.apache.qpid.server.queue.QueueRegistry;
@@ -74,7 +74,7 @@
}
}
- protected <B extends AMQMethodBody> StateAwareMethodListener<B> findStateTransitionHandler(AMQState state, B frame) throws IllegalStateTransitionException
+ protected <B extends AMQMethodBody> StateAwareMethodListener<B> findStateTransitionHandler(AMQState state, B frame) //throws IllegalStateTransitionException
{
MethodHandlerRegistry registry = _handlers.get(state);
StateAwareMethodListener<B> handler = (registry == null) ? null : registry.getHandler(frame);
Modified: incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/AMQChannelClosedException.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/AMQChannelClosedException.java?view=diff&rev=540119&r1=540118&r2=540119
==============================================================================
--- incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/AMQChannelClosedException.java (original)
+++ incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/AMQChannelClosedException.java Mon May 21 04:26:55 2007
@@ -7,9 +7,9 @@
* 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
@@ -23,7 +23,14 @@
import org.apache.qpid.protocol.AMQConstant;
/**
- * AMQ channel closed exception.
+ * AMQChannelClosedException indicates that an operation cannot be performed becauase a channel has been closed.
+ *
+ * <p/><table id="crc"><caption>CRC Card</caption>
+ * <tr><th> Responsibilities <th> Collaborations
+ * <tr><td> Represents a failed operation on a closed channel.
+ * </table>
+ *
+ * @todo Does this duplicate AMQChannelException?
*/
public class AMQChannelClosedException extends AMQException
{
@@ -32,5 +39,3 @@
super(errorCode, msg);
}
}
-
-
Modified: incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/AMQChannelException.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/AMQChannelException.java?view=diff&rev=540119&r1=540118&r2=540119
==============================================================================
--- incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/AMQChannelException.java (original)
+++ incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/AMQChannelException.java Mon May 21 04:26:55 2007
@@ -25,6 +25,16 @@
import org.apache.qpid.framing.ChannelCloseBody;
import org.apache.qpid.protocol.AMQConstant;
+/**
+ * AMQChannelException indicates that an error that requires the channel to be closed has occurred.
+ *
+ * <p/><table id="crc"><caption>CRC Card</caption>
+ * <tr><th> Responsibilities <th> Collaborations
+ * <tr><td> Represents an error that rquires the channel to be closed.
+ * </table>
+ *
+ * @todo Does this duplicate AMQChannelClosedException?
+ */
public class AMQChannelException extends AMQException
{
private final int _classId;
Modified: incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/AMQConnectionClosedException.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/AMQConnectionClosedException.java?view=diff&rev=540119&r1=540118&r2=540119
==============================================================================
--- incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/AMQConnectionClosedException.java (original)
+++ incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/AMQConnectionClosedException.java Mon May 21 04:26:55 2007
@@ -7,9 +7,9 @@
* 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
@@ -23,7 +23,14 @@
import org.apache.qpid.protocol.AMQConstant;
/**
- * AMQ channel closed exception.
+ * AMQConnectionClosedException indicates that an operation cannot be performed becauase a connection has been closed.
+ *
+ * <p/><table id="crc"><caption>CRC Card</caption>
+ * <tr><th> Responsibilities <th> Collaborations
+ * <tr><td> Represents a failed operation on a closed conneciton.
+ * </table>
+ *
+ * @todo Does this duplicate AMQConnectionException?
*/
public class AMQConnectionClosedException extends AMQException
{
@@ -32,5 +39,3 @@
super(errorCode, msg);
}
}
-
-
Modified: incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/AMQConnectionException.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/AMQConnectionException.java?view=diff&rev=540119&r1=540118&r2=540119
==============================================================================
--- incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/AMQConnectionException.java (original)
+++ incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/AMQConnectionException.java Mon May 21 04:26:55 2007
@@ -7,9 +7,9 @@
* 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
@@ -26,6 +26,16 @@
import org.apache.qpid.framing.ConnectionCloseBody;
import org.apache.qpid.protocol.AMQConstant;
+/**
+ * AMQConnectionException indicates that an error that requires the channel to be closed has occurred.
+ *
+ * <p/><table id="crc"><caption>CRC Card</caption>
+ * <tr><th> Responsibilities <th> Collaborations
+ * <tr><td> Represents an error that rquires the channel to be closed.
+ * </table>
+ *
+ * @todo Does this duplicate AMQChannelClosedException?
+ */
public class AMQConnectionException extends AMQException
{
private final int _classId;
@@ -35,7 +45,8 @@
private final byte minor;
boolean _closeConnetion;
- public AMQConnectionException(AMQConstant errorCode, String msg, int classId, int methodId, byte major, byte minor, Throwable t)
+ public AMQConnectionException(AMQConstant errorCode, String msg, int classId, int methodId, byte major, byte minor,
+ Throwable t)
{
super(errorCode, msg, t);
_classId = classId;
@@ -53,12 +64,10 @@
this.minor = minor;
}
-
-
public AMQFrame getCloseFrame(int channel)
{
- return ConnectionCloseBody.createAMQFrame(channel, major, minor, _classId, _methodId, getErrorCode().getCode(), new AMQShortString(getMessage()));
+ return ConnectionCloseBody.createAMQFrame(channel, major, minor, _classId, _methodId, getErrorCode().getCode(),
+ new AMQShortString(getMessage()));
}
-
}
Modified: incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/AMQConnectionFailureException.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/AMQConnectionFailureException.java?view=diff&rev=540119&r1=540118&r2=540119
==============================================================================
--- incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/AMQConnectionFailureException.java (original)
+++ incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/AMQConnectionFailureException.java Mon May 21 04:26:55 2007
@@ -1,5 +1,15 @@
package org.apache.qpid;
+/**
+ * AMQConnectionFailureException indicates that a connection to a broker could not be formed.
+ *
+ * <p/><table id="crc"><caption>CRC Card</caption>
+ * <tr><th> Responsibilities <th> Collaborations
+ * <tr><td> Represents failure to connect to a broker.
+ * </table>
+ *
+ * @todo Not an AMQP exception as no status code.
+ */
public class AMQConnectionFailureException extends AMQException
{
public AMQConnectionFailureException(String message)
Modified: incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/AMQDisconnectedException.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/AMQDisconnectedException.java?view=diff&rev=540119&r1=540118&r2=540119
==============================================================================
--- incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/AMQDisconnectedException.java (original)
+++ incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/AMQDisconnectedException.java Mon May 21 04:26:55 2007
@@ -7,9 +7,9 @@
* 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
@@ -21,7 +21,14 @@
package org.apache.qpid;
/**
- * AMQ disconnected exception.
+ * AMQDisconnectedException indicates that a broker disconnected without failover.
+ *
+ * <p/><table id="crc"><caption>CRC Card</caption>
+ * <tr><th> Responsibilities <th> Collaborations
+ * <tr><td> Represents disconnection without failover by the broker.
+ * </table>
+ *
+ * @todo Not an AMQP exception as no status code.
*/
public class AMQDisconnectedException extends AMQException
{
@@ -30,5 +37,3 @@
super(msg);
}
}
-
-
Modified: incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/AMQException.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/AMQException.java?view=diff&rev=540119&r1=540118&r2=540119
==============================================================================
--- incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/AMQException.java (original)
+++ incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/AMQException.java Mon May 21 04:26:55 2007
@@ -24,11 +24,11 @@
/**
* AMQException forms the root exception of all exceptions relating to the AMQ protocol. It provides space to associate
- * an AMQ error code with the exception, which is a numberic value, with a meaning defined by the protocol.
+ * a required AMQ error code with the exception, which is a numeric value, with a meaning defined by the protocol.
*
* <p/><table id="crc"><caption>CRC Card</caption>
* <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Represents an exception condition associated with an AMQ protocol error code.
+ * <tr><td> Represents an exception condition associated with an AMQ protocol status code.
* </table>
*
* @todo This exception class is also used as a generic exception throughout Qpid code. This usage may not be strictly
Modified: incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/AMQInvalidArgumentException.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/AMQInvalidArgumentException.java?view=diff&rev=540119&r1=540118&r2=540119
==============================================================================
--- incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/AMQInvalidArgumentException.java (original)
+++ incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/AMQInvalidArgumentException.java Mon May 21 04:26:55 2007
@@ -14,14 +14,22 @@
* "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.
+ * under the License.
+ *
*
- *
*/
package org.apache.qpid;
import org.apache.qpid.protocol.AMQConstant;
+/**
+ * AMQInvalidArgumentException indicates that an invalid argument has been passed to an AMQP method.
+ *
+ * <p/><table id="crc"><caption>CRC Card</caption>
+ * <tr><th> Responsibilities <th> Collaborations
+ * <tr><td> Represents an error due to an invalid argument being passed to an AMQP method.
+ * </table>
+ */
public class AMQInvalidArgumentException extends AMQException
{
public AMQInvalidArgumentException(String message)
Modified: incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/AMQInvalidRoutingKeyException.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/AMQInvalidRoutingKeyException.java?view=diff&rev=540119&r1=540118&r2=540119
==============================================================================
--- incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/AMQInvalidRoutingKeyException.java (original)
+++ incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/AMQInvalidRoutingKeyException.java Mon May 21 04:26:55 2007
@@ -22,6 +22,14 @@
import org.apache.qpid.protocol.AMQConstant;
+/**
+ * AMQInvalidRoutingKeyException indicates an error with a routing key having an invalid format.
+ *
+ * <p/><table id="crc"><caption>CRC Card</caption>
+ * <tr><th> Responsibilities <th> Collaborations
+ * <tr><td> Represents a format error in a routing key.
+ * </table>
+ */
public class AMQInvalidRoutingKeyException extends AMQException
{
public AMQInvalidRoutingKeyException(String message)
Modified: incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/AMQTimeoutException.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/AMQTimeoutException.java?view=diff&rev=540119&r1=540118&r2=540119
==============================================================================
--- incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/AMQTimeoutException.java (original)
+++ incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/AMQTimeoutException.java Mon May 21 04:26:55 2007
@@ -14,14 +14,22 @@
* "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.
+ * under the License.
+ *
*
- *
*/
package org.apache.qpid;
import org.apache.qpid.protocol.AMQConstant;
+/**
+ * AMQTimeoutException indicates that an expected response from a broker took too long.
+ *
+ * <p/><table id="crc"><caption>CRC Card</caption>
+ * <tr><th> Responsibilities <th> Collaborations
+ * <tr><td> Indicates that an expected response from a broker took too long.
+ * </table>
+ */
public class AMQTimeoutException extends AMQException
{
public AMQTimeoutException(String message)
Modified: incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/AMQUndeliveredException.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/AMQUndeliveredException.java?view=diff&rev=540119&r1=540118&r2=540119
==============================================================================
--- incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/AMQUndeliveredException.java (original)
+++ incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/AMQUndeliveredException.java Mon May 21 04:26:55 2007
@@ -7,9 +7,9 @@
* 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
@@ -23,7 +23,12 @@
import org.apache.qpid.protocol.AMQConstant;
/**
- * Generic AMQ exception.
+ * AMQUndeliveredException indicates that a message, marked immediate or mandatory, could not be delivered.
+ *
+ * <p/><table id="crc"><caption>CRC Card</caption>
+ * <tr><th> Responsibilities <th> Collaborations
+ * <tr><td> Represents failure to delivery a message that must be delivered.
+ * </table>
*/
public class AMQUndeliveredException extends AMQException
{
@@ -40,7 +45,4 @@
{
return _bounced;
}
-
}
-
-
Modified: incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/AMQUnknownExchangeType.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/AMQUnknownExchangeType.java?view=diff&rev=540119&r1=540118&r2=540119
==============================================================================
--- incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/AMQUnknownExchangeType.java (original)
+++ incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/AMQUnknownExchangeType.java Mon May 21 04:26:55 2007
@@ -1,5 +1,18 @@
package org.apache.qpid;
+/**
+ * AMQUnknownExchangeType represents coding error where unknown exchange type requested from exchange factory.
+ *
+ * <p/><table id="crc"><caption>CRC Card</caption>
+ * <tr><th> Responsibilities <th> Collaborations
+ * <tr><td> Represents unknown exchange type request.
+ * <tr><td>
+ *
+ * @todo Not an AMQP exception as no status code.
+ *
+ * @todo Represent coding error, where unknown exchange type is requested by passing a string parameter. Use a type safe
+ * enum for the exchange type, or replace with IllegalArgumentException. Should be runtime.
+ */
public class AMQUnknownExchangeType extends AMQException
{
public AMQUnknownExchangeType(String message)
Modified: incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/AMQUnresolvedAddressException.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/AMQUnresolvedAddressException.java?view=diff&rev=540119&r1=540118&r2=540119
==============================================================================
--- incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/AMQUnresolvedAddressException.java (original)
+++ incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/AMQUnresolvedAddressException.java Mon May 21 04:26:55 2007
@@ -7,9 +7,9 @@
* 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
@@ -20,6 +20,19 @@
*/
package org.apache.qpid;
+/**
+ * AMQUnresolvedAddressException indicates failure to resolve a socket address.
+ *
+ * <p/><table id="crc"><caption>CRC Card</caption>
+ * <tr><th> Responsibilities <th> Collaborations
+ * <tr><td> Represents failre to resolve a socket address.
+ * </table>
+ *
+ * @todo Not an AMQP exception as no status code.
+ *
+ * @todo Why replace java.nio.UnresolvedAddressException with this? This is checked, which may explain why, but it
+ * doesn't wrap the underlying exception.
+ */
public class AMQUnresolvedAddressException extends AMQException
{
String _broker;
@@ -32,6 +45,6 @@
public String toString()
{
- return super.toString() + " Broker, \"" + _broker +"\"";
+ return super.toString() + " Broker, \"" + _broker + "\"";
}
}
Modified: incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/configuration/PropertyException.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/configuration/PropertyException.java?view=diff&rev=540119&r1=540118&r2=540119
==============================================================================
--- incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/configuration/PropertyException.java (original)
+++ incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/configuration/PropertyException.java Mon May 21 04:26:55 2007
@@ -32,8 +32,7 @@
* <tr><td> Represent failure to expand a property name into a value.
* </table>
*
- * @todo AMQException is to be reserved for protocol related conditions. This exception does not have a status code, so
- * don't inherit from AMQException.
+ * @todo Not an AMQP exception as no status code.
*/
public class PropertyException extends AMQException
{
Modified: incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQFrameDecodingException.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQFrameDecodingException.java?view=diff&rev=540119&r1=540118&r2=540119
==============================================================================
--- incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQFrameDecodingException.java (original)
+++ incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQFrameDecodingException.java Mon May 21 04:26:55 2007
@@ -23,13 +23,17 @@
import org.apache.qpid.AMQException;
import org.apache.qpid.protocol.AMQConstant;
+/**
+ * AMQFrameDecodingException indicates that an AMQP frame cannot be decoded because it does not have the correct
+ * format as defined by the protocol.
+ *
+ * <p/><table id="crc"><caption>CRC Card</caption>
+ * <tr><th> Responsibilities <th> Collaborations
+ * <tr><td> Represents a format error in a protocol frame.
+ * </table>
+ */
public class AMQFrameDecodingException extends AMQException
{
- /*public AMQFrameDecodingException(String message)
- {
- super(message);
- }*/
-
public AMQFrameDecodingException(AMQConstant errorCode, String message, Throwable t)
{
super(errorCode, message, t);
Modified: incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQProtocolClassException.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQProtocolClassException.java?view=diff&rev=540119&r1=540118&r2=540119
==============================================================================
--- incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQProtocolClassException.java (original)
+++ incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQProtocolClassException.java Mon May 21 04:26:55 2007
@@ -7,9 +7,9 @@
* 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
@@ -20,10 +20,20 @@
*/
package org.apache.qpid.framing;
+/**
+ * AMQProtocolInstanceException indicates that the protocol class is incorrect in a header.
+ *
+ * <p/><table id="crc"><caption>CRC Card</caption>
+ * <tr><th> Responsibilities <th> Collaborations
+ * <tr><td> Represent incorrect protocol class in frame header.
+ * </table>
+ *
+ * @todo Not an AMQP exception as no status code.
+ */
public class AMQProtocolClassException extends AMQProtocolHeaderException
{
- public AMQProtocolClassException(String message)
- {
- super(message);
- }
-}
\ No newline at end of file
+ public AMQProtocolClassException(String message)
+ {
+ super(message);
+ }
+}