Package org.quartz.impl

Examples of org.quartz.impl.StdSchedulerFactory


            initDatabaseSchema(dataNode, dataMap);

            loadDatabase();

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

            SchedulerService schedulerService = new SchedulerService(schedulerFactory);

            loadQuartzJobs(schedulerService);
View Full Code Here


    }

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

     */
    @Override
    public void doInit() throws Exception {
        if (scheduler == null) {
            if (factory == null) {
                factory = new StdSchedulerFactory();
            }
            scheduler = factory.getScheduler();
        }
        scheduler.getContext().setAllowsTransientData(true);
        scheduler.getContext().put(getComponentName(), this);
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

        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

        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().getManagementName();

            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

{
   private Scheduler scheduler_;

   public QuartzSheduler() throws Exception
   {
      SchedulerFactory sf = new StdSchedulerFactory();
      scheduler_ = sf.getScheduler();
      scheduler_.start();
   }
View Full Code Here

        Properties prop = loadProperties();
        if (prop != null) {
            if (LOG.isDebugEnabled()) {
                LOG.debug("Creating SchedulerFactory with properties: " + prop);
            }
            return new StdSchedulerFactory(prop);
        } else {
            return new StdSchedulerFactory();
        }
    }
View Full Code Here

                defaultProperties.put(THREAD_COUNT, "1") ;
            }
            final Scheduler scheduler ;
            try
            {
                scheduler = new StdSchedulerFactory(defaultProperties).getScheduler();
                scheduler.start() ;
            }
            catch (final SchedulerException se)
            {
                throw new SchedulingException("Failed to initialise the scheduler", se) ;
View Full Code Here

    if (conn == null)
    {
      return false;
    }

    StdSchedulerFactory factory;
    int          errorCode = 0;
    try
    {
            //Initialize scheduler
        logger.info("Initializing Quartz java scheduler");

        String quartzConfigFile = props.getProperty("tcg.sched.configfile", "");
            String threadNo = props.getProperty("tcg.sched.thread", DEF_THREADCOUNT);
           
            //load properties from file
          Properties quartzProps = new Properties();
          if (quartzConfigFile.length() >= 0)
          {
               InputStream in = Utilities.getInputStream(quartzConfigFile);
               if (in != null)
               {
                 quartzProps.load(in);
                   try
                   {
                     in.close();
                   }
                   catch(IOException ioe)
                   {
                     //ignore
                   }
               }
          }

          //override properties with some of our setting
          quartzProps.setProperty("org.quartz.threadPool.threadCount", threadNo);
          String str = quartzProps.getProperty("org.quartz.threadPool.class");
          if (str == null || str.length() == 0)
          {
            quartzProps.setProperty("org.quartz.threadPool.class", "org.quartz.simpl.SimpleThreadPool");
          }
         
          //create the scheduler
          factory = new StdSchedulerFactory(quartzProps);
          scheduler_ = factory.getScheduler();
     
          //Schedule all the jobs
          scheduleJobs(scheduler_, conn);
         
            //Start the scheduler
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.