Examples of AsyncTask


Examples of com.bergerkiller.bukkit.common.AsyncTask

    if (worldConfig.isLoaded()) {
      CommonUtil.sendMessage(sender, ChatColor.RED + "Can not delete a loaded world!");
      return;
    }
    WorldConfig.remove(worldConfig.worldname);
    new AsyncTask("World deletion thread") {
      public void run() {
        if (worldConfig.deleteWorld()) {
          CommonUtil.sendMessage(sender, ChatColor.GREEN + "World '" + worldConfig.worldname + "' has been removed!");
        } else {
          CommonUtil.sendMessage(sender, ChatColor.RED + "Failed to (completely) remove the world!");
View Full Code Here

Examples of com.sun.enterprise.web.connector.grizzly.AsyncTask

   
    /**
     * Create an instance of <code>AsyncTask</code>
     */
    private AsyncTask newAsyncProcessorTask(){
        AsyncTask asyncTask = new AsyncProcessorTask();
        asyncTask.setAsyncExecutor(newAsyncExecutor(asyncTask))
        return asyncTask;
    }
View Full Code Here

Examples of com.sun.enterprise.web.connector.grizzly.AsyncTask

    /**
     * Return an instance of <code>AsyncTask</code>, which is
     * configured and ready to be executed.
     */
    private AsyncTask getAsyncProcessorTask(){
        AsyncTask asyncTask = asyncProcessors.poll();
        if (asyncTask == null) {
            asyncTask = newAsyncProcessorTask();
        } else {
            asyncTask.recycle();
        }
        return asyncTask;
    }
View Full Code Here

Examples of com.sun.enterprise.web.connector.grizzly.AsyncTask

     * this handler. Second, this method is invoked once a
     * <code>ProcessorTask</code> needs to be removed from the interrupted queue.
     */
    public void handle(Task task){
       
        AsyncTask apt = null;
        if (task.getType() == Task.PROCESSOR_TASK) {
            apt = getAsyncProcessorTask();
            apt.setProcessorTask((ProcessorTask)task);
            apt.setSelectorThread(task.getSelectorThread());
        }
       
        boolean wasInterrupted = interruptedQueue.remove(apt);
        if ( !wasInterrupted && apt == null) {
            // Try to remove the ProcessorTask itself
            interruptedQueue.remove(task);
        }

        // Last chance to execute asynchronously.
        if ( apt == null ){
            apt = (AsyncTask)task;
        }

        if (apt != null){
            apt.execute();
        }
    }
View Full Code Here

Examples of gri.tasks.AsyncTask

    }
 
  // --------------------------------------------- Running Jobs
 
  public String submitJob(JobSubmission submission) throws Exception {
    AsyncTask task = tasks.getAsyncTask(submission.getTaskId());
      //NOTE: This is first so that we can easily throw UnknownTaskExceptions
   
    String jobId = createJobId()//TODO: synchronize and error check until jobs.put()?
   
    AsyncTaskController controller = task.start(
        submission.getInputs(),
        submission.getEventHandler());
   
    JobEntry jobEntry = new JobEntry(jobId, submission, controller);
    jobs.put(jobId, jobEntry);
View Full Code Here

Examples of net.timewalker.ffmq3.utils.async.AsyncTask

        try
        {
          final String messageId = message.getJMSMessageID();
           
            // Schedule an async rollback
            ClientEnvironment.getAsyncTaskManager().execute(new AsyncTask()
            {
                /*
                 * (non-Javadoc)
                 * @see net.timewalker.ffmq3.utils.async.AsyncTask#isMergeable()
                 */
 
View Full Code Here

Examples of org.jboss.errai.bus.client.api.AsyncTask

      throw new RuntimeException(e);
    }
  }

  public AsyncTask scheduleRepeating(TimeUnit unit, int interval, Runnable task) {
    AsyncTask t = service.scheduleRepeating(task, unit, 0, interval);

    if (task instanceof HasAsyncTaskRef) {
      ((HasAsyncTaskRef) task).setAsyncTask(t);
    }
View Full Code Here

Examples of org.jboss.errai.bus.client.api.AsyncTask

    return t;
  }

  public AsyncTask schedule(TimeUnit unit, int interval, Runnable task) {
    AsyncTask t = service.schedule(task, unit, interval);

    if (task instanceof HasAsyncTaskRef) {
      ((HasAsyncTaskRef) task).setAsyncTask(t);
    }
View Full Code Here

Examples of org.jboss.errai.bus.client.api.AsyncTask

      public void run() {
        task.run();
      }
    };

    AsyncTask asyncTask = createAsyncTask(task, timer);
    timer.scheduleRepeating((int) unit.convert(interval, TimeUnit.MILLISECONDS));
    return asyncTask;
  }
View Full Code Here

Examples of org.jboss.errai.bus.client.api.AsyncTask

      public void run() {
        task.run();
      }
    };

    AsyncTask asyncTask = createAsyncTask(task, timer);
    timer.schedule((int) unit.convert(interval, TimeUnit.MILLISECONDS));
    return asyncTask;
  }
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.