Package org.mule.api.config

Examples of org.mule.api.config.MuleConfiguration


        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";
        ImmutableThreadingProfile threadingProfile = createMuleWorkManager();
        return new MuleWorkManager(threadingProfile, threadPrefix, config.getShutdownTimeout());
    }
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(),
                             context.getClusterId(),
                             conf.getId());
    }
View Full Code Here

        {
            if (muleContext != null && !(muleContext.isDisposed() || muleContext.isDisposing()))
            {
                muleContext.dispose();

                MuleConfiguration configuration = muleContext.getConfiguration();

                if (configuration != null)
                {
                    final String workingDir = configuration.getWorkingDirectory();
                    // do not delete TM recovery object store, everything else is good to
                    // go
                    FileUtils.deleteTree(FileUtils.newFile(workingDir), IGNORED_DOT_MULE_DIRS);
                }
            }
View Full Code Here

    public void testMuleMessageInput()
    {
        RegExFilter filter = new RegExFilter("The quick (.*)");
        assertNotNull(filter.getPattern());

        MuleConfiguration muleConfiguration = mock(MuleConfiguration.class);
        when(muleConfiguration.isCacheMessageAsBytes()).thenReturn(false);
        MuleContext muleContext= mock(MuleContext.class);
        when(muleContext.getConfiguration()).thenReturn(muleConfiguration);

        MuleMessage message = new DefaultMuleMessage("The quick brown fox", muleContext);
        assertTrue(filter.accept(message));
View Full Code Here

    private void initMockMuleContext() throws IOException
    {
        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());
        when(mockMuleContext.getExecutionClassLoader()).thenReturn(getClass().getClassLoader());
View Full Code Here

        return new PartitionedInMemoryObjectStore<>();
    }

    private PartitionableObjectStore<?> createPersistentPartitionableObjectStore(MuleContext muleContext)
    {
        MuleConfiguration muleConfiguration = mock(MuleConfiguration.class);
        when(muleConfiguration.getWorkingDirectory()).thenReturn(tempWorkDir.getRoot().getAbsolutePath());
        when(muleContext.getConfiguration()).thenReturn(muleConfiguration);

        return new PartitionedPersistentObjectStore<>(muleContext);
    }
View Full Code Here

    @Before
    public void setup()
    {
        Mockito.when(muleSession.getId()).thenReturn("1");
        MuleConfiguration muleConfiguration = Mockito.mock(MuleConfiguration.class);
        Mockito.when(muleContext.getConfiguration()).thenReturn(muleConfiguration);
    }
View Full Code Here

    @Override
    protected TransactionalQueueManager createQueueManager() throws Exception
    {
        TransactionalQueueManager mgr = new TransactionalQueueManager();
        MuleConfiguration mockConfiguration = Mockito.mock(MuleConfiguration.class);
        Mockito.when(mockConfiguration.getWorkingDirectory()).thenReturn(temporaryFolder.getRoot().getAbsolutePath());
        ((DefaultMuleContext)muleContext).setMuleConfiguration(mockConfiguration);
        mgr.setMuleContext(muleContext);
        mgr.initialise();
        mgr.setDefaultQueueConfiguration(new DefaultQueueConfiguration(0, true));
        return mgr;
View Full Code Here

        mutableConfig.setDefaultEncoding("UTF-16");
        mutableConfig.setWorkingDirectory(workingDirectory);
        mutableConfig.setId("MY_SERVER");
        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_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

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.