Package es.emergya.scheduler

Examples of es.emergya.scheduler.CustomScheduler


  protected void loadJobs() {
    try {
      ExtensionClassLoader ecl = new ExtensionClassLoader();
      List<File> jobs = ecl.getJobs();

      CustomScheduler scheduler = new CustomScheduler();

      for (File job : jobs) {
        Properties p = new Properties();
        try {
          p.load(new FileReader(job));
          String _class = p.get("CLASS").toString();

          Job plugin = (Job) Class.forName(_class).newInstance();
          scheduler.addJob((int) plugin.getFrequency(),
              plugin.getName(), plugin.getClass(),
              plugin.getParameters(), plugin.getListenerList());
        } catch (Throwable e) {
          LOG.error(
              "Error trying to load job " + job.getAbsolutePath(),
              e);
        }
      }
      scheduler.start();
    } catch (Throwable t) {
      LOG.error("Error trying to load jobs", t);
      showError(t);
    }
  }
View Full Code Here


            "Error registering Hibernate StatisticsService ["
                + e.getMessage() + "]", e);
      }

      try {
        final CustomScheduler scheduler = new CustomScheduler();

        scheduler.addJob(FREQUENCY, "messageProcessorJob",
            MessageProcessorJob.class, null,
            new ArrayList<JobListener>(0));

        scheduler.start();
      } catch (Throwable e) {
        Main.LOG.error("No se pudo programar el job", e); //$NON-NLS-1$
      }
    }
View Full Code Here

TOP

Related Classes of es.emergya.scheduler.CustomScheduler

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.