當前位置: 首頁>>代碼示例>>Java>>正文


Java Scheduler.getSchedulerName方法代碼示例

本文整理匯總了Java中org.quartz.Scheduler.getSchedulerName方法的典型用法代碼示例。如果您正苦於以下問題:Java Scheduler.getSchedulerName方法的具體用法?Java Scheduler.getSchedulerName怎麽用?Java Scheduler.getSchedulerName使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.quartz.Scheduler的用法示例。


在下文中一共展示了Scheduler.getSchedulerName方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: initialize

import org.quartz.Scheduler; //導入方法依賴的package包/類
/**
 * <p>
 * Called during creation of the <code>Scheduler</code> in order to give
 * the <code>SchedulerPlugin</code> a chance to initialize.
 * </p>
 * 
 * @throws SchedulerConfigException
 *           if there is an error initializing.
 */
public void initialize(String name, final Scheduler scheduler, ClassLoadHelper classLoadHelper)
    throws SchedulerException {

    getLog().info("Registering Quartz shutdown hook.");

    Thread t = new Thread("Quartz Shutdown-Hook "
            + scheduler.getSchedulerName()) {
        @Override
        public void run() {
            getLog().info("Shutting down Quartz...");
            try {
                scheduler.shutdown(isCleanShutdown());
            } catch (SchedulerException e) {
                getLog().info(
                        "Error shutting down Quartz: " + e.getMessage(), e);
            }
        }
    };

    Runtime.getRuntime().addShutdownHook(t);
}
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:31,代碼來源:ShutdownHookPlugin.java

示例2: initialize

import org.quartz.Scheduler; //導入方法依賴的package包/類
/**
 * <p>
 * Called during creation of the <code>Scheduler</code> in order to give
 * the <code>SchedulerPlugin</code> a chance to initialize.
 * </p>
 * 
 * @throws SchedulerConfigException
 *           if there is an error initializing.
 */
public void initialize(String name, final Scheduler scheduler)
    throws SchedulerException {
    this.name = name;
    this.scheduler = scheduler;

    getLog().info("Registering Quartz shutdown hook.");

    Thread t = new Thread("Quartz Shutdown-Hook "
            + scheduler.getSchedulerName()) {
        public void run() {
            getLog().info("Shutting down Quartz...");
            try {
                scheduler.shutdown(isCleanShutdown());
            } catch (SchedulerException e) {
                getLog().info(
                        "Error shutting down Quartz: " + e.getMessage(), e);
            }
        }
    };

    Runtime.getRuntime().addShutdownHook(t);
}
 
開發者ID:AsuraTeam,項目名稱:asura,代碼行數:32,代碼來源:ShutdownHookPlugin.java

示例3: bind

import org.quartz.Scheduler; //導入方法依賴的package包/類
public synchronized void bind(Scheduler sched) throws SchedulerException {

        if ((Scheduler) schedulers.get(sched.getSchedulerName()) != null) {
            throw new SchedulerException("Scheduler with name '"
                    + sched.getSchedulerName() + "' already exists.");
        }

        schedulers.put(sched.getSchedulerName(), sched);
    }
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:10,代碼來源:SchedulerRepository.java

示例4: bind

import org.quartz.Scheduler; //導入方法依賴的package包/類
public synchronized void bind(Scheduler sched) throws SchedulerException {

        if ((Scheduler) schedulers.get(sched.getSchedulerName()) != null) {
            throw new SchedulerException("Scheduler with name '"
                    + sched.getSchedulerName() + "' already exists.",
                    SchedulerException.ERR_BAD_CONFIGURATION);
        }

        schedulers.put(sched.getSchedulerName(), sched);
    }
 
開發者ID:AsuraTeam,項目名稱:asura,代碼行數:11,代碼來源:SchedulerRepository.java

示例5: afterDAO

import org.quartz.Scheduler; //導入方法依賴的package包/類
@Bean(name = "afterDAO")
public AfterDAO afterDAO(@Qualifier("mainScheduler") Scheduler scheduler,
                         @Qualifier("namedParameterJdbcTemplate") NamedParameterJdbcTemplate namedParameterJdbcTemplate,
                         @Qualifier("nameAndGroupRowMapper") NameAndGroupRowMapper nameAndGroupRowMapper,
                         @Qualifier("nameAndGroupOrderedPairMapper") NameAndGroupOrderedPairMapper nameAndGroupOrderedPairMapper) throws SchedulerException {
    return new StdAfterDAO(scheduler.getSchedulerName(), namedParameterJdbcTemplate, nameAndGroupRowMapper, nameAndGroupOrderedPairMapper);
}
 
開發者ID:taboola,項目名稱:taboola-cronyx,代碼行數:8,代碼來源:CronyxAutoConfiguration.java

示例6: newJob

import org.quartz.Scheduler; //導入方法依賴的package包/類
@Override
public Job newJob(TriggerFiredBundle bundle, Scheduler scheduler) throws SchedulerException {

    JobDetail jobDetail = bundle.getJobDetail();
    MetricRegistry metricRegistry = autowireCapableBeanFactory.getBean(MetricRegistry.class);
    HistorianDAO historianDAO = autowireCapableBeanFactory.getBean(HistorianDAO.class);
    AfterDAO afterDAO = autowireCapableBeanFactory.getBean(AfterDAO.class);

    try {
        return new TriggerAwareLoggingJob(
                new HistorianJob(
                        new TimedJob(
                                new ErrorHandlingJob(
                                        (Job) autowireCapableBeanFactory.autowire(jobDetail.getJobClass(),
                                                AutowireCapableBeanFactory.AUTOWIRE_CONSTRUCTOR, false)
                                ),
                                metricRegistry
                        ),
                        Clock.systemUTC(),
                        scheduler.getSchedulerName(),
                        scheduler.getSchedulerInstanceId(),
                        historianDAO,
                        afterDAO
                )
        );
    } catch (Exception e) {
        throw new SchedulerException(
                "Problem instantiating class '"
                        + jobDetail.getJobClass().getName() + "'", e);
    }
}
 
開發者ID:taboola,項目名稱:taboola-cronyx,代碼行數:32,代碼來源:DelegatingQuartzJobFactory.java

示例7: schedulerName

import org.quartz.Scheduler; //導入方法依賴的package包/類
@Bean(name = "schedulerName")
public String schedulerName(@Qualifier("mainScheduler") Scheduler scheduler) throws SchedulerException {
    return scheduler.getSchedulerName();
}
 
開發者ID:taboola,項目名稱:taboola-cronyx,代碼行數:5,代碼來源:CronyxAutoConfiguration.java

示例8: historianDAO

import org.quartz.Scheduler; //導入方法依賴的package包/類
@Bean(name = "historianDAO")
public HistorianDAO historianDAO(@Qualifier("mainScheduler") Scheduler scheduler,
                                 @Qualifier("namedParameterJdbcTemplate") NamedParameterJdbcTemplate namedParameterJdbcTemplate,
                                 @Qualifier("historianEntryMapper") HistorianEntryMapper historianEntryMapper) throws SchedulerException {
    return new StdHistorianDAO(scheduler.getSchedulerName(), namedParameterJdbcTemplate, historianEntryMapper);
}
 
開發者ID:taboola,項目名稱:taboola-cronyx,代碼行數:7,代碼來源:CronyxAutoConfiguration.java


注:本文中的org.quartz.Scheduler.getSchedulerName方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。