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()
Descriptor
getImplementation
in interface Descriptor
public Set<String> getAdvertisedContracts()
Descriptor
getAdvertisedContracts
in interface Descriptor
public String getScope()
Descriptor
getScope
in interface Descriptor
public String getName()
Descriptor
getName
in interface Descriptor
public Set<String> getQualifiers()
Descriptor
getQualifiers
in interface Descriptor
public DescriptorType getDescriptorType()
Descriptor
getDescriptorType
in interface Descriptor
public DescriptorVisibility getDescriptorVisibility()
Descriptor
If 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 Descriptor
public Map<String,List<String>> getMetadata()
Descriptor
getMetadata
in interface Descriptor
public HK2Loader getLoader()
Descriptor
getLoader
in interface Descriptor
public int getRanking()
Descriptor
getRanking
in interface Descriptor
public Boolean isProxiable()
Descriptor
ProxyCtl
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 Descriptor
Proxiable
)public Boolean isProxyForSameScope()
Descriptor
isProxyForSameScope
in interface Descriptor
public String getClassAnalysisName()
Descriptor
ClassAnalyzer
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 Descriptor
public int setRanking(int ranking)
Descriptor
The ranking of a service may change at any time during the life of the descriptor
setRanking
in interface Descriptor
ranking
- The new ranking this descriptor should havepublic Long getServiceId()
Descriptor
getServiceId
in interface Descriptor
public T getCache()
SingleCache
getCache
in interface SingleCache<T>
public boolean isCacheSet()
SingleCache
isCacheSet
in interface SingleCache<T>
public void setCache(T cacheMe)
SingleCache
setCache
in interface SingleCache<T>
cacheMe
- A single value that can be cached in this
active descriptorpublic void releaseCache()
SingleCache
releaseCache
in interface SingleCache<T>
public boolean isReified()
ActiveDescriptor
isReified
in interface ActiveDescriptor<T>
public Class<?> getImplementationClass()
ActiveDescriptor
If 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()
ActiveDescriptor
ActiveDescriptor.getImplementationClass()
getImplementationType
in interface ActiveDescriptor<T>
public Set<Type> getContractTypes()
ActiveDescriptor
getContractTypes
in interface ActiveDescriptor<T>
public Annotation getScopeAsAnnotation()
ActiveDescriptor
Annotation
implementation that this ActiveDescriptor belongs togetScopeAsAnnotation
in interface ActiveDescriptor<T>
Annotation
public Class<? extends Annotation> getScopeAnnotation()
ActiveDescriptor
getScopeAnnotation
in interface ActiveDescriptor<T>
public Set<Annotation> getQualifierAnnotations()
ActiveDescriptor
getQualifierAnnotations
in interface ActiveDescriptor<T>
public List<Injectee> getInjectees()
ActiveDescriptor
If this descriptor is describing a factory created type then this list must have zero length
getInjectees
in interface ActiveDescriptor<T>
public Long getFactoryServiceId()
ActiveDescriptor
getFactoryServiceId
in interface ActiveDescriptor<T>
public Long getFactoryLocatorId()
ActiveDescriptor
getFactoryLocatorId
in interface ActiveDescriptor<T>
public T create(ServiceHandle<?> root)
ActiveDescriptor
create
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)
ActiveDescriptor
dispose
in interface ActiveDescriptor<T>
instance
- The instance to destroypublic Long getLocatorId()
Descriptor
getLocatorId
in interface Descriptor
public boolean close()
Closeable
public boolean isClosed()
Closeable
Copyright © 2009-2017, Oracle and/or its affiliates. All Rights Reserved.