Package io.micronaut.context
Interface ExecutionHandleLocator
- All Known Subinterfaces:
ApplicationContext
,BeanContext
,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 Summary
-
Method Summary
Modifier and TypeMethodDescriptiondefault MethodExecutionHandle<?,
Object> createExecutionHandle
(BeanDefinition<?> beanDefinition, ExecutableMethod<Object, ?> method) Create an execution handle for the given bean definition and method.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.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.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.default <T,
R> Optional<MethodExecutionHandle<T, R>> findExecutionHandle
(T bean, String method, Class<?>... arguments) Finds an optimized execution handle for invoking a bean method.default <T,
R> Optional<ExecutableMethod<T, R>> findProxyTargetMethod
(Argument<T> beanType, Qualifier<T> qualifier, String method, Class<?>... arguments) Finds the original unproxied method for aProxyBeanDefinition
.default <T,
R> Optional<ExecutableMethod<T, R>> findProxyTargetMethod
(Class<T> beanType, Qualifier<T> qualifier, String method, Class<?>... arguments) Finds the original unproxied method for aProxyBeanDefinition
.default <T,
R> Optional<ExecutableMethod<T, R>> findProxyTargetMethod
(Class<T> beanType, String method, Class<?>... arguments) Finds the original unproxied method for aProxyBeanDefinition
.default <T,
R> ExecutableMethod<T, R> getExecutableMethod
(Class<T> beanType, String method, Class<?>... arguments) Finds an optimized execution handle for invoking a bean method.default <T,
R> MethodExecutionHandle<T, R> getExecutionHandle
(Class<T> beanType, String method, Class<?>... arguments) Finds an optimized execution handle for invoking a bean method.default <T,
R> MethodExecutionHandle<T, R> getExecutionHandle
(T bean, String method, Class<?>... arguments) Finds an optimized execution handle for invoking a bean method.default <T,
R> ExecutableMethod<T, R> getProxyTargetMethod
(Argument<T> beanType, Qualifier<T> qualifier, String method, Class<?>... arguments) Finds an optimized execution handle for invoking a bean method.default <T,
R> ExecutableMethod<T, R> getProxyTargetMethod
(Class<T> beanType, Qualifier<T> qualifier, String method, Class<?>... arguments) Finds an optimized execution handle for invoking a bean method.default <T,
R> ExecutableMethod<T, R> getProxyTargetMethod
(Class<T> beanType, String method, Class<?>... arguments) Finds an optimized execution handle for invoking a bean method.
-
Field Details
-
EMPTY
A empty no-op locator.
-
-
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 beanR
- The result type of the execution handle- Parameters:
beanType
- The bean typemethod
- The methodarguments
- 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 beanR
- The result type of the execution handle- Parameters:
beanType
- The bean typequalifier
- The bean qualifermethod
- The methodarguments
- 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 beanR
- The result type of the execution handle- Parameters:
bean
- The bean to invoke the method onmethod
- The methodarguments
- 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 classR
- The result type of the execution handle- Parameters:
beanType
- The bean typemethod
- The methodarguments
- 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 aProxyBeanDefinition
.- Type Parameters:
T
- The bean type classR
- The result type of the execution handle- Parameters:
beanType
- The bean typemethod
- The methodarguments
- 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 aProxyBeanDefinition
.- Type Parameters:
T
- The bean type classR
- The result type of the execution handle- Parameters:
beanType
- The bean typequalifier
- The qualifiermethod
- The methodarguments
- 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 aProxyBeanDefinition
.- Type Parameters:
T
- The bean type classR
- The result type of the execution handle- Parameters:
beanType
- The bean typequalifier
- The qualifiermethod
- The methodarguments
- 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 classR
- The result type of the execution handle- Parameters:
beanType
- The bean typemethod
- The methodarguments
- 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 classR
- The result type of the execution handle- Parameters:
beanType
- The bean typemethod
- The methodarguments
- 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 classR
- The result type of the execution handle- Parameters:
beanType
- The bean typequalifier
- The qualifiermethod
- The methodarguments
- 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 classR
- The result type of the execution handle- Parameters:
beanType
- The bean typequalifier
- The qualifiermethod
- The methodarguments
- 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 beanR
- The result type of the execution handle- Parameters:
beanType
- The bean typemethod
- The methodarguments
- 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 beanR
- The result type of the execution handle- Parameters:
bean
- The bean to invoke the method onmethod
- The methodarguments
- 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 definitionmethod
- The method- Returns:
- The execution handle
-