• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java KeyMatcher类的典型用法和代码示例

java 2次浏览

本文整理汇总了Java中org.quartz.impl.matchers.KeyMatcher的典型用法代码示例。如果您正苦于以下问题:Java KeyMatcher类的具体用法?Java KeyMatcher怎么用?Java KeyMatcher使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

KeyMatcher类属于org.quartz.impl.matchers包,在下文中一共展示了KeyMatcher类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: main

点赞 2

import org.quartz.impl.matchers.KeyMatcher; //导入依赖的package包/类
/**
 * The main method.
 *
 * @param args the arguments
 * @throws SchedulerException the scheduler exception
 */
public static void main(String[] args) throws SchedulerException {
	System.out.println("Starting MainApplication...");
	System.out.println("Starting Scheduler...");

	app.sched_fact = new org.quartz.impl.StdSchedulerFactory();
	app.scheduler = app.sched_fact.getScheduler();
	app.setIsinMutexMap(new LinkedHashMap<String, ReentrantLock>());
	app.scheduler.start();
	
	System.out.println("Creating Jobs...");

	app.createJobs();
	System.out.println("Adding Jobs...");

	if(!app.addJobsToScheduler()) {
		System.out.println("Adding Jobs to Scheduler failed.");
		return;
	}
	
	System.out.println("Creating Listeners...");
  
	CompanyIndexerListener company_index_listener = new CompanyIndexerListener("company_index_listener");
	app.scheduler.getListenerManager().addJobListener(company_index_listener, KeyMatcher.keyEquals(app.company_indexer_job.getKey()));

	IsinMutexMapListener isin_mutex_map_listener = new IsinMutexMapListener("isin_mutex_map_listener");
	app.scheduler.getListenerManager().addJobListener(isin_mutex_map_listener, KeyMatcher.keyEquals(app.isin_mutex_map_creation_job.getKey()));

	System.out.println("Creating Triggers...");

	/*Trigger daily_trigger = newTrigger()
		    .withIdentity("Daily Trigger", "Crawler Triggers")
		    .withSchedule(cronSchedule("0 25 17 ? * MON-FRI"))
		    .build();
	
	Trigger weekly_trigger = newTrigger()
			.withIdentity("Weekly Trigger", "Crawler Triggers")
			.withSchedule(cronSchedule("0 00 15 ? * SAT-SUN"))
			.build();
	
	app.scheduler.scheduleJob(app.market_values_crawler_job, daily_trigger);
	app.scheduler.scheduleJob(app.company_indexer_job, weekly_trigger);*/
	
	MainApplication.app.getMarketValuesCrawlerJob().getJobDataMap().put("to_crawl", MarketValuesCrawler.ToCrawl.HISTORY.ordinal());
	//app.getScheduler().triggerJob(MainApplication.app.company_indexer_job.getKey());
	app.getScheduler().triggerJob(MainApplication.app.getIsinMutexMapCreationJob().getKey());
	//app.getScheduler().triggerJob(MainApplication.app.history_market_values_crawler_job.getKey());
	//app.getScheduler().triggerJob(MainApplication.app.market_values_crawler_job.getKey());



}
 

开发者ID:mattmagic149,
项目名称:AnSoMia,
代码行数:58,
代码来源:MainApplication.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)