- 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 class
Invocation base type for both callable and runnable methods.static final class
Callable based Invocation with checked exceptions.static interface
Runnable with checked exceptions.static interface
Callable with checked exceptions.static final class
Runnable 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 Object
Invoke the underlying method returning the result.method()
Return the method being called for this invocation.void
Set 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 asInvocationException
s.- 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
#invoke
or can be used to provide a result allowing to skip calling#invoke
altogether.- 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.
-