Class ConstantActiveDescriptor<T>

java.lang.Object
org.glassfish.hk2.utilities.DescriptorImpl
org.glassfish.hk2.utilities.AbstractActiveDescriptor<T>
org.jvnet.hk2.internal.ConstantActiveDescriptor<T>
Type Parameters:
T - The type of the constant
All Implemented Interfaces:
Externalizable, Serializable, org.glassfish.hk2.api.ActiveDescriptor<T>, org.glassfish.hk2.api.Descriptor, org.glassfish.hk2.api.SingleCache<T>

public class ConstantActiveDescriptor<T> extends org.glassfish.hk2.utilities.AbstractActiveDescriptor<T>
Author:
jwells
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    For serialization
    ConstantActiveDescriptor(T theOne, Set<Type> advertisedContracts, Class<? extends Annotation> scope, String name, Set<Annotation> qualifiers, org.glassfish.hk2.api.DescriptorVisibility visibility, int ranking, Boolean proxy, Boolean proxyForSameScope, String analyzerName, long locatorId, Map<String,List<String>> metadata)
    Constructor with more control over the fields of the descriptor
    Creates a constant active descriptor with the given locator
  • Method Summary

    Modifier and Type
    Method
    Description
    create(org.glassfish.hk2.api.ServiceHandle<?> root)
     
    void
    dispose(T instance)
     
     
     
     
     
     
    boolean
     
    void
     

    Methods inherited from class org.glassfish.hk2.utilities.AbstractActiveDescriptor

    addContractType, addQualifierAnnotation, equals, getContractTypes, getFactoryLocatorId, getFactoryServiceId, getInjectees, getQualifierAnnotations, getScopeAnnotation, getScopeAsAnnotation, hashCode, 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, getLoader, 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, getLoader, getMetadata, getName, getQualifiers, getRanking, getScope, getServiceId, isProxiable, isProxyForSameScope, setRanking
  • Constructor Details

    • ConstantActiveDescriptor

      public ConstantActiveDescriptor()
      For serialization
    • ConstantActiveDescriptor

      public ConstantActiveDescriptor(T theOne, ServiceLocatorImpl locator)
      Creates a constant active descriptor with the given locator
      Parameters:
      theOne - the object to create it from
      locator - the locator this is being created for
    • ConstantActiveDescriptor

      public ConstantActiveDescriptor(T theOne, Set<Type> advertisedContracts, Class<? extends Annotation> scope, String name, Set<Annotation> qualifiers, org.glassfish.hk2.api.DescriptorVisibility visibility, int ranking, Boolean proxy, Boolean proxyForSameScope, String analyzerName, long locatorId, Map<String,List<String>> metadata)
      Constructor with more control over the fields of the descriptor
      Parameters:
      theOne - The non-null constant
      advertisedContracts - its advertised contracts
      scope - its scope
      name - its possibly null name
      qualifiers - its set of qualifiers
      visibility - its visibility
      ranking - its starting rank
      proxy - can it be proxied (null for default)
      proxyForSameScope - will it be proxied for the same scope (null for default)
      analyzerName - The name of the analyzer (null for default)
      locatorId - its locator parent
      metadata - The metadata associated with it
  • Method Details

    • getImplementation

      public String getImplementation()
      Specified by:
      getImplementation in interface org.glassfish.hk2.api.Descriptor
      Overrides:
      getImplementation in class org.glassfish.hk2.utilities.DescriptorImpl
    • getLocatorId

      public Long getLocatorId()
      Specified by:
      getLocatorId in interface org.glassfish.hk2.api.Descriptor
      Overrides:
      getLocatorId in class org.glassfish.hk2.utilities.DescriptorImpl
    • getCache

      public T getCache()
      Specified by:
      getCache in interface org.glassfish.hk2.api.SingleCache<T>
      Overrides:
      getCache in class org.glassfish.hk2.utilities.AbstractActiveDescriptor<T>
    • isCacheSet

      public boolean isCacheSet()
      Specified by:
      isCacheSet in interface org.glassfish.hk2.api.SingleCache<T>
      Overrides:
      isCacheSet in class org.glassfish.hk2.utilities.AbstractActiveDescriptor<T>
    • getImplementationClass

      public Class<?> getImplementationClass()
    • getImplementationType

      public Type getImplementationType()
    • setImplementationType

      public void setImplementationType(Type t)
      Overrides:
      setImplementationType in class org.glassfish.hk2.utilities.AbstractActiveDescriptor<T>
    • create

      public T create(org.glassfish.hk2.api.ServiceHandle<?> root)
    • dispose

      public void dispose(T instance)
      Specified by:
      dispose in interface org.glassfish.hk2.api.ActiveDescriptor<T>
      Overrides:
      dispose in class org.glassfish.hk2.utilities.AbstractActiveDescriptor<T>