@Singleton public class GuiceToHk2JITResolver extends java.lang.Object implements JustInTimeInjectionResolver
Modifier and Type | Field and Description |
---|---|
private com.google.inject.Injector |
guiceInjector |
private ServiceLocator |
locator |
Constructor and Description |
---|
GuiceToHk2JITResolver(ServiceLocator locator,
com.google.inject.Injector guiceInjector) |
Modifier and Type | Method and Description |
---|---|
private com.google.inject.Binding<?> |
findBinding(Injectee injectee)
This tries every qualifier in the injectee
|
static java.lang.Class<?> |
getClassFromType(java.lang.reflect.Type type)
Gets the class from the given type
|
boolean |
justInTimeResolution(Injectee failedInjectionPoint)
This method will be called whenever an injection point cannot be resolved.
|
private final ServiceLocator locator
private final com.google.inject.Injector guiceInjector
GuiceToHk2JITResolver(ServiceLocator locator, com.google.inject.Injector guiceInjector)
private com.google.inject.Binding<?> findBinding(Injectee injectee)
injectee
- The injectee to look for a binding forpublic static java.lang.Class<?> getClassFromType(java.lang.reflect.Type type)
type
- The type to find the class frompublic boolean justInTimeResolution(Injectee failedInjectionPoint)
JustInTimeInjectionResolver
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
justInTimeResolution
in interface JustInTimeInjectionResolver
failedInjectionPoint
- 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 point