T
- The type returned from the cachepublic abstract class AbstractActiveDescriptor<T> extends DescriptorImpl implements ActiveDescriptor<T>, Serializable
Modifier | Constructor and Description |
---|---|
|
AbstractActiveDescriptor()
For serialization
|
protected |
AbstractActiveDescriptor(Descriptor baseDescriptor)
Creates a NON reified ActiveDescriptor based on a copy of the given
baseDescriptor.
|
protected |
AbstractActiveDescriptor(Set<Type> advertisedContracts,
Class<? extends Annotation> scope,
String name,
Set<Annotation> qualifiers,
DescriptorType descriptorType,
DescriptorVisibility descriptorVisibility,
int ranking,
Boolean proxy,
String analyzerName,
Map<String,List<String>> metadata)
This constructor must be called with the information about
this descriptor
|
Modifier and Type | Method and Description |
---|---|
void |
addContractType(Type addMe)
Adds an advertised contract to the set of contracts advertised by this descriptor
|
void |
addQualifierAnnotation(Annotation addMe)
Adds the given string to the list of qualifiers
|
void |
dispose(T instance)
Disposes this instance.
|
T |
getCache()
This can be used for scopes that will only every be created once.
|
Set<Type> |
getContractTypes()
The set of types that this ActiveDescriptor must produce.
|
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.
|
List<Injectee> |
getInjectees()
Returns the full list of Injectees this class has.
|
Set<Annotation> |
getQualifierAnnotations()
The full set of qualifiers that this ActiveDescriptor
provides
|
Class<? extends Annotation> |
getScopeAnnotation()
Returns the scope that this ActiveDescriptor belongs to
|
boolean |
isCacheSet()
Returns true if this cache has been set
|
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
|
boolean |
removeContractType(Type removeMe)
Removes an advertised contract from the set of contracts advertised by this descriptor
|
boolean |
removeQualifierAnnotation(Annotation removeMe)
Removes the given qualifier from the list of qualifiers
|
void |
setCache(T cacheMe)
Sets the value into the cache
|
void |
setFactoryId(Long locatorId,
Long serviceId) |
void |
setName(String name)
Sets the name this descriptor should have
|
void |
setReified(boolean reified)
This method is called to change the state of the
reification of this descriptor
|
addAdvertisedContract, addMetadata, addMetadata, addQualifier, clearMetadata, equals, getAdvertisedContracts, getClassAnalysisName, getDescriptorType, getDescriptorVisibility, getImplementation, getLoader, getLocatorId, getMetadata, getName, getQualifiers, getRanking, getScope, getServiceId, hashCode, isProxiable, pretty, readExternal, readObject, removeAdvertisedContract, removeAllMetadata, removeMetadata, removeQualifier, setClassAnalysisName, setDescriptorType, setDescriptorVisibility, setImplementation, setLoader, setLocatorId, setMetadata, setProxiable, setRanking, setScope, setServiceId, toString, writeExternal, writeObject
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
create, getImplementationClass
getAdvertisedContracts, getClassAnalysisName, getDescriptorType, getDescriptorVisibility, getImplementation, getLoader, getLocatorId, getMetadata, getName, getQualifiers, getRanking, getScope, getServiceId, isProxiable, setRanking
public AbstractActiveDescriptor()
protected AbstractActiveDescriptor(Descriptor baseDescriptor)
baseDescriptor
- The non-null base descriptor to copy values fromprotected AbstractActiveDescriptor(Set<Type> advertisedContracts, Class<? extends Annotation> scope, String name, Set<Annotation> qualifiers, DescriptorType descriptorType, DescriptorVisibility descriptorVisibility, int ranking, Boolean proxy, String analyzerName, Map<String,List<String>> metadata)
advertisedContracts
- The contracts that should be
advertised by this descriptor (may not be null, but may be
empty)scope
- The scope of this descriptor (may not be null)name
- The name of this descriptor (may be null)qualifiers
- The qualifiers of this descriptor (may not
be null, but may be empty)ranking
- The ranking for this descriptorlocatorId
- The id of the locator for this descriptormetadata
- Metadata to add to this descriptorpublic void setName(String name)
DescriptorImpl
setName
in class DescriptorImpl
name
- The name for this descriptorpublic 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 void setReified(boolean reified)
reified
- true if this descriptor should appear reified,
false otherwisepublic Set<Type> getContractTypes()
ActiveDescriptor
getContractTypes
in interface ActiveDescriptor<T>
public void addContractType(Type addMe)
addMe
- The contract to add. May not be nullpublic boolean removeContractType(Type removeMe)
removeMe
- The contract to remove. May not be nullpublic Class<? extends Annotation> getScopeAnnotation()
ActiveDescriptor
getScopeAnnotation
in interface ActiveDescriptor<T>
public Set<Annotation> getQualifierAnnotations()
ActiveDescriptor
getQualifierAnnotations
in interface ActiveDescriptor<T>
public void addQualifierAnnotation(Annotation addMe)
addMe
- The fully qualified class name of the qualifier to add. May not be nullpublic boolean removeQualifierAnnotation(Annotation removeMe)
removeMe
- The fully qualifier class name of the qualifier to remove. May not be nullpublic Long getFactoryServiceId()
ActiveDescriptor
getFactoryServiceId
in interface ActiveDescriptor<T>
public Long getFactoryLocatorId()
ActiveDescriptor
getFactoryLocatorId
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 void dispose(T instance)
ActiveDescriptor
dispose
in interface ActiveDescriptor<T>
instance
- The instance to destroyCopyright © 2014 Oracle Corporation. All rights reserved.