|
||||||||||
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.jvnet.hk2.internal.AutoActiveDescriptor<T>
T
- The type from the cachepublic class AutoActiveDescriptor<T>
Constructor Summary | |
---|---|
AutoActiveDescriptor(Class<?> clazz,
Creator<T> creator,
Set<Type> advertisedContracts,
Class<? extends Annotation> scope,
String name,
Set<Annotation> qualifiers,
int ranking,
Map<String,List<String>> metadata)
|
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. |
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. |
boolean |
isCacheSet()
Returns true if this cache has been set |
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, getContractTypes, getFactoryLocatorId, getFactoryServiceId, getQualifierAnnotations, getScopeAnnotation, isReified, 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 AutoActiveDescriptor(Class<?> clazz, Creator<T> creator, Set<Type> advertisedContracts, Class<? extends Annotation> scope, String name, Set<Annotation> qualifiers, int ranking, Map<String,List<String>> metadata)
clazz
- creator
- advertisedContracts
- scope
- name
- qualifiers
- ranking
- Method 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 void dispose(T instance)
ActiveDescriptor
dispose
in interface ActiveDescriptor<T>
dispose
in class AbstractActiveDescriptor<T>
instance
- The instance to destroypublic String getImplementation()
Descriptor
getImplementation
in interface Descriptor
getImplementation
in class DescriptorImpl
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 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>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |