- java.lang.Object
-
- io.avaje.inject.aop.Invocation.Build<T>
-
- Type Parameters:
T- The result type
- All Implemented Interfaces:
Invocation
- Direct Known Subclasses:
Invocation.Call,Invocation.Run
- Enclosing interface:
- Invocation
public abstract static class Invocation.Build<T> extends Object implements Invocation
Builds Invocation for both callable and runnable methods.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface io.avaje.inject.aop.Invocation
Invocation.Build<T>, Invocation.Call<T>, Invocation.CheckedRunnable, Invocation.CheckedSupplier<T>, Invocation.Run
-
-
Constructor Summary
Constructors Constructor Description Build()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description Object[]arguments()Return the arguments used for this invocation.Object[]arguments(Throwable e)Return the arguments additionally appending the throwable.TfinalResult()Return the final invocation result.Objectinstance()Return the 'this' instance of the invocation.Methodmethod()Return the method being called for this invocation.voidresult(Object result)Set the result that will be returned to the caller.Invocation.Build<T>with(Object instance, Method method, Object... args)Set the instance, method and arguments for the invocation.abstract Invocation.Build<T>wrap(MethodInterceptor methodInterceptor)Wrap this invocation using a methodInterceptor returning the wrapped call.-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.avaje.inject.aop.Invocation
invoke
-
-
-
-
Constructor Detail
-
Build
public Build()
-
-
Method Detail
-
with
public Invocation.Build<T> with(Object instance, Method method, Object... args)
Set the instance, method and arguments for the invocation.
-
result
public void result(Object result)
Description copied from interface:InvocationSet 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.- Specified by:
resultin interfaceInvocation- Parameters:
result- The result that will be returned to the caller.
-
finalResult
public T finalResult()
Return the final invocation result.
-
arguments
public Object[] arguments()
Description copied from interface:InvocationReturn the arguments used for this invocation.- Specified by:
argumentsin interfaceInvocation
-
arguments
public Object[] arguments(Throwable e)
Description copied from interface:InvocationReturn the arguments additionally appending the throwable.- Specified by:
argumentsin interfaceInvocation
-
method
public Method method()
Description copied from interface:InvocationReturn the method being called for this invocation.- Specified by:
methodin interfaceInvocation
-
instance
public Object instance()
Description copied from interface:InvocationReturn the 'this' instance of the invocation.This is typically used when invoking fallback/recovery methods.
- Specified by:
instancein interfaceInvocation
-
wrap
public abstract Invocation.Build<T> wrap(MethodInterceptor methodInterceptor)
Wrap this invocation using a methodInterceptor returning the wrapped call.This invocation is effectively nested inside the returned invocation.
- Parameters:
methodInterceptor- The method interceptor to use to wrap this call with- Returns:
- The wrapped call
-
-