org.quartz.core.QuartzSchedulerResources Java Examples

The following examples show how to use org.quartz.core.QuartzSchedulerResources. 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 File: AlfrescoSchedulerFactory.java    From alfresco-repository with GNU Lesser General Public License v3.0 5 votes vote down vote up
@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 #2
Source File: StdSchedulerFactory.java    From AsuraFramework with 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 #3
Source File: StdSchedulerFactory.java    From lams with 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 #4
Source File: DirectSchedulerFactory.java    From AsuraFramework with Apache License 2.0 4 votes vote down vote up
/**
 * Same as
 * {@link DirectSchedulerFactory#createRemoteScheduler(String rmiHost, int rmiPort)},
 * with the addition of specifying the scheduler name, instance ID, and rmi
 * bind name. This scheduler can only be retrieved via
 * {@link DirectSchedulerFactory#getScheduler(String)}
 *
 * @param schedulerName
 *          The name for the scheduler.
 * @param schedulerInstanceId
 *          The instance ID for the scheduler.
 * @param rmiBindName
 *          The name of the remote scheduler in the RMI repository.  If null
 *          defaults to the generated unique identifier.
 * @param rmiHost
 *          The hostname for remote scheduler
 * @param rmiPort
 *          Port for the remote scheduler. The default RMI port is 1099.
 * @throws SchedulerException
 *           if the remote scheduler could not be reached.
 */
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);
}
 
Example #5
Source File: DirectSchedulerFactory.java    From lams with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Same as
 * {@link DirectSchedulerFactory#createRemoteScheduler(String rmiHost, int rmiPort)},
 * with the addition of specifying the scheduler name, instance ID, and rmi
 * bind name. This scheduler can only be retrieved via
 * {@link DirectSchedulerFactory#getScheduler(String)}
 *
 * @param schedulerName
 *          The name for the scheduler.
 * @param schedulerInstanceId
 *          The instance ID for the scheduler.
 * @param rmiBindName
 *          The name of the remote scheduler in the RMI repository.  If null
 *          defaults to the generated unique identifier.
 * @param rmiHost
 *          The hostname for remote scheduler
 * @param rmiPort
 *          Port for the remote scheduler. The default RMI port is 1099.
 * @throws SchedulerException
 *           if the remote scheduler could not be reached.
 */
public void createRemoteScheduler(String schedulerName,
        String schedulerInstanceId, String rmiBindName, String rmiHost, int rmiPort)
    throws SchedulerException {

    String uid = (rmiBindName != null) ? rmiBindName :
        QuartzSchedulerResources.getUniqueIdentifier(
            schedulerName, schedulerInstanceId);

    RemoteScheduler remoteScheduler = new RemoteScheduler(uid, rmiHost, rmiPort);

    SchedulerRepository schedRep = SchedulerRepository.getInstance();
    schedRep.bind(remoteScheduler);
    initialized = true;
}