Examples of cancel()


Examples of java.util.TimerTask.cancel()

      try {
        Thread.sleep(100);
      } catch (InterruptedException ignored) {
      }
    }
    failTask.cancel();
    if (fail) fail("Test did not complete in a timely manner.");
    // Give sockets a chance to close before starting the next test.
    try {
      Thread.sleep(1000);
    } catch (InterruptedException ignored) {
View Full Code Here

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

        Future future;
        StressTask task=new StressTask();
        try {
            future=timer.scheduleWithDynamicInterval(task);
            assert timer.size() == 1;
            future.cancel(true);
            assert timer.size() == 1;
            Util.sleep(200);
            int num_executions=task.getNumExecutions();
            System.out.println("number of task executions=" + num_executions);
            assert num_executions ==0 : "task should never have executed as it was cancelled before execution";
View Full Code Here

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

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

     */
    private ScheduledFuture cancelCurrentTask() {
        ScheduledFuture currentTask = (ScheduledFuture) m_futureRef.get();
        if (currentTask != null) {
            // Doesn't matter for completed tasks...
            currentTask.cancel(false /* mayInterruptIfRunning */);
        }
        return currentTask;
    }
}
View Full Code Here

Examples of javax.ejb.Timer.cancel()

        //Verifies if the new timer was added to the timers list
        if(ts.getTimers().size() < 1){
            throw new IllegalStateException("The Timers Collection must have at least one timer. It was created in this method.");
        }
        //Cancels the timer
        t.cancel();
    }

    /**
     * Checks if a timer service reference can be obtained using the JNDI API.
     * @throws Exception if a problem occurs
View Full Code Here

Examples of javax.enterprise.deploy.spi.status.ProgressObject.cancel()

        if (!isCancelSupported()) {
            throw new OperationUnsupportedException("cancel");
        }
        for (Iterator itr=getSources().iterator();itr.hasNext();) {
            ProgressObject source = (ProgressObject) itr.next();
            source.cancel();
        }       
    }
   
    public void stop() throws OperationUnsupportedException {
        if (!isStopSupported()) {
View Full Code Here

Examples of javax.jdo.Query.cancel()

            // Wait a couple of millis such that the other thread can start query execution
            Thread.sleep(MAIN_SLEEP_MILLIS);

            // cancel query
            query.cancel(t);
            if (!isQueryCancelSupported()) {
                fail(ASSERTION_FAILED,
                     "Query.cancel should throw a JDOQueryInterruptedException, " +
                     "if query canceling is not supported ");
            }
View Full Code Here

Examples of javax.tv.service.SIRequest.cancel()

            timeout++;
        }
       
        // if we still don't have a response just cancel the request
        if (!requestor.getResponse()) {
            req.cancel();
        }
       
        if (requestor.getResult() == null)
            return false;
       
View Full Code Here

Examples of javax.ws.rs.container.AsyncResponse.cancel()

                asyncResponse.setTimeoutHandler(new TimeoutHandler() {

                    @Override
                    public void handleTimeout(final AsyncResponse asyncResponse) {
                        asyncResponse.resume("timeout1=" + timeout1 + "_timeout2=" + timeout2 + "_handled");
                        asyncResponse.cancel();
                    }
                });
            }
        });
    }
View Full Code Here

Examples of jsky.util.IApplyCancel.cancel()

                symbolConfig.apply();
            }
        };
        ActionListener cancelListener = new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                symbolConfig.cancel();
            }
        };
        _configPanel.getApplyButton().addActionListener(applyListener);
        _configPanel.getOKButton().addActionListener(applyListener);
        _configPanel.getCancelButton().addActionListener(cancelListener);
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.