public class DelegatingNamedActiveDescriptor extends java.lang.Object implements ActiveDescriptor<java.lang.Object>
| Modifier and Type | Field and Description |
|---|---|
private java.lang.Object |
cache |
private boolean |
isSet |
private java.lang.Object |
lock |
private javax.inject.Named |
name |
private ActiveDescriptor<?> |
parent |
private java.util.HashSet<java.lang.String> |
qualifierNames |
private java.util.HashSet<java.lang.annotation.Annotation> |
qualifiers |
private int |
ranking |
| Constructor and Description |
|---|
DelegatingNamedActiveDescriptor(ActiveDescriptor<?> parent,
java.lang.String name) |
| Modifier and Type | Method and Description |
|---|---|
java.lang.Object |
create(ServiceHandle<?> root)
Creates an instance of the ActiveDescriptor.
|
void |
dispose(java.lang.Object instance)
Disposes this instance.
|
java.util.Set<java.lang.String> |
getAdvertisedContracts()
Returns the base class name of the contracts that
this service describes.
|
java.lang.Object |
getCache()
This can be used for scopes that will only every be created once.
|
java.lang.String |
getClassAnalysisName()
Returns the name of the
ClassAnalyzer service that
should be used to discover the constructors, initialization methods,
field and postConstruct and preDestory methods. |
java.util.Set<java.lang.reflect.Type> |
getContractTypes()
The set of types that this ActiveDescriptor must produce.
|
DescriptorType |
getDescriptorType()
Returns CLASS if this is a class descriptor
and FACTORY if this is a descriptor describing
a factory for a type, in which case the
implClass should point to the implementation
class of the factory
|
DescriptorVisibility |
getDescriptorVisibility()
Returns the visibility of this descriptor.
|
java.lang.Long |
getFactoryLocatorId()
If this ActiveDescriptor has DescriptorType of PROVIDE_METHOD then
this field will return the ServiceId of its associated Factory
service.
|
java.lang.Long |
getFactoryServiceId()
If this ActiveDescriptor has DescriptorType of PROVIDE_METHOD then
this field will return the ServiceId of its associated Factory
service.
|
java.lang.String |
getImplementation()
Returns the fully qualified class
name of the implementation
class.
|
java.lang.Class<?> |
getImplementationClass()
The implementation class that should be used
to generate new instances of this descriptor.
|
java.util.List<Injectee> |
getInjectees()
Returns the full list of Injectees this class has.
|
HK2Loader |
getLoader()
This returns the loader that should be used when
classloading this descriptor.
|
java.lang.Long |
getLocatorId()
This returns the id of the ServiceLocator which this descriptor
is registered with.
|
java.util.Map<java.lang.String,java.util.List<java.lang.String>> |
getMetadata()
Returns all of the metadata associated
that this object should be registered
with or looked up by
|
java.lang.String |
getName()
The name of this descriptor.
|
java.util.Set<java.lang.annotation.Annotation> |
getQualifierAnnotations()
The full set of qualifiers that this ActiveDescriptor
provides
|
java.util.Set<java.lang.String> |
getQualifiers()
Returns all of the annotation classes
that this object should be registered
with or looked up by
|
int |
getRanking()
Returns the ranking of this descriptor.
|
java.lang.String |
getScope()
Returns the fully qualified class name of
the scope annotation that should be
associated with this descriptor.
|
java.lang.Class<? extends java.lang.annotation.Annotation> |
getScopeAnnotation()
Returns the scope that this ActiveDescriptor belongs to
|
java.lang.annotation.Annotation |
getScopeAsAnnotation()
Returns the scope as an
Annotation
implementation that this ActiveDescriptor belongs to |
java.lang.Long |
getServiceId()
This returns the unique identifier for this descriptor.
|
boolean |
isCacheSet()
Returns true if this cache has been set
|
java.lang.Boolean |
isProxiable()
If this returns true then the system will create a proxy for
instances of this descriptor.
|
java.lang.Boolean |
isProxyForSameScope()
This value determines whether or not this service should be
proxied when being injected into other services of the same
scope.
|
boolean |
isReified()
This method returns true if this descriptor has been reified
(class loaded).
|
void |
releaseCache()
Removes the cached value and makes it such
that this cache has not been set
|
void |
setCache(java.lang.Object cacheMe)
Sets the value into the cache
|
int |
setRanking(int ranking)
Returns the ranking of this descriptor.
|
private final ActiveDescriptor<?> parent
private final javax.inject.Named name
private final java.util.HashSet<java.lang.String> qualifierNames
private final java.util.HashSet<java.lang.annotation.Annotation> qualifiers
private int ranking
private java.lang.Object lock
private java.lang.Object cache
private boolean isSet
DelegatingNamedActiveDescriptor(ActiveDescriptor<?> parent, java.lang.String name)
public java.lang.String getImplementation()
DescriptorgetImplementation in interface Descriptorpublic java.util.Set<java.lang.String> getAdvertisedContracts()
DescriptorgetAdvertisedContracts in interface Descriptorpublic java.lang.String getScope()
DescriptorgetScope in interface Descriptorpublic java.lang.String getName()
DescriptorgetName in interface Descriptorpublic java.util.Set<java.lang.String> getQualifiers()
DescriptorgetQualifiers in interface Descriptorpublic DescriptorType getDescriptorType()
DescriptorgetDescriptorType in interface Descriptorpublic DescriptorVisibility getDescriptorVisibility()
DescriptorIf the visibility is NORMAL then this descriptor may be seen by all children locators of the locator in which this descriptor is bound
If the visibility is LOCAL then this descriptor may only be seen by the servcie locator in which it is bound, and in none of the children of that locator
getDescriptorVisibility in interface Descriptorpublic java.util.Map<java.lang.String,java.util.List<java.lang.String>> getMetadata()
DescriptorgetMetadata in interface Descriptorpublic HK2Loader getLoader()
DescriptorgetLoader in interface Descriptorpublic int getRanking()
DescriptorgetRanking in interface Descriptorpublic int setRanking(int ranking)
DescriptorThe ranking of a service may change at any time during the life of the descriptor
setRanking in interface Descriptorranking - The new ranking this descriptor should havepublic java.lang.Boolean isProxiable()
DescriptorProxyCtl interface
It is an error for this method to return true if the scope that
this descriptor is in is Unproxiable (such as PerLookup).
isProxiable in interface DescriptorProxiable)public java.lang.Boolean isProxyForSameScope()
DescriptorisProxyForSameScope in interface Descriptorpublic java.lang.String getClassAnalysisName()
DescriptorClassAnalyzer service that
should be used to discover the constructors, initialization methods,
field and postConstruct and preDestory methods. If null the default
implementation will be used. Will be ignored for descriptors that
are not automatically analyzed by hk2getClassAnalysisName in interface Descriptorpublic java.lang.Long getServiceId()
DescriptorgetServiceId in interface Descriptorpublic java.lang.Long getLocatorId()
DescriptorgetLocatorId in interface Descriptorpublic java.lang.Object getCache()
SingleCachegetCache in interface SingleCache<java.lang.Object>public boolean isCacheSet()
SingleCacheisCacheSet in interface SingleCache<java.lang.Object>public void setCache(java.lang.Object cacheMe)
SingleCachesetCache in interface SingleCache<java.lang.Object>cacheMe - A single value that can be cached in this
active descriptorpublic void releaseCache()
SingleCachereleaseCache in interface SingleCache<java.lang.Object>public boolean isReified()
ActiveDescriptorisReified in interface ActiveDescriptor<java.lang.Object>public java.lang.Class<?> getImplementationClass()
ActiveDescriptorIf the class returned is a Factory, then the factory is used to create instances. In this case the system will get an instance of the factory and use it to create the instances
getImplementationClass in interface ActiveDescriptor<java.lang.Object>public java.util.Set<java.lang.reflect.Type> getContractTypes()
ActiveDescriptorgetContractTypes in interface ActiveDescriptor<java.lang.Object>public java.lang.annotation.Annotation getScopeAsAnnotation()
ActiveDescriptorAnnotation
implementation that this ActiveDescriptor belongs togetScopeAsAnnotation in interface ActiveDescriptor<java.lang.Object>Annotationpublic java.lang.Class<? extends java.lang.annotation.Annotation> getScopeAnnotation()
ActiveDescriptorgetScopeAnnotation in interface ActiveDescriptor<java.lang.Object>public java.util.Set<java.lang.annotation.Annotation> getQualifierAnnotations()
ActiveDescriptorgetQualifierAnnotations in interface ActiveDescriptor<java.lang.Object>public java.util.List<Injectee> getInjectees()
ActiveDescriptorIf this descriptor is describing a factory created type then this list must have zero length
getInjectees in interface ActiveDescriptor<java.lang.Object>public java.lang.Long getFactoryServiceId()
ActiveDescriptorgetFactoryServiceId in interface ActiveDescriptor<java.lang.Object>public java.lang.Long getFactoryLocatorId()
ActiveDescriptorgetFactoryLocatorId in interface ActiveDescriptor<java.lang.Object>public java.lang.Object create(ServiceHandle<?> root)
ActiveDescriptorcreate in interface ActiveDescriptor<java.lang.Object>root - The root service handle, which can be used
to associated all the PerLookup objects with this creationpublic void dispose(java.lang.Object instance)
ActiveDescriptordispose in interface ActiveDescriptor<java.lang.Object>instance - The instance to destroy