Examples of PoolingProfile


Examples of org.mule.config.PoolingProfile

        assertTrue(totalTime >= borrowerWait);
    }
   
    public void testGrowOnExhaust() throws Exception
    {
        PoolingProfile pp = createDefaultPoolingProfile();
        pp.setExhaustedAction(PoolingProfile.WHEN_EXHAUSTED_GROW);
       
        PooledJavaComponent component = createPooledComponent(pp);

        borrowLifecycleAdaptersUntilPoolIsFull(component);
View Full Code Here

Examples of org.mule.config.PoolingProfile

        assertEquals(MAX_ACTIVE + 1, component.lifecycleAdapterPool.getNumActive());
    }

    public void testClearPool() throws Exception
    {
        PoolingProfile pp = createDefaultPoolingProfile();
        pp.setExhaustedAction(PoolingProfile.WHEN_EXHAUSTED_FAIL);
       
        PooledJavaComponent component = createPooledComponent(pp);

        LifecycleAdapter borrowed = component.borrowComponentLifecycleAdaptor();
        assertEquals(1, component.lifecycleAdapterPool.getNumActive());
View Full Code Here

Examples of org.mule.config.PoolingProfile

    private void validatePoolingProfile(Service service)
    {
        assertNotNull(((PooledJavaComponent) service.getComponent()).getPoolingProfile());
        assertNotNull(((PooledJavaComponent) service.getComponent()).getPoolingProfile());

        PoolingProfile profile = ((PooledJavaComponent) service.getComponent()).getPoolingProfile();
        assertNotNull(profile);
        assertEquals("exhausted:", PoolingProfile.WHEN_EXHAUSTED_FAIL, profile.getExhaustedAction());
        assertEquals("initialisation:", PoolingProfile.INITIALISE_ALL, profile.getInitialisationPolicy());
        assertEquals("active:", 1, profile.getMaxActive());
        assertEquals("idle:", 2, profile.getMaxIdle());
        assertEquals("wait:", 3, profile.getMaxWait());
    }
View Full Code Here

Examples of org.mule.config.PoolingProfile

//        assertEquals(PoolingProfile.INITIALISE_ONE, pp.getInitialisationPolicy());
//        assertTrue(pp.getPoolFactory() instanceof CommonsPoolFactory);

        // test per-descriptor overrides
        Service service = muleContext.getRegistry().lookupService("appleComponent2");
        PoolingProfile pp = ((PooledJavaComponent)service.getComponent()).getPoolingProfile();

        assertEquals(9, pp.getMaxActive());
        assertEquals(6, pp.getMaxIdle());
        assertEquals(4002, pp.getMaxWait());
        assertEquals(PoolingProfile.WHEN_EXHAUSTED_FAIL, pp.getExhaustedAction());
        assertEquals(PoolingProfile.INITIALISE_ALL, pp.getInitialisationPolicy());
    }
View Full Code Here

Examples of org.mule.config.PoolingProfile

        MuleDescriptor d = new MuleDescriptor(name);
        d.setImplementation(BenchmarkComponent.class.getName());
        d.setThreadingProfile(new ThreadingProfile(config.getThreads(), config.getThreads(), -1, (byte) 4, null, null));
        d.setQueueProfile(new QueueProfile(config.getQueue(), false));
        d.setPoolingProfile(new PoolingProfile(config.getThreads(), config.getThreads(), 0, (byte) 2, PoolingProfile.POOL_INITIALISE_ALL_COMPONENTS));
        d.setInboundEndpoint(ConnectorFactory.createEndpoint(inbound, UMOEndpoint.ENDPOINT_TYPE_RECEIVER));

        if (outbound != null) {
            d.setOutboundEndpoint(ConnectorFactory.createEndpoint(outbound, UMOEndpoint.ENDPOINT_TYPE_SENDER));
        }
View Full Code Here

Examples of org.mule.config.PoolingProfile

        {
            queueProfile = QueueProfile.newInstancePersistingToDefaultMemoryQueueStore(muleContext);
        }
        if (poolingProfile == null)
        {
            poolingProfile = new PoolingProfile();
        }
        super.initialise();
    }
View Full Code Here

Examples of org.mule.config.PoolingProfile

    @Test
    public void testComponentCreation() throws Exception
    {
        PrototypeObjectFactory objectFactory = getDefaultObjectFactory();

        PoolingProfile pp = createDefaultPoolingProfile();
        pp.setExhaustedAction(PoolingProfile.WHEN_EXHAUSTED_FAIL);

        PooledJavaComponent component = new PooledJavaComponent(objectFactory, pp);
        component.setMuleContext(muleContext);
        assertNotNull(component.getObjectFactory());
        assertEquals(objectFactory, component.getObjectFactory());
View Full Code Here

Examples of org.mule.config.PoolingProfile

    }

    @Test
    public void testFailOnExhaust() throws Exception
    {
        PoolingProfile pp = createDefaultPoolingProfile();
        pp.setExhaustedAction(PoolingProfile.WHEN_EXHAUSTED_FAIL);
       
        PooledJavaComponent component = createPooledComponent(pp);
        borrowLifecycleAdaptersUntilPoolIsFull(component);

        try
View Full Code Here

Examples of org.mule.config.PoolingProfile

    }

    @Test
    public void testBlockExpiryOnExhaust() throws Exception
    {
        PoolingProfile pp = createDefaultPoolingProfile();
        pp.setExhaustedAction(PoolingProfile.WHEN_EXHAUSTED_WAIT);
       
        PooledJavaComponent component = createPooledComponent(pp);
        assertEquals(0, component.lifecycleAdapterPool.getNumActive());
       
        borrowLifecycleAdaptersUntilPoolIsFull(component);
View Full Code Here

Examples of org.mule.config.PoolingProfile

    }

    @Test
    public void testBlockOnExhaust() throws Exception
    {
        PoolingProfile pp = createDefaultPoolingProfile();
        pp.setExhaustedAction(PoolingProfile.WHEN_EXHAUSTED_WAIT);
       
        PooledJavaComponent component = createPooledComponent(pp);
        assertEquals(0, component.lifecycleAdapterPool.getNumActive());

        // borrow all but one lifecycle adapters
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.