T - The type of the constantpublic class ConstantActiveDescriptor<T> extends AbstractActiveDescriptor<T>
| Modifier and Type | Field and Description |
|---|---|
private java.lang.Long |
locatorId |
private static long |
serialVersionUID
For serialization
|
private T |
theOne |
| Constructor and Description |
|---|
ConstantActiveDescriptor()
For serialization
|
ConstantActiveDescriptor(T theOne,
ServiceLocatorImpl locator)
Creates a constant active descriptor with the given locator ID
|
ConstantActiveDescriptor(T theOne,
java.util.Set<java.lang.reflect.Type> advertisedContracts,
java.lang.Class<? extends java.lang.annotation.Annotation> scope,
java.lang.String name,
java.util.Set<java.lang.annotation.Annotation> qualifiers,
DescriptorVisibility visibility,
int ranking,
java.lang.Boolean proxy,
java.lang.Boolean proxyForSameScope,
java.lang.String analyzerName,
long locatorId,
java.util.Map<java.lang.String,java.util.List<java.lang.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.
|
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.lang.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, equals, getContractTypes, getFactoryLocatorId, getFactoryServiceId, getInjectees, getQualifierAnnotations, getScopeAnnotation, getScopeAsAnnotation, hashCode, isReified, releaseCache, removeContractType, removeQualifierAnnotation, setCache, setFactoryId, setName, setReified, setScopeAnnotation, setScopeAsAnnotationaddAdvertisedContract, addMetadata, addMetadata, addQualifier, clearMetadata, descriptorEquals, getAdvertisedContracts, getClassAnalysisName, getDescriptorType, getDescriptorVisibility, getLoader, getMetadata, getName, getQualifiers, getRanking, getScope, getServiceId, isProxiable, isProxyForSameScope, pretty, readExternal, readObject, removeAdvertisedContract, removeAllMetadata, removeMetadata, removeQualifier, setClassAnalysisName, setDescriptorType, setDescriptorVisibility, setImplementation, setLoader, setLocatorId, setMetadata, setProxiable, setProxyForSameScope, setRanking, setScope, setServiceId, toString, writeExternal, writeObjectclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetAdvertisedContracts, getClassAnalysisName, getDescriptorType, getDescriptorVisibility, getLoader, getMetadata, getName, getQualifiers, getRanking, getScope, getServiceId, isProxiable, isProxyForSameScope, setRankingprivate static final long serialVersionUID
private T theOne
private java.lang.Long locatorId
public ConstantActiveDescriptor()
public ConstantActiveDescriptor(T theOne, ServiceLocatorImpl locator)
theOne - the object to create it fromlocatorId - The id of the locator this is being created forpublic ConstantActiveDescriptor(T theOne, java.util.Set<java.lang.reflect.Type> advertisedContracts, java.lang.Class<? extends java.lang.annotation.Annotation> scope, java.lang.String name, java.util.Set<java.lang.annotation.Annotation> qualifiers, DescriptorVisibility visibility, int ranking, java.lang.Boolean proxy, java.lang.Boolean proxyForSameScope, java.lang.String analyzerName, long locatorId, java.util.Map<java.lang.String,java.util.List<java.lang.String>> metadata)
theOne - The non-null constantadvertisedContracts - its advertised contractsscope - its scopename - its possibly null namequalifiers - its set of qualifiersvisibility - its visibilityranking - its starting rankproxy - can it be proxied (null for default)proxyForSameScope - will it be proxied for the same scope (null for default)analyzerName - The name of the analyzer (null for default)locatorId - its locator parentmetadata - The metadata associated with itpublic java.lang.String getImplementation()
DescriptorgetImplementation in interface DescriptorgetImplementation in class DescriptorImplpublic java.lang.Long getLocatorId()
DescriptorgetLocatorId in interface DescriptorgetLocatorId in class DescriptorImplpublic T getCache()
SingleCachegetCache in interface SingleCache<T>getCache in class AbstractActiveDescriptor<T>public boolean isCacheSet()
SingleCacheisCacheSet in interface SingleCache<T>isCacheSet in class AbstractActiveDescriptor<T>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
public T create(ServiceHandle<?> root)
ActiveDescriptorroot - 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>dispose in class AbstractActiveDescriptor<T>instance - The instance to destroy