Search in sources :

Example 1 with ScheduleAdded

use of com.swiftmq.impl.scheduler.standard.po.ScheduleAdded in project swiftmq-ce by iitsoftware.

the class SchedulerSwiftletImpl method addTemporarySchedule.

public void addTemporarySchedule(String name, String jobGroup, String jobName, String calendar, String dateFrom, String dateTo, String timeExpr, String maxRuntime, boolean loggingEnabled) throws InvalidScheduleException {
    if (ctx.traceSpace.enabled)
        ctx.traceSpace.trace(getName(), "addTemporarySchedule, name=" + name + " ...");
    Schedule schedule = ScheduleFactory.createSchedule(ctx, name, jobGroup, jobName, calendar, dateFrom, dateTo, timeExpr, maxRuntime, loggingEnabled);
    schedule.setEnabled(true);
    try {
        ctx.scheduler.enqueue(new ScheduleAdded(schedule.createCopy()));
    } catch (Exception e) {
        throw new InvalidScheduleException(e.toString());
    }
    if (ctx.traceSpace.enabled)
        ctx.traceSpace.trace(getName(), "addTemporarySchedule, name=" + name + " done");
}
Also used : InvalidScheduleException(com.swiftmq.swiftlet.scheduler.InvalidScheduleException) ScheduleAdded(com.swiftmq.impl.scheduler.standard.po.ScheduleAdded) SwiftletException(com.swiftmq.swiftlet.SwiftletException) InvalidScheduleException(com.swiftmq.swiftlet.scheduler.InvalidScheduleException)

Aggregations

ScheduleAdded (com.swiftmq.impl.scheduler.standard.po.ScheduleAdded)1 SwiftletException (com.swiftmq.swiftlet.SwiftletException)1 InvalidScheduleException (com.swiftmq.swiftlet.scheduler.InvalidScheduleException)1