Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * JBoss, Home of Professional Open Source
   * Copyright 2008, Red Hat, Inc., and individual contributors
   * by the @authors tag. See the copyright.txt in the distribution for a
   * full listing of individual contributors.
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
  * http://www.apache.org/licenses/LICENSE-2.0
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
 package org.jboss.weld.bean;
 
 import java.util.Set;
 
 
Represents a producer method bean

Parameters:
<T>
Author(s):
Pete Muir
 
 public class ProducerMethod<X, T> extends AbstractProducerBean<X, T, Method> {
 
     private final boolean proxiable;
 
     private final AnnotatedMethod<? super X> annotatedMethod;
     private volatile EnhancedAnnotatedMethod<T, ? super X> enhancedAnnotatedMethod;

    
Creates a producer method Web Bean

Parameters:
method The underlying method abstraction
declaringBean The declaring bean abstraction
beanManager the current manager
Returns:
A producer Web Bean
 
     public static <X, T> ProducerMethod<X, T> of(BeanAttributes<T> attributesEnhancedAnnotatedMethod<T, ? super X> methodAbstractClassBean<X> declaringBeanDisposalMethod<X, ?> disposalMethodBeanManagerImpl beanManagerServiceRegistry services) {
         return new ProducerMethod<X, T>(createId(attributesmethoddeclaringBean), attributesmethoddeclaringBeandisposalMethodbeanManagerservices);
     }
 
     private static BeanIdentifier createId(BeanAttributes<?> attributesEnhancedAnnotatedMethod<?, ?> methodAbstractClassBean<?> declaringBean) {
         if (Dependent.class.equals(attributes.getScope()) || ApplicationScoped.class.equals(attributes.getScope())) {
             return new ProducerMethodIdentifier(methoddeclaringBean);
         } else {
             return new StringBeanIdentifier(BeanIdentifiers.forProducerMethod(methoddeclaringBean));
         }
     }
 
     protected ProducerMethod(BeanIdentifier identifierBeanAttributes<T> attributesEnhancedAnnotatedMethod<T, ? super X> methodAbstractClassBean<X> declaringBeanDisposalMethod<X, ?> disposalMethodBeanManagerImpl beanManagerServiceRegistry services) {
         super(attributesidentifierdeclaringBeanbeanManagerservices);
         this. = method;
         this. = method.slim();
         initType();
         this. = Proxies.isTypesProxyable(method.getTypeClosure(), beanManager.getServices());
         setProducer(new ProducerMethodProducer<X, T>(methoddisposalMethod) {
 
             @Override
             public BeanManagerImpl getBeanManager() {
                 return ProducerMethod.this.;
             }
 
             @Override
             public Bean<X> getDeclaringBean() {
                 return ProducerMethod.this.getDeclaringBean();
             }
 
             @Override
             public Bean<T> getBean() {
                 return ProducerMethod.this;
             }
         });
     }
 
     @Override
     public AnnotatedMethod<? super X> getAnnotated() {
         return ;
     }

    
Gets the annotated item representing the method

Returns:
The annotated item
    @Override
    public EnhancedAnnotatedMethod<T, ? super X> getEnhancedAnnotated() {
    }
    @Override
    public void cleanupAfterBoot() {
        this. = null;
    }
    @Override
    protected void specialize() {
        Set<? extends AbstractBean<?, ?>> specializedBeans = getSpecializedBeans();
        if (specializedBeans.isEmpty()) {
            throw ..producerMethodNotSpecializing(this);
        }
    }
    @Override
    public String toString() {
        return "Producer Method [" + Formats.formatType(getAnnotated().getBaseType()) + "] with qualifiers [" + Formats.formatAnnotations(getQualifiers()) + "] declared as [" + getAnnotated() + "]";
    }
    @Override
    public boolean isProxyable() {
        return ;
    }
New to GrepCode? Check out our FAQ X