Examples of PoolingProfile


Examples of org.mule.config.PoolingProfile

    }
   
    @Test
    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

    }

    @Test
    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

        assertEquals(MAX_ACTIVE, objectFactory.getInstanceCount());
    }

    private ObjectPool createPoolWithExhaustedAction(int exhaustedAction) throws Exception
    {
        PoolingProfile poolingProfile = createDefaultPoolingProfile();
        poolingProfile.setExhaustedAction(exhaustedAction);

        ObjectFactory objectFactory = new BananaFactory();
        return createPool(poolingProfile, objectFactory);
    }
View Full Code Here

Examples of org.mule.config.PoolingProfile

        return createPool(poolingProfile, objectFactory);
    }

    private ObjectPool createPoolWithInitialisationPolicy(int initPolicy) throws Exception
    {
        PoolingProfile poolingProfile = createDefaultPoolingProfile();
        poolingProfile.setInitialisationPolicy(initPolicy);
       
        ObjectFactory objectFactory = new CountingObjectFactory();
        return createPool(poolingProfile, objectFactory);
    }
View Full Code Here

Examples of org.mule.config.PoolingProfile

        assertEquals("stopped", borrowed.getState());
    }

    private DefaultLifecycleEnabledObjectPool createObjectPool() throws Exception
    {
        PoolingProfile poolingProfile = createDefaultPoolingProfile();
        ObjectFactory objectFactory = createDefaultObjectFactory();
        DefaultLifecycleEnabledObjectPool pool =
            new DefaultLifecycleEnabledObjectPool(objectFactory, poolingProfile, muleContext);
       
        pool.initialise();
View Full Code Here

Examples of org.mule.config.PoolingProfile

    protected static final int MAX_IDLE = -1;
    protected static final long MAX_WAIT = 1500;

    protected PoolingProfile createDefaultPoolingProfile()
    {
        PoolingProfile poolingProfile = new PoolingProfile();
        poolingProfile.setExhaustedAction(DEFAULT_EXHAUSTED_ACTION);
        poolingProfile.setInitialisationPolicy(DEFAULT_INITIALISATION_POLICY);
        poolingProfile.setMaxActive(MAX_ACTIVE);
        poolingProfile.setMaxIdle(MAX_IDLE);
        poolingProfile.setMaxWait(MAX_WAIT);
        return poolingProfile;
    }
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

    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

    private void validatePoolingProfile(Flow service)
    {
        assertNotNull(((PooledJavaComponent) service.getMessageProcessors().get(0)).getPoolingProfile());
        assertNotNull(((PooledJavaComponent) service.getMessageProcessors().get(0)).getPoolingProfile());

        PoolingProfile profile = ((PooledJavaComponent) service.getMessageProcessors().get(0)).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

        {           
            assertTrue(((Flow)o).getMessageProcessors().get(0) instanceof PooledJavaComponent);
            pjc = (PooledJavaComponent) ((Flow)o).getMessageProcessors().get(0);
        }
       
        PoolingProfile profile = pjc.getPoolingProfile();
        assertNotNull(profile);
        assertEquals("exhausted:", exhausted, profile.getExhaustedAction());
        assertEquals("initialisation:", initialisation, profile.getInitialisationPolicy());
        assertEquals("active:", active, profile.getMaxActive());
        assertEquals("idle:", idle, profile.getMaxIdle());
        assertEquals("wait:", wait, profile.getMaxWait());
    }
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.