Package org.quartz.impl

Examples of org.quartz.impl.StdSchedulerFactory


      return;
    }
        log.info("Quartz Initializer Servlet loaded, initializing Scheduler...");

        ServletContext servletContext = sce.getServletContext();
        StdSchedulerFactory factory;
        try {

            String configFile = servletContext.getInitParameter("quartz:config-file");
            if(configFile == null)
                configFile = servletContext.getInitParameter("config-file"); // older name, for backward compatibility
            String shutdownPref = servletContext.getInitParameter("quartz:shutdown-on-unload");
            if(shutdownPref == null)
                shutdownPref = servletContext.getInitParameter("shutdown-on-unload");
            if (shutdownPref != null) {
                performShutdown = Boolean.valueOf(shutdownPref).booleanValue();
            }
            String shutdownWaitPref = servletContext.getInitParameter("quartz:wait-on-shutdown");
            if (shutdownPref != null) {
                waitOnShutdown = Boolean.valueOf(shutdownWaitPref).booleanValue();
            }

            // get Properties
            if (configFile != null) {
                factory = new StdSchedulerFactory(configFile);
            } else {
                factory = new StdSchedulerFactory();
            }

            // Always want to get the scheduler, even if it isn't starting,
            // to make sure it is both initialized and registered.
            SchedulerProvider.scheduler = factory.getScheduler();

//            System.out.println(SchedulerProvider.scheduler.getSchedulerInstanceId());
//            System.out.println(SchedulerProvider.scheduler.getSchedulerName());
//            System.out.println(SchedulerProvider.scheduler.getMetaData().getSummary());
           
View Full Code Here


    }
   
        log.info("Quartz Initializer Servlet loaded, initializing Scheduler...");

        ServletContext servletContext = sce.getServletContext();
        StdSchedulerFactory factory;
        try {

            String configFile = servletContext.getInitParameter("quartz:train-config-file");
            if(configFile == null)
                configFile = servletContext.getInitParameter("config-file"); // older name, for backward compatibility
            String shutdownPref = servletContext.getInitParameter("quartz:shutdown-on-unload");
            if(shutdownPref == null)
                shutdownPref = servletContext.getInitParameter("shutdown-on-unload");
            if (shutdownPref != null) {
                performShutdown = Boolean.valueOf(shutdownPref).booleanValue();
            }
            String shutdownWaitPref = servletContext.getInitParameter("quartz:wait-on-shutdown");
            if (shutdownPref != null) {
                waitOnShutdown = Boolean.valueOf(shutdownWaitPref).booleanValue();
            }

            // get Properties
            if (configFile != null) {
                factory = new StdSchedulerFactory(configFile);
            } else {
                factory = new StdSchedulerFactory();
            }

            // Always want to get the scheduler, even if it isn't starting,
            // to make sure it is both initialized and registered.
            SchedulerProvider.scheduler_train = factory.getScheduler();

            // Should the Scheduler being started now or later
            String startOnLoad = servletContext.getInitParameter("quartz:start-on-load");
            if(startOnLoad == null)
                startOnLoad = servletContext.getInitParameter("start-scheduler-on-load");
View Full Code Here

    @PostConstruct
    public void initialize()
        throws SchedulerException
    {
        SchedulerFactory factory = new StdSchedulerFactory( properties );

        scheduler = (StdScheduler) factory.getScheduler();

        scheduler.start();

    }
View Full Code Here

* @author robh
*/
public class CronTriggerExample {

    public static void main(String[] args) throws Exception {
        Scheduler scheduler = new StdSchedulerFactory().getScheduler();
        scheduler.start();

        JobDetail jobDetail = new JobDetail("messageJob",
                Scheduler.DEFAULT_GROUP, MessageJob.class);

View Full Code Here

* @author robh
*/
public class CronWithCalendarExample {

    public static void main(String[] args) throws Exception {
        Scheduler scheduler = new StdSchedulerFactory().getScheduler();
        scheduler.start();
       
        // create a calendar to exclude a particular date
        Calendar cal = Calendar.getInstance();
        cal.set(2004, Calendar.DECEMBER, 25);
View Full Code Here

* @author robh
*/
public class MessageScheduling {

    public static void main(String[] args) throws Exception{
        Scheduler scheduler = new StdSchedulerFactory().getScheduler();
        scheduler.start();

        JobDetail jobDetail = new JobDetail("messageJob",
                Scheduler.DEFAULT_GROUP, MessageJob.class);
       
View Full Code Here

*/
public class HelloWorldScheduling {

    public static void main(String[] args) throws Exception {

        Scheduler scheduler = new StdSchedulerFactory().getScheduler();
        scheduler.start();

        JobDetail jobDetail = new JobDetail("helloWorldJob",
                Scheduler.DEFAULT_GROUP, HelloWorldJob.class);

View Full Code Here

     * @see org.apache.avalon.framework.activity.Initializable#initialize()
     */
    public void initialize() throws Exception
    {
        // instantiating a specific scheduler from a property file or properties
        StdSchedulerFactory schedulerFactory = new StdSchedulerFactory();
        if(this.quartzProperties != null)
        {
            getLogger().info("Pulling quartz configuration from the container XML configuration");
            schedulerFactory.initialize(this.quartzProperties);
        }
        else if(this.quartzPropertyFile != null)
        {
            getLogger().info("Pulling quartz configuration from the following property file : " + this.quartzPropertyFile);
            schedulerFactory.initialize(this.quartzPropertyFile);
        }
        else
        {
            getLogger().info("Using Quartz default configuration since no user-supplied configuration was found");
            schedulerFactory.initialize();
        }

        this.scheduler = schedulerFactory.getScheduler();

        // add this service instance as JobListener to allow basic monitoring
        getScheduler().getListenerManager().addJobListener(this, new ArrayList());
    }
View Full Code Here

    protected void init() throws SchedulerException {
        // if we don't have a thread pool manager, we use the default thread pool
        final ThreadPoolManager tpm = this.threadPoolManager;
        if ( tpm == null ) {
            final SchedulerFactory factory = new StdSchedulerFactory();
            this.scheduler = factory.getScheduler();
        } else {
            final ThreadPool pool = tpm.get(THREAD_POOL_NAME);
            final QuartzThreadPool quartzPool = new QuartzThreadPool(pool);
            final DirectSchedulerFactory factory = DirectSchedulerFactory.getInstance();
            factory.createScheduler(quartzPool, new RAMJobStore());
            this.scheduler = factory.getScheduler();
        }
        this.scheduler.start();
        if ( this.logger.isDebugEnabled() ) {
            this.logger.debug("Scheduler started.");
        }
View Full Code Here

    protected void init() throws JBIException {
        super.init();
        try {
            if (scheduler == null) {
                if (factory == null) {
                    factory = new StdSchedulerFactory();
                }
                scheduler = factory.getScheduler();
            }
        }
        catch (SchedulerException e) {
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.