- All Implemented Interfaces:
Invocation
- Enclosing interface:
Invocation
Runnable based Invocation.
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.avaje.inject.aop.Invocation
Invocation.Base<T>, Invocation.Call<T>, Invocation.CheckedRunnable, Invocation.CheckedSupplier<T>, Invocation.Run -
Field Summary
Fields inherited from class io.avaje.inject.aop.Invocation.Base
args, instance, method, result -
Constructor Summary
ConstructorsConstructorDescriptionRun(Invocation.CheckedRunnable delegate) Create with a given closure to run. -
Method Summary
Modifier and TypeMethodDescriptionRegister a fallback method which can be used to recover from an exception while intercepting an invocationbooleanReturn whether this invocation has a registered recovery methodinvoke()Invoke the underlying method returning the result.Invoke the recovery method associated for this invocation and return the result.Set the instance, method and arguments for the invocation.wrap(MethodInterceptor methodInterceptor) Wrap this invocation using a methodInterceptor returning the wrapped call.Methods inherited from class io.avaje.inject.aop.Invocation.Base
arguments, finalResult, instance, method, noRecovery, resultMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.avaje.inject.aop.Invocation
invokeUnchecked
-
Constructor Details
-
Run
Create with a given closure to run.
-
-
Method Details
-
invoke
Description copied from interface:InvocationInvoke the underlying method returning the result.- Returns:
- The result of the method call. This will return null for void methods.
- Throws:
Throwable- Exception thrown by underlying method
-
fallback
Register a fallback method which can be used to recover from an exception while intercepting an invocation -
wrap
Description copied from class:Invocation.BaseWrap this invocation using a methodInterceptor returning the wrapped call.This invocation is effectively nested inside the returned invocation.
- Specified by:
wrapin classInvocation.Base<Void>- Parameters:
methodInterceptor- The method interceptor to use to wrap this call with- Returns:
- The wrapped call
-
hasRecoveryMethod
public boolean hasRecoveryMethod()Description copied from interface:InvocationReturn whether this invocation has a registered recovery method -
invokeRecoveryMethod
Description copied from interface:InvocationInvoke the recovery method associated for this invocation and return the result.- Returns:
- The result of the method call. This will return null for void methods.
-
with
Description copied from class:Invocation.BaseSet the instance, method and arguments for the invocation.- Overrides:
within classInvocation.Base<Void>
-