Package java.util.concurrent

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


    private void applyToBugs(final BugAction bugAction) {
        Executor executor = backgroundExecutor;

        final AtomicInteger shownErrorMessages = new AtomicInteger(0);
        for (final BugInstance bug : getSelectedBugs()) {
            executor.execute(new Runnable() {
                @Override
                public void run() {
                    if (shownErrorMessages.get() > 5) {
                        // 5 errors? let's just stop trying.
                        return;
View Full Code Here


            invocation.run();
        } else {
            exchange.put(Executor.class, executor);
            FutureTask<Object> o = new FutureTask<Object>(invocation, null);
            synchronized (o) {
                executor.execute(o);
                if (!exchange.isOneWay()) {
                    if (!o.isDone()) {
                        try {
                            o.wait();
                        } catch (InterruptedException e) {
View Full Code Here

                                executor = wqm.getAutomaticWorkQueue();
                            }   
                        }
                        if (executor != null) {
                            try {
                                executor.execute(new JMSExecutor(message));
                                message = null;
                            } catch (RejectedExecutionException ree) {
                                //FIXME - no room left on workqueue, what to do
                                //for now, loop until it WILL fit on the queue,
                                //although we could just dispatch on this thread.
View Full Code Here

            changeMergeInterval(channels[i]);
            changeViewBundling(channels[i]);
        }

        for(final Task t:tasks) {
            executor.execute(t);
        }

        try {
            // Wait for all channels to finish connecting
            latch.await();
View Full Code Here

            public void execute(Runnable command) {
                Executor ex = getExecutor();
                if (ex == null) {
                    ex = OneShotAsyncExecutor.getInstance();
                }
                ex.execute(command);
            }
        });
        configureObject(service);
               
        // Configure the JaxWsEndpoitnImpl
View Full Code Here

            } else {
                LOG.log(Level.FINE, "Using endpoint executor {0}", executor.getClass().getName());
            }
           
            try {
                executor.execute(this);
            } catch (RejectedExecutionException ex) {
                LOG.log(Level.SEVERE, "RESEND_INITIATION_FAILED_MSG", ex);
            }
        }
View Full Code Here

            };
            Executor ex = reliableEndpoint.getApplicationEndpoint().getExecutor();
            if (ex == null) {
                ex = SynchronousExecutor.getInstance();
            }
            ex.execute(r);
            return null;
        }
       
       
        Object resp = invoke(oi, protocol, new Object[] {send}, context, exchange);
View Full Code Here

                    }
                } else {
                    outMessage.getExchange().put(Executor.class.getName()
                                                 + ".USING_SPECIFIED", Boolean.TRUE);
                }
                ex.execute(runnable);
            }
        }
        protected void handleResponseInternal() throws IOException {
            Exchange exchange = outMessage.getExchange();
            int responseCode = connection.getResponseCode();
View Full Code Here

    Executor executor = Executors.newFixedThreadPool(clientThreads);
    // Run many clients to make server reach its maximum number of threads
    final CountDownLatch ready = new CountDownLatch(clientThreads);
    final CountDownLatch start = new CountDownLatch(1);
    for (int i = 0; i < clientThreads; i++) {
      executor.execute(new Runnable() {
        @Override
        public void run() {
          ready.countDown();
          try {
            start.await();
View Full Code Here

                    }
                } else {
                    outMessage.getExchange().put(Executor.class.getName()
                                                 + ".USING_SPECIFIED", Boolean.TRUE);
                }
                ex.execute(runnable);
            }
        }
        protected void handleResponseInternal() throws IOException {
            Exchange exchange = outMessage.getExchange();
            int responseCode = connection.getResponseCode();
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.