/** * Creates a scheduler using the specified thread pool and job store. This * scheduler can be retrieved via * {@link DirectSchedulerFactory#getScheduler()} * * @param threadPool * The thread pool for executing jobs * @param jobStore * The type of job store * @throws SchedulerException * if initialization failed */ public void createScheduler(ThreadPool threadPool, JobStore jobStore) throws SchedulerException { createScheduler(DEFAULT_SCHEDULER_NAME, DEFAULT_INSTANCE_ID, threadPool, jobStore); }
/** * Creates a scheduler using the specified thread pool and job store. This * scheduler can be retrieved via * {@link DirectSchedulerFactory#getScheduler()} * * @param threadPool * The thread pool for executing jobs * @param jobStore * The type of job store * @throws SchedulerException * if initialization failed */ public void createScheduler(ThreadPool threadPool, JobStore jobStore) throws SchedulerException { createScheduler(DEFAULT_SCHEDULER_NAME, DEFAULT_INSTANCE_ID, threadPool, jobStore); }
/** * Same as * {@link DirectSchedulerFactory#createScheduler(ThreadPool threadPool, JobStore jobStore)}, * with the addition of specifying the scheduler name and instance ID. This * scheduler can only be retrieved via * {@link DirectSchedulerFactory#getScheduler(String)} * * @param schedulerName * The name for the scheduler. * @param schedulerInstanceId * The instance ID for the scheduler. * @param threadPool * The thread pool for executing jobs * @param jobStore * The type of job store * @throws SchedulerException * if initialization failed */ public void createScheduler(String schedulerName, String schedulerInstanceId, ThreadPool threadPool, JobStore jobStore) throws SchedulerException { createScheduler(schedulerName, schedulerInstanceId, threadPool, jobStore, null, 0, -1, -1); }
/** * Same as * {@link DirectSchedulerFactory#createScheduler(ThreadPool threadPool, JobStore jobStore)}, * with the addition of specifying the scheduler name and instance ID. This * scheduler can only be retrieved via * {@link DirectSchedulerFactory#getScheduler(String)} * * @param schedulerName * The name for the scheduler. * @param schedulerInstanceId * The instance ID for the scheduler. * @param threadPool * The thread pool for executing jobs * @param jobStore * The type of job store * @throws SchedulerException * if initialization failed */ public void createScheduler(String schedulerName, String schedulerInstanceId, ThreadPool threadPool, JobStore jobStore) throws SchedulerException { createScheduler(schedulerName, schedulerInstanceId, threadPool, jobStore, null, 0, -1, -1); }
long idleWaitTime, long dbFailureRetryInterval) throws SchedulerException { createScheduler(schedulerName, schedulerInstanceId, threadPool,
boolean jmxExport, String jmxObjectName) throws SchedulerException { createScheduler(schedulerName, schedulerInstanceId, threadPool, DEFAULT_THREAD_EXECUTOR, jobStore, schedulerPluginMap, rmiRegistryHost, rmiRegistryPort, idleWaitTime,
long idleWaitTime, long dbFailureRetryInterval) throws SchedulerException { createScheduler(schedulerName, schedulerInstanceId, threadPool,
boolean jmxExport, String jmxObjectName) throws SchedulerException { createScheduler(schedulerName, schedulerInstanceId, threadPool, DEFAULT_THREAD_EXECUTOR, jobStore, schedulerPluginMap, rmiRegistryHost, rmiRegistryPort, idleWaitTime,
boolean jmxExport, String jmxObjectName) throws SchedulerException { createScheduler(schedulerName, schedulerInstanceId, threadPool, DEFAULT_THREAD_EXECUTOR, jobStore, schedulerPluginMap, rmiRegistryHost, rmiRegistryPort, idleWaitTime,
boolean jmxExport, String jmxObjectName) throws SchedulerException { createScheduler(schedulerName, schedulerInstanceId, threadPool, DEFAULT_THREAD_EXECUTOR, jobStore, schedulerPluginMap, rmiRegistryHost, rmiRegistryPort, idleWaitTime,
/** * Creates an in memory job store (<code>{@link RAMJobStore}</code>) * The thread priority is set to Thread.NORM_PRIORITY * * @param maxThreads * The number of threads in the thread pool * @throws SchedulerException * if initialization failed. */ public void createVolatileScheduler(int maxThreads) throws SchedulerException { SimpleThreadPool threadPool = new SimpleThreadPool(maxThreads, Thread.NORM_PRIORITY); JobStore jobStore = new RAMJobStore(); this.createScheduler(threadPool, jobStore); }
/** * Creates an in memory job store (<code>{@link RAMJobStore}</code>) * The thread priority is set to Thread.NORM_PRIORITY * * @param maxThreads * The number of threads in the thread pool * @throws SchedulerException * if initialization failed. */ public void createVolatileScheduler(int maxThreads) throws SchedulerException { SimpleThreadPool threadPool = new SimpleThreadPool(maxThreads, Thread.NORM_PRIORITY); JobStore jobStore = new RAMJobStore(); this.createScheduler(threadPool, jobStore); }
/** * Creates a scheduler using the specified thread pool and job store. This * scheduler can be retrieved via * {@link DirectSchedulerFactory#getScheduler()} * * @param threadPool * The thread pool for executing jobs * @param jobStore * The type of job store * @throws SchedulerException * if initialization failed */ public void createScheduler(ThreadPool threadPool, JobStore jobStore) throws SchedulerException { createScheduler(DEFAULT_SCHEDULER_NAME, DEFAULT_INSTANCE_ID, threadPool, jobStore); initialized = true; }
/** * Creates a scheduler using the specified thread pool and job store. This * scheduler can be retrieved via * {@link DirectSchedulerFactory#getScheduler()} * * @param threadPool * The thread pool for executing jobs * @param jobStore * The type of job store * @throws SchedulerException * if initialization failed */ public void createScheduler(ThreadPool threadPool, JobStore jobStore) throws SchedulerException { createScheduler(DEFAULT_SCHEDULER_NAME, DEFAULT_INSTANCE_ID, threadPool, jobStore); initialized = true; }
public QuartzCronScheduler(HealthCheckExecutorThreadPool healthCheckExecutorThreadPool) { try { DirectSchedulerFactory schedulerFactory = DirectSchedulerFactory.getInstance(); ThreadPool threadPool = new QuartzThreadPool(healthCheckExecutorThreadPool); schedulerFactory.createScheduler(HC_SCHEDULER_NAME, "id_" + System.currentTimeMillis(), threadPool, new RAMJobStore()); scheduler = schedulerFactory.getScheduler(HC_SCHEDULER_NAME); scheduler.start(); LOG.debug("Started quartz scheduler {}", scheduler); } catch (SchedulerException e) { throw new IllegalStateException("Could not initialise/start quartz scheduler " + HC_SCHEDULER_NAME, e); } }
/** * Creates an in memory job store (<code>{@link RAMJobStore}</code>) * The thread priority is set to Thread.NORM_PRIORITY * * @param maxThreads * The number of threads in the thread pool * @throws SchedulerException * if initialization failed. */ public void createVolatileScheduler(int maxThreads) throws SchedulerException { SimpleThreadPool threadPool = new SimpleThreadPool(maxThreads, Thread.NORM_PRIORITY); threadPool.initialize(); JobStore jobStore = new RAMJobStore(); this.createScheduler(threadPool, jobStore); }
/** * Creates an in memory job store (<code>{@link RAMJobStore}</code>) * The thread priority is set to Thread.NORM_PRIORITY * * @param maxThreads * The number of threads in the thread pool * @throws SchedulerException * if initialization failed. */ public void createVolatileScheduler(int maxThreads) throws SchedulerException { SimpleThreadPool threadPool = new SimpleThreadPool(maxThreads, Thread.NORM_PRIORITY); threadPool.initialize(); JobStore jobStore = new RAMJobStore(); this.createScheduler(threadPool, jobStore); }
@Override public void setTenantEngine(IMicroserviceTenantEngine tenantEngine) { super.setTenantEngine(tenantEngine); try { DirectSchedulerFactory.getInstance().createScheduler(tenantEngine.getTenant().getToken(), INSTANCE_ID, new SimpleThreadPool(getNumProcessingThreads(), Thread.NORM_PRIORITY), new RAMJobStore()); } catch (SchedulerException e) { throw new RuntimeException("Unable to create Quartz scheduler for schedule manager.", e); } }
@Override public void setTenant(ITenant tenant) { super.setTenant(tenant); try { DirectSchedulerFactory.getInstance().createScheduler(getTenant().getId(), INSTANCE_ID, new SimpleThreadPool(getNumProcessingThreads(), Thread.NORM_PRIORITY), new RAMJobStore()); } catch (SchedulerException e) { throw new RuntimeException("Unable to create Quartz scheduler for schedule manager.", e); } }
private static void schedulerSetup(boolean enablePersistence) throws SchedulerException { JobStore js; if (enablePersistence) { CConfiguration conf = injector.getInstance(CConfiguration.class); tableUtil = new ScheduleStoreTableUtil(dsFramework, conf); datasetBasedTimeScheduleStore = new DatasetBasedTimeScheduleStore(factory, tableUtil, conf); js = datasetBasedTimeScheduleStore; } else { js = new RAMJobStore(); } SimpleThreadPool threadPool = new SimpleThreadPool(10, Thread.NORM_PRIORITY); threadPool.initialize(); DirectSchedulerFactory.getInstance().createScheduler(DUMMY_SCHEDULER_NAME, "1", threadPool, js); scheduler = DirectSchedulerFactory.getInstance().getScheduler(DUMMY_SCHEDULER_NAME); scheduler.start(); }