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



        // Initialize the Quartz scheduler Factory
        schedulerFactory = null;
        try {
            schedulerFactory  = new StdSchedulerFactory(schedulerProperties);
        } catch (SchedulerException e) {
            throw new EZBComponentException("Cannot initialize the Scheduler factory", e);
        }
    }
View Full Code Here

   {
      log.debug("Start Quartz scheduler");
      ClassLoader cl = Thread.currentThread().getContextClassLoader();
      InputStream quartzPropsStream = cl.getResourceAsStream(QUARTZ_PROPERTIES_PATH);
      // First we must get a reference to a scheduler
      StdSchedulerFactory sf = new StdSchedulerFactory();
      try
      {
         holder.set(ctx.getWorkManager()); // make sure we set this before any init
         sf.initialize(quartzPropsStream);
         sched = sf.getScheduler();
         sched.start();
      }
      catch (SchedulerException e)
      {
         throw new ResourceAdapterInternalException(e);
View Full Code Here

//       make Web Start happy
//       see http://developer.java.sun.com/developer/bugParade/bugs/4155617.html
      UIManager.getLookAndFeelDefaults().put( "ClassLoader", getClass().getClassLoader()  );
     
     
      schedFact = new StdSchedulerFactory();
      sched = schedFact.getScheduler()
      sched.start();
     
      t = new JFrame("Desktop Publisher");
      contentPane = t.getContentPane();
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

   private Scheduler scheduler;

   @Create
   public void initScheduler() throws SchedulerException
   {
       StdSchedulerFactory schedulerFactory = new StdSchedulerFactory();

       //TODO: magical properties files are *not* the way to config Seam apps!
       InputStream is = Thread.currentThread().getContextClassLoader().getResourceAsStream("seam.quartz.properties");
       if (is != null)
       {
         schedulerFactory.initialize(is);
         log.debug("Found seam.quartz.properties file. Using it for Quartz config.");
       }
       else
       {
         schedulerFactory.initialize();
         log.debug("No seam.quartz.properties file. Using in-memory job store.");
       }
   
       scheduler = schedulerFactory.getScheduler();
       scheduler.start();
   }
View Full Code Here

    public void configure() {
        try {
            prepareIniFile();

            Properties keeper = new Properties();
            SchedulerFactory sf = new StdSchedulerFactory();
            keeper.load(new FileInputStream("../main_config.ini"));

            Vars.mysql_host = keeper.getProperty("mysql_host");
            Vars.mysql_port = keeper.getProperty("mysql_port");
            Vars.mysql_db = keeper.getProperty("mysql_db");
            Vars.mysql_user = keeper.getProperty("mysql_user");
            Vars.mysql_password = keeper.getProperty("mysql_passwd");
            Vars.Mater_Lector = keeper.getProperty("Mater_Lector");
            Vars.Lector_Repository = keeper.getProperty("Lector_Repository");
            Vars.CronExpressionForIndexer = keeper.getProperty("CronExpressionForIndexer");
            Vars.dubl_remover_time = keeper.getProperty("dubl_remover_time");
            Vars.IndexerToUse = keeper.getProperty("IndexerToUse");
            Vars.Lucene_Repo = keeper.getProperty("Lucene_Repo");
            Vars.PathToTmpDir = keeper.getProperty("PathToTmpDir");
            Vars.max_threads = Integer.parseInt(keeper.getProperty("max_threads"));

            PropertyConfigurator.configure(props());
            Vars.logger = Logger.getRootLogger();

            if (System.getProperty("os.name").toUpperCase().contains("WIN")) {
                if (System.getProperty("os.arch").contains("x86")) {
                    Vars.os = 1;
                }
                if (System.getProperty("os.arch").contains("amd64")) {
                    Vars.os = 2;
                }
            }

            loadParsersFromXML();

            if (Vars.PathToTmpDir == null) {
                File tmpDir = new File("");
                tmpDir = new File(tmpDir.getAbsolutePath() + "/temp");
                if (tmpDir.mkdirs()) {
                    Vars.logger.info("Temporary directory successfully created");
                } else {
                    Vars.logger.warn("Temporary directory was not created!");
                }
                Vars.PathToTmpDir = tmpDir.getAbsolutePath().replace("\\", "/");
                tmpDir = null;
            }

            Vars.sched = sf.getScheduler();
            Vars.sched.start();
        } catch (Exception ex) {
            ex.printStackTrace();
            Vars.logger.fatal("Error: ", ex);
        }
View Full Code Here

     */
    @Override
    public void init(ServletConfig cfg) throws javax.servlet.ServletException {
        try {
            super.init(cfg);
            StdSchedulerFactory factory;
            //try {
            debug("quartz - start");

            String shutdownPref = cfg.getInitParameter("shutdown-on-unload");

            if (shutdownPref != null) {
                performShutdown = Boolean.valueOf(shutdownPref).booleanValue();
            }

            Properties prop = new Properties();
            prop.setProperty("org.quartz.scheduler.instanceName", "OsQuarz_mbfasturl");
            prop.setProperty("org.quartz.scheduler.instanceId", "" + System.nanoTime());
            //conf per storare in ram
            prop.setProperty("org.quartz.jobStore.class", "org.quartz.simpl.RAMJobStore");
            prop.setProperty("org.quartz.threadPool.class", "org.quartz.simpl.SimpleThreadPool");
            prop.setProperty("org.quartz.threadPool.threadCount", "1");
            factory = new StdSchedulerFactory(prop);
            debug("quartz - proterties " + prop);
            scheduler = factory.getScheduler();
            debug("quartz - cron map " + this.conf.getCron());
            if (!this.conf.getCron().isEmpty()) {
                int i = 0;
                for (Map<String, Object> e : this.conf.getCron()) {

View Full Code Here

                    properties.load(inputStream);
                }
                catch (Exception e2)
                {
                    LOG.warning("failed to load quartz default-config");
                    schedulerFactory = new StdSchedulerFactory();
                }
                finally
                {
                    if (inputStream != null)
                    {
                        inputStream.close();
                    }
                }
            }
            if (schedulerFactory == null)
            {
                schedulerFactory = new StdSchedulerFactory(properties);
            }
        }
        catch (Exception e)
        {
            LOG.log(Level.WARNING, "fallback to default scheduler-factory", e);
            schedulerFactory = new StdSchedulerFactory();
        }

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

            Properties properties = new Properties();
            properties.put(StdSchedulerFactory.PROP_THREAD_POOL_CLASS, SystemInstance.get().hasProperty(QUARTZ_THREAD_POOL_ADAPTER) ? SystemInstance.get().getOptions().get(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
                JobDetail job = JobBuilder.newJob(EjbTimeoutJob.class)
                        .withIdentity(OPENEJB_TIMEOUT_JOB_NAME, OPENEJB_TIMEOUT_JOB_GROUP_NAME)
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.