Package java.util

Examples of java.util.Timer.schedule()


        Thread.currentThread().setPriority(Thread.MIN_PRIORITY);                // don't disturb other things going on
        createXML();
      }
    };
    Timer timer = new Timer();
    timer.schedule(tt, (new GregorianCalendar()).getTime(), inter);
    instance=true;
    return retVal;
  }
 
  protected void createXML() {
View Full Code Here


        Timer samplingTimer = synapseEnvironment.getSynapseConfiguration().getSynapseTimer();
        messageProcessor = new MessageProcessor();
        log.info("Scheduling the sampling timer to invoke the message processor " +
                "at an interval of : " + unitTime);
        samplingTimer.schedule(messageProcessor, 0, unitTime);
    }

    public void destroy() {
        messageProcessor.cancel();
        if (!messageQueue.isEmpty()) {
View Full Code Here

    rollbackParentContext = false;
        if (timeoutMillis > 0) {
            TimerFactory factory = Monitor.getMonitor().getTimerFactory();
            Timer timer = factory.getCancellationTimer();
            cancelTask = new CancelQueryTask(this);
            timer.schedule(cancelTask, timeoutMillis);
        }
  }

  public void clearInUse() {
    /* We must clear out the current top ResultSet to prepare for
View Full Code Here

        if (timeoutMillis > 0) {
            // take care of the transaction timeout
            TimerTask cancelTask = new CancelXATransactionTask();
            TimerFactory timerFactory = Monitor.getMonitor().getTimerFactory();
            Timer timer = timerFactory.getCancellationTimer();
            timer.schedule(cancelTask, timeoutMillis);
        } else {
            timeoutTask = null;
        }
    }
View Full Code Here

                @Override
                public void run() {
                    mainThread.interrupt();
                }
           };
           t.schedule(task, timeoutSeconds * 1000L);
           try {
               toDestroy.waitFor();
               try {
                   final int exit = toDestroy.exitValue();
                   log.info("Process {} ended with exit code {}", processInfo, exit);
View Full Code Here

        final AtomicBoolean hasTimedOut = new AtomicBoolean(false);
        Timer timer = null;
        try {
            if (timeoutMs < Long.MAX_VALUE) {
                timer = new Timer(true);
                timer.schedule(new TimerTask() {

                    @Override
                    public void run() {
                        hasTimedOut.set(true);
                    }
View Full Code Here

    if (timeOutInterval > 0) {
      timeOutTimer = new Timer();
      timeoutTimerTask = new ShellTimeoutTimerTask(
          this);
      //One time scheduling.
      timeOutTimer.schedule(timeoutTimerTask, timeOutInterval);
    }
    final BufferedReader errReader =
            new BufferedReader(new InputStreamReader(process
                                                     .getErrorStream()));
    BufferedReader inReader =
View Full Code Here

    assertThatListContains(list, "first", "second", "third");
  }

  private void showDropDownListWithDelay() {
    java.util.Timer timer = new Timer("showJComboBoxDropDownList", false);
    timer.schedule(new TimerTask() {
      @Override
      public void run() {
        showJComboBoxDropDownList();
      }
    }, 18000);
View Full Code Here

  public static void main(String args[]){
    Timer timer = new Timer();
    try {
      TimerTask task = new ChangeZkTask(DemoConf.host, DemoConf.root);
      timer.schedule(task, 0, 5000);   
    } catch(Exception e){
      e.printStackTrace();
    }
  }
View Full Code Here

  public static void main(String args[]){
    Timer timer = new Timer();
    try {
      TimerTask task = new ChangeZkTask2(DemoConf.host, DemoConf.root);
      timer.schedule(task, 0, 5000);   
    } catch(Exception e){
      e.printStackTrace();
    }
  }
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.