Package java.util.concurrent

Examples of java.util.concurrent.FutureTask.cancel()


    executor.execute(task);
    try {
      task.get(fetchTimeoutSeconds, TimeUnit.SECONDS);
    } catch(InterruptedException ie) {
      // attempt to cancel execution of the task.
      task.cancel(true);
      LOGGER.error("interrupted during fetch: "+ie.toString());
    } catch(ExecutionException ee) {
      // attempt to cancel execution of the task.
      task.cancel(true);
      LOGGER.error("exception during fetch: "+ee.toString());
View Full Code Here


      // attempt to cancel execution of the task.
      task.cancel(true);
      LOGGER.error("interrupted during fetch: "+ie.toString());
    } catch(ExecutionException ee) {
      // attempt to cancel execution of the task.
      task.cancel(true);
      LOGGER.error("exception during fetch: "+ee.toString());
    } catch(TimeoutException te) {
      // attempt to cancel execution of the task. 
      task.cancel(true);
      LOGGER.error("timeout for fetch: "+te.toString());
View Full Code Here

      // attempt to cancel execution of the task.
      task.cancel(true);
      LOGGER.error("exception during fetch: "+ee.toString());
    } catch(TimeoutException te) {
      // attempt to cancel execution of the task. 
      task.cancel(true);
      LOGGER.error("timeout for fetch: "+te.toString());
    }

    executor.shutdownNow();
    multiFetch.close();
View Full Code Here

        {
            Iterator<FutureTask> taskIterator = tasks.iterator();
            while (taskIterator.hasNext())
            {
                FutureTask task = taskIterator.next();
                task.cancel(true);
            }
            tasks.clear();
        }
    }
View Full Code Here

    executor.execute(task);
    try {
      task.get(fetchTimeoutSeconds, TimeUnit.SECONDS);
    } catch(InterruptedException ie) {
      // attempt to cancel execution of the task.
      task.cancel(true);
      LOG.error("interrupted during fetch: "+ie.toString());
    } catch(ExecutionException ee) {
      // attempt to cancel execution of the task.
      task.cancel(true);
      LOG.error("exception during fetch: "+ee.toString());
View Full Code Here

      // attempt to cancel execution of the task.
      task.cancel(true);
      LOG.error("interrupted during fetch: "+ie.toString());
    } catch(ExecutionException ee) {
      // attempt to cancel execution of the task.
      task.cancel(true);
      LOG.error("exception during fetch: "+ee.toString());
    } catch(TimeoutException te) {
      // attempt to cancel execution of the task. 
      task.cancel(true);
      LOG.error("timeout for fetch: "+te.toString());
View Full Code Here

      // attempt to cancel execution of the task.
      task.cancel(true);
      LOG.error("exception during fetch: "+ee.toString());
    } catch(TimeoutException te) {
      // attempt to cancel execution of the task. 
      task.cancel(true);
      LOG.error("timeout for fetch: "+te.toString());
    }

    executor.shutdownNow();
    multiFetch.close();
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.