Package org.mule.context

Examples of org.mule.context.DefaultMuleContextFactory


            final String contextName = FilenameUtils.getBaseName(tempDir.toString());
            serverId = contextName;
        }

        WebappMuleXmlConfigurationBuilder builder = new WebappMuleXmlConfigurationBuilder(servletContext, configResource);
        MuleContextFactory muleContextFactory = new DefaultMuleContextFactory();

        String muleAppConfig = servletContext.getInitParameter(INIT_PARAMETER_MULE_APP_CONFIG) != null
            ? servletContext.getInitParameter(INIT_PARAMETER_MULE_APP_CONFIG)
            : PropertiesMuleConfigurationFactory.getMuleAppConfiguration(configResource);
       
        DefaultMuleConfiguration muleConfiguration = new PropertiesMuleConfigurationFactory(muleAppConfig).createConfiguration();

        /*
            We deliberately enable container mode here to allow for multi-tenant environment (multiple WARs
            embedding Mule instance each). See property javadocs for more info.
         */
        muleConfiguration.setContainerMode(true);

        if (serverId != null)
        {
            muleConfiguration.setId(serverId);
        }
        MuleContextBuilder muleContextBuilder = new DefaultMuleContextBuilder();
        muleContextBuilder.setMuleConfiguration(muleConfiguration);

        // Support Spring-first configuration in webapps
        final ApplicationContext parentContext = (ApplicationContext) servletContext.getAttribute(
                                                        WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE);
        if (parentContext != null)
        {
            builder.setParentContext(parentContext);
        }
        return muleContextFactory.createMuleContext(builder, muleContextBuilder);
    }
View Full Code Here


        ThreadSafeAccess.AccessControl.setAssertMessageAccess(false);
        config.setAutoWrapMessageAwareTransform(false);
       
        MuleContextBuilder contextBuilder = new DefaultMuleContextBuilder();
        contextBuilder.setMuleConfiguration(config);
        muleContext = new DefaultMuleContextFactory().createMuleContext(contextBuilder);
       
        muleContext.start();
       
        verifyConfiguration();
    }
View Full Code Here

        System.setProperty(MuleProperties.SYSTEM_PROPERTY_PREFIX + "message.cacheOriginal", "false");
        System.setProperty(MuleProperties.SYSTEM_PROPERTY_PREFIX + "streaming.enable", "false");
        System.setProperty(MuleProperties.SYSTEM_PROPERTY_PREFIX + "message.assertAccess", "false");
        System.setProperty(MuleProperties.SYSTEM_PROPERTY_PREFIX + "transform.autoWrap", "false");
       
        muleContext = new DefaultMuleContextFactory().createMuleContext();
        muleContext.start();

        verifyConfiguration();

        System.clearProperty(MuleProperties.SYSTEM_PROPERTY_PREFIX + "encoding");
View Full Code Here

    }

    /** Test for MULE-3110 */
    public void testConfigureAfterInitFails() throws Exception
    {
        muleContext = new DefaultMuleContextFactory().createMuleContext();       

        DefaultMuleConfiguration mutableConfig = ((DefaultMuleConfiguration) muleContext.getConfiguration());
       
        // These are OK to change after init but before start
        mutableConfig.setDefaultSynchronousEndpoints(true);
View Full Code Here

    }

    /** Test for MULE-3110 */
    public void testConfigureAfterStartFails() throws Exception
    {
        muleContext = new DefaultMuleContextFactory().createMuleContext();       
        muleContext.start();

        DefaultMuleConfiguration mutableConfig = ((DefaultMuleConfiguration) muleContext.getConfiguration());
        mutableConfig.setDefaultSynchronousEndpoints(true);
        mutableConfig.setSystemModelType("direct");
View Full Code Here

public class AutoConfigurationBuilderTestCase extends AbstractMuleTestCase
{

    protected MuleContext createMuleContext() throws Exception
    {
        MuleContextFactory muleContextFactory = new DefaultMuleContextFactory();
        return muleContextFactory.createMuleContext(new SimpleConfigurationBuilder(null));
    }
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

                logger.info("Initializing Mule...");

                MuleContextBuilder contextBuilder = new DefaultMuleContextBuilder();
                muleConfiguration.setSystemModelType(JcaModel.JCA_MODEL_TYPE);
                contextBuilder.setMuleConfiguration(muleConfiguration);
                muleContext = new DefaultMuleContextFactory().createMuleContext(configBuilder, contextBuilder);
               
                // Make single shared application server instance of mule context
                // available to DeployableMuleXmlContextListener to support hot
                // deployment of Mule configurations in web applications.
                DeployableMuleXmlContextListener.setMuleContext(muleContext);
View Full Code Here

                addAnnotationsConfigBuilderIfPresent(builders);
                addIBeansConfigurationBuilderIfPackagesConfiguredForScanning(builders);

                builders.add(cfgBuilder);

                DefaultMuleContextFactory muleContextFactory = new DefaultMuleContextFactory();
                this.muleContext = muleContextFactory.createMuleContext(builders, new ApplicationMuleContextBuilder(descriptor));

                if (descriptor.isRedeploymentEnabled())
                {
                    createRedeployMonitor();
                }
View Full Code Here

            MuleConfiguration configuration = createMuleConfiguration();

            MuleContextBuilder contextBuilder = new DefaultMuleContextBuilder();
            contextBuilder.setMuleConfiguration(configuration);

            MuleContextFactory contextFactory = new DefaultMuleContextFactory();
            muleContext = contextFactory.createMuleContext(configBuilders, contextBuilder);
        }
    }
View Full Code Here

TOP

Related Classes of org.mule.context.DefaultMuleContextFactory

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.