Package org.quartz.impl

Examples of org.quartz.impl.StdSchedulerFactory


     *
     * @param properties Properties
     */
    public void init(Properties properties) {

        StdSchedulerFactory sf = new StdSchedulerFactory();

        if (properties != null) {
            String quartzConf = properties.getProperty(QUARTZ_CONF);
            try {
                if (quartzConf != null && !"".equals(quartzConf)) {

                    if (log.isDebugEnabled()) {
                        log.debug("Initiating a Scheduler with configuration : " + quartzConf);
                    }

                    sf.initialize(quartzConf);
                }
            } catch (SchedulerException e) {
                throw new SynapseTaskException("Error initiating scheduler factory "
                        + sf + "with configuration loaded from " + quartzConf, e, log);
            }
        }

        try {

            if (name != null) {
                scheduler = sf.getScheduler(name);
            }
            if (scheduler == null) {
                scheduler = sf.getScheduler();
            }

        } catch (SchedulerException e) {
            throw new SynapseTaskException("Error getting a  scheduler instance form scheduler" +
                    " factory " + sf, e, log);
View Full Code Here


        try
        {
            if (quartzScheduler == null)
            {
                SchedulerFactory factory = new StdSchedulerFactory(factoryProperties);
                quartzScheduler = factory.getScheduler();
            }
            quartzScheduler.getContext().put(MuleProperties.MULE_CONTEXT_PROPERTY, muleContext);           
       
        }
        catch (Exception e)
View Full Code Here

    }
  }
 
  public void schedulerRestart() {

    StdSchedulerFactory ssf = null;
    Scheduler sched = null;
   
      try {
        ssf = new StdSchedulerFactory();
      sched = ssf.getScheduler();
      sched.start();
    } catch (SchedulerException e) {
      e.printStackTrace();
    }
   
View Full Code Here

   */
  public Scheduler() throws SchedulerException, IOException
  {
    super();
    try {
      StdSchedulerFactory factory = new StdSchedulerFactory();
      Properties config = new Properties();
      InputStream configSource = Thread.currentThread().getContextClassLoader().getResourceAsStream("org/jresearch/gossip/resources/scheduler.properties");
      config.load(configSource);
      factory.initialize(config);
      m_scheduler = factory.getScheduler();
      m_scheduler.addGlobalJobListener(new JobListener());
      m_scheduler.addGlobalTriggerListener(new TriggerListener());
      JobDetail jobDetail = new JobDetail(
          getConfValue(config, "task.name"),
          getConfValue(config, "task.group"),
View Full Code Here

import org.quartz.impl.StdSchedulerFactory;

public class SchedulerUtil {
 
  public static Calendar getCalendarByCronExpression(String cronExpression) throws Exception {
    SchedulerFactory sf = new StdSchedulerFactory();
    Scheduler sched = sf.getScheduler();
   
    JobDetail jd = sched.getJobDetail("tempJobDetail", "tempGroupJobDetail");
    if (jd != null) {
      sched.unscheduleJob("tempJobDetail", "tempGroupJobDetail");
      sched.deleteJob("tempJobDetail" , "tempGroupJobDetail");
View Full Code Here

     */
    protected SchedulerService getSchedulerService() {
        if (schedulerService == null) {
            ServletContext servletContext = getContext().getServletContext();

            StdSchedulerFactory schedulerFactory = (StdSchedulerFactory)
                servletContext.getAttribute(QuartzInitializerListener.QUARTZ_FACTORY_KEY);

            if (schedulerFactory != null) {
                schedulerService = new SchedulerService(schedulerFactory);
            }
View Full Code Here

    props.setProperty(PROP_THREAD_POOL_CLASS, SimpleThreadPool.class.getCanonicalName());
    props.setProperty(PROP_THREAD_POOL_PREFIX + ".threadCount", NUM_THREADS.get().toString());
    props.setProperty(PROP_THREAD_POOL_PREFIX + ".makeThreadsDaemons", Boolean.TRUE.toString());

    props.setProperty(PROP_SCHED_MAKE_SCHEDULER_THREAD_DAEMON, Boolean.TRUE.toString());
    Scheduler scheduler = new StdSchedulerFactory(props).getScheduler();
    scheduler.setJobFactory(jobFactory);
    return scheduler;
  }
View Full Code Here

        SchedulerFactory schedulerFactory;
        try
        {
            String configFile =
                ConfigResolver.getPropertyValue("deltaspike.scheduler.quartz_config-file", "quartz.properties");
            schedulerFactory = new StdSchedulerFactory(configFile);
        }
        catch (SchedulerException e)
        {
            schedulerFactory = new StdSchedulerFactory();
        }

        try
        {
            this.scheduler = schedulerFactory.getScheduler();
View Full Code Here

    }

    // Implementation methods
    // -------------------------------------------------------------------------
    protected SchedulerFactory createSchedulerFactory() {
        return new StdSchedulerFactory();
    }
View Full Code Here

        if (prop != null) {

            // force disabling update checker (will do online check over the internet)
            prop.put("org.quartz.scheduler.skipUpdateCheck", "true");

            answer = new StdSchedulerFactory(prop);
        } else {
            // read default props to be able to use a single scheduler per camel context
            // if we need more than one scheduler per context use setScheduler(Scheduler)
            // or setFactory(SchedulerFactory) methods

            // must use classloader from StdSchedulerFactory to work even in OSGi
            InputStream is = StdSchedulerFactory.class.getClassLoader().getResourceAsStream("org/quartz/quartz.properties");
            if (is == null) {
                throw new SchedulerException("Quartz properties file not found in classpath: org/quartz/quartz.properties");
            }
            prop = new Properties();
            try {
                prop.load(is);
            } catch (IOException e) {
                throw new SchedulerException("Error loading Quartz properties file from classpath: org/quartz/quartz.properties", e);
            }

            // camel context name will be a suffix to use one scheduler per context
            String identity = getCamelContext().getName();

            String instName = prop.getProperty(StdSchedulerFactory.PROP_SCHED_INSTANCE_NAME);
            if (instName == null) {
                instName = "scheduler-" + identity;
            } else {
                instName = instName + "-" + identity;
            }
            prop.setProperty(StdSchedulerFactory.PROP_SCHED_INSTANCE_NAME, instName);

            // force disabling update checker (will do online check over the internet)
            prop.put("org.quartz.scheduler.skipUpdateCheck", "true");

            answer = new StdSchedulerFactory(prop);
        }

        if (LOG.isDebugEnabled()) {
            String name = prop.getProperty(StdSchedulerFactory.PROP_SCHED_INSTANCE_NAME);
            LOG.debug("Creating SchedulerFactory: {} with properties: {}", name, prop);
View Full Code Here

TOP

Related Classes of org.quartz.impl.StdSchedulerFactory

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.