Search in sources :

Example 1 with BeanComponentDefinition

use of cn.taketoday.beans.factory.parsing.BeanComponentDefinition in project today-infrastructure by TAKETODAY.

the class AnnotationDrivenBeanDefinitionParser method registerPostProcessor.

private static void registerPostProcessor(ParserContext parserContext, BeanDefinitionBuilder builder, String beanName) {
    builder.setRole(BeanDefinition.ROLE_INFRASTRUCTURE);
    parserContext.getRegistry().registerBeanDefinition(beanName, builder.getBeanDefinition());
    BeanDefinitionHolder holder = new BeanDefinitionHolder(builder.getBeanDefinition(), beanName);
    parserContext.registerComponent(new BeanComponentDefinition(holder));
}
Also used : BeanDefinitionHolder(cn.taketoday.beans.factory.config.BeanDefinitionHolder) BeanComponentDefinition(cn.taketoday.beans.factory.parsing.BeanComponentDefinition)

Example 2 with BeanComponentDefinition

use of cn.taketoday.beans.factory.parsing.BeanComponentDefinition in project today-infrastructure by TAKETODAY.

the class JeeNamespaceHandlerEventTests method testLocalSlsbComponentEventReceived.

@Test
public void testLocalSlsbComponentEventReceived() {
    ComponentDefinition component = this.eventListener.getComponentDefinition("simpleLocalEjb");
    boolean condition = component instanceof BeanComponentDefinition;
    assertThat(condition).isTrue();
}
Also used : BeanComponentDefinition(cn.taketoday.beans.factory.parsing.BeanComponentDefinition) ComponentDefinition(cn.taketoday.beans.factory.parsing.ComponentDefinition) BeanComponentDefinition(cn.taketoday.beans.factory.parsing.BeanComponentDefinition) Test(org.junit.jupiter.api.Test)

Example 3 with BeanComponentDefinition

use of cn.taketoday.beans.factory.parsing.BeanComponentDefinition in project today-infrastructure by TAKETODAY.

the class JeeNamespaceHandlerEventTests method testRemoteSlsbComponentEventReceived.

@Test
public void testRemoteSlsbComponentEventReceived() {
    ComponentDefinition component = this.eventListener.getComponentDefinition("simpleRemoteEjb");
    boolean condition = component instanceof BeanComponentDefinition;
    assertThat(condition).isTrue();
}
Also used : BeanComponentDefinition(cn.taketoday.beans.factory.parsing.BeanComponentDefinition) ComponentDefinition(cn.taketoday.beans.factory.parsing.ComponentDefinition) BeanComponentDefinition(cn.taketoday.beans.factory.parsing.BeanComponentDefinition) Test(org.junit.jupiter.api.Test)

Example 4 with BeanComponentDefinition

use of cn.taketoday.beans.factory.parsing.BeanComponentDefinition in project today-infrastructure by TAKETODAY.

the class AnnotationDrivenBeanDefinitionParser method registerJtaTransactionAspect.

private void registerJtaTransactionAspect(Element element, ParserContext parserContext) {
    String txAspectBeanName = TransactionManagementConfigUtils.JTA_TRANSACTION_ASPECT_BEAN_NAME;
    String txAspectClassName = TransactionManagementConfigUtils.JTA_TRANSACTION_ASPECT_CLASS_NAME;
    if (!parserContext.getRegistry().containsBeanDefinition(txAspectBeanName)) {
        RootBeanDefinition def = new RootBeanDefinition();
        def.setBeanClassName(txAspectClassName);
        def.setFactoryMethodName("aspectOf");
        registerTransactionManager(element, def);
        parserContext.registerBeanComponent(new BeanComponentDefinition(def, txAspectBeanName));
    }
}
Also used : RootBeanDefinition(cn.taketoday.beans.factory.support.RootBeanDefinition) BeanComponentDefinition(cn.taketoday.beans.factory.parsing.BeanComponentDefinition)

Example 5 with BeanComponentDefinition

use of cn.taketoday.beans.factory.parsing.BeanComponentDefinition in project today-infrastructure by TAKETODAY.

the class AnnotationDrivenBeanDefinitionParser method registerTransactionAspect.

private void registerTransactionAspect(Element element, ParserContext parserContext) {
    String txAspectBeanName = TransactionManagementConfigUtils.TRANSACTION_ASPECT_BEAN_NAME;
    String txAspectClassName = TransactionManagementConfigUtils.TRANSACTION_ASPECT_CLASS_NAME;
    if (!parserContext.getRegistry().containsBeanDefinition(txAspectBeanName)) {
        RootBeanDefinition def = new RootBeanDefinition();
        def.setBeanClassName(txAspectClassName);
        def.setFactoryMethodName("aspectOf");
        registerTransactionManager(element, def);
        parserContext.registerBeanComponent(new BeanComponentDefinition(def, txAspectBeanName));
    }
}
Also used : RootBeanDefinition(cn.taketoday.beans.factory.support.RootBeanDefinition) BeanComponentDefinition(cn.taketoday.beans.factory.parsing.BeanComponentDefinition)

Aggregations

BeanComponentDefinition (cn.taketoday.beans.factory.parsing.BeanComponentDefinition)30 ComponentDefinition (cn.taketoday.beans.factory.parsing.ComponentDefinition)12 Test (org.junit.jupiter.api.Test)12 RootBeanDefinition (cn.taketoday.beans.factory.support.RootBeanDefinition)8 CompositeComponentDefinition (cn.taketoday.beans.factory.parsing.CompositeComponentDefinition)6 BeanDefinitionHolder (cn.taketoday.beans.factory.config.BeanDefinitionHolder)4 Nullable (cn.taketoday.lang.Nullable)4 BeanDefinitionStoreException (cn.taketoday.beans.factory.BeanDefinitionStoreException)2 BeanDefinition (cn.taketoday.beans.factory.config.BeanDefinition)2 RuntimeBeanReference (cn.taketoday.beans.factory.config.RuntimeBeanReference)2 TypedStringValue (cn.taketoday.beans.factory.config.TypedStringValue)2 AbstractBeanDefinition (cn.taketoday.beans.factory.support.AbstractBeanDefinition)2 BeanDefinitionBuilder (cn.taketoday.beans.factory.support.BeanDefinitionBuilder)2 Element (org.w3c.dom.Element)2