本文整理汇总了Java中org.quartz.simpl.CascadingClassLoadHelper类的典型用法代码示例。如果您正苦于以下问题:Java CascadingClassLoadHelper类的具体用法?Java CascadingClassLoadHelper怎么用?Java CascadingClassLoadHelper使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CascadingClassLoadHelper类属于org.quartz.simpl包,在下文中一共展示了CascadingClassLoadHelper类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: initialize
import org.quartz.simpl.CascadingClassLoadHelper; //导入依赖的package包/类
/**
* <p>
* Called during creation of the <code>Scheduler</code> in order to give
* the <code>SchedulerPlugin</code> a chance to initialize.
* </p>
*
* @throws org.quartz.SchedulerConfigException
* if there is an error initializing.
*/
public void initialize(String name, final Scheduler scheduler)
throws SchedulerException {
super.initialize(name, scheduler);
classLoadHelper = new CascadingClassLoadHelper();
classLoadHelper.initialize();
getLog().info("Registering Quartz Job Initialization Plug-in.");
// Create JobFile objects
StringTokenizer stok = new StringTokenizer(fileNames, FILE_NAME_DELIMITERS);
while (stok.hasMoreTokens()) {
final String fileName = stok.nextToken();
final JobFile jobFile = new JobFile(fileName);
jobFiles.put(fileName, jobFile);
}
}
开发者ID:AsuraTeam,项目名称:asura,代码行数:27,代码来源:XMLSchedulingDataProcessorPlugin.java
示例2: makeJobDetail
import org.quartz.simpl.CascadingClassLoadHelper; //导入依赖的package包/类
private QuartzJobDetail makeJobDetail(CascadingClassLoadHelper cascadingClassLoadHelper, ResultSet rs) throws SQLException, ClassNotFoundException, IOException {
JobDetailImpl jobDetail = new JobDetailImpl();
String groupName = rs.getString(Constants.COL_JOB_GROUP);
String jobName = rs.getString(Constants.COL_JOB_NAME);
jobDetail.setName(jobName);
jobDetail.setGroup(groupName);
jobDetail.setDescription(rs.getString(Constants.COL_DESCRIPTION));
jobDetail.setJobClass(
cascadingClassLoadHelper.loadClass(rs.getString(Constants.COL_JOB_CLASS), Job.class)
);
jobDetail.setDurability(rs.getBoolean(Constants.COL_IS_DURABLE));
jobDetail.setRequestsRecovery(rs.getBoolean(Constants.COL_REQUESTS_RECOVERY));
Map<?, ?> map = (Map<?, ?>) getObjectFromBlob(rs, COL_JOB_DATAMAP);
if (map != null) {
jobDetail.setJobDataMap(new JobDataMap(map));
}
JobId jobId = new QuartzJobId(groupName, jobName, engine.getClusterName());
QuartzJobDetail quartzJobDetail = new QuartzJobDetail(engine, jobId, jobDetail,
rs.getTimestamp(WinderJDBCDelegate.COL_JOB_CREATED));
return quartzJobDetail;
}
开发者ID:eBay,项目名称:Winder,代码行数:27,代码来源:QuartzSchedulerManager.java
示例3: setUp
import org.quartz.simpl.CascadingClassLoadHelper; //导入依赖的package包/类
@BeforeClass
public void setUp()
throws SchedulerException, InterruptedException {
fSignaler = new SampleSignaler();
Config config = new Config();
config.setProperty("hazelcast.logging.type", "slf4j");
hazelcastInstance = Hazelcast.newHazelcastInstance(config);
ClassLoadHelper loadHelper = new CascadingClassLoadHelper();
loadHelper.initialize();
HazelcastJobStore.setHazelcastClient(hazelcastInstance);
jobStore = createJobStore("AbstractJobStoreTest");
jobStore.initialize(loadHelper, this.fSignaler);
jobStore.schedulerStarted();
jobDetail = JobBuilder.newJob(NoOpJob.class).withIdentity("job1", "jobGroup1").build();
jobStore.storeJob(jobDetail, false);
}
开发者ID:FlavioF,项目名称:quartz-scheduler-hazelcast-jobstore,代码行数:22,代码来源:HazelcastJobStoreTest.java
示例4: testStoreAndRetrieveJobs
import org.quartz.simpl.CascadingClassLoadHelper; //导入依赖的package包/类
@Test
public void testStoreAndRetrieveJobs()
throws Exception {
final int nJobs = 10;
SchedulerSignaler schedSignaler = new SampleSignaler();
ClassLoadHelper loadHelper = new CascadingClassLoadHelper();
loadHelper.initialize();
JobStore store = createJobStore("testStoreAndRetrieveJobs");
store.initialize(loadHelper, schedSignaler);
// Store jobs.
for (int i = 0; i < nJobs; i++) {
JobDetail job = JobBuilder.newJob(NoOpJob.class).withIdentity("job" + i).build();
store.storeJob(job, false);
}
// Retrieve jobs.
for (int i = 0; i < nJobs; i++) {
JobKey jobKey = JobKey.jobKey("job" + i);
JobDetail storedJob = store.retrieveJob(jobKey);
Assert.assertEquals(storedJob.getKey(), jobKey);
}
}
开发者ID:FlavioF,项目名称:quartz-scheduler-hazelcast-jobstore,代码行数:27,代码来源:HazelcastJobStoreTest.java
示例5: testStoreAndRetrieveJobs
import org.quartz.simpl.CascadingClassLoadHelper; //导入依赖的package包/类
@Test()
public void testStoreAndRetrieveJobs() throws Exception {
SchedulerSignaler schedSignaler = new SampleSignaler();
ClassLoadHelper loadHelper = new CascadingClassLoadHelper();
loadHelper.initialize();
JobStore store = createJobStore("testStoreAndRetrieveJobs");
store.initialize(loadHelper, schedSignaler);
// Store jobs.
for (int i = 0; i < 10; i++) {
JobDetail job = JobBuilder.newJob(NoOpJob.class).withIdentity("job" + i)
.build();
store.storeJob(job, false);
}
// Retrieve jobs.
for (int i = 0; i < 10; i++) {
JobKey jobKey = JobKey.jobKey("job" + i);
JobDetail storedJob = store.retrieveJob(jobKey);
Assert.assertEquals(jobKey, storedJob.getKey());
}
}
开发者ID:Ameausoone,项目名称:quartz-hazelcast-jobstore,代码行数:23,代码来源:TestHazelcastJobStore.java
示例6: setUp
import org.quartz.simpl.CascadingClassLoadHelper; //导入依赖的package包/类
@BeforeClass
public void setUp() throws SchedulerException, InterruptedException {
Config config = new Config();
config.setProperty("hazelcast.logging.type", "slf4j");
hazelcastInstance = Hazelcast.newHazelcastInstance(config);
this.fSignaler = new SampleSignaler();
ClassLoadHelper loadHelper = new CascadingClassLoadHelper();
loadHelper.initialize();
this.jobStore = createJobStore("AbstractJobStoreTest");
this.jobStore.initialize(loadHelper, this.fSignaler);
this.jobStore.schedulerStarted();
this.fJobDetail = new JobDetailImpl("job1", "jobGroup1", NoOpJob.class);
this.fJobDetail.setDurability(true);
this.jobStore.storeJob(this.fJobDetail, false);
}
开发者ID:Ameausoone,项目名称:quartz-hazelcast-jobstore,代码行数:21,代码来源:AbstractTestHazelcastJobStore.java
示例7: initialize
import org.quartz.simpl.CascadingClassLoadHelper; //导入依赖的package包/类
@Override
public void initialize() {
geemoduleClassLoader = App.get().moduleLoader().getPublicClassLoader();
// Initialize a fall back ClassLoadHelper.
cascadeClassLoadHelper = new CascadingClassLoadHelper();
cascadeClassLoadHelper.initialize();
}
开发者ID:geetools,项目名称:geeCommerce-Java-Shop-Software-and-PIM,代码行数:9,代码来源:TaskClassLoadHelper.java
示例8: setUp
import org.quartz.simpl.CascadingClassLoadHelper; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
ClassLoadHelper loadHelper = new CascadingClassLoadHelper();
loadHelper.initialize();
this.jobStore = createJobStore();
this.jobStore.start();
this.jobStore.initialize(loadHelper, new SampleSignaler());
this.jobStore.schedulerStarted();
}
开发者ID:sonatype,项目名称:nexus-public,代码行数:10,代码来源:JobStoreImplTest.java
示例9: testStoreAndRetriveTriggers
import org.quartz.simpl.CascadingClassLoadHelper; //导入依赖的package包/类
@Test
public void testStoreAndRetriveTriggers()
throws Exception {
final int nJobs = 10;
SchedulerSignaler schedSignaler = new SampleSignaler();
ClassLoadHelper loadHelper = new CascadingClassLoadHelper();
loadHelper.initialize();
JobStore store = createJobStore("testStoreAndRetriveTriggers");
store.initialize(loadHelper, schedSignaler);
// Store jobs and triggers.
for (int i = 0; i < nJobs; i++) {
JobDetail job = JobBuilder.newJob(NoOpJob.class).withIdentity("job" + i).build();
store.storeJob(job, true);
OperableTrigger trigger = buildTrigger("job" + i, DEFAULT_GROUP, job);
store.storeTrigger((OperableTrigger) trigger, true);
}
// Retrieve jobs and triggers.
for (int i = 0; i < nJobs; i++) {
JobKey jobKey = JobKey.jobKey("job" + i);
JobDetail storedJob = store.retrieveJob(jobKey);
Assert.assertEquals(storedJob.getKey(), jobKey);
TriggerKey triggerKey = TriggerKey.triggerKey("job" + i);
OperableTrigger storedTrigger = store.retrieveTrigger(triggerKey);
Assert.assertEquals(storedTrigger.getKey(), triggerKey);
}
}
开发者ID:FlavioF,项目名称:quartz-scheduler-hazelcast-jobstore,代码行数:33,代码来源:HazelcastJobStoreTest.java
示例10: testStoreAndRetriveTriggers
import org.quartz.simpl.CascadingClassLoadHelper; //导入依赖的package包/类
@Test()
public void testStoreAndRetriveTriggers() throws Exception {
SchedulerSignaler schedSignaler = new SampleSignaler();
ClassLoadHelper loadHelper = new CascadingClassLoadHelper();
loadHelper.initialize();
JobStore store = createJobStore("testStoreAndRetriveTriggers");
store.initialize(loadHelper, schedSignaler);
// Store jobs and triggers.
for (int i = 0; i < 10; i++) {
JobDetail job = JobBuilder.newJob(NoOpJob.class).withIdentity("job" + i)
.build();
store.storeJob(job, true);
SimpleScheduleBuilder schedule = SimpleScheduleBuilder.simpleSchedule();
Trigger trigger = TriggerBuilder.newTrigger().withIdentity("job" + i)
.withSchedule(schedule).forJob(job).build();
store.storeTrigger((OperableTrigger) trigger, true);
}
// Retrieve job and trigger.
for (int i = 0; i < 10; i++) {
JobKey jobKey = JobKey.jobKey("job" + i);
JobDetail storedJob = store.retrieveJob(jobKey);
Assert.assertEquals(jobKey, storedJob.getKey());
TriggerKey triggerKey = TriggerKey.triggerKey("job" + i);
Trigger storedTrigger = store.retrieveTrigger(triggerKey);
Assert.assertEquals(triggerKey, storedTrigger.getKey());
}
}
开发者ID:Ameausoone,项目名称:quartz-hazelcast-jobstore,代码行数:31,代码来源:TestHazelcastJobStore.java
示例11: testAcquireTriggers
import org.quartz.simpl.CascadingClassLoadHelper; //导入依赖的package包/类
@Test
public void testAcquireTriggers()
throws Exception {
final int nJobs = 10;
SchedulerSignaler schedSignaler = new SampleSignaler();
ClassLoadHelper loadHelper = new CascadingClassLoadHelper();
loadHelper.initialize();
JobStore store = createJobStore("testAcquireTriggers");
store.initialize(loadHelper, schedSignaler);
// Setup: Store jobs and triggers.
long MIN = 60 * 1000L;
Date startTime0 = new Date(System.currentTimeMillis() + MIN); // a min from
// now.
for (int i = 0; i < nJobs; i++) {
Date startTime = new Date(startTime0.getTime() + i * MIN); // a min apart
JobDetail job = JobBuilder.newJob(NoOpJob.class).withIdentity("job" + i).build();
SimpleScheduleBuilder schedule = SimpleScheduleBuilder.repeatMinutelyForever(2);
OperableTrigger trigger = (OperableTrigger) newTrigger()
.withIdentity("job" + i)
.withSchedule(schedule).forJob(job)
.startAt(startTime)
.build();
// Manually trigger the first fire time computation that scheduler would
// do. Otherwise
// the store.acquireNextTriggers() will not work properly.
Date fireTime = trigger.computeFirstFireTime(null);
Assert.assertNotNull(fireTime);
store.storeJobAndTrigger(job, trigger);
}
// Test acquire one trigger at a time
for (int i = 0; i < nJobs; i++) {
long noLaterThan = (startTime0.getTime() + i * MIN);
int maxCount = 1;
long timeWindow = 0;
List<OperableTrigger> triggers = store.acquireNextTriggers(noLaterThan, maxCount, timeWindow);
Assert.assertEquals(triggers.size(), 1);
Assert.assertEquals(triggers.get(0).getKey().getName(), "job" + i);
// Let's remove the trigger now.
store.removeJob(triggers.get(0).getJobKey());
}
}
开发者ID:FlavioF,项目名称:quartz-scheduler-hazelcast-jobstore,代码行数:50,代码来源:HazelcastJobStoreTest.java
示例12: testAcquireTriggersInBatch
import org.quartz.simpl.CascadingClassLoadHelper; //导入依赖的package包/类
@Test
public void testAcquireTriggersInBatch()
throws Exception {
SchedulerSignaler schedSignaler = new SampleSignaler();
ClassLoadHelper loadHelper = new CascadingClassLoadHelper();
loadHelper.initialize();
JobStore store = createJobStore("testAcquireTriggersInBatch");
store.initialize(loadHelper, schedSignaler);
// Setup: Store jobs and triggers.
long MIN = 60 * 1000L;
Date startTime0 = new Date(System.currentTimeMillis() + MIN); // a min from
// now.
for (int i = 0; i < 10; i++) {
Date startTime = new Date(startTime0.getTime() + i * MIN); // a min apart
JobDetail job = JobBuilder.newJob(NoOpJob.class).withIdentity("job" + i).build();
SimpleScheduleBuilder schedule = SimpleScheduleBuilder.repeatMinutelyForever(2);
OperableTrigger trigger = (OperableTrigger) newTrigger()
.withIdentity("job" + i)
.withSchedule(schedule)
.forJob(job)
.startAt(startTime)
.build();
// Manually trigger the first fire time computation that scheduler would
// do. Otherwise
// the store.acquireNextTriggers() will not work properly.
Date fireTime = trigger.computeFirstFireTime(null);
Assert.assertNotNull(fireTime);
store.storeJobAndTrigger(job, trigger);
}
// Test acquire batch of triggers at a time
long noLaterThan = startTime0.getTime() + 10 * MIN;
int maxCount = 7;
// time window needs to be big to be able to pick up multiple triggers when
// they are a minute apart
long timeWindow = 8 * MIN;
List<OperableTrigger> triggers = store.acquireNextTriggers(noLaterThan, maxCount, timeWindow);
Assert.assertEquals(triggers.size(), 7);
}
开发者ID:FlavioF,项目名称:quartz-scheduler-hazelcast-jobstore,代码行数:45,代码来源:HazelcastJobStoreTest.java
示例13: testAcquireTriggers
import org.quartz.simpl.CascadingClassLoadHelper; //导入依赖的package包/类
@Test()
public void testAcquireTriggers() throws Exception {
SchedulerSignaler schedSignaler = new SampleSignaler();
ClassLoadHelper loadHelper = new CascadingClassLoadHelper();
loadHelper.initialize();
JobStore store = createJobStore("testAcquireTriggers");
store.initialize(loadHelper, schedSignaler);
// Setup: Store jobs and triggers.
long MIN = 60 * 1000L;
Date startTime0 = new Date(System.currentTimeMillis() + MIN); // a min from
// now.
for (int i = 0; i < 10; i++) {
Date startTime = new Date(startTime0.getTime() + i * MIN); // a min apart
JobDetail job = JobBuilder.newJob(NoOpJob.class).withIdentity("job" + i)
.build();
SimpleScheduleBuilder schedule = SimpleScheduleBuilder
.repeatMinutelyForever(2);
OperableTrigger trigger = (OperableTrigger) TriggerBuilder.newTrigger()
.withIdentity("job" + i).withSchedule(schedule).forJob(job)
.startAt(startTime).build();
// Manually trigger the first fire time computation that scheduler would
// do. Otherwise
// the store.acquireNextTriggers() will not work properly.
Date fireTime = trigger.computeFirstFireTime(null);
Assert.assertEquals(true, fireTime != null);
store.storeJobAndTrigger(job, trigger);
}
// Test acquire one trigger at a time
for (int i = 0; i < 10; i++) {
long noLaterThan = (startTime0.getTime() + i * MIN);
int maxCount = 1;
long timeWindow = 0;
List<OperableTrigger> triggers = store.acquireNextTriggers(noLaterThan,
maxCount, timeWindow);
Assert.assertEquals(1, triggers.size());
Assert.assertEquals("job" + i, triggers.get(0).getKey().getName());
// Let's remove the trigger now.
store.removeJob(triggers.get(0).getJobKey());
}
}
开发者ID:Ameausoone,项目名称:quartz-hazelcast-jobstore,代码行数:47,代码来源:TestHazelcastJobStore.java
示例14: testAcquireTriggersInBatch
import org.quartz.simpl.CascadingClassLoadHelper; //导入依赖的package包/类
@Test()
public void testAcquireTriggersInBatch() throws Exception {
SchedulerSignaler schedSignaler = new SampleSignaler();
ClassLoadHelper loadHelper = new CascadingClassLoadHelper();
loadHelper.initialize();
JobStore store = createJobStore("testAcquireTriggersInBatch");
store.initialize(loadHelper, schedSignaler);
// Setup: Store jobs and triggers.
long MIN = 60 * 1000L;
Date startTime0 = new Date(System.currentTimeMillis() + MIN); // a min from
// now.
for (int i = 0; i < 10; i++) {
Date startTime = new Date(startTime0.getTime() + i * MIN); // a min apart
JobDetail job = JobBuilder.newJob(NoOpJob.class).withIdentity("job" + i)
.build();
SimpleScheduleBuilder schedule = SimpleScheduleBuilder
.repeatMinutelyForever(2);
OperableTrigger trigger = (OperableTrigger) TriggerBuilder.newTrigger()
.withIdentity("job" + i).withSchedule(schedule).forJob(job)
.startAt(startTime).build();
// Manually trigger the first fire time computation that scheduler would
// do. Otherwise
// the store.acquireNextTriggers() will not work properly.
Date fireTime = trigger.computeFirstFireTime(null);
Assert.assertEquals(true, fireTime != null);
store.storeJobAndTrigger(job, trigger);
}
// Test acquire batch of triggers at a time
long noLaterThan = startTime0.getTime() + 10 * MIN;
int maxCount = 7;
// time window needs to be big to be able to pick up multiple triggers when
// they are a minute apart
long timeWindow = 8 * MIN;
List<OperableTrigger> triggers = store.acquireNextTriggers(noLaterThan,
maxCount, timeWindow);
Assert.assertEquals(7, triggers.size());
}
开发者ID:Ameausoone,项目名称:quartz-hazelcast-jobstore,代码行数:43,代码来源:TestHazelcastJobStore.java
示例15: getJobStoreClassLoadHelper
import org.quartz.simpl.CascadingClassLoadHelper; //导入依赖的package包/类
/**
* Gets the job store class load helper used during scheduler scheduler creation to
* set up the job store that is assigned in the S
* @return
*/
protected ClassLoadHelper getJobStoreClassLoadHelper() {
return new CascadingClassLoadHelper();
}
开发者ID:andyphillips404,项目名称:awplab-core,代码行数:9,代码来源:AbstractSchedulerProvider.java
注:本文中的org.quartz.simpl.CascadingClassLoadHelper类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论