@Documented
@Retention(value=RUNTIME)
@Target(value=METHOD)
@Inherited
public @interface Fallback
FallbackHandler.handle(ExecutionContext)
on the specified handler to execute the fallback.FaultToleranceDefinitionException
must be thrown.When a method returns and the fallback policy is present, the following rules are applied:
skipOn()
parameter, the thrown object will be rethrown.
applyOn()
parameter,
the fallback policy, detailed above, will be applied.
Throwable
which is not an Error
or Exception
, non-portable behavior results.value()
,
fallbackMethod()
,
applyOn()
,
skipOn()
Modifier and Type | Optional Element and Description |
---|---|
java.lang.Class<? extends java.lang.Throwable>[] |
applyOn
The list of exception types which should trigger Fallback
|
java.lang.String |
fallbackMethod
Specify the method name to fallback to.
|
java.lang.Class<? extends java.lang.Throwable>[] |
skipOn
The list of exception types which should not trigger Fallback
|
java.lang.Class<? extends FallbackHandler<?>> |
value
Specify the fallback class to be used.
|
public abstract java.lang.Class<? extends FallbackHandler<?>> value
FaultToleranceDefinitionException
occurs.public abstract java.lang.String fallbackMethod
FaultToleranceDefinitionException
must be thrown.public abstract java.lang.Class<? extends java.lang.Throwable>[] applyOn
Note that if a method throws a Throwable
which is not an Error
or Exception
,
non-portable behavior results.
public abstract java.lang.Class<? extends java.lang.Throwable>[] skipOn
This list takes priority over the types listed in applyOn()
Note that if a method throws a Throwable
which is not an Error
or Exception
,
non-portable behavior results.