Top Fields Constructors Methods
org.jvnet.hk2.internal

public Class AutoActiveDescriptor<T>

extends AbstractActiveDescriptor<T>
Class Inheritance
Type Parameters
<T>
The type from the cache
Imports
java.lang.annotation.Annotation, java.lang.reflect.Type, java.util.List, .Map, .Set, org.glassfish.hk2.api.ActiveDescriptor, .DescriptorType, .DescriptorVisibility, .Injectee, .ServiceHandle, org.glassfish.hk2.utilities.AbstractActiveDescriptor

Author
jwells

Field Summary

Modifier and TypeField and Description
private Creator<T>
private SystemDescriptor<?>
private Class<?>
private Type
private static final long

Constructor Summary

AccessConstructor and Description
public
AutoActiveDescriptor()

For serialization

public
AutoActiveDescriptor(Class<?>
The class of the implementation
clazz
,
Creator<T>
The creator to use (factory or clazz)
creator
,
Set<Type>
The set of advertised contracts
advertisedContracts
,
Class<? extends Annotation>
The scope of the service
scope
,
String
The name of the service (may be null)
name
,
Set<Annotation>
The set of qualifier annotations
qualifiers
,
DescriptorVisibility
The visibility of this descriptor
descriptorVisibility
,
int
The initial rank
ranking
,
Boolean
Whether or not this can be proxied (null for default)
proxy
,
Boolean
Whether or not to proxy within the same scope (null for default)
proxyForSameScope
,
String
The name of the class analyzer (null for default)
classAnalysisName
,
Map<String, List<String>>
The set of metadata associated with this descriptor
metadata
,
DescriptorType
The type of the descriptor
descriptorType
,
Type clazzType)

Constructor with all relevant fields

Method Summary

Modifier and TypeMethod and Description
public T
create(ServiceHandle<?> root)

Implements org.glassfish.hk2.api.ActiveDescriptor.create.

Creates an instance of the ActiveDescriptor.

public void
public Class<?>
getImplementationClass()

Implements org.glassfish.hk2.api.ActiveDescriptor.getImplementationClass.

The implementation class that should be used to generate new instances of this descriptor.

public Type
getImplementationType()

Implements org.glassfish.hk2.api.ActiveDescriptor.getImplementationType.

If known the Type of the implementation.

public List<Injectee>
pack-priv void
pack-priv void
public void
Inherited from org.glassfish.hk2.utilities.AbstractActiveDescriptor:
addContractTypeaddQualifierAnnotationequalsgetCachegetContractTypesgetFactoryLocatorIdgetFactoryServiceIdgetQualifierAnnotationsgetScopeAnnotationgetScopeAsAnnotationhashCodeisCacheSetisReifiedreleaseCacheremoveContractTyperemoveQualifierAnnotationsetCachesetFactoryIdsetNamesetReifiedsetScopeAnnotationsetScopeAsAnnotation

Field Detail

creatorback to summary
private Creator<T> creator
hk2Parentback to summary
private SystemDescriptor<?> hk2Parent
implClassback to summary
private Class<?> implClass
implTypeback to summary
private Type implType
serialVersionUIDback to summary
private static final long serialVersionUID

Hides org.glassfish.hk2.utilities.AbstractActiveDescriptor.serialVersionUID.

For serialization

Constructor Detail

AutoActiveDescriptorback to summary
public AutoActiveDescriptor()

For serialization

AutoActiveDescriptorback to summary
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:Class<?>

The class of the implementation

creator:Creator<T>

The creator to use (factory or clazz)

advertisedContracts:Set<Type>

The set of advertised contracts

scope:Class<? extends Annotation>

The scope of the service

name:String

The name of the service (may be null)

qualifiers:Set<Annotation>

The set of qualifier annotations

descriptorVisibility:DescriptorVisibility

The visibility of this descriptor

ranking:int

The initial rank

proxy:Boolean

Whether or not this can be proxied (null for default)

proxyForSameScope:Boolean

Whether or not to proxy within the same scope (null for default)

classAnalysisName:String

The name of the class analyzer (null for default)

metadata:Map<String, List<String>>

The set of metadata associated with this descriptor

descriptorType:DescriptorType

The type of the descriptor

Method Detail

createback to summary
public T create(ServiceHandle<?> root)

Implements org.glassfish.hk2.api.ActiveDescriptor.create.

Doc from org.glassfish.hk2.api.ActiveDescriptor.create.

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

Annotations
@Override
disposeback to summary
public void dispose(T instance)

Overrides org.glassfish.hk2.utilities.AbstractActiveDescriptor.dispose.

Implements org.glassfish.hk2.api.ActiveDescriptor.dispose.

Doc from org.glassfish.hk2.api.ActiveDescriptor.dispose.

Disposes this instance. All the PerLookup objects that were created for this instance will be destroyed after this object has been destroyed

Annotations
@Override
getImplementationClassback to summary
public Class<?> getImplementationClass()

Implements org.glassfish.hk2.api.ActiveDescriptor.getImplementationClass.

Doc from org.glassfish.hk2.api.ActiveDescriptor.getImplementationClass.

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

Annotations
@Override
getImplementationTypeback to summary
public Type getImplementationType()

Implements org.glassfish.hk2.api.ActiveDescriptor.getImplementationType.

Doc from org.glassfish.hk2.api.ActiveDescriptor.getImplementationType.

If known the Type of the implementation. If unknown will return the same as getImplementationClass()

Annotations
@Override
getInjecteesback to summary
public List<Injectee> getInjectees()

Overrides org.glassfish.hk2.utilities.AbstractActiveDescriptor.getInjectees.

Implements org.glassfish.hk2.api.ActiveDescriptor.getInjectees.

Doc from org.glassfish.hk2.api.ActiveDescriptor.getInjectees.

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

Annotations
@Override
resetSelfDescriptorback to summary
pack-priv void resetSelfDescriptor(ActiveDescriptor<?> toMe)
setHK2Parentback to summary
pack-priv void setHK2Parent(SystemDescriptor<?> hk2Parent)
setImplementationTypeback to summary
public void setImplementationType(Type t)

Overrides org.glassfish.hk2.utilities.AbstractActiveDescriptor.setImplementationType.

Annotations
@Override