Examples of ThreadingProfile


Examples of org.mule.api.config.ThreadingProfile

    }

    private TestConnector createConnectorWithSingleObjectDispatcherPool(int exhaustedAction) throws Exception
    {
        TestConnector connector = new TestConnector(muleContext);
        ThreadingProfile threadingProfile = new ImmutableThreadingProfile(1, 1, 1, 1, 1, exhaustedAction,
            true, null, null);
        connector.setDispatcherThreadingProfile(threadingProfile);
        connector.createReceiver(getTestService(), getTestInboundEndpoint("test", "test://test"));
        muleContext.getRegistry().registerConnector(connector);
        return connector;
View Full Code Here

Examples of org.mule.api.config.ThreadingProfile

                newWorkManager.start();
            }
        }
        if (dispatcherWorkManager.get() == null)
        {
            ThreadingProfile dispatcherThreadingProfile = this.getDispatcherThreadingProfile();
            if (dispatcherThreadingProfile.getMuleContext() == null)
            {
                dispatcherThreadingProfile.setMuleContext(muleContext);
            }

            final String threadPrefix = ThreadNameHelper.dispatcher(muleContext, getName());
            WorkManager newWorkManager = dispatcherThreadingProfile.createWorkManager(
                    threadPrefix, muleContext.getConfiguration().getShutdownTimeout());

            if (dispatcherWorkManager.compareAndSet(null, newWorkManager))
            {
                newWorkManager.start();
View Full Code Here

Examples of org.mule.api.config.ThreadingProfile

            .getDefaultQueueTimeout();

        initQueueStore(muleContext);

        QueueProfile queueProfile = new QueueProfile(maxQueueSize, queueStore);
        ThreadingProfile threadingProfile = createThreadingProfile(muleContext);
        String stageName = nameSource.getName();
        return new LaxSedaStageInterceptingMessageProcessor(getThreadPoolName(stageName, muleContext),
            stageName, queueProfile, timeout, threadingProfile, queueStatistics, muleContext);
    }
View Full Code Here

Examples of org.mule.api.config.ThreadingProfile

    public void doStart() throws MuleException
    {
        // Connector property overrides any implied value
        this.setUseMultipleTransactedReceivers(connector.isCreateMultipleTransactedReceivers());

        ThreadingProfile tp = connector.getReceiverThreadingProfile();
        int numReceiversToStart = 1;

        if (this.isReceiveMessagesInTransaction() && this.isUseMultipleTransactedReceivers()
                && tp.isDoThreading())
        {
            numReceiversToStart = connector.getNumberOfConcurrentTransactedReceivers();
        }

        for (int i = 0; i < numReceiversToStart; i++)
View Full Code Here

Examples of org.mule.api.config.ThreadingProfile

{

    @Test
    public void defaultThreadPoolFactory() throws Exception
    {
        final ThreadingProfile tp = muleContext.getDefaultThreadingProfile();
        final ThreadPoolFactory pf = tp.getPoolFactory();
        assertThat(pf, instanceOf(DefaultThreadPoolFactory.class));
    }
View Full Code Here

Examples of org.mule.api.config.ThreadingProfile

    }

    @Test
    public void scheduledThreadPollDefaults() throws Exception
    {
        ThreadingProfile threadingProfile = muleContext.getDefaultThreadingProfile();
        ScheduledExecutorService executorService = threadingProfile.createScheduledPool("sapo pepe");
        assertThat(executorService, notNullValue());
        assertThat(executorService, instanceOf(ScheduledThreadPoolExecutor.class));
        ScheduledThreadPoolExecutor scheduledPool = (ScheduledThreadPoolExecutor) executorService;
        assertThat(scheduledPool.getContinueExistingPeriodicTasksAfterShutdownPolicy(), is(false));
        assertThat(scheduledPool.getExecuteExistingDelayedTasksAfterShutdownPolicy(), is(true));
        assertThat(scheduledPool.getMaximumPoolSize(), is(threadingProfile.getMaxThreadsActive()));
        assertThat(scheduledPool.getCorePoolSize(), is(threadingProfile.getMaxThreadsIdle()));
        assertThat(scheduledPool.getKeepAliveTime(TimeUnit.MILLISECONDS),is(threadingProfile.getThreadTTL()));
    }
View Full Code Here

Examples of org.mule.api.config.ThreadingProfile

    }

    @Test
    public void scheduledThreadPollRejectHandler() throws Exception
    {
        ThreadingProfile threadingProfile = muleContext.getDefaultThreadingProfile();
        ThreadPoolExecutor.DiscardOldestPolicy expectedRejectedExecutionHandler = new ThreadPoolExecutor.DiscardOldestPolicy();
        threadingProfile.setRejectedExecutionHandler(expectedRejectedExecutionHandler);
        ScheduledExecutorService executorService = threadingProfile.createScheduledPool("sapo pepe");
        ScheduledThreadPoolExecutor scheduledPool = (ScheduledThreadPoolExecutor) executorService;
        assertThat(scheduledPool.getRejectedExecutionHandler(), is((RejectedExecutionHandler) expectedRejectedExecutionHandler));
    }
View Full Code Here

Examples of org.mule.api.config.ThreadingProfile

            .getDefaultQueueTimeout();

        initQueueStore(muleContext);

        QueueProfile queueProfile = new QueueProfile(maxQueueSize, queueStore);
        ThreadingProfile threadingProfile = createThreadingProfile(muleContext);
        String stageName = nameSource.getName();
        return new SedaStageInterceptingMessageProcessor(ThreadNameHelper.flow(muleContext, stageName),
            stageName, queueProfile, timeout, threadingProfile, queueStatistics, muleContext);
    }
View Full Code Here

Examples of org.mule.api.config.ThreadingProfile

            nameSource.getName(), muleContext), muleContext.getConfiguration().getShutdownTimeout());
    }

    protected ThreadingProfile createThreadingProfile(MuleContext muleContext)
    {
        ThreadingProfile threadingProfile = new ChainedThreadingProfile(
            muleContext.getDefaultThreadingProfile());
        if (maxThreads != null) threadingProfile.setMaxThreadsActive(maxThreads);
        if (minThreads != null) threadingProfile.setMaxThreadsIdle(minThreads);
        if (maxBufferSize != null) threadingProfile.setMaxBufferSize(maxBufferSize);
        if (threadTTL != null) threadingProfile.setThreadTTL(threadTTL);
        if (threadWaitTimeout != null) threadingProfile.setThreadWaitTimeout(threadWaitTimeout);
        if (poolExhaustedAction != null) threadingProfile.setPoolExhaustedAction(poolExhaustedAction);
        threadingProfile.setMuleContext(muleContext);
        return threadingProfile;
    }
View Full Code Here

Examples of org.mule.api.config.ThreadingProfile

        muleContext.getRegistry().registerObject(DefaultMuleContext.LOCAL_QUEUE_MANAGER_KEY, queueManager);
    }

    protected void configureThreadingProfiles(MuleRegistry registry) throws RegistrationException
    {
        ThreadingProfile defaultThreadingProfile = new ChainedThreadingProfile();
        registry.registerObject(MuleProperties.OBJECT_DEFAULT_THREADING_PROFILE, defaultThreadingProfile);

        registry.registerObject(MuleProperties.OBJECT_DEFAULT_MESSAGE_RECEIVER_THREADING_PROFILE,
            new ChainedThreadingProfile(defaultThreadingProfile));
        registry.registerObject(MuleProperties.OBJECT_DEFAULT_MESSAGE_REQUESTER_THREADING_PROFILE,
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.