mirror of https://github.com/apache/activemq.git
Allows for the persistence adapter to implement JobSchedulerStore and also allows for user set JobSchedulerStore to be used even when persitence is off on the broker. git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1517084 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
b3c132780b
commit
01704eece0
|
@ -1814,7 +1814,31 @@ public class BrokerService implements Service {
|
|||
}
|
||||
|
||||
public synchronized JobSchedulerStore getJobSchedulerStore() {
|
||||
if (jobSchedulerStore == null && isSchedulerSupport()) {
|
||||
|
||||
// If support is off don't allow any scheduler even is user configured their own.
|
||||
if (!isSchedulerSupport()) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// If the user configured their own we use it even if persistence is disabled since
|
||||
// we don't know anything about their implementation.
|
||||
if (jobSchedulerStore == null) {
|
||||
|
||||
if (!isPersistent()) {
|
||||
return null;
|
||||
}
|
||||
|
||||
try {
|
||||
PersistenceAdapter pa = getPersistenceAdapter();
|
||||
if (pa != null && pa instanceof JobSchedulerStore) {
|
||||
this.jobSchedulerStore = (JobSchedulerStore) pa;
|
||||
configureService(jobSchedulerStore);
|
||||
return this.jobSchedulerStore;
|
||||
}
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
try {
|
||||
String clazz = "org.apache.activemq.store.kahadb.scheduler.JobSchedulerStoreImpl";
|
||||
jobSchedulerStore = (JobSchedulerStore) getClass().getClassLoader().loadClass(clazz).newInstance();
|
||||
|
@ -1825,7 +1849,6 @@ public class BrokerService implements Service {
|
|||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
}
|
||||
return jobSchedulerStore;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue