Class AutoActiveDescriptor<T>

    • Field Detail

      • serialVersionUID

        private static final long serialVersionUID
        For serialization
        See Also:
        Constant Field Values
      • implClass

        private java.lang.Class<?> implClass
      • implType

        private java.lang.reflect.Type implType
    • Constructor Detail

      • AutoActiveDescriptor

        public AutoActiveDescriptor()
        For serialization
      • AutoActiveDescriptor

        public AutoActiveDescriptor​(java.lang.Class<?> clazz,
                                    Creator<T> creator,
                                    java.util.Set<java.lang.reflect.Type> advertisedContracts,
                                    java.lang.Class<? extends java.lang.annotation.Annotation> scope,
                                    java.lang.String name,
                                    java.util.Set<java.lang.annotation.Annotation> qualifiers,
                                    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,
                                    DescriptorType descriptorType,
                                    java.lang.reflect.Type clazzType)
        Constructor with all relevant fields
        Parameters:
        clazz - The class of the implementation
        creator - The creator to use (factory or clazz)
        advertisedContracts - The set of advertised contracts
        scope - The scope of the service
        name - The name of the service (may be null)
        qualifiers - The set of qualifier annotations
        descriptorVisibility - The visibility of this descriptor
        ranking - The initial rank
        proxy - 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 descriptor
        descriptorType - The type of the descriptor
    • Method Detail

      • getImplementationClass

        public java.lang.Class<?> 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

        public java.lang.reflect.Type getImplementationType()
        Description copied from interface: ActiveDescriptor
        If known the Type of the implementation. If unknown will return the same as ActiveDescriptor.getImplementationClass()
        Returns:
        The type of the implementation or the implementation class
      • create

        public T create​(ServiceHandle<?> root)
        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

        public void dispose​(T instance)
        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 interface ActiveDescriptor<T>
        Overrides:
        dispose in class AbstractActiveDescriptor<T>
        Parameters:
        instance - The instance to destroy
      • getInjectees

        public java.util.List<Injectee> 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 interface ActiveDescriptor<T>
        Overrides:
        getInjectees in class AbstractActiveDescriptor<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