
javax.enterprise.inject.spi.InjectionTargetFactory Maven / Gradle / Ivy
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 InjectionTarget createInjectionTarget(Bean bean) {
* return new WrappingInjectionTarget(beanManager.getInjectionTargetFactory(myBeanAnnotatedType).createInjectionTarget(bean));
* }
* });
*
*
* @author Pete Muir
*
*/
public interface InjectionTargetFactory {
/**
* Create a new injection target for a bean.
*
* @param bean the bean to create the injection target for
* @return the injection target
*/
public InjectionTarget createInjectionTarget(Bean bean);
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy