Package org.springframework.scheduling

Examples of org.springframework.scheduling.Trigger


          @Override
          public void run() {
            counter().incrementAndGet();
          }
        },
        new Trigger() {
          @Override
          public Date nextExecutionTime(TriggerContext triggerContext) {
            return new Date(new Date().getTime()+10);
          }
        });
View Full Code Here


    Object targetObject = runnable.getTarget();
    Method targetMethod = runnable.getMethod();
    assertEquals(target, targetObject);
    assertEquals("cron", targetMethod.getName());
    assertEquals("0 0 0-4,6-23 * * ?", task.getExpression());
    Trigger trigger = task.getTrigger();
    assertNotNull(trigger);
    assertTrue(trigger instanceof CronTrigger);
    CronTrigger cronTrigger = (CronTrigger) trigger;
    Calendar cal = Calendar.getInstance(TimeZone.getTimeZone("GMT+10"));
    cal.clear();
View Full Code Here

    @Override
    public ScheduledFuture<Object> schedule(Runnable task, final Trigger trigger) {
        task = wrapRunnable(task);
        //Wrap the trigger so that the first call to nextExecutionTime adds in the additionalStartDelay
        final Trigger wrappedTrigger = new Trigger() {
            boolean firstExecution = false;
            @Override
            public Date nextExecutionTime(TriggerContext triggerContext) {
                Date nextExecutionTime = trigger.nextExecutionTime(triggerContext);
                if (nextExecutionTime == null) {
View Full Code Here

  protected static final Logger log = LoggerFactory.getLogger(TriggerBuilder.class);

  Trigger build(String triggerExpression) {

    Trigger trigger = null;
    try {
      trigger = new CronTrigger(triggerExpression);
    } catch (Exception e) {
      // simply, not a cron!
    }
View Full Code Here

TOP

Related Classes of org.springframework.scheduling.Trigger

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.