public final class CachingConstructorInjectionComponentAdapter extends AbstractComponentAdapter
ConstructorInjectionComponentAdapter
The same code (generified and cleaned up) but without constructor caching (hence taking up less memory).
This class also inlines instance caching (e.g. it doesn't need to be wrapped in a CachingComponentAdapter).Modifier and Type | Class and Description |
---|---|
protected static class |
InstantiatingComponentAdapter.Guard
The cycle guard for the verification.
|
Modifier and Type | Field and Description |
---|---|
protected boolean |
allowNonPublicClasses |
protected Parameter[] |
parameters
The parameters to use for initialization.
|
Constructor and Description |
---|
CachingConstructorInjectionComponentAdapter(java.lang.Object componentKey,
java.lang.Class componentImplementation) |
CachingConstructorInjectionComponentAdapter(java.lang.Object componentKey,
java.lang.Class componentImplementation,
Parameter[] parameters) |
CachingConstructorInjectionComponentAdapter(java.lang.Object componentKey,
java.lang.Class componentImplementation,
Parameter[] parameters,
boolean allowNonPublicClasses) |
Modifier and Type | Method and Description |
---|---|
protected Parameter[] |
createDefaultParameters(java.lang.Class<?>[] parameters)
Create default parameters for the given types.
|
java.lang.Object |
getComponentInstance(PicoContainer container) |
protected java.lang.Object |
newInstance(java.lang.reflect.Constructor<?> constructor,
java.lang.Object[] parameters)
Instantiate an object with given parameters and respect the accessible flag.
|
checkTypeCompatibility, getComponentImplementation, getComponentKey, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
verify
protected transient Parameter[] parameters
protected boolean allowNonPublicClasses
public CachingConstructorInjectionComponentAdapter(java.lang.Object componentKey, java.lang.Class componentImplementation, Parameter[] parameters, boolean allowNonPublicClasses) throws AssignabilityRegistrationException
public CachingConstructorInjectionComponentAdapter(java.lang.Object componentKey, java.lang.Class componentImplementation, Parameter[] parameters)
public CachingConstructorInjectionComponentAdapter(java.lang.Object componentKey, java.lang.Class componentImplementation) throws AssignabilityRegistrationException
public java.lang.Object getComponentInstance(PicoContainer container) throws PicoInitializationException, PicoIntrospectionException, AssignabilityRegistrationException
container
- the PicoContainer
, that is used to resolve any possible dependencies of the instance.PicoInitializationException
- if the component could not be instantiated.PicoIntrospectionException
- if the component has dependencies which could not be resolved, or
instantiation of the component lead to an ambigous situation within the
container.AssignabilityRegistrationException
protected Parameter[] createDefaultParameters(java.lang.Class<?>[] parameters)
parameters
- the parameter typesprotected java.lang.Object newInstance(java.lang.reflect.Constructor<?> constructor, java.lang.Object[] parameters) throws java.lang.InstantiationException, java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException
constructor
- the constructor to useparameters
- the parameters for the constructorjava.lang.InstantiationException
java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException