Class ArcContainerImpl

    • Constructor Detail

      • ArcContainerImpl

        public ArcContainerImpl()
    • Method Detail

      • init

        public void init()
      • getActiveContext

        public InjectableContext getActiveContext​(Class<? extends Annotation> scopeType)
        Description copied from interface: ArcContainer
        Unlike BeanManager.getContext(Class) this method does not throw ContextNotActiveException if there is no active context for the given scope.
        Specified by:
        getActiveContext in interface ArcContainer
        Returns:
        the active context or null
      • instance

        public <T> InstanceHandle<T> instance​(Class<T> type,
                                              Annotation... qualifiers)
        Description copied from interface: ArcContainer
        Never returns null. However, the handle is empty if no bean matches/multiple beans match the specified type and qualifiers.
        Specified by:
        instance in interface ArcContainer
        Returns:
        a new instance handle
      • instance

        public <T> InstanceHandle<T> instance​(javax.enterprise.util.TypeLiteral<T> type,
                                              Annotation... qualifiers)
        Description copied from interface: ArcContainer
        Never returns null. However, the handle is empty if no bean matches/multiple beans match the specified type and qualifiers.
        Specified by:
        instance in interface ArcContainer
        Returns:
        a new instance handle
      • instance

        public <X> InstanceHandle<X> instance​(Type type,
                                              Annotation... qualifiers)
        Description copied from interface: ArcContainer
        Never returns null. However, the handle is empty if no bean matches/multiple beans match the specified type and qualifiers.
        Specified by:
        instance in interface ArcContainer
        Returns:
        a new instance handle
      • instanceSupplier

        public <T> Supplier<InstanceHandle<T>> instanceSupplier​(Class<T> type,
                                                                Annotation... qualifiers)
        Description copied from interface: ArcContainer
        Returns a supplier that can be used to create new instances, or null if no matching bean can be found. Note that if there are multiple sub classes of the given type this will return the exact match. This means that this can be used to directly instantiate superclasses of other beans without causing problems. see https://github.com/quarkusio/quarkus/issues/3369
        Specified by:
        instanceSupplier in interface ArcContainer
        Returns:
      • select

        public <T> InjectableInstance<T> select​(Class<T> type,
                                                Annotation... qualifiers)
        Description copied from interface: ArcContainer
        Instances of dependent scoped beans obtained with the returned injectable instance must be explicitly destroyed, either via the Instance.destroy(Object) method invoked upon the same injectable instance or with InstanceHandle.destroy(). If no qualifier is passed, the @Default qualifier is assumed.
        Specified by:
        select in interface ArcContainer
        Returns:
        a new injectable instance that could be used for programmatic lookup
      • select

        public <T> InjectableInstance<T> select​(javax.enterprise.util.TypeLiteral<T> type,
                                                Annotation... qualifiers)
        Description copied from interface: ArcContainer
        Instances of dependent scoped beans obtained with the returned injectable instance must be explicitly destroyed, either via the Instance.destroy(Object) method invoked upon the same injectable instance or with InstanceHandle.destroy(). If no qualifier is passed, the @Default qualifier is assumed.
        Specified by:
        select in interface ArcContainer
        Returns:
        a new injectable instance that could be used for programmatic lookup
      • isRunning

        public boolean isRunning()
        Description copied from interface: ArcContainer
        Returns true if Arc container is running. This can be used as a quick check to determine CDI availability in Quarkus.
        Specified by:
        isRunning in interface ArcContainer
        Returns:
        true if ArcContainer is running, false otherwise
      • requestContext

        public ManagedContext requestContext()
        Description copied from interface: ArcContainer
        This method never throws ContextNotActiveException.
        Specified by:
        requestContext in interface ArcContainer
        Returns:
        the built-in context for RequestScoped
      • beanManager

        public javax.enterprise.inject.spi.BeanManager beanManager()
        Description copied from interface: ArcContainer
        NOTE: Not all methods are supported!
        Specified by:
        beanManager in interface ArcContainer
        Returns:
        the bean manager
      • shutdown

        public void shutdown()
      • mockObservers

        public static void mockObservers​(String beanIdentifier,
                                         boolean mock)
      • mockObserversFor

        public void mockObserversFor​(Class<?> beanClass,
                                     boolean mock)