Class CrossOverDescriptor<T>

All Implemented Interfaces:
Externalizable, Serializable, ActiveDescriptor<T>, Descriptor, SingleCache<T>

public class CrossOverDescriptor<T> extends AbstractActiveDescriptor<T>
See Also:
  • Field Details

    • remoteLocator

      private final ServiceLocator remoteLocator
    • remote

      private final ActiveDescriptor<T> remote
    • remoteReified

      private boolean remoteReified
  • Constructor Details

  • Method Details

    • isReified

      public boolean isReified()
      This method returns true if this descriptor has been reified (class loaded). If this method returns false then the other methods in this interface will throw an IllegalStateException. Once this method returns true it may be
      Specified by:
      isReified in interface ActiveDescriptor<T>
      Overrides:
      isReified in class AbstractActiveDescriptor<T>
      Returns:
      true if this descriptor has been reified, false otherwise
    • checkState

      private void checkState()
    • getImplementationClass

      public 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 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
    • setImplementationType

      public void setImplementationType(Type t)
      Overrides:
      setImplementationType in class AbstractActiveDescriptor<T>
    • getContractTypes

      public Set<Type> getContractTypes()
      Description copied from interface: ActiveDescriptor
      The set of types that this ActiveDescriptor must produce. These types may be Classes or ParameterizedTypes, and may be no other subclass of Type
      Specified by:
      getContractTypes in interface ActiveDescriptor<T>
      Overrides:
      getContractTypes in class AbstractActiveDescriptor<T>
      Returns:
      the set of types this ActiveDescriptor must implement or extend
    • getScopeAsAnnotation

      public Annotation getScopeAsAnnotation()
      Description copied from interface: ActiveDescriptor
      Returns the scope as an Annotation implementation that this ActiveDescriptor belongs to
      Specified by:
      getScopeAsAnnotation in interface ActiveDescriptor<T>
      Overrides:
      getScopeAsAnnotation in class AbstractActiveDescriptor<T>
      Returns:
      The scope of this ActiveDescriptor as an Annotation
    • getScopeAnnotation

      public Class<? extends Annotation> getScopeAnnotation()
      Description copied from interface: ActiveDescriptor
      Returns the scope that this ActiveDescriptor belongs to
      Specified by:
      getScopeAnnotation in interface ActiveDescriptor<T>
      Overrides:
      getScopeAnnotation in class AbstractActiveDescriptor<T>
      Returns:
      The scope of this ActiveDescriptor
    • getQualifierAnnotations

      public Set<Annotation> getQualifierAnnotations()
      Description copied from interface: ActiveDescriptor
      The full set of qualifiers that this ActiveDescriptor provides
      Specified by:
      getQualifierAnnotations in interface ActiveDescriptor<T>
      Overrides:
      getQualifierAnnotations in class AbstractActiveDescriptor<T>
      Returns:
      The set of annotations that this ActiveDescriptor provides
    • getInjectees

      public 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
    • getFactoryServiceId

      public Long getFactoryServiceId()
      Description copied from interface: ActiveDescriptor
      If this ActiveDescriptor has DescriptorType of PROVIDE_METHOD then this field will return the ServiceId of its associated Factory service. Otherwise this method should return null
      Specified by:
      getFactoryServiceId in interface ActiveDescriptor<T>
      Overrides:
      getFactoryServiceId in class AbstractActiveDescriptor<T>
      Returns:
      The service ID of the associated factory service
    • getFactoryLocatorId

      public Long getFactoryLocatorId()
      Description copied from interface: ActiveDescriptor
      If this ActiveDescriptor has DescriptorType of PROVIDE_METHOD then this field will return the ServiceId of its associated Factory service. Otherwise this method should return null
      Specified by:
      getFactoryLocatorId in interface ActiveDescriptor<T>
      Overrides:
      getFactoryLocatorId in class AbstractActiveDescriptor<T>
      Returns:
      The locator ID of the associated factory service
    • 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