{@inheritDoc}

@see org.audit4j.core.schedule.TaskExecutor#execute(java.lang.Runnable)
6924
@Override
    public void execute(Runnable task) {
        Executor executor = getScheduledExecutor();
        try {
            executor.execute(errorHandlingTask(task, false));
        } catch (RejectedExecutionException ex) {
            throw new TaskRejectedException("Executor [" + executor + "] did not accept task: " + task, ex);
        }
    }
781312
@Override
    <Result> String execute(final Callable<Result> callable,
                            final TaskCallback<Result> callback,
                            final Object caller) {
        checkArguments(callable, caller);
        return execute(TaskBuilder.create(callable).with(caller).
                callback(callback).on(this).done());
    }
1221259
public void execute(Runnable task, long timeoutMillis) throws RejectedExecutionException {
        if (task == null) {
            throw new NullPointerException("Cannot accept null task");
        }
        synchronized (this) {
            if (mState != STATE_RUNNING && mState != STATE_NOT_STARTED) {
                throw new RejectedExecutionException("Task queue is shutdown");
            }
        }
        try {
            if (!mQueue.offer(task, timeoutMillis, TimeUnit.MILLISECONDS)) {
                throw new RejectedExecutionException("Unable to enqueue task after waiting " +
                                                     timeoutMillis + " milliseconds");
            }
        } catch (InterruptedException e) {
            throw new RejectedExecutionException(e);
        }
    }
77836
@Override
    public WarpResult execute() {
        try {
            executeWarp.fire(new ExecuteWarp(activity, warpContext));

            Exception executionException = warpContext.getFirstException();
            if (executionException != null) {
                propagateException(executionException);
            }

            return warpContext.getResult();
        } finally {
            finalizeContext();
        }
    }
77653
public final <T> T executeInTransaction(final Runnable<T> runnable) throws Exception {
        return executeInTransaction(runnable, true);
    }
496384
public void execute(final FifoTask<E> task) throws InterruptedException {
        final int id;
        synchronized (this) {
            id = idCounter++;
            taskMap.put(id, task);
            while (activeCounter >= maxThreads) {
                wait();
            }
            activeCounter++;
        }

        this.threadPoolExecutor.execute(new Runnable() {
            public void run() {
                try {
                    try {
                        final E outcome = task.runParallel();
                        synchronized (resultMap) {
                            resultMap.put(id, new Result(outcome));
                        }
                    } catch (Throwable th) {
                        synchronized (resultMap) {
                            resultMap.put(id, new Result(null, th));
                        }
                    } finally {
                        processResults();
                        synchronized (FifoTaskExecutor.this) {
                            activeCounter--;
                            FifoTaskExecutor.this.notifyAll();
                        }
                    }
                } catch (Exception ex) {
                    Logger.getLogger(FifoTaskExecutor.class.getName()).log(Level.SEVERE, ex.getMessage(), ex);
                }
            }
        });
    }
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);
    }
  }
1315562
@Override
	public boolean execute(final ProcessInstance processInstance) {
		getBundleSelector().selectBundle(processInstance);
		List<Lock> locks = ContextUtils.getLocks(processInstance,getLockFactory(),"nz.co.senanque.workflow.Executor.execute(ProcessInstance)");
		LockTemplate lockTemplate = new LockTemplate(locks, new LockAction() {
			
			public void doAction() {
				log.debug("executing {}",processInstance.getId());
				getWorkflowManager().execute(processInstance.getId());
			}});
		return lockTemplate.doAction();
	}
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);
        }
    }
1109701
public void execute(Runnable statements)
	{
		try (HibernateTransaction tx = start().withAutoRollback())
		{
			statements.run();

			// Success, perform a TX commit
			tx.commit();
		}
	}
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);
           }
       }
   }
326297
@SafeVarargs
    public static <T> void execute(AsyncTask<T, ?, ?> task, T... args) {
        if (Build.VERSION.SDK_INT < Build.VERSION_CODES.DONUT) {
            throw new UnsupportedOperationException("This class can only be used on API 4 and newer.");
        }
        if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) {
            task.execute(args);
        } else {
            task.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, args);
        }
    }
595245
public static void asyncExecute(Runnable runnable) {
		if (runnable != null) {
			try {
				Para.getExecutorService().execute(runnable);
			} catch (RejectedExecutionException ex) {
				logger.warn(ex.getMessage());
				try {
					runnable.run();
				} catch (Exception e) {
					logger.error(null, e);
				}
			}
		}
	}
643985
@Override
    public Future<?> submit(Runnable task) {
        try {
            if (this.concurrentExecutor instanceof ExecutorService) {
                return ((ExecutorService) this.concurrentExecutor).submit(task);
            } else {
                FutureTask<Object> future = new FutureTask<Object>(task, null);
                this.concurrentExecutor.execute(future);
                return future;
            }
        } catch (RejectedExecutionException ex) {
            throw new TaskRejectedException("Executor [" + this.concurrentExecutor + "] did not accept task: " + task,
                    ex);
        }
    }
626708
public void execute(DelegateExecution execution) {
    boolean isSkipExpressionEnabled = SkipExpressionUtil.isSkipExpressionEnabled(execution, skipExpression);
    if (!isSkipExpressionEnabled || (isSkipExpressionEnabled && !SkipExpressionUtil.shouldSkipFlowElement(execution, skipExpression))) {

      if (Context.getProcessEngineConfiguration().isEnableProcessDefinitionInfoCache()) {
        ObjectNode taskElementProperties = Context.getBpmnOverrideElementProperties(serviceTaskId, execution.getProcessDefinitionId());
        if (taskElementProperties != null && taskElementProperties.has(DynamicBpmnConstants.SERVICE_TASK_CLASS_NAME)) {
          String overrideClassName = taskElementProperties.get(DynamicBpmnConstants.SERVICE_TASK_CLASS_NAME).asText();
          if (StringUtils.isNotEmpty(overrideClassName) && !overrideClassName.equals(className)) {
            className = overrideClassName;
            activityBehaviorInstance = null;
          }
        }
      }
      
      if (activityBehaviorInstance == null) {
        activityBehaviorInstance = getActivityBehaviorInstance();
      }

      try {
        activityBehaviorInstance.execute(execution);
      } catch (BpmnError error) {
        ErrorPropagation.propagateError(error, execution);
      } catch (RuntimeException e) {
        if (!ErrorPropagation.mapException(e, (ExecutionEntity) execution, mapExceptions))
          throw e;
      }
    }
  }
487457
public int executeTask(final TransactionalProtocolClient.TransactionalOperationListener<ServerOperation> listener, final ServerUpdateTask task) {
        try {
            return execute(listener, task.getServerIdentity(), task.getOperation());
        } catch (OperationFailedException e) {
            // Handle failures operation transformation failures
            final ServerIdentity identity = task.getServerIdentity();
            final ServerOperation serverOperation = new ServerOperation(identity, task.getOperation(), null, null, OperationResultTransformer.ORIGINAL_RESULT);
            final TransactionalProtocolClient.PreparedOperation<ServerOperation> result = BlockingQueueOperationListener.FailedOperation.create(serverOperation, e);
            listener.operationPrepared(result);
            recordExecutedRequest(new ExecutedServerRequest(identity, result.getFinalResult(), OperationResultTransformer.ORIGINAL_RESULT));
            return 1; // 1 ms timeout since there is no reason to wait for the locally stored result
        }

    }
1370207
@Override
    public void execute(Runnable command)
    {
        super.execute(isTracing() && !(command instanceof TraceSessionWrapper)
                      ? new TraceSessionWrapper<Object>(Executors.callable(command, null))
                      : command);
    }