Package org.jvnet.hk2.internal
Class AutoActiveDescriptor<T>
java.lang.Object
org.glassfish.hk2.utilities.DescriptorImpl
org.glassfish.hk2.utilities.AbstractActiveDescriptor<T>
org.jvnet.hk2.internal.AutoActiveDescriptor<T>
- Type Parameters:
T
- The type from the cache
- All Implemented Interfaces:
Externalizable
,Serializable
,ActiveDescriptor<T>
,Descriptor
,SingleCache<T>
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate SystemDescriptor
<?> private Class
<?> private Type
private static final long
For serialization -
Constructor Summary
ConstructorsConstructorDescriptionFor serializationAutoActiveDescriptor
(Class<?> clazz, Creator<T> creator, Set<Type> advertisedContracts, Class<? extends Annotation> scope, String name, Set<Annotation> qualifiers, DescriptorVisibility descriptorVisibility, int ranking, Boolean proxy, Boolean proxyForSameScope, String classAnalysisName, Map<String, List<String>> metadata, DescriptorType descriptorType, Type clazzType) Constructor with all relevant fields -
Method Summary
Modifier and TypeMethodDescriptioncreate
(ServiceHandle<?> root) Creates an instance of the ActiveDescriptor.void
Disposes this instance.Class
<?> The implementation class that should be used to generate new instances of this descriptor.If known the Type of the implementation.Returns the full list of Injectees this class has.(package private) void
resetSelfDescriptor
(ActiveDescriptor<?> toMe) (package private) void
setHK2Parent
(SystemDescriptor<?> hk2Parent) void
Methods inherited from class org.glassfish.hk2.utilities.AbstractActiveDescriptor
addContractType, addQualifierAnnotation, equals, getCache, getContractTypes, getFactoryLocatorId, getFactoryServiceId, getQualifierAnnotations, getScopeAnnotation, getScopeAsAnnotation, hashCode, isCacheSet, isReified, releaseCache, removeContractType, removeQualifierAnnotation, setCache, setFactoryId, setName, setReified, setScopeAnnotation, setScopeAsAnnotation
Methods inherited from class org.glassfish.hk2.utilities.DescriptorImpl
addAdvertisedContract, addMetadata, addMetadata, addQualifier, clearMetadata, descriptorEquals, getAdvertisedContracts, getClassAnalysisName, getDescriptorType, getDescriptorVisibility, getImplementation, getLoader, getLocatorId, 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, 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, getClassAnalysisName, getDescriptorType, getDescriptorVisibility, getImplementation, getLoader, getLocatorId, getMetadata, getName, getQualifiers, getRanking, getScope, getServiceId, isProxiable, isProxyForSameScope, setRanking
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDFor serialization- See Also:
-
implClass
-
creator
-
hk2Parent
-
implType
-
-
Constructor Details
-
AutoActiveDescriptor
public AutoActiveDescriptor()For serialization -
AutoActiveDescriptor
public AutoActiveDescriptor(Class<?> clazz, Creator<T> creator, Set<Type> advertisedContracts, Class<? extends Annotation> scope, String name, Set<Annotation> qualifiers, DescriptorVisibility descriptorVisibility, int ranking, Boolean proxy, Boolean proxyForSameScope, String classAnalysisName, Map<String, List<String>> metadata, DescriptorType descriptorType, Type clazzType) Constructor with all relevant fields- Parameters:
clazz
- The class of the implementationcreator
- The creator to use (factory or clazz)advertisedContracts
- The set of advertised contractsscope
- The scope of the servicename
- The name of the service (may be null)qualifiers
- The set of qualifier annotationsdescriptorVisibility
- The visibility of this descriptorranking
- The initial rankproxy
- Whether or not this can be proxied (null for default)proxyForSameScope
- Whether or not to proxy within the same scope (null for default)classAnalysisName
- The name of the class analyzer (null for default)metadata
- The set of metadata associated with this descriptordescriptorType
- The type of the descriptor
-
-
Method Details
-
resetSelfDescriptor
-
setHK2Parent
-
getImplementationClass
Description copied from interface:ActiveDescriptor
The implementation class that should be used to generate new instances of this descriptor.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
- Returns:
- The class that directly implements the contract types, or the class that is the factory for an object that implements the contract types
-
getImplementationType
Description copied from interface:ActiveDescriptor
If known the Type of the implementation. If unknown will return the same asActiveDescriptor.getImplementationClass()
- Returns:
- The type of the implementation or the implementation class
-
setImplementationType
- Overrides:
setImplementationType
in classAbstractActiveDescriptor<T>
-
create
Description copied from interface:ActiveDescriptor
Creates an instance of the ActiveDescriptor. All of the Injectee's must be created prior to instantiation, and associated with the ExtendedProvider so that they can be destroyed properly- Parameters:
root
- The root service handle, which can be used to associated all the PerLookup objects with this creation- Returns:
- An instance of this ActiveDescriptor
-
dispose
Description copied from interface:ActiveDescriptor
Disposes this instance. All the PerLookup objects that were created for this instance will be destroyed after this object has been destroyed- Specified by:
dispose
in interfaceActiveDescriptor<T>
- Overrides:
dispose
in classAbstractActiveDescriptor<T>
- Parameters:
instance
- The instance to destroy
-
getInjectees
Description copied from interface:ActiveDescriptor
Returns the full list of Injectees this class has. These references will be resolved prior to the class being constructed, even if these injectees are field or method injectees.If this descriptor is describing a factory created type then this list must have zero length
- Specified by:
getInjectees
in interfaceActiveDescriptor<T>
- Overrides:
getInjectees
in classAbstractActiveDescriptor<T>
- Returns:
- Will not return null, but may return an empty list. The set of Injectees that must be resolved before this ActiveDescriptor can be constructed
-