Home » apache-openwebbeans-1.0.0-incubating-M3-sources » org.apache.webbeans.component » [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;
   15   
   16   import javax.enterprise.context.spi.CreationalContext;
   17   import javax.enterprise.inject.New;
   18   
   19   /**
   20    * Component definition with {@link New} binding annotation.
   21    * 
   22    * <p>
   23    * It is defined as concrete java class component.
   24    * </p>
   25    * 
   26    */
   27   public class NewBean<T> extends ManagedBean<T>
   28   {
   29       private WebBeansType definedType;
   30   
   31       public NewBean(Class<T> returnType, WebBeansType definedType)
   32       {
   33           super(returnType);
   34           this.definedType = definedType;        
   35       }
   36   
   37       @Override
   38       protected T createInstance(CreationalContext<T> creationalContext)
   39       {
   40           return super.createInstance(creationalContext);
   41       }
   42   
   43       @Override
   44       protected void destroyInstance(T instance)
   45       {
   46           super.destroyInstance(instance);
   47       }
   48   
   49       /**
   50        * @return the definedType
   51        */
   52       public WebBeansType getDefinedType()
   53       {
   54           return definedType;
   55       }
   56   
   57   }

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