Package org.switchyard.transform.xslt.internal

Examples of org.switchyard.transform.xslt.internal.TransformerPool.take()


    }

    @Test
    public void takeAndGive() throws Exception {
        TransformerPool pool = new TransformerPool(templates, 1);
        Transformer t1 = pool.take();
        Assert.assertNotNull(t1);
        pool.give(t1);
        Transformer t2 = pool.take();
        Assert.assertNotNull(t2);
        Assert.assertEquals(t1, t2);
View Full Code Here


    public void takeAndGive() throws Exception {
        TransformerPool pool = new TransformerPool(templates, 1);
        Transformer t1 = pool.take();
        Assert.assertNotNull(t1);
        pool.give(t1);
        Transformer t2 = pool.take();
        Assert.assertNotNull(t2);
        Assert.assertEquals(t1, t2);
    }
   
    @Test
View Full Code Here

   
    @Test
    public void blockOnTake() throws Exception {
        final TransformerPool pool = new TransformerPool(templates, 3);
        // draw down the pool
        pool.take();
        pool.take();
        final Transformer t = pool.take();
       
        // spin up a thread to offer back
        new Thread() {
View Full Code Here

    @Test
    public void blockOnTake() throws Exception {
        final TransformerPool pool = new TransformerPool(templates, 3);
        // draw down the pool
        pool.take();
        pool.take();
        final Transformer t = pool.take();
       
        // spin up a thread to offer back
        new Thread() {
            public void run() {
View Full Code Here

    public void blockOnTake() throws Exception {
        final TransformerPool pool = new TransformerPool(templates, 3);
        // draw down the pool
        pool.take();
        pool.take();
        final Transformer t = pool.take();
       
        // spin up a thread to offer back
        new Thread() {
            public void run() {
                try {
View Full Code Here

                }
            }
        }.start();
       
        // This will block until the give from our thread above
        Transformer t2 = pool.take();
        Assert.assertEquals(t, t2);
    }
   
}
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.