Interface ExecutionHandle<T,R>

Type Parameters:
T - The target type
R - The result type
All Superinterfaces:
AnnotationMetadata, AnnotationMetadataDelegate, AnnotationMetadataProvider, AnnotationSource
All Known Subinterfaces:
MethodBasedRouteMatch<T,R>, MethodExecutionHandle<T,R>, UnsafeExecutionHandle<T,R>, UriRouteMatch<T,R>
All Known Implementing Classes:
DefaultUriRouteMatch

public interface ExecutionHandle<T,R> extends AnnotationMetadataDelegate

Represents a handle to an executable object. Differs from Executable in that the first argument to invoke(Object...) is not the object instead the object is typically held within the handle itself.

Executable handles are also applicable to constructors and static methods

Since:
1.0
Author:
Graeme Rocher
  • Method Details

    • getTarget

      T getTarget()
      The target of the method invocation.
      Returns:
      The target object
    • getDeclaringType

      Class<T> getDeclaringType()
      Returns:
      The declaring type
    • getArguments

      Argument[] getArguments()
      Returns:
      The required argument types.
    • invoke

      R invoke(Object... arguments)
      Invokes the method.
      Parameters:
      arguments - The arguments
      Returns:
      The result
    • of

      static <T2, R2> MethodExecutionHandle<T2,R2> of(T2 bean, ExecutableMethod<T2,R2> method)
      Creates an ExecutionHandle for the give bean and method.
      Type Parameters:
      T2 - The bean type
      R2 - The method return type
      Parameters:
      bean - The bean
      method - The method
      Returns:
      The execution handle