org.quartz.spi.ThreadPool#org.quartz.spi.ThreadExecutor源码实例Demo

下面列出了org.quartz.spi.ThreadPool#org.quartz.spi.ThreadExecutor 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: lams   文件: QuartzScheduler.java
/**
 * <p>
 * Create a <code>QuartzScheduler</code> with the given configuration
 * properties.
 * </p>
 * 
 * @see QuartzSchedulerResources
 */
public QuartzScheduler(QuartzSchedulerResources resources, long idleWaitTime, @Deprecated long dbRetryInterval)
    throws SchedulerException {
    this.resources = resources;
    if (resources.getJobStore() instanceof JobListener) {
        addInternalJobListener((JobListener)resources.getJobStore());
    }

    this.schedThread = new QuartzSchedulerThread(this, resources);
    ThreadExecutor schedThreadExecutor = resources.getThreadExecutor();
    schedThreadExecutor.execute(this.schedThread);
    if (idleWaitTime > 0) {
        this.schedThread.setIdleWaitTime(idleWaitTime);
    }

    jobMgr = new ExecutingJobsManager();
    addInternalJobListener(jobMgr);
    errLogger = new ErrorLogger();
    addInternalSchedulerListener(errLogger);

    signaler = new SchedulerSignalerImpl(this, this.schedThread);
    
    if(shouldRunUpdateCheck()) 
        updateTimer = scheduleUpdateCheck();
    else
        updateTimer = null;
    
    getLog().info("Quartz Scheduler v." + getVersion() + " created.");
}
 
源代码2 项目: AsuraFramework   文件: QuartzScheduler.java
/**
 * <p>
 * Create a <code>QuartzScheduler</code> with the given configuration
 * properties.
 * </p>
 * 
 * @see QuartzSchedulerResources
 */
public QuartzScheduler(QuartzSchedulerResources resources,
        SchedulingContext ctxt, long idleWaitTime, long dbRetryInterval)
    throws SchedulerException {
    this.resources = resources;

    this.schedThread = new QuartzSchedulerThread(this, resources, ctxt);
    ThreadExecutor schedThreadExecutor = resources.getThreadExecutor();
    schedThreadExecutor.execute(this.schedThread);
    if (idleWaitTime > 0) {
        this.schedThread.setIdleWaitTime(idleWaitTime);
    }
    if (dbRetryInterval > 0) {
        this.schedThread.setDbFailureRetryInterval(dbRetryInterval);
    }

    jobMgr = new ExecutingJobsManager();
    addGlobalJobListener(jobMgr);
    errLogger = new ErrorLogger();
    addSchedulerListener(errLogger);

    signaler = new SchedulerSignalerImpl(this, this.schedThread);
    
    if(shouldRunUpdateCheck()) 
        updateTimer = scheduleUpdateCheck();
    else
        updateTimer = null;
    
    this.dbRetryInterval = dbRetryInterval;
    
    getLog().info("Quartz Scheduler v." + getVersion() + " created.");
    
}
 
源代码3 项目: lams   文件: JobStoreSupport.java
public void setThreadExecutor(ThreadExecutor threadExecutor) {
    this.threadExecutor = threadExecutor;
}
 
源代码4 项目: lams   文件: JobStoreSupport.java
public ThreadExecutor getThreadExecutor() {
    return threadExecutor;
}
 
源代码5 项目: lams   文件: JobStoreSupport.java
public void initialize() {
    this.manage();

    ThreadExecutor executor = getThreadExecutor();
    executor.execute(ClusterManager.this);
}
 
源代码6 项目: lams   文件: JobStoreSupport.java
public void initialize() {
    ThreadExecutor executor = getThreadExecutor();
    executor.execute(MisfireHandler.this);
}
 
源代码7 项目: lams   文件: QuartzSchedulerResources.java
/**
 * Get the ThreadExecutor which runs the QuartzSchedulerThread
 */
public ThreadExecutor getThreadExecutor() {
    return threadExecutor;
}
 
源代码8 项目: lams   文件: QuartzSchedulerResources.java
/**
 * Set the ThreadExecutor which runs the QuartzSchedulerThread
 */
public void setThreadExecutor(ThreadExecutor threadExecutor) {
    this.threadExecutor = threadExecutor;
}
 
源代码9 项目: AsuraFramework   文件: JobStoreSupport.java
public void setThreadExecutor(ThreadExecutor threadExecutor) {
	this.threadExecutor = threadExecutor;
}
 
源代码10 项目: AsuraFramework   文件: JobStoreSupport.java
public ThreadExecutor getThreadExecutor() {
	return threadExecutor;
}
 
源代码11 项目: AsuraFramework   文件: JobStoreSupport.java
public void initialize() {
    this.manage();

    ThreadExecutor executor = getThreadExecutor();
    executor.execute(ClusterManager.this);
}
 
源代码12 项目: AsuraFramework   文件: JobStoreSupport.java
public void initialize() {
    ThreadExecutor executor = getThreadExecutor();
    executor.execute(MisfireHandler.this);
}
 
源代码13 项目: nexus-public   文件: QuartzSchedulerProvider.java
private Scheduler createScheduler() {
  try {
    // ensure executed threads have TCCL set
    ThreadExecutor threadExecutor = new DefaultThreadExecutor()
    {
      @Override
      public void execute(final Thread thread) {
        thread.setContextClassLoader(QuartzSchedulerProvider.class.getClassLoader());
        super.execute(thread);
      }
    };

    // create Scheduler (implicitly registers it with repository)
    DirectSchedulerFactory.getInstance().createScheduler(
        SCHEDULER_NAME,
        nodeAccess.getId(), // instance-id
        new QuartzThreadPool(threadPoolSize, threadPriority),
        threadExecutor,
        jobStore.get(),
        null, // scheduler plugin-map
        null, // rmi-registry host
        0,    // rmi-registry port
        -1,   // idle-wait time
        -1,   // db-failure retry-interval
        true, // jmx-export
        null, // custom jmx object-name, lets use the default
        1,    // max batch-size
        0L    // batch time-window
    );
    Scheduler s = DirectSchedulerFactory.getInstance().getScheduler(SCHEDULER_NAME);
    s.setJobFactory(jobFactory);

    // re-logging with version, as by default we limit quartz logging to WARN, hiding its default version logging
    log.info("Quartz Scheduler v{}", s.getMetaData().getVersion());

    s.standby();

    return s;
  }
  catch (Exception e) {
    throw new RuntimeException(e);
  }
}
 
源代码14 项目: lams   文件: DirectSchedulerFactory.java
/**
 * Creates a scheduler using the specified thread pool, job store, and
 * plugins, and binds it to RMI.
 *
 * @param schedulerName
 *          The name for the scheduler.
 * @param schedulerInstanceId
 *          The instance ID for the scheduler.
 * @param threadPool
 *          The thread pool for executing jobs
 * @param threadExecutor
 *          The thread executor for executing jobs
 * @param jobStore
 *          The type of job store
 * @param schedulerPluginMap
 *          Map from a <code>String</code> plugin names to
 *          <code>{@link org.quartz.spi.SchedulerPlugin}</code>s.  Can use
 *          "null" if no plugins are required.
 * @param rmiRegistryHost
 *          The hostname to register this scheduler with for RMI. Can use
 *          "null" if no RMI is required.
 * @param rmiRegistryPort
 *          The port for RMI. Typically 1099.
 * @param idleWaitTime
 *          The idle wait time in milliseconds. You can specify "-1" for
 *          the default value, which is currently 30000 ms.
 * @throws SchedulerException
 *           if initialization failed
 */
public void createScheduler(String schedulerName,
        String schedulerInstanceId, ThreadPool threadPool,
        ThreadExecutor threadExecutor,
        JobStore jobStore, Map<String, SchedulerPlugin> schedulerPluginMap,
        String rmiRegistryHost, int rmiRegistryPort,
        long idleWaitTime, long dbFailureRetryInterval,
        boolean jmxExport, String jmxObjectName)
    throws SchedulerException {
    createScheduler(schedulerName, schedulerInstanceId, threadPool,
            DEFAULT_THREAD_EXECUTOR, jobStore, schedulerPluginMap,
            rmiRegistryHost, rmiRegistryPort, idleWaitTime,
            dbFailureRetryInterval, jmxExport, jmxObjectName, DEFAULT_BATCH_MAX_SIZE, DEFAULT_BATCH_TIME_WINDOW);
}
 
源代码15 项目: AsuraFramework   文件: QuartzSchedulerResources.java
/**
 * Get the ThreadExecutor which runs the QuartzSchedulerThread
 * 
 * @return
 */
public ThreadExecutor getThreadExecutor() {
    return threadExecutor;
}
 
源代码16 项目: AsuraFramework   文件: QuartzSchedulerResources.java
/**
 * Set the ThreadExecutor which runs the QuartzSchedulerThread
 *
 * @param threadExecutor
 */
public void setThreadExecutor(ThreadExecutor threadExecutor) {
    this.threadExecutor = threadExecutor;
}