Package org.mule.util

Examples of org.mule.util.ExceptionHolder


        int i = 0;

        int numberOfThreads = 1;

        CountDownLatch latch = new CountDownLatch(numberOfThreads);
        ExceptionHolder exceptionHolder = new ExceptionHolder();
        try
        {
            for (int x = 0; x < numberOfThreads; x++)
            {
                Thread thread = new Thread(new ClientReceiver(latch, numRequests / numberOfThreads, exceptionHolder));
                thread.start();
            }


            for (i = 0; i < numRequests; i++)
            {
                if (i == getWarmUpMessages())
                {
                    stopWatch.start();
                }
                client.dispatch("CustomerRequests", requests[i % 3], null);
            }
        }
        finally
        {
            latch.await();
            stopWatch.stop();
            System.out.println("Total running time was: " + stopWatch.getTime() + "ms");
            System.out.println("Requests processed was: " + i);
            int mps = (int) (numRequests / ((double) stopWatch.getTime() / (double) 1000));
            System.out.println("Msg/sec: " + mps + " (warm up msgs = " + getWarmUpMessages() + ")");
            if(exceptionHolder.isExceptionThrown())
            {
                exceptionHolder.print();
                fail("Exceptions thrown during async processing");
            }
        }
    }
View Full Code Here


        int i = 0;

        int numberOfThreads = 1;

        CountDownLatch latch = new CountDownLatch(numberOfThreads);
        ExceptionHolder exceptionHolder = new ExceptionHolder();
        try
        {
            for (int x = 0; x < numberOfThreads; x++)
            {
                Thread thread = new Thread(new ClientReceiver(latch, numRequests / numberOfThreads, exceptionHolder));
                thread.start();
            }


            for (i = 0; i < numRequests; i++)
            {
                if (i == getWarmUpMessages())
                {
                    stopWatch.start();
                }
                client.dispatch("CustomerRequests", requests[i % 3], null);
            }
        }
        finally
        {
            latch.await();
            stopWatch.stop();
            System.out.println("Total running time was: " + stopWatch.getTime() + "ms");
            System.out.println("Requests processed was: " + i);
            int mps = (int) (numRequests / ((double) stopWatch.getTime() / (double) 1000));
            System.out.println("Msg/sec: " + mps + " (warm up msgs = " + getWarmUpMessages() + ")");
            if(exceptionHolder.isExceptionThrown())
            {
                exceptionHolder.print();
                fail("Exceptions thrown during async processing");
            }
        }
    }
View Full Code Here

        int i = 0;

        int numberOfThreads = 1;

        CountDownLatch latch = new CountDownLatch(numberOfThreads);
        ExceptionHolder exceptionHolder = new ExceptionHolder();
        try
        {
            for (int x = 0; x < numberOfThreads; x++)
            {
                Thread thread = new Thread(new ClientReceiver(latch, numRequests / numberOfThreads, exceptionHolder));
                thread.start();
            }


            for (i = 0; i < numRequests; i++)
            {
                if (i == getWarmUpMessages())
                {
                    stopWatch.start();
                }
                client.dispatch("CustomerRequests", requests[i % 3], null);
            }
        }
        finally
        {
            latch.await();
            stopWatch.stop();
            System.out.println("Total running time was: " + stopWatch.getTime() + "ms");
            System.out.println("Requests processed was: " + i);
            int mps = (int) (numRequests / ((double) stopWatch.getTime() / (double) 1000));
            System.out.println("Msg/sec: " + mps + " (warm up msgs = " + getWarmUpMessages() + ")");
            if(exceptionHolder.isExceptionThrown())
            {
                exceptionHolder.print();
                fail("Exceptions thrown during async processing");
            }
        }
    }
View Full Code Here

TOP

Related Classes of org.mule.util.ExceptionHolder

Copyright © 2018 www.massapicom. 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.