public class PerLocatorUtilities
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private Hk2ThreadLocal<java.util.WeakHashMap<java.lang.reflect.AnnotatedElement,java.lang.Boolean>> |
hasInjectCache |
private ServiceLocatorImpl |
parent |
private ProxyUtilities |
proxyUtilities |
private Hk2ThreadLocal<java.util.WeakHashMap<java.lang.reflect.AnnotatedElement,SoftAnnotatedElementAnnotationInfo>> |
threadLocalAnnotationCache
Must not be static, otherwise it can leak when using thread pools
|
private Hk2ThreadLocal<java.util.WeakHashMap<java.lang.Class<?>,java.lang.String>> |
threadLocalAutoAnalyzerNameCache
Must not be static, otherwise it can leak when using thread pools
|
Constructor and Description |
---|
PerLocatorUtilities(ServiceLocatorImpl parent) |
Modifier and Type | Method and Description |
---|---|
private AnnotatedElementAnnotationInfo |
computeElementAnnotationInfo(java.lang.reflect.AnnotatedElement ae) |
java.lang.String |
getAutoAnalyzerName(java.lang.Class<?> c)
Gets the analyzer name from the Service annotation
|
private java.lang.annotation.Annotation |
getInjectAnnotation(ServiceLocatorImpl locator,
java.lang.reflect.AnnotatedElement annotated,
boolean checkParams,
int position)
Gets the annotation that was used for the injection
|
(package private) InjectionResolver<?> |
getInjectionResolver(ServiceLocatorImpl locator,
java.lang.reflect.AnnotatedElement annotatedGuy)
Returns an injection resolver for this AnnotatedElement.
|
private InjectionResolver<?> |
getInjectionResolver(ServiceLocatorImpl locator,
java.lang.reflect.AnnotatedElement annotatedGuy,
int position) |
InjectionResolver<?> |
getInjectionResolver(ServiceLocatorImpl locator,
SystemInjecteeImpl injectee)
Returns an injection resolver for the injectee
|
ProxyUtilities |
getProxyUtilities() |
(package private) boolean |
hasInjectAnnotation(java.lang.reflect.AnnotatedElement annotated)
Checks whether an annotated element has any annotation that was used for the injection
|
void |
releaseCaches() |
void |
shutdown() |
private final Hk2ThreadLocal<java.util.WeakHashMap<java.lang.Class<?>,java.lang.String>> threadLocalAutoAnalyzerNameCache
private final Hk2ThreadLocal<java.util.WeakHashMap<java.lang.reflect.AnnotatedElement,SoftAnnotatedElementAnnotationInfo>> threadLocalAnnotationCache
private final Hk2ThreadLocal<java.util.WeakHashMap<java.lang.reflect.AnnotatedElement,java.lang.Boolean>> hasInjectCache
private volatile ProxyUtilities proxyUtilities
private final ServiceLocatorImpl parent
PerLocatorUtilities(ServiceLocatorImpl parent)
boolean hasInjectAnnotation(java.lang.reflect.AnnotatedElement annotated)
locator
- The service locator to use (as it will get all
the annotations that were added on as well as the normal Inject)annotated
- the annotated elementcheckParams
- check the params if truepublic java.lang.String getAutoAnalyzerName(java.lang.Class<?> c)
c
- The class to get the analyzer name frompublic InjectionResolver<?> getInjectionResolver(ServiceLocatorImpl locator, SystemInjecteeImpl injectee) throws java.lang.IllegalStateException
locator
- The locator to use when finding the resolverinjectee
- Injectee from which the annotation should be extractedjava.lang.IllegalStateException
- If we could not find a valid resolverInjectionResolver<?> getInjectionResolver(ServiceLocatorImpl locator, java.lang.reflect.AnnotatedElement annotatedGuy) throws java.lang.IllegalStateException
locator
- The locator to use when finding the resolverannotatedGuy
- The annotated class or producer methodjava.lang.IllegalStateException
- If we could not find a valid resolverprivate InjectionResolver<?> getInjectionResolver(ServiceLocatorImpl locator, java.lang.reflect.AnnotatedElement annotatedGuy, int position) throws java.lang.IllegalStateException
java.lang.IllegalStateException
private java.lang.annotation.Annotation getInjectAnnotation(ServiceLocatorImpl locator, java.lang.reflect.AnnotatedElement annotated, boolean checkParams, int position)
locator
- The service locator to use (as it will get all
the annotations that were added on as well as the normal Inject)annotated
- the annotated annotatedcheckParams
- check the params if trueposition
- index of constructor or method parameter which which will be checked
for inject annotations. The position
parameter is only used when
annotated
is method or constructor otherwise the value will be ignored.private AnnotatedElementAnnotationInfo computeElementAnnotationInfo(java.lang.reflect.AnnotatedElement ae)
public void releaseCaches()
public void shutdown()
public ProxyUtilities getProxyUtilities()