Package org.glassfish.jersey.inject.hk2
Class ContextInjectionResolverImpl
java.lang.Object
org.glassfish.jersey.inject.hk2.ContextInjectionResolverImpl
- All Implemented Interfaces:
org.glassfish.hk2.api.InjectionResolver<javax.ws.rs.core.Context>,ContextInjectionResolver,InjectionResolver<javax.ws.rs.core.Context>
@Singleton
public class ContextInjectionResolverImpl
extends Object
implements org.glassfish.hk2.api.InjectionResolver<javax.ws.rs.core.Context>, ContextInjectionResolver
Injection resolver for
@Context injection annotation.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classContext injection resolver binder.private static classKey dedicated for internal cache mechanism because two differentInjecteeHk2 implementations comes from Jersey side and HK2 side injection resolver.private static classprivate static class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Cache<ContextInjectionResolverImpl.CacheKey, org.glassfish.hk2.api.ActiveDescriptor<?>> private final Cache<ContextInjectionResolverImpl.CacheKey, org.glassfish.hk2.api.Injectee> private org.glassfish.hk2.api.ServiceLocatorFields inherited from interface org.glassfish.hk2.api.InjectionResolver
SYSTEM_RESOLVER_NAME -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate org.glassfish.hk2.api.FactoryasFactory(org.glassfish.hk2.api.ServiceHandle handle) Class<javax.ws.rs.core.Context> This method returns the annotation for what the injection resolver is implemented.private org.glassfish.hk2.api.InjecteegetFactoryInjectee(org.glassfish.hk2.api.Injectee injectee, Type requiredType) booleanThis method should return true if the annotation that indicates that this is an injection point can appear in the parameter list of a constructor.booleanThis 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(org.glassfish.hk2.api.Injectee injectee, org.glassfish.hk2.api.ServiceHandle<?> root) Jersey Injection Resolver method that just populate HK2 injectee object and delegates the processing to HK2 Injection Resolver.private static org.glassfish.hk2.utilities.InjecteeImpltoInjecteeImpl(Injectee injectee)
-
Field Details
-
serviceLocator
@Inject private org.glassfish.hk2.api.ServiceLocator serviceLocator -
descriptorCache
private final Cache<ContextInjectionResolverImpl.CacheKey,org.glassfish.hk2.api.ActiveDescriptor<?>> descriptorCache -
foreignRequestScopedInjecteeCache
private final Cache<ContextInjectionResolverImpl.CacheKey,org.glassfish.hk2.api.Injectee> foreignRequestScopedInjecteeCache -
foreignRequestScopedComponents
-
-
Constructor Details
-
ContextInjectionResolverImpl
public ContextInjectionResolverImpl()
-
-
Method Details
-
resolve
public Object resolve(org.glassfish.hk2.api.Injectee injectee, org.glassfish.hk2.api.ServiceHandle<?> root) - Specified by:
resolvein interfaceorg.glassfish.hk2.api.InjectionResolver<javax.ws.rs.core.Context>
-
resolve
Jersey Injection Resolver method that just populate HK2 injectee object and delegates the processing to HK2 Injection Resolver.- Specified by:
resolvein interfaceInjectionResolver<javax.ws.rs.core.Context>- Parameters:
injectee- The injection point this value is being injected into- Returns:
- result of the injection processing.
-
toInjecteeImpl
-
asFactory
private org.glassfish.hk2.api.Factory asFactory(org.glassfish.hk2.api.ServiceHandle handle) -
getFactoryInjectee
private org.glassfish.hk2.api.Injectee getFactoryInjectee(org.glassfish.hk2.api.Injectee injectee, Type requiredType) -
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 interfaceorg.glassfish.hk2.api.InjectionResolver<javax.ws.rs.core.Context>- Specified by:
isConstructorParameterIndicatorin interfaceInjectionResolver<javax.ws.rs.core.Context>- 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 interfaceorg.glassfish.hk2.api.InjectionResolver<javax.ws.rs.core.Context>- Specified by:
isMethodParameterIndicatorin interfaceInjectionResolver<javax.ws.rs.core.Context>- Returns:
- true if the injection annotation can appear in the parameter list of a method.
-
getAnnotation
Description copied from interface:InjectionResolverThis method returns the annotation for what the injection resolver is implemented.- Specified by:
getAnnotationin interfaceInjectionResolver<javax.ws.rs.core.Context>- Returns:
- handled annotation by injection resolver.
-
getForeignRequestScopedComponents
-