Package org.springframework.scheduling.support

Examples of org.springframework.scheduling.support.ScheduledMethodRunnable


                  "pull the method up to an interface or switch to subclass (CGLIB) " +
                  "proxies by setting proxy-target-class/proxyTargetClass " +
                  "attribute to 'true'", method.getName(), targetClass.getSimpleName()));
            }
          }
          Runnable runnable = new ScheduledMethodRunnable(bean, method);
          boolean processedSchedule = false;
          String errorMessage = "Exactly one of 'cron', 'fixedDelay', or 'fixedRate' is required.";
          String cron = annotation.cron();
          if (!"".equals(cron)) {
            processedSchedule = true;
View Full Code Here


                  "pull the method up to an interface or switch to subclass (CGLIB) " +
                  "proxies by setting proxy-target-class/proxyTargetClass " +
                  "attribute to 'true'", method.getName(), targetClass.getSimpleName()));
            }
          }
          Runnable runnable = new ScheduledMethodRunnable(bean, method);
          boolean processedSchedule = false;
          String errorMessage = "Exactly one of the 'cron', 'fixedDelay', or 'fixedRate' attributes is required.";
          String cron = annotation.cron();
          if (!"".equals(cron)) {
            processedSchedule = true;
View Full Code Here

              "be delegated to target bean. Switch its visibility to package or protected.",
              method.getName(), method.getDeclaringClass().getSimpleName()));
        }
      }

      Runnable runnable = new ScheduledMethodRunnable(bean, method);
      boolean processedSchedule = false;
      String errorMessage =
          "Exactly one of the 'cron', 'fixedDelay(String)', or 'fixedRate(String)' attributes is required";

      // Determine initial delay
View Full Code Here

    @SuppressWarnings("unchecked")
    List<CronTask> cronTasks = (List<CronTask>)
        new DirectFieldAccessor(registrar).getPropertyValue("cronTasks");
    assertEquals(1, cronTasks.size());
    CronTask task = cronTasks.get(0);
    ScheduledMethodRunnable runnable = (ScheduledMethodRunnable) task.getRunnable();
    Object targetObject = runnable.getTarget();
    Method targetMethod = runnable.getMethod();
    assertEquals(target, targetObject);
    assertEquals("x", targetMethod.getName());
    assertEquals(businessHoursCronExpression, task.getExpression());
  }
View Full Code Here

    @SuppressWarnings("unchecked")
    List<IntervalTask> fixedDelayTasks = (List<IntervalTask>)
        new DirectFieldAccessor(registrar).getPropertyValue("fixedDelayTasks");
    assertEquals(1, fixedDelayTasks.size());
    IntervalTask task = fixedDelayTasks.get(0);
    ScheduledMethodRunnable runnable = (ScheduledMethodRunnable) task.getRunnable();
    Object targetObject = runnable.getTarget();
    Method targetMethod = runnable.getMethod();
    assertEquals(target, targetObject);
    assertEquals("fixedDelay", targetMethod.getName());
    assertEquals(1000L, task.getInitialDelay());
    assertEquals(5000L, task.getInterval());
  }
View Full Code Here

    @SuppressWarnings("unchecked")
    List<IntervalTask> fixedRateTasks = (List<IntervalTask>)
        new DirectFieldAccessor(registrar).getPropertyValue("fixedRateTasks");
    assertEquals(1, fixedRateTasks.size());
    IntervalTask task = fixedRateTasks.get(0);
    ScheduledMethodRunnable runnable = (ScheduledMethodRunnable) task.getRunnable();
    Object targetObject = runnable.getTarget();
    Method targetMethod = runnable.getMethod();
    assertEquals(target, targetObject);
    assertEquals("fixedRate", targetMethod.getName());
    assertEquals(1000L, task.getInitialDelay());
    assertEquals(3000L, task.getInterval());
  }
View Full Code Here

    @SuppressWarnings("unchecked")
    List<CronTask> cronTasks = (List<CronTask>)
        new DirectFieldAccessor(registrar).getPropertyValue("cronTasks");
    assertEquals(1, cronTasks.size());
    CronTask task = cronTasks.get(0);
    ScheduledMethodRunnable runnable = (ScheduledMethodRunnable) task.getRunnable();
    Object targetObject = runnable.getTarget();
    Method targetMethod = runnable.getMethod();
    assertEquals(target, targetObject);
    assertEquals("y", targetMethod.getName());
    assertEquals(businessHoursCronExpression, task.getExpression());
  }
View Full Code Here

    @SuppressWarnings("unchecked")
    List<IntervalTask> fixedDelayTasks = (List<IntervalTask>)
        new DirectFieldAccessor(registrar).getPropertyValue("fixedDelayTasks");
    assertEquals(1, fixedDelayTasks.size());
    IntervalTask task = fixedDelayTasks.get(0);
    ScheduledMethodRunnable runnable = (ScheduledMethodRunnable) task.getRunnable();
    Object targetObject = runnable.getTarget();
    Method targetMethod = runnable.getMethod();
    assertEquals(target, targetObject);
    assertEquals("fixedDelay", targetMethod.getName());
    assertEquals(0L, task.getInitialDelay());
    assertEquals(5000L, task.getInterval());
  }
View Full Code Here

    @SuppressWarnings("unchecked")
    List<IntervalTask> fixedRateTasks = (List<IntervalTask>)
        new DirectFieldAccessor(registrar).getPropertyValue("fixedRateTasks");
    assertEquals(1, fixedRateTasks.size());
    IntervalTask task = fixedRateTasks.get(0);
    ScheduledMethodRunnable runnable = (ScheduledMethodRunnable) task.getRunnable();
    Object targetObject = runnable.getTarget();
    Method targetMethod = runnable.getMethod();
    assertEquals(target, targetObject);
    assertEquals("fixedRate", targetMethod.getName());
    assertEquals(0L, task.getInitialDelay());
    assertEquals(3000L, task.getInterval());
  }
View Full Code Here

    @SuppressWarnings("unchecked")
    List<IntervalTask> fixedRateTasks = (List<IntervalTask>)
        new DirectFieldAccessor(registrar).getPropertyValue("fixedRateTasks");
    assertEquals(1, fixedRateTasks.size());
    IntervalTask task = fixedRateTasks.get(0);
    ScheduledMethodRunnable runnable = (ScheduledMethodRunnable) task.getRunnable();
    Object targetObject = runnable.getTarget();
    Method targetMethod = runnable.getMethod();
    assertEquals(target, targetObject);
    assertEquals("fixedRate", targetMethod.getName());
    assertEquals(1000L, task.getInitialDelay());
    assertEquals(3000L, task.getInterval());
  }
View Full Code Here

TOP

Related Classes of org.springframework.scheduling.support.ScheduledMethodRunnable

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.