Examples of Executor


Examples of EDU.oswego.cs.dl.util.concurrent.Executor

      {
         Fqn fqn = Fqn.fromString("/a/b/c/" + Integer.toString(i + 1));
         region.putNodeEvent(new EvictedEventNode(fqn, EvictedEventNode.ADD_NODE_EVENT));        
      }
     
      Executor executor = new ThreadedExecutor();
      FutureResult future = new FutureResult();

      Runnable command = future.setter(new ProcessEvictionRegion(region, algorithm));
      executor.execute(command);
     
      try
      {
         future.timedGet(20000);
      }
View Full Code Here

Examples of bitronix.tm.twopc.executor.Executor

    /**
     * Create the 2PC executor.
     * @return the 2PC executor.
     */
    public static Executor getExecutor() {
        Executor executor = executorRef.get();
        if (executor == null) {
            if (getConfiguration().isAsynchronous2Pc()) {
                if (log.isDebugEnabled()) { log.debug("using AsyncExecutor"); }
                executor = new AsyncExecutor();
            } else {
                if (log.isDebugEnabled()) { log.debug("using SyncExecutor"); }
                executor = new SyncExecutor();
            }
            if (!executorRef.compareAndSet(null, executor)) {
                executor.shutdown();
                executor = executorRef.get();
            }
        }
        return executor;
    }
View Full Code Here

Examples of ch.hortis.sonar.core.service.Executor

  }
 
  public static List<Service> services = new ArrayList<Service>();

  protected void processGroup(SnapshotGroup group) {
    Executor executor = new Executor(Service.getAllServices(getEntityManager()));
    executor.execute(group);

    for (Snapshot snapshot : group.getSnapshots()) {
      if (snapshot.getId() == null) {
        LOG.debug("Persisting Snapshot");
        getEntityManager().persist(snapshot);
View Full Code Here

Examples of ch.tatool.exec.Executor

        UserAccount account = createAccount();
        Module module = createModule(account);
       
        // execute the module
        System.out.println("START: Executing module...");
        Executor executor = getExecutionService().createExecutor(module);
        getExecutionService().startExecution(executor, true);
        System.out.println("END:   Executing module.");
       
        // cleanup
        getUserAccountService().deleteAccount(account);
View Full Code Here

Examples of com.alibaba.wasp.executor.ExecutorService.Executor

    // Start an executor service pool with max 5 threads
    ExecutorService executorService = new ExecutorService("unit_test");
    executorService.startExecutorService(
      ExecutorType.MASTER_SERVER_OPERATIONS, maxThreads);

    Executor executor =
      executorService.getExecutor(ExecutorType.MASTER_SERVER_OPERATIONS);
    ThreadPoolExecutor pool = executor.threadPoolExecutor;

    // Assert no threads yet
    assertEquals(0, pool.getPoolSize());

    AtomicBoolean lock = new AtomicBoolean(true);
    AtomicInteger counter = new AtomicInteger(0);

    // Submit maxThreads executors.
    for (int i = 0; i < maxThreads; i++) {
      executorService.submit(
        new TestEventHandler(mockedServer, EventType.M_SERVER_SHUTDOWN,
            lock, counter));
    }

    // The TestEventHandler will increment counter when it starts.
    int tries = 0;
    while (counter.get() < maxThreads && tries < maxTries) {
      LOG.info("Waiting for all event handlers to start...");
      Thread.sleep(sleepInterval);
      tries++;
    }

    // Assert that pool is at max threads.
    assertEquals(maxThreads, counter.get());
    assertEquals(maxThreads, pool.getPoolSize());

    ExecutorStatus status = executor.getStatus();
    assertTrue(status.queuedEvents.isEmpty());
    assertEquals(5, status.running.size());
    checkStatusDump(status);
   
   
View Full Code Here

Examples of com.cedarsoft.exec.Executor

    for ( File serializerFile : serializerFiles ) {
      String relativePath = calculateRelativePath( sourceDir, serializerFile );

      File targetFile = new File( destination, relativePath );
      if ( targetFile.exists() ) {
        Executor executor = new Executor( new ProcessBuilder( "meld", targetFile.getAbsolutePath(), serializerFile.getAbsolutePath() ) );
        executor.execute();
      } else {
        //Create the directory if necessary
        File targetDir = targetFile.getParentFile();
        if ( !targetDir.isDirectory() ) {
          targetDir.mkdirs();
View Full Code Here

Examples of com.cedarsoft.execution.Executor

    for ( File serializerFile : serializerFiles ) {
      String relativePath = calculateRelativePath( sourceDir, serializerFile );

      File targetFile = new File( destination, relativePath );
      if ( targetFile.exists() ) {
        Executor executor = new Executor( new ProcessBuilder( "meld", targetFile.getAbsolutePath(), serializerFile.getAbsolutePath() ) );
        executor.execute();
      } else {
        //Create the directory if necessary
        File targetDir = targetFile.getParentFile();
        if ( !targetDir.isDirectory() ) {
          targetDir.mkdirs();
View Full Code Here

Examples of com.espertech.esperio.db.config.Executor

    public ExecutorServices(EPServiceProviderSPI spi, Map<String, Executor> workQueue)
    {
        this.services = new HashMap<String, ExecutorService>();

        for (Map.Entry<String, Executor> entry : workQueue.entrySet()) {
            Executor queue = entry.getValue();

            if (queue.getNumThreads() <= 0) {
                continue;
            }
           
            LinkedBlockingQueue<Runnable> runnableQueue = new LinkedBlockingQueue<Runnable>();
            ExecutorService service = new ThreadPoolExecutor(queue.getNumThreads(), queue.getNumThreads(), 1000, TimeUnit.SECONDS, runnableQueue);
            services.put(entry.getKey(), service);
        }

        try
        {
View Full Code Here

Examples of com.intellij.execution.Executor

                                           RunProfileState state,
                                           RunContentDescriptor contentToReuse,
                                           final ExecutionEnvironment env) throws ExecutionException {
    final HXCPPRemoteDebugConfiguration configuration = (HXCPPRemoteDebugConfiguration)env.getRunProfile();
    final Module module = configuration.getConfigurationModule().getModule();
    final Executor executor = env.getExecutor();

    if (module == null) {
      throw new ExecutionException(HaxeBundle.message("no.module.for.run.configuration", configuration.getName()));
    }
View Full Code Here

Examples of com.mysql.clusterj.jdbc.SQLExecutor.Executor

            com.mysql.jdbc.PreparedStatement preparedStatement =
                (com.mysql.jdbc.PreparedStatement)statement;
            // key must be interned because we are using IdentityHashMap
            String preparedSql = preparedStatement.getPreparedSql().intern();
            // see if we have a parsed version of this query
            Executor sQLExecutor = null;
            synchronized(parsedSqlMap) {
                sQLExecutor = parsedSqlMap.get(preparedSql);
            }
            // if no cached SQLExecutor, create it, which might take some time
            if (sQLExecutor == null) {
                sQLExecutor = createSQLExecutor(preparedSql);
                if (sQLExecutor != null) {
                    // multiple thread might have created a SQLExecutor but it's ok
                    synchronized(parsedSqlMap) {
                        parsedSqlMap.put(preparedSql, sQLExecutor);
                    }
                }
            }
            return sQLExecutor.execute(this, preparedStatement.getParameterBindings());
        }
        return null;
    }
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.