All Downloads are FREE. Search and download functionalities are using the official Maven repository.

javax.enterprise.inject.spi.InjectionTargetFactory Maven / Gradle / Ivy

There is a newer version: 3.0.0.Alpha1
Show newest version
package javax.enterprise.inject.spi;

/**
 * 

* An {@link InjectionTargetFactory} can create an {@link InjectionTarget} for a given bean. *

* *

* The {@link InjectionTargetFactory} obtained from {@link BeanManager#getInjectionTargetFactory()} is capable of providing * container created injection targets. This factory can be wrapped to add behavior to container created injection targets. *

* *

* For example: *

* *
 * BeanAttributes<MyBean> myBeanAttributes = beanManager.createBeanAttributes(myBeanAnnotatedType);
 * beanManager.createBean(myBeanAttributes, MyBean.class, new InjectionTargetFactory() {
 * 
 *     public <T> InjectionTarget<T> createInjectionTarget(Bean<T> bean) {
 *         return new WrappingInjectionTarget<T>(beanManager.getInjectionTargetFactory(myBeanAnnotatedType).createInjectionTarget(
 *                 bean));
 *     }
 * });
 * 
* * @author Pete Muir * @since 1.1 * */ public interface InjectionTargetFactory { /** * Create a new injection target for a bean. * * @param bean the bean to create the injection target for, or null if creating a non-contextual object * @return the injection target */ public InjectionTarget createInjectionTarget(Bean bean); }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy