Home » apache-openwebbeans-1.0.0-incubating-M3-sources » org.apache.webbeans.component.third » [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
    4    *  this work for additional information regarding copyright ownership.
    5    *  The ASF licenses this file to You under the Apache License, Version 2.0
    6    *  (the "License"); you may not use this file except in compliance with
    7    *  the License.  You may obtain a copy of the License at
    8    * 
    9    *       http://www.apache.org/licenses/LICENSE-2.0
   10    * 
   11    *  Unless required by applicable law or agreed to in writing, software
   12    *  distributed under the License is distributed on an "AS IS" BASIS,
   13    *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   14    *  See the License for the specific language governing permissions and
   15    *  limitations under the License.
   16    */
   17   package org.apache.webbeans.component.third;
   18   
   19   import java.lang.annotation.Annotation;
   20   import java.lang.reflect.Type;
   21   import java.util.Set;
   22   
   23   import javax.enterprise.context.spi.CreationalContext;
   24   import javax.enterprise.inject.spi.Bean;
   25   import javax.enterprise.inject.spi.InjectionPoint;
   26   
   27   import org.apache.webbeans.component.AbstractBean;
   28   import org.apache.webbeans.component.WebBeansType;
   29   
   30   public class ThirdpartyBeanImpl<T> extends AbstractBean<T>
   31   {
   32       private Bean<T> bean = null;
   33       
   34       
   35       public ThirdpartyBeanImpl(Bean<T> bean)
   36       {
   37           super(WebBeansType.THIRDPARTY);
   38           
   39           this.bean = bean;
   40           
   41       }
   42       
   43       @Override
   44       public Set<Annotation> getQualifiers()
   45       {
   46           
   47           return bean.getQualifiers();
   48       }
   49   
   50       @Override
   51       public Class<? extends Annotation> getDeploymentType()
   52       {
   53           
   54           return bean.getDeploymentType();
   55       }
   56   
   57       @Override
   58       public Set<InjectionPoint> getInjectionPoints()
   59       {
   60           
   61           return bean.getInjectionPoints();
   62       }
   63   
   64       @Override
   65       public String getName()
   66       {
   67           
   68           return bean.getName();
   69       }
   70   
   71       @Override
   72       public Class<? extends Annotation> getScope()
   73       {
   74           
   75           return bean.getScope();
   76       }
   77   
   78       @Override
   79       public Set<Type> getTypes()
   80       {
   81           
   82           return bean.getTypes();
   83       }
   84   
   85       @Override
   86       public boolean isNullable()
   87       {
   88           
   89           return bean.isNullable();
   90       }
   91   
   92       @Override
   93       public boolean isSerializable()
   94       {
   95           
   96           return bean.isSerializable();
   97       }
   98   
   99       public T create(CreationalContext<T> context)
  100       {
  101           
  102           return bean.create(context);
  103       }
  104   
  105       public void destroy(T instance, CreationalContext<T> context)
  106       {
  107           bean.destroy(instance,context);
  108           
  109       }
  110   
  111   
  112   
  113       @Override
  114       protected T createInstance(CreationalContext<T> creationalContext)
  115       {
  116           throw new UnsupportedOperationException();
  117       }
  118   
  119   
  120   
  121       @Override
  122       protected void destroyInstance(T instance)
  123       {
  124           throw new UnsupportedOperationException();
  125           
  126       }
  127   
  128   }

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