Java 类javax.enterprise.inject.spi.InjectionTargetFactory 实例源码

项目:HotswapAgent    文件:BeanClassRefreshAgent.java   
@SuppressWarnings({ "rawtypes", "unchecked" })
private static void createAnnotatedTypeForExistingBeanClass(BeanManagerImpl beanManager, Class<?> beanClass, InjectionTargetBean bean) {

    WebBeansContext wbc = beanManager.getWebBeansContext();

    AnnotatedElementFactory annotatedElementFactory = wbc.getAnnotatedElementFactory();
    // Clear AnnotatedElementFactory caches
    annotatedElementFactory.clear();

    AnnotatedType annotatedType = annotatedElementFactory.newAnnotatedType(beanClass);

    ReflectionHelper.set(bean, InjectionTargetBean.class, "annotatedType", annotatedType);

    // Updated members that were set by bean attributes
    BeanAttributesImpl attributes = BeanAttributesBuilder.forContext(wbc).newBeanAttibutes(annotatedType).build();
    ReflectionHelper.set(bean, BeanAttributesImpl.class, "types", attributes.getTypes());
    ReflectionHelper.set(bean, BeanAttributesImpl.class, "qualifiers", attributes.getQualifiers());
    ReflectionHelper.set(bean, BeanAttributesImpl.class, "scope", attributes.getScope());
    ReflectionHelper.set(bean, BeanAttributesImpl.class, "name", attributes.getName());
    ReflectionHelper.set(bean, BeanAttributesImpl.class, "stereotypes", attributes.getStereotypes());
    ReflectionHelper.set(bean, BeanAttributesImpl.class, "alternative", attributes.isAlternative());

    InjectionTargetFactory factory = new InjectionTargetFactoryImpl(annotatedType, bean.getWebBeansContext());
    InjectionTarget injectionTarget = factory.createInjectionTarget(bean);
    ReflectionHelper.set(bean, InjectionTargetBean.class, "injectionTarget", injectionTarget);

    LOGGER.debug("New annotated type created for bean '{}'", beanClass.getName());
}
项目:tapestry-jpa-transactions    文件:NoopBeanManager.java   
@Override
public <T> InjectionTargetFactory<T> getInjectionTargetFactory(AnnotatedType<T> annotatedType)
{
    // TODO Auto-generated method stub
    return null;
}
项目:tapestry-jpa-transactions    文件:NoopBeanManager.java   
@Override
public <T> Bean<T> createBean(BeanAttributes<T> attributes, Class<T> beanClass, InjectionTargetFactory<T> injectionTargetFactory)
{
    // TODO Auto-generated method stub
    return null;
}
项目:jbromo    文件:BeanManagerExt.java   
@Override
public <T> Bean<T> createBean(final BeanAttributes<T> arg0,
        final Class<T> arg1, final InjectionTargetFactory<T> arg2) {
    return this.beanManager.createBean(arg0, arg1, arg2);
}
项目:jbromo    文件:BeanManagerExt.java   
@Override
public <T> InjectionTargetFactory<T> getInjectionTargetFactory(
        final AnnotatedType<T> arg0) {
    return this.beanManager.getInjectionTargetFactory(arg0);
}