Package org.quartz.impl

Examples of org.quartz.impl.StdSchedulerFactory


        }
    }

    public void init(SynapseEnvironment se) {
        super.init(se);
        StdSchedulerFactory sf = new StdSchedulerFactory();
        try {
            if (quartzConfig != null && !"".equals(quartzConfig)) {
                if (log.isDebugEnabled()) {
                    log.debug("Initiating a Scheduler with configuration : " + quartzConfig);
                }

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

        try {
            scheduler = sf.getScheduler();

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


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

            if(properties != null && !properties.isEmpty()) {
                // Overlay the defaults with the configs on the schedule config...
                defaultProperties.putAll(properties);
            }
            if(!defaultProperties.isEmpty()) {
                scheduler = new StdSchedulerFactory(defaultProperties).getScheduler();
            } else {
                scheduler = new StdSchedulerFactory().getScheduler();
            }
            scheduler.start() ;
            tcc = Thread.currentThread().getContextClassLoader() ;
        } catch (SchedulerException e) {
            throw new ConfigurationException("Unable to create Scheduler instance.", e);
View Full Code Here

     *
     * @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

            Properties properties = new Properties();
            properties.put(StdSchedulerFactory.PROP_THREAD_POOL_CLASS, SystemInstance.get().hasProperty(QUARTZ_THREAD_POOL_ADAPTER) ? SystemInstance.get().getProperty(QUARTZ_THREAD_POOL_ADAPTER)
                    : DefaultTimerThreadPoolAdapter.class.getName());
            properties.put(StdSchedulerFactory.PROP_SCHED_INSTANCE_NAME, "OpenEJB-TimerService-Scheduler");
            try {
                scheduler = new StdSchedulerFactory(properties).getScheduler();
                scheduler.start();
                //durability is configured with true, which means that the job will be kept in the store even if no trigger is attached to it.
                //Currently, all the EJB beans share with the same job instance
                scheduler.addJob(new JobDetail(OPENEJB_TIMEOUT_JOB_NAME, OPENEJB_TIMEOUT_JOB_GROUP_NAME, EjbTimeoutJob.class, false, true, false), true);
            } catch (SchedulerException e) {
View Full Code Here

     */
    public SchedulerWrapper(String _servletContextPath, String _schedulerConfigurationPath) {
        this.servletContextPath = _servletContextPath;
        this.schedulerConfigurationPath = _schedulerConfigurationPath;

        SchedulerFactory factory = new StdSchedulerFactory();
        log.info("------- Starting up -----------------------");

        try {
            this.scheduler = factory.getScheduler();

            this.scheduler.addSchedulerListener(new AbstractSchedulerListener());
            this.scheduler.start();
        } catch (SchedulerException e) {
            log.error("Can't initialize SchedulerWrapper: ", e);
View Full Code Here

    protected void init() throws JBIException {
        super.init();
        try {
            if (scheduler == null) {
                if (factory == null) {
                    factory = new StdSchedulerFactory();
                }
                scheduler = factory.getScheduler();
                scheduler.pauseAll();
                scheduler.start();
            }
View Full Code Here

  public void init(ServiceContext context) throws JBIException {
    this.serviceContext = context;
    try {
      if (scheduler == null) {
        if (factory == null) {
          factory = new StdSchedulerFactory();
        }
        scheduler = factory.getScheduler();
      }
    } catch (SchedulerException e) {
      throw new JBIException(e);
View Full Code Here

        schedulerConfig.setProperty(StdSchedulerFactory.PROP_THREAD_POOL_CLASS, SimpleThreadPool.class.getName());
        schedulerConfig.setProperty(StdSchedulerFactory.PROP_THREAD_POOL_PREFIX + ".threadCount", "5");
        schedulerConfig.setProperty(StdSchedulerFactory.PROP_THREAD_POOL_PREFIX + ".threadNamePrefix",
            "RHQServerPluginsJob");

        StdSchedulerFactory factory = new StdSchedulerFactory();
        factory.initialize(schedulerConfig);

        Scheduler scheduler = factory.getScheduler();
        scheduler.start();

        this.nonClusteredSchedulerFactory = factory;
        return;
    }
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: " + name + " with properties: " + 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.