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 java.lang.Object implements org.glassfish.hk2.api.InjectionResolver<javax.ws.rs.core.Context>, ContextInjectionResolver
Injection resolver for@Context
injection annotation.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ContextInjectionResolverImpl.Binder
Context injection resolver binder.private static class
ContextInjectionResolverImpl.CacheKey
Key dedicated for internal cache mechanism because two differentInjectee
Hk2 implementations comes from Jersey side and HK2 side injection resolver.private static class
ContextInjectionResolverImpl.DescriptorOverridingInjectee
private static class
ContextInjectionResolverImpl.RequiredTypeOverridingInjectee
-
Field Summary
Fields Modifier and Type Field Description private Cache<ContextInjectionResolverImpl.CacheKey,org.glassfish.hk2.api.ActiveDescriptor<?>>
descriptorCache
private LazyValue<java.util.Set<java.lang.Class<?>>>
foreignRequestScopedComponents
private Cache<ContextInjectionResolverImpl.CacheKey,org.glassfish.hk2.api.Injectee>
foreignRequestScopedInjecteeCache
private org.glassfish.hk2.api.ServiceLocator
serviceLocator
-
Constructor Summary
Constructors Constructor Description ContextInjectionResolverImpl()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private org.glassfish.hk2.api.Factory
asFactory(org.glassfish.hk2.api.ServiceHandle handle)
java.lang.Class<javax.ws.rs.core.Context>
getAnnotation()
This method returns the annotation for what the injection resolver is implemented.private org.glassfish.hk2.api.Injectee
getFactoryInjectee(org.glassfish.hk2.api.Injectee injectee, java.lang.reflect.Type requiredType)
private java.util.Set<java.lang.Class<?>>
getForeignRequestScopedComponents()
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.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.java.lang.Object
resolve(org.glassfish.hk2.api.Injectee injectee, org.glassfish.hk2.api.ServiceHandle<?> root)
java.lang.Object
resolve(Injectee injectee)
Jersey Injection Resolver method that just populate HK2 injectee object and delegates the processing to HK2 Injection Resolver.private static org.glassfish.hk2.utilities.InjecteeImpl
toInjecteeImpl(Injectee injectee)
-
-
-
Field Detail
-
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
private LazyValue<java.util.Set<java.lang.Class<?>>> foreignRequestScopedComponents
-
-
Method Detail
-
resolve
public java.lang.Object resolve(org.glassfish.hk2.api.Injectee injectee, org.glassfish.hk2.api.ServiceHandle<?> root)
- Specified by:
resolve
in interfaceorg.glassfish.hk2.api.InjectionResolver<javax.ws.rs.core.Context>
-
resolve
public java.lang.Object resolve(Injectee injectee)
Jersey Injection Resolver method that just populate HK2 injectee object and delegates the processing to HK2 Injection Resolver.- Specified by:
resolve
in interfaceInjectionResolver<javax.ws.rs.core.Context>
- Parameters:
injectee
- The injection point this value is being injected into- Returns:
- result of the injection processing.
-
toInjecteeImpl
private static org.glassfish.hk2.utilities.InjecteeImpl toInjecteeImpl(Injectee injectee)
-
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, java.lang.reflect.Type requiredType)
-
isConstructorParameterIndicator
public boolean isConstructorParameterIndicator()
Description copied from interface:InjectionResolver
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.- Specified by:
isConstructorParameterIndicator
in interfaceorg.glassfish.hk2.api.InjectionResolver<javax.ws.rs.core.Context>
- Specified by:
isConstructorParameterIndicator
in 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:InjectionResolver
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.- Specified by:
isMethodParameterIndicator
in interfaceorg.glassfish.hk2.api.InjectionResolver<javax.ws.rs.core.Context>
- Specified by:
isMethodParameterIndicator
in interfaceInjectionResolver<javax.ws.rs.core.Context>
- Returns:
- true if the injection annotation can appear in the parameter list of a method.
-
getAnnotation
public java.lang.Class<javax.ws.rs.core.Context> getAnnotation()
Description copied from interface:InjectionResolver
This method returns the annotation for what the injection resolver is implemented.- Specified by:
getAnnotation
in interfaceInjectionResolver<javax.ws.rs.core.Context>
- Returns:
- handled annotation by injection resolver.
-
getForeignRequestScopedComponents
private java.util.Set<java.lang.Class<?>> getForeignRequestScopedComponents()
-
-