Class BulkheadMethodInterceptor
java.lang.Object
io.github.resilience4j.ratpack.internal.AbstractMethodInterceptor
io.github.resilience4j.ratpack.bulkhead.BulkheadMethodInterceptor
- All Implemented Interfaces:
org.aopalliance.aop.Advice,org.aopalliance.intercept.Interceptor,org.aopalliance.intercept.MethodInterceptor
public class BulkheadMethodInterceptor extends AbstractMethodInterceptor
A
MethodInterceptor to handle all methods annotated with Bulkhead. It will handle
methods that return a Promise, Flux, Mono, CompletionStage, or value.
Given a method like this:
@Bulkhead(name = "myService")
public String fancyName(String name) {
return "Sir Captain " + name;
}
each time the #fancyName(String) method is invoked, the method's execution will pass
through a a Bulkhead (concurrent limiting) according to
the given policy.
The fallbackMethod parameter signature must match either:
1) The method parameter signature on the annotated method or 2) The method parameter signature with a matching exception type as the last parameter on the annotated method
The return value can be a Promise, CompletionStage, Flux, Mono, or an object value. Other
reactive types are not supported.
If the return value is one of the reactive types listed above, it must match the return value type of the annotated method.
-
Constructor Summary
Constructors Constructor Description BulkheadMethodInterceptor() -
Method Summary
Modifier and Type Method Description java.lang.Objectinvoke(org.aopalliance.intercept.MethodInvocation invocation)Methods inherited from class io.github.resilience4j.ratpack.internal.AbstractMethodInterceptor
completeFailedFuture, createRecoveryFunction, proceed
-
Constructor Details
-
BulkheadMethodInterceptor
public BulkheadMethodInterceptor()
-
-
Method Details
-
invoke
@Nullable public java.lang.Object invoke(org.aopalliance.intercept.MethodInvocation invocation) throws java.lang.Throwable- Throws:
java.lang.Throwable
-