T - The type from the cachepublic class SystemDescriptor<T> extends Object implements ActiveDescriptor<T>, Closeable
| Modifier and Type | Method and Description |
|---|---|
boolean |
close()
Idempotent close method.
|
T |
create(ServiceHandle<?> root)
Creates an instance of the ActiveDescriptor.
|
void |
dispose(T instance)
Disposes this instance.
|
boolean |
equals(Object o) |
Set<String> |
getAdvertisedContracts()
Returns the base class name of the contracts that
this service describes.
|
T |
getCache()
This can be used for scopes that will only every be created once.
|
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. |
Set<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.
|
Long |
getFactoryLocatorId()
If this ActiveDescriptor has DescriptorType of PROVIDE_METHOD then
this field will return the ServiceId of its associated Factory
service.
|
Long |
getFactoryServiceId()
If this ActiveDescriptor has DescriptorType of PROVIDE_METHOD then
this field will return the ServiceId of its associated Factory
service.
|
String |
getImplementation()
Returns the fully qualified class
name of the implementation
class.
|
Class<?> |
getImplementationClass()
The implementation class that should be used
to generate new instances of this descriptor.
|
Type |
getImplementationType()
If known the Type of the implementation.
|
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.
|
Long |
getLocatorId()
This returns the id of the ServiceLocator which this descriptor
is registered with.
|
Map<String,List<String>> |
getMetadata()
Returns all of the metadata associated
that this object should be registered
with or looked up by
|
String |
getName()
The name of this descriptor.
|
Set<Annotation> |
getQualifierAnnotations()
The full set of qualifiers that this ActiveDescriptor
provides
|
Set<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.
|
String |
getScope()
Returns the fully qualified class name of
the scope annotation that should be
associated with this descriptor.
|
Class<? extends Annotation> |
getScopeAnnotation()
Returns the scope that this ActiveDescriptor belongs to
|
Annotation |
getScopeAsAnnotation()
Returns the scope as an
Annotation
implementation that this ActiveDescriptor belongs to |
Long |
getServiceId()
This returns the unique identifier for this descriptor.
|
int |
hashCode() |
boolean |
isCacheSet()
Returns true if this cache has been set
|
boolean |
isClosed()
Returns true if the instance has been
closed
|
Boolean |
isProxiable()
If this returns true then the system will create a proxy for
instances of this descriptor.
|
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(T cacheMe)
Sets the value into the cache
|
int |
setRanking(int ranking)
Returns the ranking of this descriptor.
|
String |
toString() |
public String getImplementation()
DescriptorgetImplementation in interface Descriptorpublic Set<String> getAdvertisedContracts()
DescriptorgetAdvertisedContracts in interface Descriptorpublic String getScope()
DescriptorgetScope in interface Descriptorpublic String getName()
DescriptorgetName in interface Descriptorpublic Set<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 Map<String,List<String>> getMetadata()
DescriptorgetMetadata in interface Descriptorpublic HK2Loader getLoader()
DescriptorgetLoader in interface Descriptorpublic int getRanking()
DescriptorgetRanking in interface Descriptorpublic 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 Boolean isProxyForSameScope()
DescriptorisProxyForSameScope in interface Descriptorpublic 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 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 Long getServiceId()
DescriptorgetServiceId in interface Descriptorpublic T getCache()
SingleCachegetCache in interface SingleCache<T>public boolean isCacheSet()
SingleCacheisCacheSet in interface SingleCache<T>public void setCache(T cacheMe)
SingleCachesetCache in interface SingleCache<T>cacheMe - A single value that can be cached in this
active descriptorpublic void releaseCache()
SingleCachereleaseCache in interface SingleCache<T>public boolean isReified()
ActiveDescriptorisReified in interface ActiveDescriptor<T>public 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<T>public Type getImplementationType()
ActiveDescriptorActiveDescriptor.getImplementationClass()getImplementationType in interface ActiveDescriptor<T>public Set<Type> getContractTypes()
ActiveDescriptorgetContractTypes in interface ActiveDescriptor<T>public Annotation getScopeAsAnnotation()
ActiveDescriptorAnnotation
implementation that this ActiveDescriptor belongs togetScopeAsAnnotation in interface ActiveDescriptor<T>Annotationpublic Class<? extends Annotation> getScopeAnnotation()
ActiveDescriptorgetScopeAnnotation in interface ActiveDescriptor<T>public Set<Annotation> getQualifierAnnotations()
ActiveDescriptorgetQualifierAnnotations in interface ActiveDescriptor<T>public List<Injectee> getInjectees()
ActiveDescriptorIf this descriptor is describing a factory created type then this list must have zero length
getInjectees in interface ActiveDescriptor<T>public Long getFactoryServiceId()
ActiveDescriptorgetFactoryServiceId in interface ActiveDescriptor<T>public Long getFactoryLocatorId()
ActiveDescriptorgetFactoryLocatorId in interface ActiveDescriptor<T>public T create(ServiceHandle<?> root)
ActiveDescriptorcreate in interface ActiveDescriptor<T>root - The root service handle, which can be used
to associated all the PerLookup objects with this creationpublic void dispose(T instance)
ActiveDescriptordispose in interface ActiveDescriptor<T>instance - The instance to destroypublic Long getLocatorId()
DescriptorgetLocatorId in interface Descriptorpublic boolean close()
Closeablepublic boolean isClosed()
CloseableCopyright © 2009-2017, Oracle and/or its affiliates. All Rights Reserved.