Package org.mule.api.config

Examples of org.mule.api.config.MuleConfiguration


            threadingProfile = muleContext.getDefaultThreadingProfile();
        }

        DefaultMessageProcessorChainBuilder builder = new DefaultMessageProcessorChainBuilder();
        builder.setName("'async' child chain");
        final MuleConfiguration config = muleContext.getConfiguration();
        final String threadPrefix = ThreadNameHelper.asyncProcessor(muleContext, name);

        AsyncDelegateMessageProcessor asyncProcessor = new AsyncDelegateMessageProcessor(threadingProfile,
                                                                                                 threadPrefix,
                                                                                                 config.getShutdownTimeout());
        for (Object processor : messageProcessors)
        {
            if (processor instanceof MessageProcessor)
            {
                builder.chain((MessageProcessor) processor);
View Full Code Here


    private void initMockMuleContext()
    {
        persistenceFolder = tempFolder.newFolder("persistence");

        MuleConfiguration mockConfig = mock(MuleConfiguration.class);
        when(mockConfig.getWorkingDirectory()).thenReturn(persistenceFolder.getAbsolutePath());

        mockMuleContext = mock(MuleContext.class);
        when(mockMuleContext.getConfiguration()).thenReturn(mockConfig);
        when(mockMuleContext.getExecutionClassLoader()).thenReturn(getClass().getClassLoader());
    }
View Full Code Here

        return false;
    }

    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

        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());
        assertEquals(30000, config.getDefaultResponseTimeout());
        assertEquals(60000, config.getDefaultTransactionTimeout());
        assertTrue(config.isClientMode());
       
        // These are not OK to change after init
        assertFalse("UTF-16".equals(config.getDefaultEncoding()));
        assertFalse(workingDirectory.equals(config.getWorkingDirectory()));
        assertFalse("MY_SERVER".equals(config.getId()));
        assertFalse("MY_CLUSTER".equals(config.getClusterId()));
        assertFalse("MY_DOMAIN".equals(config.getDomainId()));
    }
View Full Code Here

        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());
        assertFalse(config.isClientMode());
    }
View Full Code Here

        assertFalse(config.isClientMode());
    }

    protected void verifyConfiguration()
    {
        MuleConfiguration config = muleContext.getConfiguration();
        assertEquals("UTF-16", config.getDefaultEncoding());
        assertEquals("direct", config.getSystemModelType());
        assertEquals(30000, config.getDefaultResponseTimeout());
        assertEquals(60000, config.getDefaultTransactionTimeout());
        // on windows this ends up with a c:/ in it
        assertTrue(config.getWorkingDirectory().indexOf(workingDirectory) != -1);
        assertTrue(config.isClientMode());
        assertFalse(ThreadSafeAccess.AccessControl.isFailOnMessageScribbling());
        assertEquals("MY_SERVER", config.getId());
        assertEquals("MY_CLUSTER", config.getClusterId());
        assertEquals("MY_DOMAIN", config.getDomainId());
        assertFalse(config.isCacheMessageAsBytes());
        assertFalse(config.isCacheMessageOriginalPayload());
        assertFalse(config.isEnableStreaming());
        assertFalse(ThreadSafeAccess.AccessControl.isAssertMessageAccess());
        assertFalse(config.isAutoWrapMessageAwareTransform());
    }
View Full Code Here

        return new MuleContextLifecycleManager();
    }

    protected MuleWorkManager createWorkManager()
    {
        final MuleConfiguration config = getMuleConfiguration();
        // still can be embedded, but in container mode, e.g. in a WAR
        final String threadPrefix = config.isContainerMode()
                ? String.format("[%s].Mule", config.getId())
                : "MuleServer";
        return new MuleWorkManager(ThreadingProfile.DEFAULT_THREADING_PROFILE, threadPrefix, config.getShutdownTimeout());
    }
View Full Code Here

            // annotations in Spring
            addAnnotationsConfigBuilder(configBuilders);
            addStartupPropertiesConfigBuilder(configBuilders);
            configBuilders.add(cfgBuilder);

            MuleConfiguration configuration = createMuleConfiguration();

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

            MuleContextFactory contextFactory = new DefaultMuleContextFactory();
View Full Code Here

        serverId = generateId(context);
    }

    protected static String generateId(MuleContext context)
    {
        MuleConfiguration conf = context.getConfiguration();
        return String.format("%s.%s.%s",
                             conf.getDomainId(),
                             conf.getClusterId(),
                             conf.getId());
    }
View Full Code Here

        return false;
    }

    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());
            defaultConfig.setUseExtendedTransformations(config.useExtendedTransformations());
            defaultConfig.setFlowEndingWithOneWayEndpointReturnsNull(config.isFlowEndingWithOneWayEndpointReturnsNull());
            defaultConfig.setDefaultExceptionStrategyName(config.getDefaultExceptionStrategyName());
            defaultConfig.setEnricherPropagatesSessionVariableChanges(config.isEnricherPropagatesSessionVariableChanges());
            defaultConfig.setExtensions(config.getExtensions());
            defaultConfig.setUseHttpTransportByDefault(config.useHttpTransportByDefault());
            validateDefaultExceptionStrategy();
            return configuration;
        }
        else
        {
            throw new ConfigurationException(MessageFactory.createStaticMessage("Unable to set properties on read-only MuleConfiguration: " + configuration.getClass()));
        }
    }
View Full Code Here

TOP

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

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.