Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the CI build #616

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -36,14 +36,14 @@
* <li>{@link java.util.concurrent.Future}</li>
* <li>{@link java.util.concurrent.CompletionStage}</li>
* </ul>
*
*
* Otherwise, {@link org.eclipse.microprofile.faulttolerance.exceptions.FaultToleranceDefinitionException} occurs during
* deployment. The return type {@link java.util.concurrent.CompletionStage} is preferred over
* {@link java.util.concurrent.Future} as a {@link java.util.concurrent.Future} that completes exceptionally will not
* trigger other Fault Tolerance operations even if specified (e.g. Retry), while a
* {@link java.util.concurrent.CompletionStage} that completes exceptionally will trigger other Fault Tolerance
* capabilities if specified (e.g. Retry).
*
*
* <p>
* When a method marked with this annotation is called from one thread (which we will call Thread A), the method call is
* intercepted, and execution of the method is submitted to run asynchronously on another thread (which we will call
Expand All @@ -70,7 +70,7 @@
* At this point, any calls to the Future or CompletionStage returned in Thread A will be delegated to the Future or
* CompletionStage returned from the execution in Thread B.</li>
* </ul>
*
*
* <p>
* The call made on Thread A will never throw an exception, even if the method declares that it throws checked
* exceptions, because the execution is going to occur on Thread B and hasn't happened yet. To avoid unnecessary
Expand All @@ -86,14 +86,14 @@
* <li>If the method declares {@link java.util.concurrent.CompletionStage} as the return type, the CompletionStage
* returned in Thread A is completed exceptionally with the exception.</li>
* </ul>
*
*
* <p>
* If a class is annotated with this annotation, all class methods are treated as if they were marked with this
* annotation. If one of the methods doesn't return either Future or CompletionStage,
* {@link org.eclipse.microprofile.faulttolerance.exceptions.FaultToleranceDefinitionException} occurs (at deploy time
* if the bean is discovered during deployment).
* </p>
*
*
* <p>
* Example usage:
* </p>
Expand All @@ -111,11 +111,11 @@
*
* <pre>
* <code>CompletionStage stage = getString().exceptionally(e -&gt; {
* handleException(e);
* handleException(e);
* return null;
* });</code>
* </pre>
*
*
* @author <a href="mailto:emijiang@uk.ibm.com">Emily Jiang</a>
*/
@Documented
Expand Down
Expand Up @@ -22,29 +22,29 @@

/**
* The execution context for the method being executed.
*
*
* @author <a href="mailto:emijiang@uk.ibm.com">Emily Jiang</a>
*/
@org.osgi.annotation.versioning.ProviderType
public interface ExecutionContext {

/**
* Returns the method being executed.
*
*
* @return the method
*/
public Method getMethod();

/**
* Returns the parameter values being passed to the method.
*
*
* @return the parameter values, as an array
*/
public Object[] getParameters();

/**
* Returns the failure of the method execution.
*
*
* @return the failure of the method execution
*/
public Throwable getFailure();
Expand Down
Expand Up @@ -23,12 +23,12 @@
* instance must be assignable to the return type of the method, where the {@link Fallback} is specified. The container
* must ensure this type safety. Otherwise, {@link IllegalArgumentException} should be thrown.
* <h2>Usage</h2>
*
*
* <pre>
* public class MyService {
* &#064;Inject
* OtherService otherService;
*
*
* &#064;Timeout(3000)
* &#064;Fallback(MyFallback.class)
* Long getAmount() {
Expand All @@ -46,18 +46,18 @@
* }
* }
* </pre>
*
*
* @author <a href="mailto:emijiang@uk.ibm.com">Emily Jiang</a>
* @author Ken Finnigan
*
*/
public interface FallbackHandler<T> {
/**
* Handle the previous calling failure and then call alternative methods or perform any alternative operations.
*
*
* @param context
* the execution context
*
*
* @return the result of the fallback
*/
T handle(ExecutionContext context);
Expand Down
Expand Up @@ -21,7 +21,7 @@
/**
* The exception should be thrown when the definition of any Fault Tolerance annotations is invalid. The deployment
* should fail.
*
*
* <a href="mailto:emijiang@uk.ibm.com">Emily Jiang</a>
*
*/
Expand Down
Expand Up @@ -22,7 +22,7 @@
* <p>
* CDI Support for Microprofile Fault Tolerance
*
*
*
*
* @author <a href="mailto:emijiang@uk.ibm.com">Emily Jiang</a>
*/
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Expand Up @@ -19,7 +19,7 @@
<parent>
<groupId>org.eclipse.microprofile</groupId>
<artifactId>microprofile-parent</artifactId>
<version>2.6</version>
<version>2.7</version>
</parent>

<groupId>org.eclipse.microprofile.fault-tolerance</groupId>
Expand Down
Expand Up @@ -49,7 +49,7 @@

/**
* Test the combination of the @Asynchronous and @Timeout annotations.
*
*
* @author <a href="mailto:neil_young@uk.ibm.com">Neil Young</a>
*
*/
Expand Down Expand Up @@ -92,7 +92,7 @@ public static WebArchive deploy() {
/**
* Test that an Asynchronous Service times out as expected where the service is annotated with both
* the @Asynchronous and @Timeout annotations.
*
*
* A timeout is configured for serviceA but serviceA has a 5 second sleep so that, in this case, the service should
* generate Timeout exceptions.
*/
Expand Down Expand Up @@ -151,7 +151,7 @@ public void testAsyncTimeout() {
/**
* Test that an Asynchronous Service does not throw a TimeoutException where the service completes more quickly than
* the specified time out. The service is annotated with both @Asynchronous and @Timeout.
*
*
* A 2 second timeout is configured for serviceB but serviceB has a 0.5 second sleep so that, in this case, the
* service should NOT generate Timeout exceptions.
*/
Expand Down Expand Up @@ -189,7 +189,7 @@ public void testAsyncNoTimeout() {

/**
* Analogous to testAsyncTimeout but using Class level rather than method level annotations.
*
*
* A timeout is configured for serviceA but serviceA has a 5 second sleep so that, in this case, the service should
* generate Timeout exceptions.
*/
Expand Down
Expand Up @@ -155,7 +155,7 @@ public void testClassLevelAsyncIsFinished() {
/**
* Test that the callbacks added to the initial stage are executed after the stage returned by the asynchronous
* method call is completed.
*
*
* The callbacks added inside method invocation must be called first and then callbacks added to the result of the
* call (on the calling thread) must be executed in the order they were added.
*/
Expand Down
Expand Up @@ -124,10 +124,10 @@ public void testClassLevelAsyncIsFinished() {
/**
* Test that the request context is active during execution for an asynchronous method that returns a
* CompletionStage
*
*
* If the request scope is active, then an @ApplicationScoped bean should be able to asynchronously call
* an @Asynchronous method returning a CompletionStage on a @RequestScoped bean, and return the correct result
*
*
* @throws TimeoutException
* @throws ExecutionException
* @throws InterruptedException
Expand All @@ -142,10 +142,10 @@ public void testAsyncRequestContextWithCompletionStage()

/**
* Test that the request context is active during execution for an asynchronous method that returns a Future
*
*
* If the request scope is active, then an @ApplicationScoped bean should be able to asynchronously call
* an @Asynchronous method returning a Future on a @RequestScoped bean, and return the correct result
*
*
* @throws TimeoutException
* @throws ExecutionException
* @throws InterruptedException
Expand Down
Expand Up @@ -69,14 +69,14 @@ public static WebArchive deploy() {
/**
* A test to ensure that the CircuitBreaker is checked before entering the Bulkhead and that BulkheadExceptions
* count as failures for the CircuitBreaker.
*
*
* Uses an asynchronous bulkhead
*
*
* With requestVolumeThreshold = 3, failureRatio = 1.0, delay = 50000 the expected behaviour is,
*
*
* Execution Behaviour ========= ========= 1 Fill Bulkhead 2 Fill Bulkhead 3 BulkheadException 4 BulkheadException 5
* BulkheadException 6 CircuitBreakerOpenException 7 CircuitBreakerOpenException
*
*
* @throws InterruptedException
* if the test is interrupted
* @throws TimeoutException
Expand Down Expand Up @@ -116,14 +116,14 @@ public void testCircuitBreakerAroundBulkheadAsync()
/**
* A test to ensure that the CircuitBreaker is checked before entering the Bulkhead and that BulkheadExceptions
* count as failures for the CircuitBreaker.
*
*
* Uses a synchronous bulkhead
*
*
* With requestVolumeThreshold = 3, failureRatio = 1.0, delay = 50000 the expected behaviour is,
*
*
* Execution Behaviour ========= ========= 1 Fill Bulkhead 2 BulkheadException 3 BulkheadException 4
* BulkheadException 5 CircuitBreakerOpenException 6 CircuitBreakerOpenException
*
*
* @throws InterruptedException
* if the test is interrupted
* @throws TimeoutException
Expand Down Expand Up @@ -158,15 +158,15 @@ public void testCircuitBreakerAroundBulkheadSync()
/**
* A test to ensure that the CircuitBreaker does not open in response to a BulkheadException if {@code failOn} does
* not include BulkheadException
*
*
* Uses an asynchronous bulkhead
*
*
* With requestVolumeThreshold = 3, failureRatio = 1.0, delay = 50000, failOn=TestException the expected behaviour
* is,
*
*
* Execution Behaviour ========= ========= 1 Fill Bulkhead 2 Fill Bulkhead 3 BulkheadException 4 BulkheadException 5
* BulkheadException 6 BulkheadException 7 BulkheadException
*
*
* @throws InterruptedException
* if the test is interrupted
* @throws TimeoutException
Expand Down
Expand Up @@ -36,7 +36,7 @@

/**
* Test CircuitBreaker using different success/failure pattern.
*
*
* @author <a href="mailto:neil_young@uk.ibm.com">Neil Young</a>
*
*/
Expand All @@ -60,7 +60,7 @@ public static WebArchive deploy() {
/**
* Analagous to testCircuitDefaultSuccessThreshold but with a different success/failure pattern for the service that
* is called. In this case, the service initially succeeds.
*
*
* With requestVolumeThreshold = 4, failureRatio=0.75 and successThreshold = 1 the expected behaviour is,
*
* Execution Behaviour ========= ========= 1 SUCCESS 2 RunTimeException 3 RunTimeException 4 RunTimeException 5
Expand Down
Expand Up @@ -36,7 +36,7 @@

/**
* Test CircuitBreaker using different success/failure pattern.
*
*
* @author <a href="mailto:neil_young@uk.ibm.com">Neil Young</a>
*
*/
Expand Down