org.eclipse.microprofile.fault.tolerance.tck.retrytimeout.clientserver

## Class RetryTimeoutClient

- java.lang.Object
- - org.eclipse.microprofile.fault.tolerance.tck.retrytimeout.clientserver.RetryTimeoutClient

    @RequestScoped
    public class RetryTimeoutClient
    extends Object

A client to demonstrate the combination of the @Retry and @Timeout annotations.

Author:
  Neil Young

### Constructor Summary

Constructors
Constructor and Description
`RetryTimeoutClient()`

### Method Summary

All Methods Instance Methods Concrete Methods
`int` `getCounterForInvokingServiceA()`
`int` `getCounterForInvokingServiceWithAbortOn()`
`int` `getCounterForInvokingServiceWithoutRetryOn()`
`String` `serviceA(long timeToSleep)` Times out after 500ms, retries once
`String` `serviceWithAbortOn()` Sleeps for 1000ms, times out after 500ms, retries once on anything but TimeoutException
`String` `serviceWithoutRetryOn()` Sleeps for 1000ms, times out after 500ms, retries once on BulkheadException

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

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

### Constructor Detail

#### RetryTimeoutClient

    public RetryTimeoutClient()

### Method Detail

#### getCounterForInvokingServiceA

    public int getCounterForInvokingServiceA()

#### getCounterForInvokingServiceWithoutRetryOn

    public int getCounterForInvokingServiceWithoutRetryOn()

#### getCounterForInvokingServiceWithAbortOn

    public int getCounterForInvokingServiceWithAbortOn()

#### serviceA

    @Timeout(value=500L)
     @Retry(maxRetries=1)
    public String serviceA(long timeToSleep)

Times out after 500ms, retries once

Parameters:
  `timeToSleep` - time this method should sleep for in ms
Returns:
  `null`

#### serviceWithoutRetryOn

    @Timeout(value=500L)
     @Retry(maxRetries=1,
           retryOn=org.eclipse.microprofile.faulttolerance.exceptions.BulkheadException.class)
    public String serviceWithoutRetryOn()

Sleeps for 1000ms, times out after 500ms, retries once on BulkheadException

Method will never throw a BulkheadException so the Retry annotation should have no effect

Returns:
  `null`

#### serviceWithAbortOn

    @Timeout(value=500L)
     @Retry(maxRetries=1,
           abortOn=org.eclipse.microprofile.faulttolerance.exceptions.TimeoutException.class)
    public String serviceWithAbortOn()

Sleeps for 1000ms, times out after 500ms, retries once on anything but TimeoutException

Returns:
  `null`