T
- The type of the constantpublic class ConstantActiveDescriptor<T> extends AbstractActiveDescriptor<T>
Constructor and Description |
---|
ConstantActiveDescriptor(T theOne,
long locatorId)
Creates a constant active descriptor with the given locator ID
|
ConstantActiveDescriptor(T theOne,
Set<Type> advertisedContracts,
Class<? extends Annotation> scope,
String name,
Set<Annotation> qualifiers,
DescriptorVisibility visibility,
int ranking,
Boolean proxy,
String analyzerName,
long locatorId,
Map<String,List<String>> metadata)
Constructor with more control over the fields of the descriptor
|
Modifier and Type | Method and Description |
---|---|
T |
create(ServiceHandle<?> root)
Creates an instance of the ActiveDescriptor.
|
void |
dispose(T instance)
Disposes this instance.
|
T |
getCache()
This can be used for scopes that will only every be created once.
|
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.
|
Long |
getLocatorId()
This returns the id of the ServiceLocator which this descriptor
is registered with.
|
boolean |
isCacheSet()
Returns true if this cache has been set
|
addContractType, addQualifierAnnotation, getContractTypes, getFactoryLocatorId, getFactoryServiceId, getInjectees, getQualifierAnnotations, getScopeAnnotation, isReified, releaseCache, removeContractType, removeQualifierAnnotation, setCache, setFactoryId, setName, setReified
addAdvertisedContract, addMetadata, addMetadata, addQualifier, clearMetadata, equals, getAdvertisedContracts, getClassAnalysisName, getDescriptorType, getDescriptorVisibility, getLoader, 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
getAdvertisedContracts, getClassAnalysisName, getDescriptorType, getDescriptorVisibility, getLoader, getMetadata, getName, getQualifiers, getRanking, getScope, getServiceId, isProxiable, setRanking
public ConstantActiveDescriptor(T theOne, long locatorId)
theOne
- the object to create it fromlocatorId
- The id of the locator this is being created forpublic ConstantActiveDescriptor(T theOne, Set<Type> advertisedContracts, Class<? extends Annotation> scope, String name, Set<Annotation> qualifiers, DescriptorVisibility visibility, int ranking, Boolean proxy, String analyzerName, long locatorId, Map<String,List<String>> metadata)
theOne
- advertisedContracts
- scope
- name
- qualifiers
- ranking
- locatorId
- public String getImplementation()
Descriptor
getImplementation
in interface Descriptor
getImplementation
in class DescriptorImpl
public Long getLocatorId()
Descriptor
getLocatorId
in interface Descriptor
getLocatorId
in class DescriptorImpl
public T getCache()
SingleCache
getCache
in interface SingleCache<T>
getCache
in class AbstractActiveDescriptor<T>
public boolean isCacheSet()
SingleCache
isCacheSet
in interface SingleCache<T>
isCacheSet
in class AbstractActiveDescriptor<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
public T create(ServiceHandle<?> root)
ActiveDescriptor
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>
dispose
in class AbstractActiveDescriptor<T>
instance
- The instance to destroyCopyright © 2014 Oracle Corporation. All rights reserved.