Java Code Examples for org.quartz.core.QuartzScheduler

The following examples show how to use org.quartz.core.QuartzScheduler. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: quartz-web   Source File: QuartzWebManager.java    License: Apache License 2.0 6 votes vote down vote up
public static BasicInfo getBasicInfo() {
    String versionIteration = QuartzScheduler.getVersionIteration();
    String versionMajor = QuartzScheduler.getVersionMajor();
    String versionMinor = QuartzScheduler.getVersionMinor();
    BasicInfo basicInfo = new BasicInfo();
    basicInfo.setQuartzWebVersion(VERSION.getVersionNumber());
    basicInfo.setVersionMajor(versionMajor);
    basicInfo.setVersionMinor(versionMinor);
    basicInfo.setVersionIteration(versionIteration);
    basicInfo.setQuartzVersion(versionMajor + "." + versionMinor + "." + versionIteration);
    basicInfo.setJavaVMStartTime(DateUtils.getVMStartTime());
    basicInfo.setJavaVMName(System.getProperty("java.vm.name"));
    basicInfo.setJavaVersion(System.getProperty("java.version"));
    basicInfo.setJavaClassPath(System.getProperty("java.class.path"));
    return basicInfo;
}
 
Example 2
Source Project: nexus-public   Source File: QuartzSchedulerSPI.java    License: Eclipse Public License 1.0 6 votes vote down vote up
@Override
protected void doStart() throws Exception {
  // create new scheduler
  scheduler = schedulerProvider.get();

  try {
    // access internal scheduler to simulate signals for remote updates
    Field schedField = scheduler.getClass().getDeclaredField("sched");
    schedField.setAccessible(true);
    quartzScheduler = (QuartzScheduler) schedField.get(scheduler);
  }
  catch (Exception | LinkageError e) {
    log.error("Cannot find QuartzScheduler", e);
    throw e;
  }

  // re-attach listeners right after scheduler is available
  reattachListeners();
}
 
Example 3
@Override
protected Scheduler instantiate(QuartzSchedulerResources rsrcs, QuartzScheduler qs)
{
    Scheduler scheduler = super.instantiate(rsrcs, qs);
    JobStore jobStore = rsrcs.getJobStore();
    if (jobStore instanceof SchedulerAware)
    {
        ((SchedulerAware) jobStore).setScheduler(scheduler);
    }
    return scheduler;
}
 
Example 4
Source Project: lams   Source File: StdSchedulerFactory.java    License: GNU General Public License v2.0 5 votes vote down vote up
private void shutdownFromInstantiateException(ThreadPool tp, QuartzScheduler qs, boolean tpInited, boolean qsInited) {
    try {
        if(qsInited)
            qs.shutdown(false);
        else if(tpInited)
            tp.shutdown(false);
    } catch (Exception e) {
        getLog().error("Got another exception while shutting down after instantiation exception", e);
    }
}
 
Example 5
Source Project: AsuraFramework   Source File: StdSchedulerFactory.java    License: Apache License 2.0 5 votes vote down vote up
protected Scheduler instantiate(QuartzSchedulerResources rsrcs, QuartzScheduler qs) {
    SchedulingContext schedCtxt = new SchedulingContext();
    schedCtxt.setInstanceId(rsrcs.getInstanceId());

    Scheduler scheduler = new StdScheduler(qs, schedCtxt);
    return scheduler;
}
 
Example 6
Source Project: lams   Source File: UpdateChecker.java    License: GNU General Public License v2.0 4 votes vote down vote up
private String getQuartzVersion() {
  return String.format("%s.%s.%s", QuartzScheduler.getVersionMajor(), QuartzScheduler.getVersionMinor(),
                       QuartzScheduler.getVersionIteration());
}
 
Example 7
Source Project: lams   Source File: VersionPrinter.java    License: GNU General Public License v2.0 4 votes vote down vote up
public static void main(String[] args) {
    System.out.println("Quartz version: " + QuartzScheduler.getVersionMajor()
            + "." + QuartzScheduler.getVersionMinor() + "."
            + QuartzScheduler.getVersionIteration());
}
 
Example 8
Source Project: lams   Source File: UpdateChecker.java    License: GNU General Public License v2.0 4 votes vote down vote up
private String getQuartzVersion() {
  return String.format("%s.%s.%s", QuartzScheduler.getVersionMajor(), QuartzScheduler.getVersionMinor(),
                       QuartzScheduler.getVersionIteration());
}
 
Example 9
Source Project: lams   Source File: StdSchedulerFactory.java    License: GNU General Public License v2.0 4 votes vote down vote up
protected Scheduler instantiate(QuartzSchedulerResources rsrcs, QuartzScheduler qs) {

        Scheduler scheduler = new StdScheduler(qs);
        return scheduler;
    }
 
Example 10
Source Project: AsuraFramework   Source File: VersionPrinter.java    License: Apache License 2.0 4 votes vote down vote up
public static void main(String[] args) {
    System.out.println("Quartz version: " + QuartzScheduler.getVersionMajor()
            + "." + QuartzScheduler.getVersionMinor() + "."
            + QuartzScheduler.getVersionIteration());
}
 
Example 11
Source Project: AsuraFramework   Source File: UpdateChecker.java    License: Apache License 2.0 4 votes vote down vote up
private String getQuartzVersion() {
  return String.format("%s.%s.%s", QuartzScheduler.getVersionMajor(), QuartzScheduler.getVersionMinor(),
                       QuartzScheduler.getVersionIteration());
}
 
Example 12
@Override
public String getVersion() {
	return QuartzScheduler.getVersionMajor() +"."+QuartzScheduler.getVersionMinor() +"."+QuartzScheduler.getVersionIteration();
}
 
Example 13
Source Project: lams   Source File: ManagementServer.java    License: GNU General Public License v2.0 2 votes vote down vote up
/**
 * Puts the submitted resource under the purview of this {@code ManagementServer}.
 *
 * @param managedResource the resource to be managed
 */
public void register(QuartzScheduler managedResource);
 
Example 14
Source Project: lams   Source File: ManagementServer.java    License: GNU General Public License v2.0 2 votes vote down vote up
/**
 * Removes the submitted resource under the purview of this {@code ManagementServer}.
 *
 * @param managedResource the resource to be managed
 */
public void unregister(QuartzScheduler managedResource);
 
Example 15
Source Project: lams   Source File: StdScheduler.java    License: GNU General Public License v2.0 2 votes vote down vote up
/**
 * <p>
 * Construct a <code>StdScheduler</code> instance to proxy the given
 * <code>QuartzScheduler</code> instance, and with the given <code>SchedulingContext</code>.
 * </p>
 */
public StdScheduler(QuartzScheduler sched) {
    this.sched = sched;
}
 
Example 16
Source Project: AsuraFramework   Source File: StdScheduler.java    License: Apache License 2.0 2 votes vote down vote up
/**
 * <p>
 * Construct a <code>StdScheduler</code> instance to proxy the given
 * <code>QuartzScheduler</code> instance, and with the given <code>SchedulingContext</code>.
 * </p>
 */
public StdScheduler(QuartzScheduler sched, SchedulingContext schedCtxt) {
    this.sched = sched;
    this.schedCtxt = schedCtxt;
}