本文整理汇总了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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
}
示例7: schedulerName
import org.quartz.Scheduler; //导入方法依赖的package包/类
@Bean(name = "schedulerName")
public String schedulerName(@Qualifier("mainScheduler") Scheduler scheduler) throws SchedulerException {
return scheduler.getSchedulerName();
}
示例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);
}