|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.glassfish.hk2.utilities.DescriptorImpl
org.glassfish.hk2.utilities.AbstractActiveDescriptor<T>
org.glassfish.hk2.utilities.AliasDescriptor<T>
public class AliasDescriptor<T>
A descriptor class that serves as an alias for another descriptor.
Constructor Summary | |
---|---|
AliasDescriptor(ServiceLocator locator,
ActiveDescriptor<T> descriptor,
String contract,
String name)
Construct an AliasDescriptor. |
Method Summary | |
---|---|
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. |
Set<Type> |
getContractTypes()
The set of types that this ActiveDescriptor must produce. |
ActiveDescriptor<T> |
getDescriptor()
Get the descriptor being aliased. |
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. |
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 |
void |
setCache(T cacheMe)
Sets the value into the cache |
Methods inherited from class org.glassfish.hk2.utilities.AbstractActiveDescriptor |
---|
addContractType, addQualifierAnnotation, getFactoryLocatorId, getFactoryServiceId, removeContractType, removeQualifierAnnotation, setFactoryId, setReified |
Methods inherited from class org.glassfish.hk2.utilities.DescriptorImpl |
---|
addAdvertisedContract, addMetadata, addQualifier, equals, getAdvertisedContracts, getBaseDescriptor, getDescriptorType, getLoader, getLocatorId, getMetadata, getName, getQualifiers, getRanking, getScope, getServiceId, hashCode, pretty, readObject, removeAdvertisedContract, removeAllMetadata, removeMetadata, removeQualifier, setBaseDescriptor, setDescriptorType, setImplementation, setLoader, setLocatorId, setName, setRanking, setScope, setServiceId, toString, writeObject |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.glassfish.hk2.api.Descriptor |
---|
getAdvertisedContracts, getBaseDescriptor, getDescriptorType, getLoader, getLocatorId, getMetadata, getName, getQualifiers, getRanking, getScope, getServiceId, setRanking |
Constructor Detail |
---|
public AliasDescriptor(ServiceLocator locator, ActiveDescriptor<T> descriptor, String contract, String name)
locator
- the service locatordescriptor
- the descriptor to be aliasedcontract
- the contactname
- the nameMethod Detail |
---|
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 creation
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 void setCache(T cacheMe)
SingleCache
setCache
in interface SingleCache<T>
setCache
in class AbstractActiveDescriptor<T>
cacheMe
- A single value that can be cached in this
active descriptorpublic void releaseCache()
SingleCache
releaseCache
in interface SingleCache<T>
releaseCache
in class AbstractActiveDescriptor<T>
public boolean isReified()
ActiveDescriptor
isReified
in interface ActiveDescriptor<T>
isReified
in class AbstractActiveDescriptor<T>
public String getImplementation()
Descriptor
getImplementation
in interface Descriptor
getImplementation
in class DescriptorImpl
public Set<Type> getContractTypes()
ActiveDescriptor
getContractTypes
in interface ActiveDescriptor<T>
getContractTypes
in class AbstractActiveDescriptor<T>
public Class<? extends Annotation> getScopeAnnotation()
ActiveDescriptor
getScopeAnnotation
in interface ActiveDescriptor<T>
getScopeAnnotation
in class AbstractActiveDescriptor<T>
public Set<Annotation> getQualifierAnnotations()
ActiveDescriptor
getQualifierAnnotations
in interface ActiveDescriptor<T>
getQualifierAnnotations
in class AbstractActiveDescriptor<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>
getInjectees
in class AbstractActiveDescriptor<T>
public void dispose(T instance)
ActiveDescriptor
dispose
in interface ActiveDescriptor<T>
dispose
in class AbstractActiveDescriptor<T>
instance
- The instance to destroypublic ActiveDescriptor<T> getDescriptor()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |