@Singleton @Visibility(value=LOCAL) public class GreedyResolver extends Object implements JustInTimeInjectionResolver
ServiceLocatorUtilities.addClasses(org.glassfish.hk2.api.ServiceLocator, Class...)
in order to add classes, and hence will use the default
class analyzer to discover injection points and constructors.
If the injected class is an interface the interface may use
the GreedyDefaultImplementation in order to specify
the class that should be used when another implementation
of this interface cannot be found.
WARNING: This resolve should be used with care as it could cause unexpected class files to be instantiated by hk2
| Modifier and Type | Method and Description |
|---|---|
boolean |
justInTimeResolution(Injectee failedInjectionPoint)
This method will be called whenever an injection point cannot be resolved.
|
public boolean justInTimeResolution(Injectee failedInjectionPoint)
JustInTimeInjectionResolverIf 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
justInTimeResolution in interface JustInTimeInjectionResolverfailedInjectionPoint - The injection point that failed to resolveServiceLocator
which may be used to resolve the Injectee. False if this method
did not add a descriptor to the ServiceLocator that might help
resolve the injection pointCopyright © 2009–2019 Oracle Corporation. All rights reserved.