Package org.mule.config

Examples of org.mule.config.DefaultMuleConfiguration


        muleURL += "/";
     
      loggingInterceptorLevel = p.getProperty("loggingInterceptorLevel");
     
      AutoConfigurationBuilder configbuilder = new AutoConfigurationBuilder("conf/jallinone.xml");
      DefaultMuleConfiguration muleConfig = new DefaultMuleConfiguration();
      muleConfig.setClientMode(true);
      DefaultMuleContextBuilder contextBuilder = new DefaultMuleContextBuilder();
      contextBuilder.setMuleConfiguration(muleConfig);
      muleContext = new DefaultMuleContextFactory().createMuleContext(configbuilder, contextBuilder);
     
     
View Full Code Here


    public Object getObject() throws Exception
    {
        MuleConfiguration configuration = muleContext.getConfiguration();
        if (configuration instanceof DefaultMuleConfiguration)
        {
            DefaultMuleConfiguration defaultConfig = (DefaultMuleConfiguration) configuration;
            defaultConfig.setDefaultResponseTimeout(config.getDefaultResponseTimeout());
            defaultConfig.setDefaultTransactionTimeout(config.getDefaultTransactionTimeout());
            defaultConfig.setShutdownTimeout(config.getShutdownTimeout());
            return configuration;
        }
        else
        {
            throw new ConfigurationException(MessageFactory.createStaticMessage("Unable to set properties on read-only MuleConfiguration: " + configuration.getClass()));
View Full Code Here

        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
View Full Code Here

    private MuleContext muleContext;
   
    /** Test for MULE-3092 */
    public void testConfigureProgramatically() throws Exception
    {
        DefaultMuleConfiguration config = new DefaultMuleConfiguration();
        config.setDefaultEncoding("UTF-16");
        config.setDefaultSynchronousEndpoints(true);
        config.setSystemModelType("direct");
        config.setDefaultResponseTimeout(30000);
        config.setDefaultTransactionTimeout(60000);
        config.setWorkingDirectory(workingDirectory);
        config.setClientMode(true);
        ThreadSafeAccess.AccessControl.setFailOnMessageScribbling(false);
        config.setId("MY_SERVER");
        config.setClusterId("MY_CLUSTER");
        config.setDomainId("MY_DOMAIN");
        config.setCacheMessageAsBytes(false);
        config.setCacheMessageOriginalPayload(false);
        config.setEnableStreaming(false);
        ThreadSafeAccess.AccessControl.setAssertMessageAccess(false);
        config.setAutoWrapMessageAwareTransform(false);
       
        MuleContextBuilder contextBuilder = new DefaultMuleContextBuilder();
        contextBuilder.setMuleConfiguration(config);
        muleContext = new DefaultMuleContextFactory().createMuleContext(contextBuilder);
       
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);
        mutableConfig.setSystemModelType("direct");
        mutableConfig.setDefaultResponseTimeout(30000);
        mutableConfig.setDefaultTransactionTimeout(60000);
        mutableConfig.setClientMode(true);

        // These are not OK to change after init
        mutableConfig.setDefaultEncoding("UTF-16");
        mutableConfig.setWorkingDirectory(workingDirectory);
        mutableConfig.setId("MY_SERVER");
        mutableConfig.setClusterId("MY_CLUSTER");
        mutableConfig.setDomainId("MY_DOMAIN");

        MuleConfiguration config = muleContext.getConfiguration();

        // These are OK to change after init but before start
        assertEquals("direct", config.getSystemModelType());
View Full Code Here

    public void testConfigureAfterStartFails() throws Exception
    {
        muleContext = new DefaultMuleContextFactory().createMuleContext();       
        muleContext.start();

        DefaultMuleConfiguration mutableConfig = ((DefaultMuleConfiguration) muleContext.getConfiguration());
        mutableConfig.setDefaultSynchronousEndpoints(true);
        mutableConfig.setSystemModelType("direct");
        mutableConfig.setDefaultResponseTimeout(30000);
        mutableConfig.setDefaultTransactionTimeout(60000);
        mutableConfig.setClientMode(true);

        MuleConfiguration config = muleContext.getConfiguration();
        assertFalse("direct".equals(config.getSystemModelType()));
        assertFalse(30000 == config.getDefaultResponseTimeout());
        assertFalse(60000 == config.getDefaultTransactionTimeout());
View Full Code Here

     * files.
     */
    public MuleContext createMuleContext(ConfigurationBuilder configurationBuilder, Properties properties)
        throws InitialisationException, ConfigurationException
    {
        return createMuleContext(configurationBuilder, properties, new DefaultMuleConfiguration());
    }
View Full Code Here

        this.shutdownScreen = shutdownScreen;
    }

    protected DefaultMuleConfiguration createMuleConfiguration()
    {
        return new DefaultMuleConfiguration();
    }
View Full Code Here

        Map properties = Collections.emptyMap();

        Mock mockEndpoint = new Mock(InboundEndpoint.class);
        mockEndpoint.expectAndReturn("getConnector", httpsConnector);
        mockEndpoint.expectAndReturn("getEncoding", new DefaultMuleConfiguration().getDefaultEncoding());
        mockEndpoint.expectAndReturn("getProperties", properties);
        mockEndpoint.expectAndReturn("getProperties", properties);
        InboundEndpoint inboundEndpoint = (InboundEndpoint) mockEndpoint.proxy();

        Mock mockService = new Mock(Service.class);
View Full Code Here

    }

    @Override
    protected DefaultMuleConfiguration createMuleConfiguration()
    {
        final DefaultMuleConfiguration configuration = new DefaultMuleConfiguration(true);
        PropertiesMuleConfigurationFactory.initializeFromProperties(configuration, desc.getAppProperties());
        configuration.setId(desc.getAppName());
        final String encoding = desc.getEncoding();
        if (StringUtils.isNotBlank(encoding))
        {
            configuration.setDefaultEncoding(encoding);
        }
        return configuration;
    }
View Full Code Here

TOP

Related Classes of org.mule.config.DefaultMuleConfiguration

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.