Class BeanContainerImpl

    • Constructor Detail

      • BeanContainerImpl

        BeanContainerImpl​(ArcContainer container)
    • Method Detail

      • beanInstanceFactory

        public <T> BeanContainer.Factory<T> beanInstanceFactory​(Class<T> type,
                                                                Annotation... qualifiers)
        Description copied from interface: BeanContainer
        Returns an instance factory for given bean type and qualifiers.

        This method follows standard CDI rules meaning that if there are two or more beans, an ambiguous dependency exception is thrown. Note that the factory itself is still allowed to return null if there is no matching bean which allows for fallback implementations.

        Specified by:
        beanInstanceFactory in interface BeanContainer
        Returns:
        a bean instance factory, never null
      • requestContext

        public ManagedContext requestContext()
        Description copied from interface: BeanContainer
         ManagedContext requestContext = beanContainer.requestContext();
         if (requestContext.isActive()) {
             // Perform action
         } else {
             try {
                 requestContext.activate();
                 // Perform action
             } finally {
                 requestContext.terminate();
             }
         }
         
        Specified by:
        requestContext in interface BeanContainer
        Returns:
        the context for RequestScoped