Package edu.emory.mathcs.backport.java.util.concurrent

Examples of edu.emory.mathcs.backport.java.util.concurrent.ScheduledFuture


        clockDaemon.allowCoreThreadTimeOut(false);
    }
    static HashMap clockTickets = new HashMap();

    synchronized static public void executePeriodically(final Runnable task, long period) {
        ScheduledFuture ticket = clockDaemon.scheduleAtFixedRate(task, period, period, TimeUnit.MILLISECONDS);
        clockTickets.put(task, ticket);
    }
View Full Code Here


        ScheduledFuture ticket = clockDaemon.scheduleAtFixedRate(task, period, period, TimeUnit.MILLISECONDS);
        clockTickets.put(task, ticket);
    }

    synchronized static public void cancel(Runnable task) {
        ScheduledFuture ticket = (ScheduledFuture) clockTickets.remove(task);
        if( ticket!=null ) {
            ticket.cancel(false);
            if (ticket instanceof Runnable)
              clockDaemon.remove((Runnable) ticket);           
        }
    }
View Full Code Here

                // callable.  Instead, made RPQueryCurrentState also implement
                // Runnable interface and so now is native parameter to
                // scheduleWithFixedDelay method instead of wrapped in FutureTask.
                //NOPE: final FutureTask task = new FutureTask(action);

                final ScheduledFuture scheduledFuture =
                        this.scheduled.scheduleWithFixedDelay(
                                action, this.pollDelayMs, this.pollDelayMs,
                                TimeUnit.MILLISECONDS);

                this.currentTasks.put(addrID, scheduledFuture);
View Full Code Here

               
                // *** EARLY RETURN ***
                return super.untrackWorkspace(workspace);
            }

            final ScheduledFuture task =
                    (ScheduledFuture) this.currentTasks.get(addrID);
           
            if (task == null) {
                if (this.pr.enabled()) {
                    final String err = "Unexpected: parent tracking this " +
                            "but not the poll subscription manager? " +
                            addrID.toString();
                    if (this.pr.useThis()) {
                        this.pr.errln(err);
                    } else if (this.pr.useLogging()) {
                        logger.error(err);
                    }
                }
                // *** EARLY RETURN ***
                return super.untrackWorkspace(workspace);
            }

            task.cancel(true);
           
            this.currentTasks.remove(addrID);

            return super.untrackWorkspace(workspace);
        }
View Full Code Here

        clockDaemon.allowCoreThreadTimeOut(false);
    }
    static HashMap clockTickets = new HashMap();

    synchronized static public void executePeriodically(final Runnable task, long period) {
        ScheduledFuture ticket = clockDaemon.scheduleAtFixedRate(task, period, period, TimeUnit.MILLISECONDS);
        clockTickets.put(task, ticket);
    }
View Full Code Here

        ScheduledFuture ticket = clockDaemon.scheduleAtFixedRate(task, period, period, TimeUnit.MILLISECONDS);
        clockTickets.put(task, ticket);
    }

    synchronized static public void cancel(Runnable task) {
        ScheduledFuture ticket = (ScheduledFuture) clockTickets.remove(task);
        if( ticket!=null ) {
            ticket.cancel(false);
          clockDaemon.remove(task);
        }
    }
View Full Code Here

TOP

Related Classes of edu.emory.mathcs.backport.java.util.concurrent.ScheduledFuture

Copyright © 2018 www.massapicom. 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.