Package org.jvnet.hk2.config
Class InjectionManager
- java.lang.Object
-
- org.jvnet.hk2.config.InjectionManager
-
public class InjectionManager extends Object
InjectionManager is responsible for injecting resources into a component. Injection targets are identified by the injection resolver type attribute.- Author:
- Jerome Dochez
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected classInjectionManager.InjectClassPrototype for the multi-threaded version of inject().protected static classInjectionManager.InjectContextprotected classInjectionManager.InjectFieldprotected classInjectionManager.InjectFieldsprotected classInjectionManager.InjectMethodprotected classInjectionManager.InjectMethods
-
Constructor Summary
Constructors Constructor Description InjectionManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleanallowInjection(Method method, Class<?>[] paramTypes)jsr-330 rules are very forgiving.protected voiderror_injectionException(InjectionResolver target, Annotation inject, AnnotatedElement injectionPoint, Throwable e)protected voiderror_InjectMethodIsNotVoid(Method method)voidinject(Object component, Class type, InjectionResolver... targets)Initializes the component by performing injection.voidinject(Object component, ExecutorService es, InjectionResolver... targets)Initializes the component by performing injection.voidinject(Object component, InjectionResolver... targets)Initializes the component by performing injection.protected voidsyncDoInject(Object component, Class type, InjectionResolver... targets)Initializes the component by performing injection.
-
-
-
Method Detail
-
inject
public void inject(Object component, InjectionResolver... targets)
Initializes the component by performing injection.- Parameters:
component- component instance to injectonBehalfOf- the inhabitant to do injection on behalf oftargets- the injection resolvers to resolve all injection points- Throws:
ComponentException- if injection failed for some reason.
-
inject
public void inject(Object component, ExecutorService es, InjectionResolver... targets)
Initializes the component by performing injection.- Parameters:
component- component instance to injectonBehalfOf- the inhabitant to do injection on behalf ofes- the ExecutorService to use in order to handle the work loadtargets- the injection resolvers to resolve all injection points- Throws:
ComponentException- if injection failed for some reason.
-
inject
public void inject(Object component, Class type, InjectionResolver... targets)
Initializes the component by performing injection.- Parameters:
component- component instance to injecttype- component classtargets- the injection resolvers to resolve all injection points- Throws:
ComponentException- if injection failed for some reason.
-
syncDoInject
protected void syncDoInject(Object component, Class type, InjectionResolver... targets)
Initializes the component by performing injection.- Parameters:
component- component instance to injectonBehalfOf- the inhabitant to do injection on behalf oftype- component classtargets- the injection resolvers to resolve all injection points- Throws:
ComponentException- if injection failed for some reason.
-
error_injectionException
protected void error_injectionException(InjectionResolver target, Annotation inject, AnnotatedElement injectionPoint, Throwable e)
-
allowInjection
protected boolean allowInjection(Method method, Class<?>[] paramTypes)
jsr-330 rules are very forgiving.
-
error_InjectMethodIsNotVoid
protected void error_InjectMethodIsNotVoid(Method method)
-
-