Package java.util.concurrent

Examples of java.util.concurrent.ThreadPoolExecutor.execute()


        final Map<String, File> descriptors = new HashMap<String, File>();
        for (FileSet fs : descriptorSets) {
            final DirectoryScanner ds = fs.getDirectoryScanner(getProject());
            final String[] files = ds.getIncludedFiles();
            for (final String file : files) {
                executor.execute(new Runnable() {
                    public void run() {
                        buildPlugin(descriptors, new File(ds.getBasedir(), file));
                    }
                });
            }
View Full Code Here


                    connector.setDurableDestinations(durableDestinations);
                    if (getDefaultSocketURIString() != null) {
                        connector.setBrokerURL(getDefaultSocketURIString());
                    }
                    if (networkConnectorStartExecutor != null) {
                        networkConnectorStartExecutor.execute(new Runnable() {
                            public void run() {
                                try {
                                    LOG.info("Async start of " + connector);
                                    connector.start();
                                } catch(Exception e) {
View Full Code Here

                    // Listen on main socket
                    Socket clientSocket = mainSocket.accept();
                    if (running) {
                        // Pass request to new thread
                        if(threadPoolExecutor != null) {
                            threadPoolExecutor.execute(new HttpMirrorThread(clientSocket));
                        } else {
                            Thread thd = new Thread(new HttpMirrorThread(clientSocket));
                            log.debug("Starting new Mirror thread");
                            thd.start();
                        }
View Full Code Here

                    if (getDefaultSocketURIString() != null) {
                        connector.setBrokerURL(getDefaultSocketURIString());
                    }
                    if (networkConnectorStartExecutor != null) {
                        final Map context = MDCHelper.getCopyOfContextMap();
                        networkConnectorStartExecutor.execute(new Runnable() {
                            public void run() {
                                try {
                                    MDCHelper.setContextMap(context);
                                    LOG.info("Async start of " + connector);
                                    connector.start();
View Full Code Here

        }
        if (p == null) {
            throw new IllegalStateException("ThreadPool has been stopped");
        }
        Runnable task = new ContextClassLoaderRunnable(command, classLoader);
        p.execute(task);
    }

    private synchronized void startWork(String consumerName) {
        Integer test = clients.get(consumerName);
        if (test == null) {
View Full Code Here

        ThreadPoolExecutor executor = new ThreadPoolExecutor(5, 5, 0, TimeUnit.SECONDS,
                                                             new ArrayBlockingQueue<Runnable>(10));
        CountDownLatch startSignal = new CountDownLatch(1);
        CountDownLatch doneSignal = new CountDownLatch(5);
       
        executor.execute(new BookWorker("http://localhost:" + PORT + "/bookstore/" + pathSegment + "/1",
                                        "1",
                                        "CXF in Action1", startSignal, doneSignal));
        executor.execute(new BookWorker("http://localhost:" + PORT + "/bookstore/" + pathSegment + "/2",
                                        "2",
                                        "CXF in Action2", startSignal, doneSignal));
View Full Code Here

        CountDownLatch doneSignal = new CountDownLatch(5);
       
        executor.execute(new BookWorker("http://localhost:" + PORT + "/bookstore/" + pathSegment + "/1",
                                        "1",
                                        "CXF in Action1", startSignal, doneSignal));
        executor.execute(new BookWorker("http://localhost:" + PORT + "/bookstore/" + pathSegment + "/2",
                                        "2",
                                        "CXF in Action2", startSignal, doneSignal));
        executor.execute(new BookWorker("http://localhost:" + PORT + "/bookstore/" + pathSegment + "/3",
                                        "3",
                                        "CXF in Action3", startSignal, doneSignal));
View Full Code Here

                                        "1",
                                        "CXF in Action1", startSignal, doneSignal));
        executor.execute(new BookWorker("http://localhost:" + PORT + "/bookstore/" + pathSegment + "/2",
                                        "2",
                                        "CXF in Action2", startSignal, doneSignal));
        executor.execute(new BookWorker("http://localhost:" + PORT + "/bookstore/" + pathSegment + "/3",
                                        "3",
                                        "CXF in Action3", startSignal, doneSignal));
        executor.execute(new BookWorker("http://localhost:" + PORT + "/bookstore/" + pathSegment + "/4",
                                        "4",
                                        "CXF in Action4", startSignal, doneSignal));
View Full Code Here

                                        "2",
                                        "CXF in Action2", startSignal, doneSignal));
        executor.execute(new BookWorker("http://localhost:" + PORT + "/bookstore/" + pathSegment + "/3",
                                        "3",
                                        "CXF in Action3", startSignal, doneSignal));
        executor.execute(new BookWorker("http://localhost:" + PORT + "/bookstore/" + pathSegment + "/4",
                                        "4",
                                        "CXF in Action4", startSignal, doneSignal));
        executor.execute(new BookWorker("http://localhost:" + PORT + "/bookstore/" + pathSegment + "/5",
                                        "5",
                                        "CXF in Action5", startSignal, doneSignal));
View Full Code Here

                                        "3",
                                        "CXF in Action3", startSignal, doneSignal));
        executor.execute(new BookWorker("http://localhost:" + PORT + "/bookstore/" + pathSegment + "/4",
                                        "4",
                                        "CXF in Action4", startSignal, doneSignal));
        executor.execute(new BookWorker("http://localhost:" + PORT + "/bookstore/" + pathSegment + "/5",
                                        "5",
                                        "CXF in Action5", startSignal, doneSignal));
       
        startSignal.countDown();
        doneSignal.await(60, TimeUnit.SECONDS);
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.