Class AbstractMemberProducer<X,​T>

    • Method Detail

      • checkDeclaringBean

        protected void checkDeclaringBean()
      • producerWithParameterizedTypeWithTypeVariableBeanTypeMustBeDependent

        protected abstract DefinitionException producerWithParameterizedTypeWithTypeVariableBeanTypeMustBeDependent​(AnnotatedMember<?> member)
      • getReceiver

        protected Object getReceiver​(CreationalContext<?> productCreationalContext,
                                     CreationalContext<?> receiverCreationalContext)
        Gets the receiver of the product. The two creational contexts need to be separated because the receiver only serves the product creation (it is not a dependent instance of the created instance).
        Parameters:
        productCreationalContext - the creational context of the produced instance
        receiverCreationalContext - the creational context of the receiver
        Returns:
        The receiver
      • dispose

        public void dispose​(T instance)
        Description copied from interface: Producer

        Destroys the instance.

        If the Producer represents a class, then this operation does nothing.

        If the Producer represents a producer field or method, this calls the disposer method, if any, on a contextual instance of the bean that declares the disposer method or performs any additional required cleanup, if any, to destroy state associated with a resource.

        Parameters:
        instance - The instance to dispose
      • produce

        public T produce​(CreationalContext<T> ctx)
        Description copied from interface: Producer

        Causes an instance to be produced via the Producer.

        If the Producer represents a class, this will invoke the constructor annotated Inject if it exists, or the constructor with no parameters otherwise. If the class has interceptors, produce() is responsible for building the interceptors and decorators of the instance.

        If the Producer represents a producer field or method, this will invoke the producer method on, or access the producer field of, a contextual instance of the bean that declares the producer.

        Parameters:
        ctx - The CreationalContext to use for the produced object
        Returns:
        the instance produced
      • getDisposalMethod

        public DisposalMethod<?,​?> getDisposalMethod()
      • isTypeSerializable

        protected boolean isTypeSerializable​(Object object)
      • getDeclaringBean

        public abstract Bean<X> getDeclaringBean()