Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package org.infinispan.cdi.util.defaultbean;
 
 import java.util.Set;
 
 import  javax.enterprise.context.spi.CreationalContext;
 import  javax.enterprise.inject.spi.AnnotatedMethod;
 import  javax.enterprise.inject.spi.Bean;
import  javax.enterprise.inject.spi.BeanManager;
// TODO Make this passivation capable
    private final InjectableMethod<X> producerMethod;
    private final InjectableMethod<X> disposerMethod;
    static <T, X> DefaultProducerMethod<T, X> of(Bean<T> originalBeanType declaringBeanTypeSet<TypebeanTypesSet<AnnotationqualifiersSet<AnnotationdeclaringBeanQualifiers, AnnotatedMethod<X> method, AnnotatedMethod<X> disposerMethod, BeanManager beanManager) {
        return new DefaultProducerMethod<T, X>(originalBeandeclaringBeanTypebeanTypesqualifiersdeclaringBeanQualifiersmethoddisposerMethodbeanManager);
    }
    DefaultProducerMethod(Bean<T> originalBeanType declaringBeanTypeSet<TypebeanTypesSet<AnnotationqualifiersSet<AnnotationdeclaringBeanQualifiers, AnnotatedMethod<X> method, AnnotatedMethod<X> disposerMethod, BeanManager beanManager) {
        super(originalBeandeclaringBeanTypebeanTypesqualifiersdeclaringBeanQualifiersbeanManager);
        this. = new InjectableMethod<X>(methodthisbeanManager);
        if (disposerMethod != null) {
            this. = new InjectableMethod<X>(disposerMethodthisbeanManager);
        } else {
            this. = null;
        }
    }
    @Override
    protected T getValue(Object receiver, CreationalContext<T> creationalContext) {
        return .invoke(receivercreationalContext);
    }
    @Override
    public void destroy(T instance, CreationalContext<T> creationalContext) {
        if ( != null) {
            try {
                .invoke(getReceiver(creationalContext), creationalContext);
            } finally {
                creationalContext.release();
            }
        }
    }
New to GrepCode? Check out our FAQ X