Home » apache-openwebbeans-1.0.0-incubating-M3-sources » org.apache.webbeans.component.creation » [javadoc | source]

    1   /*
    2    * Licensed to the Apache Software Foundation (ASF) under one or more
    3    * contributor license agreements. See the NOTICE file distributed with this
    4    * work for additional information regarding copyright ownership. The ASF
    5    * licenses this file to You under the Apache License, Version 2.0 (the
    6    * "License"); you may not use this file except in compliance with the License.
    7    * You may obtain a copy of the License at
    8    * http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law
    9    * or agreed to in writing, software distributed under the License is
   10    * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
   11    * KIND, either express or implied. See the License for the specific language
   12    * governing permissions and limitations under the License.
   13    */
   14   package org.apache.webbeans.component.creation;
   15   
   16   import java.lang.annotation.Annotation;
   17   
   18   import javax.enterprise.inject.spi.Bean;
   19   import javax.enterprise.inject.spi.Producer;
   20   
   21   import org.apache.webbeans.component.AbstractBean;
   22   
   23   /**
   24    * Contract for {@link Bean} creation.
   25    * 
   26    * <p>
   27    * Common operations on ManagedBean, ProducerField and ProducerMethods.
   28    * </p>
   29    * 
   30    * @version $Rev: 811507 $ $Date: 2009-09-04 21:18:41 +0300 (Fri, 04 Sep 2009) $
   31    *
   32    */
   33   public interface BeanCreator<T> extends Producer<T>
   34   {
   35       /**
   36        * MetaDataProvider. 
   37        */
   38       public enum MetaDataProvider
   39       {
   40           //Default meta-data is used
   41           DEFAULT,
   42           //Third party overriden meta-data will be used. 
   43           //It is overriden with event ProcessAnnotatedType
   44           THIRDPARTY
   45       }
   46       
   47       /**
   48        * Check conditions on creating bean instance.
   49        */
   50       public void checkCreateConditions();
   51       
   52       /**
   53        * Define serializable.
   54        */
   55       public void defineSerializable();
   56       
   57       /**
   58        * Define stereptypes.
   59        */
   60       public void defineStereoTypes();
   61       
   62       /**
   63        * Defines deployment type.
   64        * 
   65        * @param errorMessage error messahe
   66        * @return deployment type
   67        */
   68       public Class<? extends Annotation> defineDeploymentType(String errorMessage);
   69       
   70       /**
   71        * Define api type.
   72        */
   73       public void defineApiType();
   74       
   75       /**
   76        * Returns metadata provider.
   77        * 
   78        * @return metadata provider
   79        */
   80       public MetaDataProvider getMetaDataProvider();
   81       
   82       /**
   83        * Sets meta-data provider.
   84        * 
   85        * @param metadataProvider metadata provider
   86        */
   87       public void setMetaDataProvider(MetaDataProvider metadataProvider);
   88       
   89       /**
   90        * Returns producer instance.
   91        * 
   92        * @return producer instance
   93        */
   94       public Producer<T> getProducer();
   95       
   96       /**
   97        * Sets producer. If set, it is responsible
   98        * for creating bean instance.
   99        * 
  100        * @param producer set producer
  101        */
  102       public void setProducer(Producer<T> producer);
  103       
  104       /**
  105        * Define scope type of the bean.
  106        * 
  107        * <p>
  108        * Check passivation related controls.
  109        * </p>
  110        */
  111       public void defineScopeType(String errorMessage);
  112       
  113       /**
  114        * Defines qualifier.
  115        */
  116       public void defineQualifier();
  117       
  118       /**
  119        * Defines bean name.
  120        * 
  121        * @param defaultName default bean name
  122        */
  123       public void defineName(String defaultName);   
  124       
  125       /**
  126        * Gets bean.
  127        * 
  128        * @return bean instance
  129        */
  130       public AbstractBean<T> getBean();
  131       
  132       /**
  133        * Returns producer instance is set or not.
  134        * 
  135        * @return producer instance is set or not
  136        */
  137       public boolean isProducerSet();
  138   }

Home » apache-openwebbeans-1.0.0-incubating-M3-sources » org.apache.webbeans.component.creation » [javadoc | source]