An implementation of InjectionResolver must be in the Singleton scope.
Implementations of InjectionResolver will be instantiated as soon as
they are added to HK2 in order to avoid deadlocks and circular references.
Therefore it is recommended that implementations of InjectionResolver
make liberal use of jakarta. or IterableProvider
when injecting dependent services so that these services are not instantiated
when the InjectionResolver is created
| Modifier and Type | Field and Description |
|---|---|
| public static final String | SYSTEM_RESOLVER_NAME
This is the name of the system provided resolver for 330 injections |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | Returns: true if the injection annotation can appear in the parameter list of a constructorThis method should return true if the annotation that indicates that this is an injection point can appear in the parameter list of a constructor. |
| public boolean | Returns: true if the injection annotation can appear in the parameter list of a methodThis method should return true if the annotation that indicates that this is an injection point can appear in the parameter list of a method. |
| public Object | Returns: A possibly null value to be injected into the given injection pointThe injection point this value is being injected into injectee, ServiceHandle<?> 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. root)This method will return the object that should be injected into the given injection point. |
| SYSTEM_RESOLVER_NAME | back to summary |
|---|---|
| public static final String SYSTEM_RESOLVER_NAME This is the name of the system provided resolver for 330 injections | |
| isConstructorParameterIndicator | back to summary |
|---|---|
| public boolean isConstructorParameterIndicator() 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.
| |
| isMethodParameterIndicator | back to summary |
|---|---|
| public boolean isMethodParameterIndicator() 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.
| |
| resolve | back to summary |
|---|---|
| public Object resolve(Injectee injectee, ServiceHandle<?> root) This 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
| |