Interface InjectableInstance<T>

  • Type Parameters:
    T -
    All Superinterfaces:
    jakarta.enterprise.inject.Instance<T>, Iterable<T>, jakarta.inject.Provider<T>
    All Known Implementing Classes:
    InstanceImpl

    public interface InjectableInstance<T>
    extends jakarta.enterprise.inject.Instance<T>
    Enhanced version of Instance.
    • Method Detail

      • getHandle

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

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

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

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

        void clearCache()
        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.
        See Also:
        WithCaching
      • iterator

        Iterator<T> iterator()
        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 Iterable<T>
        Returns:
        an iterator over the contextual references of the disambiguated beans
        See Also:
        DefaultBean