Package org.glassfish.hk2.internal
Class ActiveDescriptorBuilderImpl.BuiltActiveDescriptor<T>
- java.lang.Object
-
- org.glassfish.hk2.utilities.DescriptorImpl
-
- org.glassfish.hk2.utilities.AbstractActiveDescriptor<T>
-
- org.glassfish.hk2.internal.ActiveDescriptorBuilderImpl.BuiltActiveDescriptor<T>
-
- All Implemented Interfaces:
java.io.Externalizable,java.io.Serializable,ActiveDescriptor<T>,Descriptor,SingleCache<T>
- Enclosing class:
- ActiveDescriptorBuilderImpl
private static class ActiveDescriptorBuilderImpl.BuiltActiveDescriptor<T> extends AbstractActiveDescriptor<T>
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.Class<?>implementationClassprivate java.lang.reflect.TypeimplementationTypeprivate static longserialVersionUIDFor serialization
-
Constructor Summary
Constructors Modifier Constructor Description BuiltActiveDescriptor()For serializationprivateBuiltActiveDescriptor(java.lang.Class<?> implementationClass, java.util.Set<java.lang.reflect.Type> advertisedContracts, java.lang.annotation.Annotation scopeAnnotation, java.lang.Class<? extends java.lang.annotation.Annotation> scope, java.lang.String name, java.util.Set<java.lang.annotation.Annotation> qualifiers, DescriptorType descriptorType, DescriptorVisibility descriptorVisibility, int ranking, java.lang.Boolean proxy, java.lang.Boolean proxyForSameScope, java.lang.String classAnalysisName, java.util.Map<java.lang.String,java.util.List<java.lang.String>> metadata, HK2Loader loader, java.lang.reflect.Type implementationType)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Tcreate(ServiceHandle<?> root)Creates an instance of the ActiveDescriptor.java.lang.Class<?>getImplementationClass()The implementation class that should be used to generate new instances of this descriptor.java.lang.reflect.TypegetImplementationType()If known the Type of the implementation.voidsetImplementationType(java.lang.reflect.Type t)-
Methods inherited from class org.glassfish.hk2.utilities.AbstractActiveDescriptor
addContractType, addQualifierAnnotation, dispose, equals, getCache, getContractTypes, getFactoryLocatorId, getFactoryServiceId, getInjectees, 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 Detail
-
serialVersionUID
private static final long serialVersionUID
For serialization- See Also:
- Constant Field Values
-
implementationClass
private java.lang.Class<?> implementationClass
-
implementationType
private java.lang.reflect.Type implementationType
-
-
Constructor Detail
-
BuiltActiveDescriptor
public BuiltActiveDescriptor()
For serialization
-
BuiltActiveDescriptor
private BuiltActiveDescriptor(java.lang.Class<?> implementationClass, java.util.Set<java.lang.reflect.Type> advertisedContracts, java.lang.annotation.Annotation scopeAnnotation, java.lang.Class<? extends java.lang.annotation.Annotation> scope, java.lang.String name, java.util.Set<java.lang.annotation.Annotation> qualifiers, DescriptorType descriptorType, DescriptorVisibility descriptorVisibility, int ranking, java.lang.Boolean proxy, java.lang.Boolean proxyForSameScope, java.lang.String classAnalysisName, java.util.Map<java.lang.String,java.util.List<java.lang.String>> metadata, HK2Loader loader, java.lang.reflect.Type implementationType)
-
-
Method Detail
-
getImplementationClass
public java.lang.Class<?> getImplementationClass()
Description copied from interface:ActiveDescriptorThe 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
public java.lang.reflect.Type getImplementationType()
Description copied from interface:ActiveDescriptorIf known the Type of the implementation. If unknown will return the same asActiveDescriptor.getImplementationClass()- Returns:
- The type of the implementation or the implementation class
-
create
public T create(ServiceHandle<?> root)
Description copied from interface:ActiveDescriptorCreates 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
-
setImplementationType
public void setImplementationType(java.lang.reflect.Type t)
- Overrides:
setImplementationTypein classAbstractActiveDescriptor<T>
-
-