Performs a synchronous execution.
506599
ExecutionResult executeSync(Supplier<ExecutionResult> supplier) {
    for (PolicyExecutor<Policy<Object>> policyExecutor : policyExecutors)
      supplier = policyExecutor.supply(supplier);

    ExecutionResult result = supplier.get();
    completed = result.isComplete();
    executor.handleComplete(result, this);
    return result;
  }
22709
public synchronized void execute( AsyncTask task ) throws JMSException
	{		
		AsyncTaskProcessorThread thread = threadPool.borrow(); // Dispatch using new borrowed thread
		if (thread != null)
		{
			thread.setTask(task);
			thread.execute();
		}
		else
		{
			// All threads are busy ...
			
			if (task.isMergeable())
			{
				if (!taskSet.add(task))
					return; // Already queued
			}
			
			// Enqueue task
			taskQueue.add(task);
		}
	}
769719
final void performAction(final AbstractEventQueue eventQueue, final Event<?> event) {
        final Event<T> eventObject = (Event<T>) event;

        try {
            action(eventObject);
        } catch (final Exception e) {
            LOGGER.log(Level.WARN, "Event perform failed", e);
        } finally { // remove event from event queue
            if (eventQueue instanceof SynchronizedEventQueue) {
                final SynchronizedEventQueue synchronizedEventQueue = (SynchronizedEventQueue) eventQueue;

                synchronizedEventQueue.removeEvent(eventObject);
            }
        }
    }
40049
public void execute() {
    try {
      Command command = new Parser().parse();
      try {
        command.execute(new ContextImpl(), execute);
        close();
      } catch (Exception e) {
        throw new RuntimeException(
            "Error while executing command " + command, e);
      } catch (AssertionError e) {
        throw new RuntimeException(
            "Error while executing command " + command, e);
      }
    } finally {
      try {
        reader.close();
      } catch (IOException e) {
        e.printStackTrace();
      }
      writer.close();
      try {
        close();
      } catch (SQLException e) {
        // ignore
      }
    }
  }
432965
@Override
    public void executeNext()
    {
        final LifecycleStage nextStage = getNextStage();
        if (nextStage == null) {
            throw new IllegalStateException("Lifecycle already hit the final stage!");
        }
        execute(nextStage);
    }
226169
public void execute() {

        ExecutorService executorService = MoreExecutors.sameThreadExecutor();

        for (Transaction<V, R> transaction : transactions) {
            if (!transaction.isComplete()) {
                executorService.execute(transaction);
            }
        }

        try {
            executorService.shutdown();
            executorService.awaitTermination(Long.MAX_VALUE, TimeUnit.MILLISECONDS);
        } catch (InterruptedException e) {
            throw new TransfuseTransactionException("Pool executor interrupted", e);
        }
    }
995190
@Override
   public void execute() {
       if(log.isDebugEnabled()) {
           log.debug("execute() starting for " + pages.size() + " pages.");
       }

       try {
           if (uriRoot == null) {
               if( pages.size() == 0 ) {
                   throw new JasperException(
                       Localizer.getMessage("jsp.error.jspc.missingTarget"));
               }
               String firstJsp = pages.get( 0 );
               File firstJspF = new File( firstJsp );
               if (!firstJspF.exists()) {
                   throw new JasperException(
                       Localizer.getMessage("jspc.error.fileDoesNotExist",
                                            firstJsp));
               }
               locateUriRoot( firstJspF );
           }

           if (uriRoot == null) {
               throw new JasperException(
                   Localizer.getMessage("jsp.error.jspc.no_uriroot"));
           }

           File uriRootF = new File(uriRoot);
           if (!uriRootF.isDirectory()) {
               throw new JasperException(
                   Localizer.getMessage("jsp.error.jspc.uriroot_not_dir"));
           }

           if(context == null) {
               initServletContext(initClassLoader());
           }

           // No explicit pages, we'll process all .jsp in the webapp
           if (pages.size() == 0) {
               scanFiles(uriRootF);
           }

           initWebXml();
           
           log.info("compiling with " + getThreads() + " threads");
           ExecutorService executor = Executors.newFixedThreadPool(getThreads());
           final List<JasperException> errorCollector = Collections.synchronizedList(new ArrayList<JasperException>());
           
           for (String nextjsp : pages) {            
               File fjsp = new File(nextjsp);
               if (!fjsp.isAbsolute()) {
                   fjsp = new File(uriRootF, nextjsp);
               }
               if (!fjsp.exists()) {
                   if (log.isWarnEnabled()) {
                       log.warn
                           (Localizer.getMessage
                            ("jspc.error.fileDoesNotExist", fjsp.toString()));
                   }
                   continue;
               }
               String s = fjsp.getAbsolutePath();
               if (s.startsWith(uriRoot)) {
                   nextjsp = s.substring(uriRoot.length());
               }
               if (nextjsp.startsWith("." + File.separatorChar)) {
                   nextjsp = nextjsp.substring(2);
               }
               
               final String jspToCompile = nextjsp;
               executor.execute(new Runnable() {
                public void run() {
                    try {
                        processFile(jspToCompile);
                    } catch (JasperException je) {
                        errorCollector.add(je);
                    }
                }
            });
           }
           
           executor.shutdown();
           executor.awaitTermination(compilationTimeoutMinutes, TimeUnit.MINUTES);
           
           if (errorCollector.size() > 0) {
               throwBuildException(errorCollector);
           }

           completeWebXml();

           if (addWebXmlMappings) {
               mergeIntoWebXml();
           }

       } catch (IOException ioe) {
           throw new BuildException(ioe);

       } catch (JasperException je) {
           throwBuildException(Arrays.asList(je));
       } catch (InterruptedException e) {
        throw new BuildException(e);
       } finally {
           if (loader != null) {
               LogFactory.release(loader);
           }
       }
   }
35452
private void executeCommand(long index, long sequence, long timestamp, ServerCommit commit, ServerSessionContext session, CompletableFuture<Result> future, ThreadContext context) {
    if (!log.isOpen()) {
      context.executor().execute(() -> future.completeExceptionally(new IllegalStateException("log closed")));
      return;
    }

    // If the session is already in an inactive state, complete the future exceptionally.
    if (!session.state().active()) {
      context.executor().execute(() -> future.completeExceptionally(new UnknownSessionException("inactive session: " + session.id())));
      return;
    }

    // Trigger scheduled callbacks in the state machine.
    executor.tick(index, timestamp);

    // Update the state machine context with the commit index and local server context. The synchronous flag
    // indicates whether the server expects linearizable completion of published events. Events will be published
    // based on the configured consistency level for the context.
    executor.init(commit.index(), commit.time(), ServerStateMachineContext.Type.COMMAND);

    // Store the event index to return in the command response.
    long eventIndex = session.getEventIndex();

    try {
      // Execute the state machine operation and get the result.
      Object output = executor.executeOperation(commit);

      // Once the operation has been applied to the state machine, commit events published by the command.
      // The state machine context will build a composite future for events published to all sessions.
      executor.commit();

      // Store the result for linearizability and complete the command.
      Result result = new Result(index, eventIndex, output);
      session.registerResult(sequence, result);
      context.executor().execute(() -> future.complete(result));
    } catch (Exception e) {
      // If an exception occurs during execution of the command, store the exception.
      Result result = new Result(index, eventIndex, e);
      session.registerResult(sequence, result);
      context.executor().execute(() -> future.complete(result));
    }
  }
664290
public <T> void executeAsync(Call call, ApiCallback<T> callback) {
        executeAsync(call, null, callback);
    }
1358637
synchronized void execute(File root, Runnable task) {
    if (executors == null) {
      throw new RuntimeException("AsyncDiskService is already shutdown");
    }
    ThreadPoolExecutor executor = executors.get(root);
    if (executor == null) {
      throw new RuntimeException("Cannot find root " + root
          + " for execution of task " + task);
    } else {
      executor.execute(task);
    }
  }
622673
function(){
                if (executionChainDone){
                    console.log('execution done !!!')
                    return;
                }
                if (i >= _middleware.length){

                    fn(request,response);
                }
                else{
                    mf = _middleware[i];
                    i++;
                    mf(request,response,next);
                }
            }
412360
@Override
    public void execute() {
        for (Task t : tasks) {
            if (t instanceof UnknownElement) {
                t.maybeConfigure();
                Object proxy = ((UnknownElement) t).getWrapper().getProxy();
                if (proxy instanceof AbstractTaskElement) {
                    ((AbstractTaskElement) proxy).setExpect(expect);
                }
            }
        }
        super.execute();
    }
1131979
@Override
	public void execute() {
		if (this.batches.isEmpty())
			return;
		
		// Reset the collection before making the call to eliminate callback chatter when
		// the batches call back to the master.
		List<Batch> old = this.batches;
		
		// Reset our batches
		this.batches = new ArrayList<Batch>();
		this.queryBatch = null;
		
		for (Batch batch: old) {
			batch.execute();
		}
	}
10115
private synchronized void ensureIsRun() {
        if (!isRun) {
            isRun = true;
            try {
                result = executeProc(args);
                exception = null;
            } catch (ProcError e) {
                throw e.asRuntimeException();
            } catch (Throwable t) {
                exception = t;
                result = null;
            }
        }
    }
1074844
public function execute()
	{
		// @event onBeforeExecute

		// Perform application routines.
		$this->doExecute();

		// @event onAfterExecute

		// If gzip compression is enabled in configuration and the server is compliant, compress the output.
		if ($this->get('gzip') && !ini_get('zlib.output_compression') && (ini_get('output_handler') != 'ob_gzhandler'))
		{
			$this->compress();
		}

		// @event onBeforeRespond

		// Send the application response.
		$this->respond();

		// @event onAfterRespond
	}
1256194
public function execute()
    {
        $queue = P\queue();

        while ($this->handles || !$queue->isEmpty()) {
            // If there are no transfers, then sleep for the next delay
            if (!$this->active && $this->delays) {
                usleep($this->timeToNext());
            }
            $this->tick();
        }
    }
619906
void runAsync() {
        // Determine if a task is running. If so, record the fact we want to have it run again, otherwise reserve our spot.
        synchronized (this) {
            Exceptions.checkNotClosed(this.closed, this);
            if (this.running) {
                this.runAgain = true;
                return;
            }

            this.running = true;
        }

        // Execute the task.
        runInternal();
    }