Class 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
    • Constructor Detail

      • InjectionManager

        public InjectionManager()
    • Method Detail

      • inject

        public void inject​(Object component,
                           InjectionResolver... targets)
        Initializes the component by performing injection.
        Parameters:
        component - component instance to inject
        onBehalfOf - the inhabitant to do injection on behalf of
        targets - 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 inject
        onBehalfOf - the inhabitant to do injection on behalf of
        es - the ExecutorService to use in order to handle the work load
        targets - 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 inject
        type - component class
        targets - 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 inject
        onBehalfOf - the inhabitant to do injection on behalf of
        type - component class
        targets - the injection resolvers to resolve all injection points
        Throws:
        ComponentException - if injection failed for some reason.
      • allowInjection

        protected boolean allowInjection​(Method method,
                                         Class<?>[] paramTypes)
        jsr-330 rules are very forgiving.
      • error_InjectMethodIsNotVoid

        protected void error_InjectMethodIsNotVoid​(Method method)