Class ConfiguredByInjectionResolver
- java.lang.Object
-
- org.glassfish.hk2.configuration.internal.ConfiguredByInjectionResolver
-
- All Implemented Interfaces:
InjectionResolver<Configured>
@Singleton @Visibility(LOCAL) public class ConfiguredByInjectionResolver extends java.lang.Object implements InjectionResolver<Configured>
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.concurrent.ConcurrentHashMap<ActiveDescriptor<?>,BeanInfo>beanMapprivate ConfiguredByContextcontextprivate InjectionResolver<javax.inject.Inject>systemResolver-
Fields inherited from interface org.glassfish.hk2.api.InjectionResolver
SYSTEM_RESOLVER_NAME
-
-
Constructor Summary
Constructors Constructor Description ConfiguredByInjectionResolver()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) BeanInfoaddBean(ActiveDescriptor<?> descriptor, java.lang.Object bean, java.lang.String type, java.lang.Object metadata)private static java.lang.StringgetParameterNameFromConstructor(java.lang.reflect.Constructor<?> cnst, int position)private static java.lang.StringgetParameterNameFromMethod(java.lang.reflect.Method method, int position)booleanisConstructorParameterIndicator()This method should return true if the annotation that indicates that this is an injection point can appear in the parameter list of a constructor.booleanisMethodParameterIndicator()This method should return true if the annotation that indicates that this is an injection point can appear in the parameter list of a method.(package private) voidremoveBean(ActiveDescriptor<?> descriptor)java.lang.Objectresolve(Injectee injectee, ServiceHandle<?> root)This method will return the object that should be injected into the given injection point.java.lang.StringtoString()
-
-
-
Field Detail
-
systemResolver
@Inject @Named("SystemInjectResolver") private InjectionResolver<javax.inject.Inject> systemResolver
-
context
@Inject private ConfiguredByContext context
-
beanMap
private final java.util.concurrent.ConcurrentHashMap<ActiveDescriptor<?>,BeanInfo> beanMap
-
-
Method Detail
-
getParameterNameFromConstructor
private static java.lang.String getParameterNameFromConstructor(java.lang.reflect.Constructor<?> cnst, int position)
-
getParameterNameFromMethod
private static java.lang.String getParameterNameFromMethod(java.lang.reflect.Method method, int position)
-
resolve
public java.lang.Object resolve(Injectee injectee, ServiceHandle<?> root)
Description copied from interface:InjectionResolverThis method will return the object that should be injected into the given injection point. It is the responsiblity of the implementation to ensure that the object returned can be safely injected into the injection point.This method should not do the injection themselves
- Specified by:
resolvein interfaceInjectionResolver<Configured>- Parameters:
injectee- The injection point this value is being injected intoroot- The service handle of the root class being created, which should be used in order to ensure proper destruction of associated &64;PerLookup scoped objects. This can be null in the case that this is being used for an object not managed by HK2. This will only happen if this object is being created with the create method of ServiceLocator.- Returns:
- A possibly null value to be injected into the given injection point
-
isConstructorParameterIndicator
public boolean isConstructorParameterIndicator()
Description copied from interface:InjectionResolverThis method should return true if the annotation that indicates that this is an injection point can appear in the parameter list of a constructor.- Specified by:
isConstructorParameterIndicatorin interfaceInjectionResolver<Configured>- Returns:
- true if the injection annotation can appear in the parameter list of a constructor
-
isMethodParameterIndicator
public boolean isMethodParameterIndicator()
Description copied from interface:InjectionResolverThis method should return true if the annotation that indicates that this is an injection point can appear in the parameter list of a method.- Specified by:
isMethodParameterIndicatorin interfaceInjectionResolver<Configured>- Returns:
- true if the injection annotation can appear in the parameter list of a method
-
addBean
BeanInfo addBean(ActiveDescriptor<?> descriptor, java.lang.Object bean, java.lang.String type, java.lang.Object metadata)
-
removeBean
void removeBean(ActiveDescriptor<?> descriptor)
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-