-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7daecea
commit 5f9a505
Showing
141 changed files
with
321 additions
and
321 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|
@@ -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 | ||
|
@@ -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> | ||
|
@@ -111,11 +111,11 @@ | |
* | ||
* <pre> | ||
* <code>CompletionStage stage = getString().exceptionally(e -> { | ||
* handleException(e); | ||
* handleException(e); | ||
* return null; | ||
* });</code> | ||
* </pre> | ||
* | ||
* | ||
* @author <a href="mailto:[email protected]">Emily Jiang</a> | ||
*/ | ||
@Documented | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,29 +22,29 @@ | |
|
||
/** | ||
* The execution context for the method being executed. | ||
* | ||
* | ||
* @author <a href="mailto:[email protected]">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(); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 { | ||
* @Inject | ||
* OtherService otherService; | ||
* | ||
* | ||
* @Timeout(3000) | ||
* @Fallback(MyFallback.class) | ||
* Long getAmount() { | ||
|
@@ -46,18 +46,18 @@ | |
* } | ||
* } | ||
* </pre> | ||
* | ||
* | ||
* @author <a href="mailto:[email protected]">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); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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:[email protected]">Emily Jiang</a> | ||
* | ||
*/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,7 +22,7 @@ | |
* <p> | ||
* CDI Support for Microprofile Fault Tolerance | ||
* | ||
* | ||
* | ||
* | ||
* @author <a href="mailto:[email protected]">Emily Jiang</a> | ||
*/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -49,7 +49,7 @@ | |
|
||
/** | ||
* Test the combination of the @Asynchronous and @Timeout annotations. | ||
* | ||
* | ||
* @author <a href="mailto:[email protected]">Neil Young</a> | ||
* | ||
*/ | ||
|
@@ -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. | ||
*/ | ||
|
@@ -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. | ||
*/ | ||
|
@@ -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. | ||
*/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,7 +37,7 @@ | |
|
||
/** | ||
* Test CircuitBreaker using different success/failure pattern. | ||
* | ||
* | ||
* @author <a href="mailto:[email protected]">Neil Young</a> | ||
* | ||
*/ | ||
|
@@ -62,7 +62,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 TestException 3 TestException 4 TestException 5 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,7 +37,7 @@ | |
|
||
/** | ||
* Test CircuitBreaker using different success/failure pattern. | ||
* | ||
* | ||
* @author <a href="mailto:[email protected]">Neil Young</a> | ||
* | ||
*/ | ||
|
Oops, something went wrong.