Examples of AstroConfig


Examples of org.openhab.binding.astro.internal.common.AstroConfig

  /**
   * Schedules the IntervalJob with the specified interval and starts it
   * immediately.
   */
  public void scheduleIntervalJob() {
    AstroConfig config = context.getConfig();

    String jobName = IntervalJob.class.getSimpleName();
    Date start = new Date(System.currentTimeMillis() + (config.getInterval()) * 1000);
    Trigger trigger = newTrigger().withIdentity(jobName + "-Trigger", JOB_GROUP).startAt(start)
        .withSchedule(simpleSchedule().repeatForever().withIntervalInSeconds(config.getInterval())).build();

    schedule(jobName, IntervalJob.class, trigger, new JobDataMap());
    logger.info("Scheduled astro job with interval of {} seconds", config.getInterval());
  }
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.