当前位置: 首页>>代码示例>>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;未经允许,请勿转载。