Package io.quarkus.arc.impl
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
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface jakarta.enterprise.inject.Instance
jakarta.enterprise.inject.Instance.Handle<T extends Object>
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclearCache()Removes the cached result of theProvider.get()operation.voiddestroy(Object instance)static jakarta.enterprise.inject.Instance<Object>forSynthesis(CreationalContextImpl<?> creationalContext, boolean allowInjectionPointLookup)Tget()InstanceHandle<T>getHandle()Iterable<InstanceHandle<T>>handles()booleanhasDependentInstances()booleanisAmbiguous()booleanisUnsatisfied()Iterator<T>iterator()This method attempts to resolve ambiguities.<U extends T>
InjectableInstance<U>select(jakarta.enterprise.util.TypeLiteral<U> subtype, Annotation... qualifiers)InjectableInstance<T>select(Annotation... qualifiers)<U extends T>
InjectableInstance<U>select(Class<U> subtype, Annotation... qualifiers)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.quarkus.arc.InjectableInstance
orElse, orNull
-
Methods inherited from interface jakarta.enterprise.inject.Instance
handlesStream, isResolvable, stream
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Method Detail
-
forSynthesis
public static jakarta.enterprise.inject.Instance<Object> forSynthesis(CreationalContextImpl<?> creationalContext, boolean allowInjectionPointLookup)
-
iterator
public Iterator<T> iterator()
Description copied from interface:InjectableInstanceThis 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:
iteratorin interfaceInjectableInstance<T>- Specified by:
iteratorin interfaceIterable<T>- Returns:
- an iterator over the contextual references of the disambiguated beans
- See Also:
DefaultBean
-
select
public InjectableInstance<T> select(Annotation... qualifiers)
- Specified by:
selectin interfaceInjectableInstance<T>- Specified by:
selectin interfacejakarta.enterprise.inject.Instance<T>
-
select
public <U extends T> InjectableInstance<U> select(Class<U> subtype, Annotation... qualifiers)
- Specified by:
selectin interfaceInjectableInstance<T>- Specified by:
selectin interfacejakarta.enterprise.inject.Instance<T>
-
select
public <U extends T> InjectableInstance<U> select(jakarta.enterprise.util.TypeLiteral<U> subtype, Annotation... qualifiers)
- Specified by:
selectin interfaceInjectableInstance<T>- Specified by:
selectin interfacejakarta.enterprise.inject.Instance<T>
-
isUnsatisfied
public boolean isUnsatisfied()
- Specified by:
isUnsatisfiedin interfacejakarta.enterprise.inject.Instance<T>
-
isAmbiguous
public boolean isAmbiguous()
- Specified by:
isAmbiguousin interfacejakarta.enterprise.inject.Instance<T>
-
destroy
public void destroy(Object instance)
- Specified by:
destroyin interfacejakarta.enterprise.inject.Instance<T>
-
getHandle
public InstanceHandle<T> getHandle()
- Specified by:
getHandlein interfaceInjectableInstance<T>- Specified by:
getHandlein interfacejakarta.enterprise.inject.Instance<T>
-
handles
public Iterable<InstanceHandle<T>> handles()
- Specified by:
handlesin interfaceInjectableInstance<T>- Specified by:
handlesin interfacejakarta.enterprise.inject.Instance<T>
-
hasDependentInstances
public boolean hasDependentInstances()
-
clearCache
public void clearCache()
Description copied from interface:InjectableInstanceRemoves the cached result of theProvider.get()operation. If the cached result was a contextual reference of aDependentbean, destroy the reference as well.- Specified by:
clearCachein interfaceInjectableInstance<T>- See Also:
WithCaching
-
-