Package org.picocontainer.injectors
Class Reinjector
java.lang.Object
org.picocontainer.injectors.Reinjector
A Reinjector allows methods on pre-instantiated classes to be invoked,
with appropriately scoped parameters.
-
Constructor Summary
ConstructorsConstructorDescriptionReinjector
(PicoContainer parentContainer) Make a reinjector with a parent container from which to pull components to be reinjected to.Reinjector
(PicoContainer parentContainer, ComponentMonitor monitor) Make a reinjector with a parent container from which to pull components to be reinjected to -
Method Summary
Modifier and TypeMethodDescriptionreinject
(Class<?> key, Class<?> impl, InjectionFactory reinjectionFactory) Reinjecting into a method.reinject
(Class<?> key, Class implementation, Object instance, Properties properties, InjectionFactory reinjectionFactory) Reinjecting into a method.reinject
(Class<?> key, Class implementation, Object instance, InjectionFactory reinjectionFactory) Reinjecting into a method.Reinjecting into a method.Reinjecting into a method.reinject
(Class<?> key, InjectionFactory reinjectionFactory) Reinjecting into a method.
-
Constructor Details
-
Reinjector
Make a reinjector with a parent container from which to pull components to be reinjected to. With this constructor, a NullComponentMonitor is used.- Parameters:
parentContainer
- the parent container
-
Reinjector
Make a reinjector with a parent container from which to pull components to be reinjected to- Parameters:
parentContainer
- the parent containermonitor
- the monitor to use for 'instantiating' events
-
-
Method Details
-
reinject
Reinjecting into a method.- Parameters:
key
- the component-key from the parent set of components to inject intoreinjectionMethod
- the reflection method to use for injection.- Returns:
- the result of the reinjection-method invocation.
-
reinject
Reinjecting into a method.- Parameters:
key
- the component-key from the parent set of components to inject intoreinjectionMethodEnum
- the enum for the reflection method to use for injection.- Returns:
- the result of the reinjection-method invocation.
-
reinject
Reinjecting into a method.- Parameters:
key
- the component-key from the parent set of components to inject into (key and impl are the same)reinjectionFactory
- the InjectionFactory to use for reinjection.- Returns:
- the result of the reinjection-method invocation.
-
reinject
Reinjecting into a method.- Parameters:
key
- the component-key from the parent set of components to inject intoimpl
- the implementation of the component that is going to result.reinjectionFactory
- the InjectionFactory to use for reinjection.- Returns:
-
reinject
public Object reinject(Class<?> key, Class implementation, Object instance, InjectionFactory reinjectionFactory) Reinjecting into a method.- Parameters:
key
- the component-key from the parent set of components to inject intoimplementation
- the implementation of the component that is going to result.instance
- the object that has the provider method to be invokedreinjectionFactory
- the InjectionFactory to use for reinjection.- Returns:
- the result of the reinjection-method invocation.
-
reinject
public Object reinject(Class<?> key, Class implementation, Object instance, Properties properties, InjectionFactory reinjectionFactory) Reinjecting into a method.- Parameters:
key
- the component-key from the parent set of components to inject intoimplementation
- the implementation of the component that is going to result.instance
- the object that has the provider method to be invokedproperties
- for reinjectionreinjectionFactory
- the InjectionFactory to use for reinjection.- Returns:
- the result of the reinjection-method invocation.
-