Package java.util.concurrent

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


  private void runProcess(final Process process, boolean allowParallel) {
    RunProcess r = new RunProcess(process, lock, allowParallel);
    Executor exec = (allowParallel ? (Executor) viewer.getExecutor() : null);
    if (exec != null) {
      exec.execute(r);
    } else {
      r.run();
    }
  }
}
View Full Code Here


        bridgeBroker(brokerA, proxyToB.getUrl().toString());
        bridgeBroker(brokerA, proxyToB.getUrl().toString());
        bridgeBroker(brokerA, brokerCUri);

        Executor e = Executors.newCachedThreadPool();
        e.execute(new Runnable() {
            public void run() {
                LOG.info("starting A");
                try {
                    brokerA.setNetworkConnectorStartAsync(true);
                    brokerA.start();
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

            future.setSuccess();
            fireChannelBound(channel, channel.getLocalAddress());

            Executor bossExecutor =
                ((NioServerSocketChannelFactory) channel.getFactory()).bossExecutor;
            bossExecutor.execute(
                    new IoWorkerRunnable(
                            new ThreadRenamingRunnable(
                                    new Boss(channel),
                                    "New I/O server boss #" + id +
                                    " (" + channel + ')')));
View Full Code Here

            localAddress = channel.getLocalAddress();
            fireChannelBound(channel, localAddress);

            Executor bossExecutor =
                ((OioServerSocketChannelFactory) channel.getFactory()).bossExecutor;
            bossExecutor.execute(
                    new IoWorkerRunnable(
                            new ThreadRenamingRunnable(
                                    new Boss(channel),
                                    "Old I/O server boss (" + channel + ')')));
            bossStarted = true;
View Full Code Here

            } else {
                SocketWrapper<Long> wrapper =
                        connections.get(Long.valueOf(socket));
                // Make sure connection hasn't been closed
                if (wrapper != null) {
                    executor.execute(new SocketProcessor(wrapper, status));
                }
            }
        } catch (RejectedExecutionException x) {
            log.warn("Socket processing request was rejected for:"+socket,x);
            return false;
View Full Code Here

                        if (executor == null) {
                            log.warn(sm.getString("endpoint.warn.noExector",
                                    socket, status));
                            return false;
                        } else {
                            executor.execute(proc);
                        }
                    } finally {
                        if (Constants.IS_SECURITY_ENABLED) {
                            PrivilegedAction<Void> pa = new PrivilegedSetTccl(loader);
                            AccessController.doPrivileged(pa);
View Full Code Here

        CountDownLatch readyForCommit = new CountDownLatch(2);
        CountDownLatch firstDone = new CountDownLatch(1);
       
        TransactedSend first = new TransactedSend(readyForCommit, firstDone, true);
        TransactedSend second = new TransactedSend(readyForCommit, firstDone, false);
        executor.execute(first);
        executor.execute(second);
       
        assertTrue("both started", readyForCommit.await(20, TimeUnit.SECONDS));
       
        LOG.info("commit out of order");       
View Full Code Here

        CountDownLatch firstDone = new CountDownLatch(1);
       
        TransactedSend first = new TransactedSend(readyForCommit, firstDone, true);
        TransactedSend second = new TransactedSend(readyForCommit, firstDone, false);
        executor.execute(first);
        executor.execute(second);
       
        assertTrue("both started", readyForCommit.await(20, TimeUnit.SECONDS));
       
        LOG.info("commit out of order");       
        // send interleaved so sequence id at time of commit could be reversed
View Full Code Here

                    final Runnable origRunnable = runnable;
                    runnable = new Runnable() {
                        public void run() {
                            outMessage.getExchange().put(Executor.class.getName()
                                                         + ".USING_SPECIFIED", Boolean.TRUE);
                            ex2.execute(origRunnable);
                        }
                    };
                }
                if (ex == null || forceWQ) {
                    WorkQueueManager mgr = outMessage.getExchange().get(Bus.class)
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.