Package org.eclipse.microprofile.fault.tolerance.tck.asynchronous

# Class AsyncClassLevelClient

java.lang.Object
org.eclipse.microprofile.fault.tolerance.tck.asynchronous.AsyncClassLevelClient

@RequestScoped @Asynchronous public class AsyncClassLevelClient extends Object
A client to demonstrate Asynchronous behaviour when @Asynchronous is applied at class level

Author:
  Antoine Sabot-Durand

## Constructor Summary

Constructors
Constructor
Description
`AsyncClassLevelClient()`

## Method Summary

Modifier and Type
Method
Description
`Future<Connection>`
`service(Future<?> waitCondition)`
Service an operation until waitCondition is completed or 1000 second timeout.
`CompletionStage<Connection>`
`serviceCS(Future<?> waitCondition)`
`CompletionStage<Connection>`
`serviceCS(Future<?> waitCondition, boolean throwException)`
Service an operation until waitCondition is completed or 1000 second timeout.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### AsyncClassLevelClient

public AsyncClassLevelClient()

## Method Details

### service

@Asynchronous public Future<Connection> service(Future<?> waitCondition)
Service an operation until waitCondition is completed or 1000 second timeout.

Parameters:
  `waitCondition` - Execution of this method will delay until the condition is finished
Returns:
  the result as a Future.

### serviceCS

public CompletionStage<Connection> serviceCS(Future<?> waitCondition, boolean throwException)
Service an operation until waitCondition is completed or 1000 second timeout. NOTE: This 1000 second timeout is to ensure test timeout kicks in before the operation timeout for a better test error to be displayed.

Parameters:
  `waitCondition` - Execution of this method will delay until the condition is finished
  `throwException` - Whether the method should throw an exception (true) or return a stage completed with exception (false)
Returns:
  the result as a CompletionStage. It may be completed with InterruptedException if the thread is interrupted

### serviceCS

public CompletionStage<Connection> serviceCS(Future<?> waitCondition)