- All Known Implementing Classes:
Invocation.Base,Invocation.Call,Invocation.Run
public interface Invocation
Method invocation using in
MethodInterceptor.invoke(Invocation) for Aspects.
Represents a method invocation that can be intercepted with additional before and after invocation logic.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classInvocation base type for both callable and runnable methods.static final classCallable based Invocation with checked exceptions.static interfaceRunnable with checked exceptions.static interfaceCallable with checked exceptions.static final classRunnable based Invocation. -
Method Summary
Modifier and TypeMethodDescriptionObject[]Return the arguments used for this invocation.Object[]Return the arguments additionally appending the throwable.instance()Return the 'this' instance of the invocation.invoke()Invoke the underlying method returning the result.default ObjectInvoke the underlying method returning the result.method()Return the method being called for this invocation.voidSet the result that will be returned to the caller.
-
Method Details
-
invoke
Invoke 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
-
invokeUnchecked
Invoke the underlying method returning the result. Checked exceptions will be caught and rethrown asInvocationExceptions.- Returns:
- The result of the method call. This will return null for void methods.
-
result
Set the result that will be returned to the caller.This will replace a prior result set by calling
#invokeor can be used to provide a result allowing to skip calling#invokealtogether.- Parameters:
result- The result that will be returned to the caller.
-
arguments
Return the arguments used for this invocation. -
arguments
Return the arguments additionally appending the throwable. -
method
Return the method being called for this invocation. -
instance
Return the 'this' instance of the invocation.This is typically used when invoking fallback/recovery methods.
-