Package java.util.concurrent

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


                if(!renderingStopRequested) {
                    requests.put(new EndRequest());
                    painterFuture.get();
                }
            } catch(Exception e) {
                painterFuture.cancel(true);
                fireErrorEvent(e);
            } finally {
                if(localPool) {
                    localThreadPool.shutdown();
                }
View Full Code Here


        } catch (Throwable e) {
            logger.error("task supervisor threw an exception", e);
            throwableCounter.increment();
        } finally {
            if (future != null) {
                future.cancel(true);
            }
        }
    }
}
View Full Code Here

                    } catch (Exception e) {
                        logger.error("interceptor process error failed", e);
                    }

                } else {
                    future.cancel(true); // 对未完成的进行取消
                }
            }
        } else {
            for (int i = 0; i < futures.size(); i++) {// 收集一下正确处理完成的结果
                Future future = futures.get(i);
View Full Code Here

    // 取消一下当前正在执行的异步任务
    private void cancel(List<Future> futures) {
        for (int i = 0; i < futures.size(); i++) {
            Future future = futures.get(i);
            if (future.isDone() == false) {
                future.cancel(true);// 中断之前的操作
            }
        }
    }

    // 调整一下线程池
View Full Code Here

    // 取消一下当前正在执行的异步任务
    private void cancel(List<Future> futures) {
        for (int i = 0; i < futures.size(); i++) {
            Future future = futures.get(i);
            if (future.isDone() == false) {
                future.cancel(true);// 中断之前的操作
            }
        }
    }

    // 调整一下线程池
View Full Code Here

        public void run() {
            boolean execute=true;
            synchronized(tasks) {
                Future future=tasks.get(token);
                if(future != null) {
                    future.cancel(false);
                    execute=true;
                }
                else {
                    execute=false;
                }
View Full Code Here

            Future future;
            synchronized(resume_tasks) {
                future=resume_tasks.remove(merge_id);
            }
            if(future != null)
                future.cancel(true);
            resumeForce();
        }

        public synchronized void resumeForce() {
            if(queue.closed())
View Full Code Here

        public void run() {
            boolean executed=true;
            synchronized(tasks) {
                Future future=tasks.get(token);
                if(future != null) {
                    future.cancel(false);
                    executed=true;
                }
                else {
                    executed=false;
                }
View Full Code Here

            } else {
                future.get();
            }
        } catch (TimeoutException e) {
            // timeout then cancel the task
            future.cancel(true);

            // if set, stop processing and return false to indicate that the shutdown is aborting
            if (abortAfterTimeout) {
                LOG.warn("Timeout occurred. Aborting the shutdown now.");
                return false;
View Full Code Here

            Future future;
            synchronized(resume_tasks) {
                future=resume_tasks.remove(merge_id);
            }
            if(future != null)
                future.cancel(true);
            resumeForce();
        }

        public synchronized void resumeForce() {
            if(queue.closed())
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.