summaryrefslogtreecommitdiff
path: root/qpid/java/client/src/main/java/org/apache/qpid/client/failover
diff options
context:
space:
mode:
Diffstat (limited to 'qpid/java/client/src/main/java/org/apache/qpid/client/failover')
-rw-r--r--qpid/java/client/src/main/java/org/apache/qpid/client/failover/FailoverException.java9
-rw-r--r--qpid/java/client/src/main/java/org/apache/qpid/client/failover/FailoverHandler.java28
-rw-r--r--qpid/java/client/src/main/java/org/apache/qpid/client/failover/FailoverProtectedOperation.java9
-rw-r--r--qpid/java/client/src/main/java/org/apache/qpid/client/failover/FailoverRetrySupport.java30
-rw-r--r--qpid/java/client/src/main/java/org/apache/qpid/client/failover/FailoverState.java5
-rw-r--r--qpid/java/client/src/main/java/org/apache/qpid/client/failover/FailoverSupport.java9
6 files changed, 30 insertions, 60 deletions
diff --git a/qpid/java/client/src/main/java/org/apache/qpid/client/failover/FailoverException.java b/qpid/java/client/src/main/java/org/apache/qpid/client/failover/FailoverException.java
index 037b0dc2d1..31a2868c13 100644
--- a/qpid/java/client/src/main/java/org/apache/qpid/client/failover/FailoverException.java
+++ b/qpid/java/client/src/main/java/org/apache/qpid/client/failover/FailoverException.java
@@ -24,13 +24,8 @@ package org.apache.qpid.client.failover;
* FailoverException is used to indicate that a synchronous request has failed to receive the reply that it is waiting
* for because the fail-over process has been started whilst it was waiting for its reply. Synchronous methods generally
* raise this exception to indicate that they must be re-tried once the fail-over process has completed.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Used to indicate failure of a synchronous request due to fail-over.
- * </table>
- *
- * @todo This exception is created and passed as an argument to a method, rather than thrown. The exception is being
+ * <p>
+ * TODO This exception is created and passed as an argument to a method, rather than thrown. The exception is being
* used to represent an event, passed out to other threads. Use of exceptions as arguments rather than as
* exceptions is extremly confusing. Ideally use a condition or set a flag and check it instead.
* This exceptions-as-events pattern seems to be in a similar style to Mina code, which is not pretty, but
diff --git a/qpid/java/client/src/main/java/org/apache/qpid/client/failover/FailoverHandler.java b/qpid/java/client/src/main/java/org/apache/qpid/client/failover/FailoverHandler.java
index 4099da18d2..315e3c4a3f 100644
--- a/qpid/java/client/src/main/java/org/apache/qpid/client/failover/FailoverHandler.java
+++ b/qpid/java/client/src/main/java/org/apache/qpid/client/failover/FailoverHandler.java
@@ -36,13 +36,13 @@ import java.util.concurrent.CountDownLatch;
* connections, failing over to a new connection if the transport connection fails. The procedure to establish a new
* connection is expressed as a continuation, in order that it may be run in a seperate thread to the i/o thread that
* detected the failure and is used to handle the communication to establish a new connection.
- *
- * </p>The reason this needs to be a separate thread is because this work cannot be done inside the i/o processor
+ * <p>
+ * The reason this needs to be a separate thread is because this work cannot be done inside the i/o processor
* thread. The significant task is the connection setup which involves a protocol exchange until a particular state
* is achieved. This procedure waits until the state is achieved which would prevent the i/o thread doing the work
* it needs to do to achieve the new state.
- *
- * <p/>The failover procedure does the following:
+ * <p>
+ * The failover procedure does the following:
*
* <ol>
* <li>Sets the failing over condition to true.</li>
@@ -57,21 +57,17 @@ import java.util.concurrent.CountDownLatch;
* <li>Resets the failing over condition and releases the mutex.</li>
* </ol>
*
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Update fail-over state <td> {@link AMQProtocolHandler}
- * </table>
- *
- * @todo The failover latch and mutex are used like a lock and condition. If the retrotranlator supports lock/condition
+ * <p>
+ * TODO The failover latch and mutex are used like a lock and condition. If the retrotranlator supports lock/condition
* then could change over to using them. 1.4 support still needed.
- *
- * @todo If the condition is set to null on a vetoes fail-over and there are already other threads waiting on the
+ * <p>
+ * TODO If the condition is set to null on a vetoes fail-over and there are already other threads waiting on the
* condition, they will never be released. It might be an idea to reset the condition in a finally block.
- *
- * @todo Creates a {@link AMQDisconnectedException} and passes it to the AMQConnection. No need to use an
+ * <p>
+ * TODO Creates a {@link AMQDisconnectedException} and passes it to the AMQConnection. No need to use an
* exception-as-argument here, could just as easily call a specific method for this purpose on AMQConnection.
- *
- * @todo Creates a {@link FailoverException} and propagates it to the MethodHandlers. No need to use an
+ * <p>
+ * TODO Creates a {@link FailoverException} and propagates it to the MethodHandlers. No need to use an
* exception-as-argument here, could just as easily call a specific method for this purpose on
* {@link org.apache.qpid.protocol.AMQMethodListener}.
*/
diff --git a/qpid/java/client/src/main/java/org/apache/qpid/client/failover/FailoverProtectedOperation.java b/qpid/java/client/src/main/java/org/apache/qpid/client/failover/FailoverProtectedOperation.java
index e9c5f24791..d7e4128183 100644
--- a/qpid/java/client/src/main/java/org/apache/qpid/client/failover/FailoverProtectedOperation.java
+++ b/qpid/java/client/src/main/java/org/apache/qpid/client/failover/FailoverProtectedOperation.java
@@ -25,16 +25,11 @@ package org.apache.qpid.client.failover;
* FailoverProtectedOperation is a continuation for an operation that may throw a {@link FailoverException} because
* it has been interrupted by the fail-over process. The {@link FailoverRetrySupport} class defines support wrappers
* for failover protected operations, in order to provide different handling schemes when failovers occurr.
- *
- * <p/>The type of checked exception that the operation may perform has been generified, in order that fail over
+ * <p>
+ * The type of checked exception that the operation may perform has been generified, in order that fail over
* protected operations can be defined that raise arbitrary exceptions. The actuall exception types used should not
* be sub-classes of FailoverException, or else catching FailoverException in the {@link FailoverRetrySupport} classes
* will mask the exception.
- *
- * <p><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities
- * <tr><td> Perform an operation that may be interrupted by fail-over.
- * </table>
*/
public interface FailoverProtectedOperation<T, E extends Exception>
{
diff --git a/qpid/java/client/src/main/java/org/apache/qpid/client/failover/FailoverRetrySupport.java b/qpid/java/client/src/main/java/org/apache/qpid/client/failover/FailoverRetrySupport.java
index d3d33d3c75..ffe0baecd8 100644
--- a/qpid/java/client/src/main/java/org/apache/qpid/client/failover/FailoverRetrySupport.java
+++ b/qpid/java/client/src/main/java/org/apache/qpid/client/failover/FailoverRetrySupport.java
@@ -32,40 +32,34 @@ import org.apache.qpid.client.AMQConnection;
* FailoverRetrySupport automatcally rechecks the condition and re-acquires the mutex and re-runs the continution. This
* automatic retrying is continued until the continuation succeeds, or throws an exception (different to
* FailoverException, which is used to signal the failure of the original condition).
- *
- * <p/>The blocking condition used is that the connection is not currently failing over, and the mutex used is the
+ * <p>
+ * The blocking condition used is that the connection is not currently failing over, and the mutex used is the
* connection failover mutex, which guards against the fail-over process being run during fail-over vulnerable methods.
* These are used like a lock and condition variable.
- *
- * <p/>The wrapped operation may throw a FailoverException, this is an exception that can be raised by a
+ * <p>
+ * The wrapped operation may throw a FailoverException, this is an exception that can be raised by a
* {@link org.apache.qpid.client.protocol.BlockingMethodFrameListener}, in response to it being notified that a
* fail-over wants to start whilst it was waiting. Methods that are vulnerable to fail-over are those that are
* synchronous, where a failure will prevent them from getting the reply they are waiting for and asynchronous
* methods that should not be attempted when a fail-over is in progress.
- *
- * <p/>Wrapping a synchronous method in a FailoverRetrySupport will have the effect that the operation will not be
+ * <p>
+ * Wrapping a synchronous method in a FailoverRetrySupport will have the effect that the operation will not be
* started during fail-over, but be delayed until any current fail-over has completed. Should a fail-over process want
* to start whilst waiting for the synchrnous reply, the FailoverRetrySupport will detect this and rety the operation
* until it succeeds. Synchronous methods are usually coordinated with a
* {@link org.apache.qpid.client.protocol.BlockingMethodFrameListener} which is notified when a fail-over process wants
* to start and throws a FailoverException in response to this.
- *
- * <p/>Wrapping an asynchronous method in a FailoverRetrySupport will have the effect that the operation will not be
+ * <p>
+ * Wrapping an asynchronous method in a FailoverRetrySupport will have the effect that the operation will not be
* started during fail-over, but be delayed until any current fail-over has completed.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Provide a continuation synchronized on a fail-over lock and condition.
- * <tr><td> Automatically retry the continuation accross fail-overs until it succeeds, or raises an exception.
- * </table>
- *
- * @todo Another continuation. Could use an interface Continuation (as described in other todos)
+ * <p>
+ * TODO Another continuation. Could use an interface Continuation (as described in other todos)
* Then have a wrapping continuation (this), which blocks on an arbitrary
* Condition or Latch (specified in constructor call), that this blocks on before calling the wrapped Continuation.
* Must work on Java 1.4, so check retrotranslator works on Lock/Condition or latch first. Argument and return type
* to match wrapped condition as type parameters. Rename to AsyncConditionalContinuation or something like that.
- *
- * @todo InterruptedException not handled well.
+ * <p>
+ * TODO InterruptedException not handled well.
*/
public class FailoverRetrySupport<T, E extends Exception> implements FailoverSupport<T, E>
{
diff --git a/qpid/java/client/src/main/java/org/apache/qpid/client/failover/FailoverState.java b/qpid/java/client/src/main/java/org/apache/qpid/client/failover/FailoverState.java
index 807a5f7d13..268bac6155 100644
--- a/qpid/java/client/src/main/java/org/apache/qpid/client/failover/FailoverState.java
+++ b/qpid/java/client/src/main/java/org/apache/qpid/client/failover/FailoverState.java
@@ -22,11 +22,6 @@ package org.apache.qpid.client.failover;
/**
* Defines the possible states of the failover process; not started, in progress, failed.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Represent a one of the states of the fail-over process.
- * </table>
*/
public final class FailoverState
{
diff --git a/qpid/java/client/src/main/java/org/apache/qpid/client/failover/FailoverSupport.java b/qpid/java/client/src/main/java/org/apache/qpid/client/failover/FailoverSupport.java
index ef2e7e1d65..be3fa230e1 100644
--- a/qpid/java/client/src/main/java/org/apache/qpid/client/failover/FailoverSupport.java
+++ b/qpid/java/client/src/main/java/org/apache/qpid/client/failover/FailoverSupport.java
@@ -26,13 +26,8 @@ package org.apache.qpid.client.failover;
* behaviour for handling fail-overs during operations that can be interrupted by the fail-over process. For example,
* the support could automatically retry once the fail-over process completes, could prevent an operation from being
* started whilst fail-over is running, or could quietly abandon the operation or raise an exception, and so on.
- *
- * <p><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities
- * <tr><td> Perform a fail-over protected operation with handling for fail-over conditions.
- * </table>
- *
- * @todo Continuation, extend some sort of re-usable Continuation interface, which might look very like this one.
+ * <p>
+ * TODO Continuation, extend some sort of re-usable Continuation interface, which might look very like this one.
*/
public interface FailoverSupport<T, E extends Exception>
{