Class JustInTimeInjectionResolverImpl
- java.lang.Object
-
- org.jvnet.hk2.testing.junit.internal.JustInTimeInjectionResolverImpl
-
- All Implemented Interfaces:
JustInTimeInjectionResolver
@Singleton public class JustInTimeInjectionResolverImpl extends java.lang.Object implements JustInTimeInjectionResolver
-
-
Field Summary
Fields Modifier and Type Field Description private DynamicConfigurationService
dcs
private java.util.Collection<?>
excludes
-
Constructor Summary
Constructors Constructor Description JustInTimeInjectionResolverImpl()
JustInTimeInjectionResolverImpl(java.util.Collection<?> excludes)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
isLookup(Injectee failedInjectionPoint)
Returnstrue
if the suppliedInjectee
represents a service lookup rather than a true injection point.boolean
justInTimeResolution(Injectee failedInjectionPoint)
This method will be called whenever an injection point cannot be resolved.
-
-
-
Field Detail
-
excludes
private final java.util.Collection<?> excludes
-
dcs
@Inject private DynamicConfigurationService dcs
-
-
Method Detail
-
isLookup
protected boolean isLookup(Injectee failedInjectionPoint)
Returnstrue
if the suppliedInjectee
represents a service lookup rather than a true injection point.
-
justInTimeResolution
public boolean justInTimeResolution(Injectee failedInjectionPoint)
Description copied from interface:JustInTimeInjectionResolver
This method will be called whenever an injection point cannot be resolved. If this method adds anything to the configuration it should return true. Otherwise it should return false. The injection point that failed to be resolved is given in failedInjectionPoint.If this method throws an exception that exception will be added to the set of exceptions in the MultiException that may be thrown from the injection resolver.
This method can be called on multiple threads with different or the same
Injectee
. Therefore care must be taken in this method to not add the same descriptor more than once- Specified by:
justInTimeResolution
in interfaceJustInTimeInjectionResolver
- Parameters:
failedInjectionPoint
- The injection point that failed to resolve- Returns:
- true if this method has added a descriptor to the
ServiceLocator
which may be used to resolve theInjectee
. False if this method did not add a descriptor to theServiceLocator
that might help resolve the injection point
-
-