Top Fields Constructors Methods
org.glassfish.hk2.internal

public Class ConstantActiveDescriptor<T>

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

Author
jwells

Field Summary

Modifier and TypeField and Description
private static final long
private final T

Constructor Summary

AccessConstructor and Description
public
ConstantActiveDescriptor()

For serializable

public
ConstantActiveDescriptor(T
May not be null
theOne
,
Set<Type> advertisedContracts, Class<? extends Annotation> scope, String name, Set<Annotation> qualifiers, DescriptorVisibility descriptorVisibility, Boolean proxy, Boolean proxyForSameScope, String classAnalysisName, Map<String, List<String>> metadata, int rank)

Creates the constant descriptor

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 T
getCache()

Overrides org.glassfish.hk2.utilities.AbstractActiveDescriptor.getCache.

Implements org.glassfish.hk2.api.SingleCache.getCache.

This can be used for scopes that will only every be created once.

public String
getImplementation()

Overrides org.glassfish.hk2.utilities.DescriptorImpl.getImplementation.

Implements org.glassfish.hk2.api.Descriptor.getImplementation.

Returns the fully qualified class name of the implementation class.

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 boolean
Inherited from org.glassfish.hk2.utilities.AbstractActiveDescriptor:
addContractTypeaddQualifierAnnotationdisposeequalsgetContractTypesgetFactoryLocatorIdgetFactoryServiceIdgetInjecteesgetQualifierAnnotationsgetScopeAnnotationgetScopeAsAnnotationhashCodeisReifiedreleaseCacheremoveContractTyperemoveQualifierAnnotationsetCachesetFactoryIdsetImplementationTypesetNamesetReifiedsetScopeAnnotationsetScopeAsAnnotation

Field Detail

serialVersionUIDback to summary
private static final long serialVersionUID

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

For serialization

theOneback to summary
private final T theOne

Constructor Detail

ConstantActiveDescriptorback to summary
public ConstantActiveDescriptor()

For serializable

ConstantActiveDescriptorback to summary
public ConstantActiveDescriptor(T theOne, Set<Type> advertisedContracts, Class<? extends Annotation> scope, String name, Set<Annotation> qualifiers, DescriptorVisibility descriptorVisibility, Boolean proxy, Boolean proxyForSameScope, String classAnalysisName, Map<String, List<String>> metadata, int rank)

Creates the constant descriptor

Parameters
theOne:T

May not be null

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
getCacheback to summary
public T getCache()

Overrides org.glassfish.hk2.utilities.AbstractActiveDescriptor.getCache.

Implements org.glassfish.hk2.api.SingleCache.getCache.

Doc from org.glassfish.hk2.api.SingleCache.getCache.

This can be used for scopes that will only every be created once. The returned value must have been set previously with setCache. If this is called when isCacheSet is false will result in a RuntimeException

Annotations
@Override
getImplementationback to summary
public String getImplementation()

Overrides org.glassfish.hk2.utilities.DescriptorImpl.getImplementation.

Implements org.glassfish.hk2.api.Descriptor.getImplementation.

Doc from org.glassfish.hk2.api.Descriptor.getImplementation.

Returns the fully qualified class name of the implementation class. If this is a factory descriptor then this will return the fully qualified name of the class implementing the factory interface.

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
isCacheSetback to summary
public boolean isCacheSet()

Overrides org.glassfish.hk2.utilities.AbstractActiveDescriptor.isCacheSet.

Implements org.glassfish.hk2.api.SingleCache.isCacheSet.

Doc from org.glassfish.hk2.api.SingleCache.isCacheSet.

Returns true if this cache has been set

Annotations
@Override