Class ForwardingBeanManager

    • Constructor Detail

      • ForwardingBeanManager

        public ForwardingBeanManager()
    • Method Detail

      • getReference

        public Object getReference​(Bean<?> bean,
                                   Type beanType,
                                   CreationalContext<?> ctx)
        Description copied from interface: BeanContainer

        Obtains a contextual reference for a certain bean and a certain bean type of the bean.

        Specified by:
        getReference in interface BeanContainer
        Parameters:
        bean - the Bean object representing the bean
        beanType - a bean type that must be implemented by any client proxy that is returned
        ctx - a CreationalContext that may be used to destroy any object with scope Dependent that is created
        Returns:
        a contextual reference representing the bean
      • getBeans

        public Set<Bean<?>> getBeans​(Type beanType,
                                     Annotation... qualifiers)
        Description copied from interface: BeanContainer
        Return the set of beans which have the given required type and qualifiers and are available for injection in the module or library containing the class into which the BeanManager/BeanContainer was injected or, in the Jakarta EE environment, the Jakarta EE component from whose JNDI environment namespace the BeanManager/BeanContainer was obtained, according to the rules of typesafe resolution. If no qualifiers are given, the default qualifier is assumed.

        Note that when called during invocation of an AfterBeanDiscovery event observer, this method will only return beans discovered by the container before the AfterBeanDiscovery event is fired.

        Specified by:
        getBeans in interface BeanContainer
        Parameters:
        beanType - the required bean type
        qualifiers - the required qualifiers
        Returns:
        the resulting set of beans
      • getBeans

        public Set<Bean<?>> getBeans​(String name)
        Description copied from interface: BeanContainer
        Return the set of beans which have the given EL name and are available for injection in the module or library containing the class into which the BeanManager/BeanContainer was injected or, in the Jakarta EE environment, the Jakarta EE component from whose JNDI environment namespace the BeanManager/BeanContainer was obtained, according to the rules of EL name resolution.

        Note that when called during invocation of an AfterBeanDiscovery event observer, this method will only return beans discovered by the container before the AfterBeanDiscovery event is fired.

        Specified by:
        getBeans in interface BeanContainer
        Parameters:
        name - the EL name
        Returns:
        the resulting set of beans
      • resolve

        public <X> Bean<? extends X> resolve​(Set<Bean<? extends X>> beans)
        Description copied from interface: BeanContainer
        Apply the ambiguous dependency resolution rules to a set of beans.

        Note that when called during invocation of an AfterBeanDiscovery event observer, this method will only return beans discovered by the container before the AfterBeanDiscovery event is fired.

        Specified by:
        resolve in interface BeanContainer
        Type Parameters:
        X - a common type of the beans
        Parameters:
        beans - a set of beans of the given type
        Returns:
        the resolved bean, or null if null or an empty set is passed
      • resolveDecorators

        public List<Decorator<?>> resolveDecorators​(Set<Type> types,
                                                    Annotation... qualifiers)
        Description copied from interface: BeanManager
        Return an ordered list of decorators for a set of bean types and a set of qualifiers and which are enabled in the module or library containing the class into which the BeanManager was injected or the Java EE component from whose JNDI environment namespace the BeanManager was obtained. Note that when called during invocation of an AfterBeanDiscovery event observer, this method will only return decorators discovered by the container before the AfterBeanDiscovery event is fired.
        Specified by:
        resolveDecorators in interface BeanManager
        Parameters:
        types - the set of bean types of the decorated bean
        qualifiers - the qualifiers declared by the decorated bean
        Returns:
        the resulting set of decorators
      • resolveInterceptors

        public List<Interceptor<?>> resolveInterceptors​(InterceptionType type,
                                                        Annotation... interceptorBindings)
        Description copied from interface: BeanContainer
        Return an ordered list of enabled interceptors for a set of interceptor bindings and a type of interception and which are enabled in the module or library containing the class into which the BeanManager/BeanContainer was injected or, in the Jakarta EE environment, the Jakarta EE component from whose JNDI environment namespace the BeanManager/BeanContainer was obtained.

        Note that when called during invocation of an AfterBeanDiscovery event observer, this method will only return interceptors discovered by the container before the AfterBeanDiscovery event is fired.

        Specified by:
        resolveInterceptors in interface BeanContainer
        Parameters:
        type - the type of the interception
        interceptorBindings - the interceptor bindings
        Returns:
        the resulting set of interceptors
      • isScope

        public boolean isScope​(Class<? extends Annotation> annotationType)
        Description copied from interface: BeanContainer
        Test the given annotation type to determine if it is a scope type.
        Specified by:
        isScope in interface BeanContainer
        Parameters:
        annotationType - the annotation type
        Returns:
        true if the annotation type is a scope type
      • isPassivatingScope

        public boolean isPassivatingScope​(Class<? extends Annotation> annotationType)
        Description copied from interface: BeanManager
        Test the given annotation type to determine if it is a passivating scope type.
        Specified by:
        isPassivatingScope in interface BeanManager
        Parameters:
        annotationType - the annotation type
        Returns:
        true if the annotation type is a passivating scope type
      • isInterceptorBinding

        public boolean isInterceptorBinding​(Class<? extends Annotation> annotationType)
        Description copied from interface: BeanContainer
        Test the given annotation type to determine if it is an interceptor binding type .
        Specified by:
        isInterceptorBinding in interface BeanContainer
        Parameters:
        annotationType - the annotation to test
        Returns:
        true if the annotation type is a interceptor binding type
      • isStereotype

        public boolean isStereotype​(Class<? extends Annotation> annotationType)
        Description copied from interface: BeanContainer
        Test the given annotation type to determine if it is a stereotype.
        Specified by:
        isStereotype in interface BeanContainer
        Parameters:
        annotationType - the annotation type
        Returns:
        true if the annotation type is a stereotype
      • getInterceptorBindingDefinition

        public Set<Annotation> getInterceptorBindingDefinition​(Class<? extends Annotation> bindingType)
        Description copied from interface: BeanManager
        Obtains the set of meta-annotations for a certain interceptor binding type .
        Specified by:
        getInterceptorBindingDefinition in interface BeanManager
        Parameters:
        bindingType - the interceptor binding type
        Returns:
        the set of meta-annotations
      • areQualifiersEquivalent

        public boolean areQualifiersEquivalent​(Annotation qualifier1,
                                               Annotation qualifier2)
        Description copied from interface: BeanManager
        Determine if two qualifiers are considered equivalent for the purposes of typesafe resolution, taking into account any members annotated with Nonbinding.
        Specified by:
        areQualifiersEquivalent in interface BeanManager
        Parameters:
        qualifier1 - a qualifier to check
        qualifier2 - a qualifier to check
        Returns:
        true if the two qualifiers are equivalent, otherwise false
      • areInterceptorBindingsEquivalent

        public boolean areInterceptorBindingsEquivalent​(Annotation interceptorBinding1,
                                                        Annotation interceptorBinding2)
        Description copied from interface: BeanManager
        Determine if two interceptor bindings are considered equivalent for the purposes of typesafe resolution, taking into account any members annotated with Nonbinding.
        Specified by:
        areInterceptorBindingsEquivalent in interface BeanManager
        Parameters:
        interceptorBinding1 - an interceptor binding to check
        interceptorBinding2 - an interceptor binding to check
        Returns:
        true if the two interceptor bindings are equivalent, otherwise false
      • getQualifierHashCode

        public int getQualifierHashCode​(Annotation qualifier)
        Description copied from interface: BeanManager
        Determine the hash code of a qualifier, using the JDK algorithm for determining an annotation hash code, ignoring any members annotated with Nonbinding.
        Specified by:
        getQualifierHashCode in interface BeanManager
        Parameters:
        qualifier - the qualifier to consider
        Returns:
        the hashCode for the qualifier
      • getInterceptorBindingHashCode

        public int getInterceptorBindingHashCode​(Annotation interceptorBinding)
        Description copied from interface: BeanManager
        Determine the hash code of an interceptor binding, using the JDK algorithm for determining an annotation hash code, ignoring any members annotated with Nonbinding.
        Specified by:
        getInterceptorBindingHashCode in interface BeanManager
        Parameters:
        interceptorBinding - the interceptor binding to consider
        Returns:
        the hashCode for the interceptor binding
      • getELResolver

        public jakarta.el.ELResolver getELResolver()
        Description copied from interface: BeanManager
        Returns a ELResolver that resolves beans by EL name.
        Specified by:
        getELResolver in interface BeanManager
        Returns:
        the ELResolver
      • wrapExpressionFactory

        public jakarta.el.ExpressionFactory wrapExpressionFactory​(jakarta.el.ExpressionFactory expressionFactory)
        Description copied from interface: BeanManager
        Returns a wrapper ExpressionFactory that delegates MethodExpression and ValueExpression creation to the given ExpressionFactory. When a Unified EL expression is evaluated using a MethodExpression or ValueExpression returned by the wrapper ExpressionFactory, the container handles destruction of objects with scope Dependent.
        Specified by:
        wrapExpressionFactory in interface BeanManager
        Parameters:
        expressionFactory - the ExpressionFactory to wrap
        Returns:
        the wrapped ExpressionFactory
      • getExtension

        public <T extends Extension> T getExtension​(Class<T> extensionClass)
        Description copied from interface: BeanManager
        Obtains the container's instance of an Extension class declared in META-INF/services.
        Specified by:
        getExtension in interface BeanManager
        Type Parameters:
        T - the type of the extension
        Parameters:
        extensionClass - the type of the extension class
        Returns:
        the extension instance
      • getEvent

        public Event<Object> getEvent()
        Description copied from interface: BeanContainer
        Returns an instance of Event with specified type java.lang.Object and specified qualifier @Default It allows typesafe synchronous or asynchronous event firing without injection of Event built-in bean requirement.
        Specified by:
        getEvent in interface BeanContainer
        Returns:
        a new Event object whose event type is Object and qualifier @Default
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • getProducerFactory

        public <X> ProducerFactory<X> getProducerFactory​(AnnotatedField<? super X> field,
                                                         Bean<X> declaringBean)
        Description copied from interface: BeanManager

        An implementation of ProducerFactory that provides container created Producer instances for the given field.

        This factory can be wrapped to add behavior to container created producers.

        Specified by:
        getProducerFactory in interface BeanManager
        Type Parameters:
        X - the declaring type
        Parameters:
        field - the field to create the producer factory for
        declaringBean - the bean declaring the producer. May be null if the producer is static or the declaring object is non-contextual
        Returns:
        the producer factory for the field
      • getProducerFactory

        public <X> ProducerFactory<X> getProducerFactory​(AnnotatedMethod<? super X> method,
                                                         Bean<X> declaringBean)
        Description copied from interface: BeanManager

        An implementation of ProducerFactory that provides container created Producer instances for the given method.

        This factory can be wrapped to add behavior to container created producers.

        Specified by:
        getProducerFactory in interface BeanManager
        Type Parameters:
        X - bean type
        Parameters:
        method - the method to create the producer factory for
        declaringBean - the bean declaring the producer. May be null if the producer is static or the declaring object is non-contextual
        Returns:
        the producer factory for the method
      • createInstance

        public Instance<Object> createInstance()
        Description copied from interface: BeanContainer
        Obtains an Instance object to access to beans instances.

        The returned Instance object can only access instances of beans that are available for injection in the module or library containing the class into which the BeanManager/BeanContainer was injected or, in the Jakarta EE environment, the Jakarta EE component from whose JNDI environment namespace the BeanContainer was obtained, according to the rules of typesafe resolution.

        Note that when called during invocation of an AfterBeanDiscovery event observer, the Instance returned by this method will only give access to instances of beans discovered by the container before the AfterBeanDiscovery event is fired.

        Instances of dependent scoped beans obtained with this Instance must be explicitly destroyed by calling Instance.destroy(Object)

        If no qualifier is passed to Instance.select(java.lang.annotation.Annotation...) method, the @Default qualifier is assumed.

        Specified by:
        createInstance in interface BeanContainer
        Returns:
        an Instance object to request beans instances