Interface ExecutionHandleLocator

All Known Subinterfaces:
ApplicationContext, BeanContext, ConfigurableApplicationContext, ConfigurableBeanContext, InitializableBeanContext
All Known Implementing Classes:
DefaultApplicationContext, DefaultBeanContext

public interface ExecutionHandleLocator
Interface for components that are able to locate and return ExecutionHandle instances for beans.
Since:
1.0
Author:
Graeme Rocher
  • Field Details

  • Method Details

    • findExecutionHandle

      default <T, R> Optional<MethodExecutionHandle<T,R>> findExecutionHandle(Class<T> beanType, String method, Class<?>... arguments)
      Finds an optimized execution handle for invoking a bean method. The execution handle may or may not be implemented by generated byte code.
      Type Parameters:
      T - The target bean
      R - The result type of the execution handle
      Parameters:
      beanType - The bean type
      method - The method
      arguments - The arguments
      Returns:
      The execution handle
    • findExecutionHandle

      default <T, R> Optional<MethodExecutionHandle<T,R>> findExecutionHandle(Class<T> beanType, Qualifier<?> qualifier, String method, Class<?>... arguments)
      Finds an optimized execution handle for invoking a bean method. The execution handle may or may not be implemented by generated byte code.
      Type Parameters:
      T - The target bean
      R - The result type of the execution handle
      Parameters:
      beanType - The bean type
      qualifier - The bean qualifer
      method - The method
      arguments - The arguments
      Returns:
      The execution handle
    • findExecutionHandle

      default <T, R> Optional<MethodExecutionHandle<T,R>> findExecutionHandle(T bean, String method, Class<?>... arguments)
      Finds an optimized execution handle for invoking a bean method. The execution handle may or may not be implemented by generated byte code.
      Type Parameters:
      T - The target bean
      R - The result type of the execution handle
      Parameters:
      bean - The bean to invoke the method on
      method - The method
      arguments - The arguments
      Returns:
      The execution handle
    • findExecutableMethod

      default <T, R> Optional<ExecutableMethod<T,R>> findExecutableMethod(Class<T> beanType, String method, Class<?>... arguments)
      Finds an optimized execution handle for invoking a bean method. The execution handle may or may not be implemented by generated byte code.
      Type Parameters:
      T - The bean type class
      R - The result type of the execution handle
      Parameters:
      beanType - The bean type
      method - The method
      arguments - The arguments
      Returns:
      The execution handle
    • findProxyTargetMethod

      default <T, R> Optional<ExecutableMethod<T,R>> findProxyTargetMethod(Class<T> beanType, String method, Class<?>... arguments)
      Finds the original unproxied method for a ProxyBeanDefinition.
      Type Parameters:
      T - The bean type class
      R - The result type of the execution handle
      Parameters:
      beanType - The bean type
      method - The method
      arguments - The arguments
      Returns:
      The execution handle
    • findProxyTargetMethod

      default <T, R> Optional<ExecutableMethod<T,R>> findProxyTargetMethod(Class<T> beanType, Qualifier<T> qualifier, String method, Class<?>... arguments)
      Finds the original unproxied method for a ProxyBeanDefinition.
      Type Parameters:
      T - The bean type class
      R - The result type of the execution handle
      Parameters:
      beanType - The bean type
      qualifier - The qualifier
      method - The method
      arguments - The arguments
      Returns:
      The execution handle
    • findProxyTargetMethod

      default <T, R> Optional<ExecutableMethod<T,R>> findProxyTargetMethod(Argument<T> beanType, Qualifier<T> qualifier, String method, Class<?>... arguments)
      Finds the original unproxied method for a ProxyBeanDefinition.
      Type Parameters:
      T - The bean type class
      R - The result type of the execution handle
      Parameters:
      beanType - The bean type
      qualifier - The qualifier
      method - The method
      arguments - The arguments
      Returns:
      The execution handle
    • getExecutableMethod

      default <T, R> ExecutableMethod<T,R> getExecutableMethod(Class<T> beanType, String method, Class<?>... arguments) throws NoSuchMethodException
      Finds an optimized execution handle for invoking a bean method. The execution handle may or may not be implemented by generated byte code.
      Type Parameters:
      T - The bean type class
      R - The result type of the execution handle
      Parameters:
      beanType - The bean type
      method - The method
      arguments - The arguments
      Returns:
      The execution handle
      Throws:
      NoSuchMethodException - if the method cannot be found
    • getProxyTargetMethod

      default <T, R> ExecutableMethod<T,R> getProxyTargetMethod(Class<T> beanType, String method, Class<?>... arguments) throws NoSuchMethodException
      Finds an optimized execution handle for invoking a bean method. The execution handle may or may not be implemented by generated byte code.
      Type Parameters:
      T - The bean type class
      R - The result type of the execution handle
      Parameters:
      beanType - The bean type
      method - The method
      arguments - The arguments
      Returns:
      The execution handle
      Throws:
      NoSuchMethodException - if the method cannot be found
    • getProxyTargetMethod

      default <T, R> ExecutableMethod<T,R> getProxyTargetMethod(Class<T> beanType, Qualifier<T> qualifier, String method, Class<?>... arguments) throws NoSuchMethodException
      Finds an optimized execution handle for invoking a bean method. The execution handle may or may not be implemented by generated byte code.
      Type Parameters:
      T - The bean type class
      R - The result type of the execution handle
      Parameters:
      beanType - The bean type
      qualifier - The qualifier
      method - The method
      arguments - The arguments
      Returns:
      The execution handle
      Throws:
      NoSuchMethodException - if the method cannot be found
    • getProxyTargetMethod

      default <T, R> ExecutableMethod<T,R> getProxyTargetMethod(Argument<T> beanType, Qualifier<T> qualifier, String method, Class<?>... arguments) throws NoSuchMethodException
      Finds an optimized execution handle for invoking a bean method. The execution handle may or may not be implemented by generated byte code.
      Type Parameters:
      T - The bean type class
      R - The result type of the execution handle
      Parameters:
      beanType - The bean type
      qualifier - The qualifier
      method - The method
      arguments - The arguments
      Returns:
      The execution handle
      Throws:
      NoSuchMethodException - if the method cannot be found
      Since:
      3.0.0
    • getExecutionHandle

      default <T, R> MethodExecutionHandle<T,R> getExecutionHandle(Class<T> beanType, String method, Class<?>... arguments) throws NoSuchMethodException
      Finds an optimized execution handle for invoking a bean method. The execution handle may or may not be implemented by generated byte code.
      Type Parameters:
      T - The target bean
      R - The result type of the execution handle
      Parameters:
      beanType - The bean type
      method - The method
      arguments - The arguments
      Returns:
      The execution handle
      Throws:
      NoSuchMethodException - if the method cannot be found
    • getExecutionHandle

      default <T, R> MethodExecutionHandle<T,R> getExecutionHandle(T bean, String method, Class<?>... arguments) throws NoSuchMethodException
      Finds an optimized execution handle for invoking a bean method. The execution handle may or may not be implemented by generated byte code.
      Type Parameters:
      T - The target bean
      R - The result type of the execution handle
      Parameters:
      bean - The bean to invoke the method on
      method - The method
      arguments - The arguments
      Returns:
      The execution handle
      Throws:
      NoSuchMethodException - if the method cannot be found
    • createExecutionHandle

      default MethodExecutionHandle<?,Object> createExecutionHandle(BeanDefinition<?> beanDefinition, ExecutableMethod<Object,?> method)
      Create an execution handle for the given bean definition and method.
      Parameters:
      beanDefinition - The bean definition
      method - The method
      Returns:
      The execution handle