Class InstanceImpl<T>

java.lang.Object
io.quarkus.arc.impl.InstanceImpl<T>
All Implemented Interfaces:
InjectableInstance<T>, jakarta.enterprise.inject.Instance<T>, jakarta.inject.Provider<T>, Iterable<T>

public class InstanceImpl<T> extends Object implements InjectableInstance<T>
Author:
Martin Kouba
  • Method Details

    • forSynthesis

      public static jakarta.enterprise.inject.Instance<Object> forSynthesis(CreationalContextImpl<?> creationalContext, boolean allowInjectionPointLookup)
    • iterator

      public Iterator<T> iterator()
      Description copied from interface: InjectableInstance
      This method attempts to resolve ambiguities.

      In general, if multiple beans are eligible then the container eliminates all beans that are:

      • not alternatives, except for producer methods and fields of beans that are alternatives,
      • default beans.
      Specified by:
      iterator in interface InjectableInstance<T>
      Specified by:
      iterator in interface Iterable<T>
      Returns:
      an iterator over the contextual references of the disambiguated beans
      See Also:
    • get

      public T get()
      Specified by:
      get in interface jakarta.inject.Provider<T>
    • select

      public InjectableInstance<T> select(Annotation... qualifiers)
      Specified by:
      select in interface InjectableInstance<T>
      Specified by:
      select in interface jakarta.enterprise.inject.Instance<T>
    • select

      public <U extends T> InjectableInstance<U> select(Class<U> subtype, Annotation... qualifiers)
      Specified by:
      select in interface InjectableInstance<T>
      Specified by:
      select in interface jakarta.enterprise.inject.Instance<T>
    • select

      public <U extends T> InjectableInstance<U> select(jakarta.enterprise.util.TypeLiteral<U> subtype, Annotation... qualifiers)
      Specified by:
      select in interface InjectableInstance<T>
      Specified by:
      select in interface jakarta.enterprise.inject.Instance<T>
    • isUnsatisfied

      public boolean isUnsatisfied()
      Specified by:
      isUnsatisfied in interface jakarta.enterprise.inject.Instance<T>
    • isAmbiguous

      public boolean isAmbiguous()
      Specified by:
      isAmbiguous in interface jakarta.enterprise.inject.Instance<T>
    • destroy

      public void destroy(Object instance)
      Specified by:
      destroy in interface jakarta.enterprise.inject.Instance<T>
    • getHandle

      public InstanceHandle<T> getHandle()
      Specified by:
      getHandle in interface InjectableInstance<T>
      Specified by:
      getHandle in interface jakarta.enterprise.inject.Instance<T>
    • handles

      public Iterable<InstanceHandle<T>> handles()
      Specified by:
      handles in interface InjectableInstance<T>
      Specified by:
      handles in interface jakarta.enterprise.inject.Instance<T>
    • hasDependentInstances

      public boolean hasDependentInstances()
    • clearCache

      public void clearCache()
      Description copied from interface: InjectableInstance
      Removes the cached result of the Provider.get() operation. If the cached result was a contextual reference of a Dependent bean, destroy the reference as well.
      Specified by:
      clearCache in interface InjectableInstance<T>
      See Also: