| Method from org.quartz.impl.DirectSchedulerFactory Detail: |
public void createRemoteScheduler(String rmiHost,
int rmiPort) throws SchedulerException {
createRemoteScheduler(DEFAULT_SCHEDULER_NAME, DEFAULT_INSTANCE_ID,
rmiHost, rmiPort);
initialized = true;
}
|
public void createRemoteScheduler(String schedulerName,
String schedulerInstanceId,
String rmiHost,
int rmiPort) throws SchedulerException {
createRemoteScheduler(schedulerName,
schedulerInstanceId, null, rmiHost, rmiPort);
}
|
public void createRemoteScheduler(String schedulerName,
String schedulerInstanceId,
String rmiBindName,
String rmiHost,
int rmiPort) throws SchedulerException {
SchedulingContext schedCtxt = new SchedulingContext();
schedCtxt.setInstanceId(schedulerInstanceId);
String uid = (rmiBindName != null) ? rmiBindName :
QuartzSchedulerResources.getUniqueIdentifier(
schedulerName, schedulerInstanceId);
RemoteScheduler remoteScheduler = new RemoteScheduler(schedCtxt, uid,
rmiHost, rmiPort);
SchedulerRepository schedRep = SchedulerRepository.getInstance();
schedRep.bind(remoteScheduler);
}
|
public void createScheduler(ThreadPool threadPool,
JobStore jobStore) throws SchedulerException {
createScheduler(DEFAULT_SCHEDULER_NAME, DEFAULT_INSTANCE_ID,
threadPool, jobStore);
initialized = true;
}
|
public void createScheduler(String schedulerName,
String schedulerInstanceId,
ThreadPool threadPool,
JobStore jobStore) throws SchedulerException {
createScheduler(schedulerName, schedulerInstanceId, threadPool,
jobStore, null, 0, -1, -1);
}
|
public void createScheduler(String schedulerName,
String schedulerInstanceId,
ThreadPool threadPool,
JobStore jobStore,
String rmiRegistryHost,
int rmiRegistryPort,
long idleWaitTime,
long dbFailureRetryInterval) throws SchedulerException {
createScheduler(schedulerName,
schedulerInstanceId, threadPool,
jobStore, null, // plugins
rmiRegistryHost, rmiRegistryPort,
idleWaitTime, dbFailureRetryInterval);
}
Creates a scheduler using the specified thread pool and job store and
binds it to RMI. |
public void createScheduler(String schedulerName,
String schedulerInstanceId,
ThreadPool threadPool,
JobStore jobStore,
Map schedulerPluginMap,
String rmiRegistryHost,
int rmiRegistryPort,
long idleWaitTime,
long dbFailureRetryInterval) throws SchedulerException {
// Currently only one run-shell factory is available...
JobRunShellFactory jrsf = new StdJobRunShellFactory();
// Fire everything up
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
SchedulingContext schedCtxt = new SchedulingContext();
schedCtxt.setInstanceId(schedulerInstanceId);
QuartzSchedulerResources qrs = new QuartzSchedulerResources();
qrs.setName(schedulerName);
qrs.setInstanceId(schedulerInstanceId);
qrs.setJobRunShellFactory(jrsf);
qrs.setThreadPool(threadPool);
qrs.setJobStore(jobStore);
qrs.setRMIRegistryHost(rmiRegistryHost);
qrs.setRMIRegistryPort(rmiRegistryPort);
// add plugins
if (schedulerPluginMap != null) {
for (Iterator pluginIter = schedulerPluginMap.values().iterator(); pluginIter.hasNext();) {
qrs.addSchedulerPlugin((SchedulerPlugin)pluginIter.next());
}
}
QuartzScheduler qs = new QuartzScheduler(qrs, schedCtxt, idleWaitTime,
dbFailureRetryInterval);
ClassLoadHelper cch = new CascadingClassLoadHelper();
cch.initialize();
jobStore.initialize(cch, qs.getSchedulerSignaler());
Scheduler scheduler = new StdScheduler(qs, schedCtxt);
// Initialize plugins now that we have a Scheduler instance.
if (schedulerPluginMap != null) {
for (Iterator pluginEntryIter = schedulerPluginMap.entrySet().iterator(); pluginEntryIter.hasNext();) {
Map.Entry pluginEntry = (Map.Entry)pluginEntryIter.next();
((SchedulerPlugin)pluginEntry.getValue()).initialize(
(String)pluginEntry.getKey(), scheduler);
}
}
jrsf.initialize(scheduler, schedCtxt);
getLog().info("Quartz scheduler '" + scheduler.getSchedulerName());
getLog().info("Quartz scheduler version: " + qs.getVersion());
SchedulerRepository schedRep = SchedulerRepository.getInstance();
qs.addNoGCObject(schedRep); // prevents the repository from being
// garbage collected
schedRep.bind(scheduler);
}
Creates a scheduler using the specified thread pool, job store, and
plugins, and binds it to RMI. |
public void createVolatileSchduler(int maxThreads) throws SchedulerException {
createVolatileScheduler(maxThreads);
} Deprecated! see - correctly spelled method.
|
public void createVolatileScheduler(int maxThreads) throws SchedulerException {
SimpleThreadPool threadPool = new SimpleThreadPool(maxThreads,
Thread.NORM_PRIORITY);
threadPool.initialize();
JobStore jobStore = new RAMJobStore();
this.createScheduler(threadPool, jobStore);
}
Creates an in memory job store (RAMJobStore )
The thread priority is set to Thread.NORM_PRIORITY |
public Collection getAllSchedulers() throws SchedulerException {
return SchedulerRepository.getInstance().lookupAll();
}
|
public static DirectSchedulerFactory getInstance() {
return instance;
}
|
protected Log getLog() {
/*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*
* Constructors.
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/
return log;
}
|
public Scheduler getScheduler() throws SchedulerException {
if (!initialized) {
throw new SchedulerException(
"you must call createRemoteScheduler or createScheduler methods before calling getScheduler()");
}
return getScheduler(DEFAULT_SCHEDULER_NAME);
}
Returns a handle to the Scheduler produced by this factory.
you must call createRemoteScheduler or createScheduler methods before
calling getScheduler()
|
public Scheduler getScheduler(String schedName) throws SchedulerException {
SchedulerRepository schedRep = SchedulerRepository.getInstance();
return schedRep.lookup(schedName);
}
Returns a handle to the Scheduler with the given name, if it exists.
|