Examples of PoolingProfile


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

    {
        Service c = muleContext.getRegistry().lookupService(service);
        assertNotNull(service, c);
        assertTrue(c.getComponent() instanceof PooledJavaComponent);
        PooledJavaComponent pjc = (PooledJavaComponent)c.getComponent();
        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

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

{   
    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

        assertEquals(2, component.lifecycleAdapterPool.getNumActive());
    }

    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

        }
    }

    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

        }
    }

    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.