Class ComponentConstructorImpl<S>
- java.lang.Object
-
- org.apache.felix.scr.impl.inject.internal.ComponentConstructorImpl<S>
-
- All Implemented Interfaces:
ComponentConstructor<S>
public class ComponentConstructorImpl<S> extends java.lang.Object implements ComponentConstructor<S>
This implementation is used to construct a component instance object, call the constructor and set the activation fields.
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.reflect.Field[]
activationFields
private ValueUtils.ValueType[]
activationFieldTypes
private java.lang.reflect.Constructor<S>
constructor
private ValueUtils.ValueType[]
constructorArgTypes
private ReferenceMetadata[]
constructorRefs
-
Constructor Summary
Constructors Constructor Description ComponentConstructorImpl(ComponentMetadata componentMetadata, java.lang.Class<S> componentClass, ComponentLogger logger)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private java.lang.String
getNames(java.util.List<ReferenceMetadata> refs)
<T> S
newInstance(ScrComponentContext componentContext, java.util.Map<ReferenceMetadata,OpenStatus<S,?>> parameterMap)
Create a new instance
-
-
-
Field Detail
-
activationFields
private final java.lang.reflect.Field[] activationFields
-
activationFieldTypes
private final ValueUtils.ValueType[] activationFieldTypes
-
constructor
private final java.lang.reflect.Constructor<S> constructor
-
constructorArgTypes
private final ValueUtils.ValueType[] constructorArgTypes
-
constructorRefs
private final ReferenceMetadata[] constructorRefs
-
-
Constructor Detail
-
ComponentConstructorImpl
public ComponentConstructorImpl(ComponentMetadata componentMetadata, java.lang.Class<S> componentClass, ComponentLogger logger)
-
-
Method Detail
-
newInstance
public <T> S newInstance(ScrComponentContext componentContext, java.util.Map<ReferenceMetadata,OpenStatus<S,?>> parameterMap) throws java.lang.Exception
Create a new instance- Specified by:
newInstance
in interfaceComponentConstructor<S>
- Parameters:
componentContext
- The component contextparameterMap
- A map of reference parameters for handling references in the constructor- Returns:
- The instance
- Throws:
java.lang.Exception
- If anything goes wrong, like constructor can't be found etc.
-
getNames
private java.lang.String getNames(java.util.List<ReferenceMetadata> refs)
-
-