Package org.mule.api.config

Examples of org.mule.api.config.ConfigurationBuilder


    public void testSpringConfigurationBuilder() throws Exception
    {
        MuleContext context = new DefaultMuleContextFactory().createMuleContext();
       
        ApplicationContext appContext = new ClassPathXmlApplicationContext("application-context.xml");
        ConfigurationBuilder builder = new SpringConfigurationBuilder(appContext);
        builder.configure(context);

        context.start();
       
        Object orange = context.getRegistry().lookupObject("orange");
        assertNotNull(orange);
View Full Code Here


    public void testSpringConfigurationBuilderPrecedence() throws Exception
    {
        MuleContext context = new DefaultMuleContextFactory().createMuleContext();
       
        ApplicationContext appContext = new ClassPathXmlApplicationContext("application-context.xml");
        ConfigurationBuilder builder = new SpringConfigurationBuilder(appContext);
        builder.configure(context);

        appContext = new ClassPathXmlApplicationContext("application-context-2.xml");
        builder = new SpringConfigurationBuilder(appContext);
        builder.configure(context);

        context.start();
       
        Object orange = context.getRegistry().lookupObject("orange");
        assertNotNull(orange);
View Full Code Here

    public void testSpringConfigurationBuilderBackwardsPrecedence() throws Exception
    {
        MuleContext context = new DefaultMuleContextFactory().createMuleContext();
       
        ApplicationContext appContext = new ClassPathXmlApplicationContext("application-context-2.xml");
        ConfigurationBuilder builder = new SpringConfigurationBuilder(appContext);
        builder.configure(context);

        appContext = new ClassPathXmlApplicationContext("application-context.xml");
        builder = new SpringConfigurationBuilder(appContext);
        builder.configure(context);

        context.start();
       
        Object orange = context.getRegistry().lookupObject("orange");
        assertNotNull(orange);
View Full Code Here

        MuleContext context = new DefaultMuleContextFactory().createMuleContext();
       
        context.getRegistry().registerObject("orange", new Orange(12, 5.5, "Tutti Frutti"));
       
        ApplicationContext appContext = new ClassPathXmlApplicationContext("application-context.xml");
        ConfigurationBuilder builder = new SpringConfigurationBuilder(appContext);
        builder.configure(context);

        context.start();
       
        Object orange = context.getRegistry().lookupObject("orange");
        assertNotNull(orange);
View Full Code Here

        return muleContextFactory.createMuleContext(new SimpleConfigurationBuilder(null));
    }

    public void testConfigureSpring() throws ConfigurationException, InitialisationException
    {
        ConfigurationBuilder configurationBuilder = new AutoConfigurationBuilder(
            "org/mule/test/spring/config1/test-xml-mule2-config.xml");
        configurationBuilder.configure(muleContext);

        // Just a few of the asserts from AbstractConfigBuilderTestCase
        MessagingExceptionHandler es = muleContext.getRegistry().lookupModel("main").getExceptionListener();
        assertNotNull(es);
        assertTrue(es instanceof TestExceptionStrategy);
View Full Code Here

public class AbstractDataSourceConfigurationTestCase extends AbstractMuleTestCase
{
    protected void tryBuildingMuleContextFromInvalidConfig(String config) throws MuleException
    {
        MuleContextFactory muleContextFactory = new DefaultMuleContextFactory();
        ConfigurationBuilder builder = new SpringXmlConfigurationBuilder(config);
        muleContextFactory.createMuleContext(builder);
        fail();
    }
View Full Code Here

    {
        this.bootstrapContext = bootstrapContext;

        if (configurations != null)
        {
            ConfigurationBuilder configBuilder = null;
            try
            {
                configBuilder = (ConfigurationBuilder) ClassUtils.instanciateClass(configurationBuilder,
                    configurations);
            }
View Full Code Here

            logger.info(miniSplash(String.format("Initializing app '%s'", descriptor.getAppName())));
        }

        try
        {
            ConfigurationBuilder cfgBuilder = createConfigurationBuilder();
            if (!cfgBuilder.isConfigured())
            {
                List<ConfigurationBuilder> builders = new ArrayList<ConfigurationBuilder>(3);
                builders.add(createConfigurationBuilderFromApplicationProperties());

                // We need to add this builder before spring so that we can use Mule annotations in Spring or any other builder
View Full Code Here

                        CoreMessages.configurationBuilderNoMatching(createConfigResourcesString()));
                }

                ConfigResource[] constructorArg = new ConfigResource[configs.size()];
                System.arraycopy(configs.toArray(), 0, constructorArg, 0, configs.size());
                ConfigurationBuilder cb = (ConfigurationBuilder) ClassUtils.instanciateClass(className, new Object[] {constructorArg});
                cb.configure(muleContext);
            }
        }
        catch (ConfigurationException e)
        {
            throw e;
View Full Code Here

            logger.warn("A configuration file was not set, using default: " + DEFAULT_CONFIGURATION);
            configurationResources = DEFAULT_CONFIGURATION;
        }

        // create a new ConfigurationBuilder that is disposed afterwards
        ConfigurationBuilder cfgBuilder = createConfigurationBuilder();

        if (!cfgBuilder.isConfigured())
        {
            List<ConfigurationBuilder> configBuilders = new ArrayList<ConfigurationBuilder>(3);

            // need to add the annotations config builder before Spring so we can use Mule
            // annotations in Spring
View Full Code Here

TOP

Related Classes of org.mule.api.config.ConfigurationBuilder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.