Esempio n. 1
0
  public static Task getTimeTaskForCalendarTrigger() throws JobException {
    Task task = new Task();
    ReflectionJob job = new ReflectionJob();
    job.setClass("org.pinae.rafiki.job.TimeJob");
    job.setMethod("showTime");

    task.setName("TimeJob");
    task.setJob(job);
    task.setTrigger(CalendarTriggerExample.getTrigger());
    return task;
  }
Esempio n. 2
0
  public static Task getHelloTask() throws JobException {
    Task task = new Task();

    ReflectionJob job = new ReflectionJob();
    job.setClass("org.pinae.rafiki.job.HelloJob");
    job.setMethod("sayHello");
    Object[] parameters = new Object[2];
    parameters[0] = new String("Hello");
    parameters[1] = new String(" World");
    job.setParameters(parameters);

    task.setName("HelloJob");
    task.setJob(job);
    task.setTrigger(CronTriggerExample.getTrigger7());
    return task;
  }