org.apache.qpid.client.failover
Class FailoverNoopSupport<T,E extends Exception>

java.lang.Object
  extended by org.apache.qpid.client.failover.FailoverNoopSupport<T,E>
All Implemented Interfaces:
FailoverSupport<T,E>

public class FailoverNoopSupport<T,E extends Exception>
extends Object
implements FailoverSupport<T,E>

FailoverNoopSupport is a FailoverSupport implementation that does not really provide any failover support at all. It wraps a FailoverProtectedOperation but should that operation throw FailoverException this support class simply re-raises that exception as an IllegalStateException. This support wrapper should only be used where the caller can be certain that the failover protected operation cannot acutally throw a failover exception, for example, because the caller already holds a lock preventing that condition from arising.

CRC Card
Responsibilities Collaborations
Perform a fail-over protected operation raising providing no handling of fail-over conditions.


Field Summary
(package private)  AMQConnection connection
          The connection on which the fail-over protected operation is to be performed.
(package private)  FailoverProtectedOperation<T,E> operation
          The protected operation that is to be retried in the event of fail-over.
 
Constructor Summary
FailoverNoopSupport(FailoverProtectedOperation<T,E> operation, AMQConnection con)
          Creates an automatic retrying fail-over handler for the specified operation.
 
Method Summary
 T execute()
          Delegates to another continuation which is to be provided with fail-over handling.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

operation

FailoverProtectedOperation<T,E extends Exception> operation
The protected operation that is to be retried in the event of fail-over.


connection

AMQConnection connection
The connection on which the fail-over protected operation is to be performed.

Constructor Detail

FailoverNoopSupport

public FailoverNoopSupport(FailoverProtectedOperation<T,E> operation,
                           AMQConnection con)
Creates an automatic retrying fail-over handler for the specified operation.

Parameters:
operation - The fail-over protected operation to wrap in this handler.
Method Detail

execute

public T execute()
          throws E extends Exception
Delegates to another continuation which is to be provided with fail-over handling.

Specified by:
execute in interface FailoverSupport<T,E extends Exception>
Returns:
The return value from the delegated to continuation.
Throws:
E - Any exception that the delegated to continuation may raise.
E extends Exception


Licensed to the Apache Software Foundation