Package org.apache.karaf.scheduler

Examples of org.apache.karaf.scheduler.ScheduleOptions


    @Override
    public Object execute() throws Exception {
        if (cron != null && (at != null || times != -1 || period != 0)) {
            throw new IllegalArgumentException("Both cron expression and explicit execution time can not be specified");
        }
        ScheduleOptions options;
        if (cron != null) {
            options = scheduler.EXPR(cron);
        } else {
            Date date;
            if (at != null) {
                date = DatatypeConverter.parseDateTime(at).getTime();
            } else {
                date = new Date();
            }
            if (period > 0) {
                options = scheduler.AT(date, times, period);
            } else {
                options = scheduler.AT(date);
            }
        }
        if (name != null) {
            options.name(name);
        }
        if (concurrent) {
            options.canRunConcurrently(concurrent);
        }
        scheduler.schedule(new ScriptJob(session, script), options);
        return null;
    }
View Full Code Here


        org.quartz.Scheduler s = this.scheduler;
        if (s != null) {
            for (String group : s.getJobGroupNames()) {
                for (JobKey key : s.getJobKeys(GroupMatcher.jobGroupEquals(group))) {
                    JobDetail detail = s.getJobDetail(key);
                    ScheduleOptions options = (ScheduleOptions) detail.getJobDataMap().get(DATA_MAP_OPTIONS);
                    Object job = detail.getJobDataMap().get(DATA_MAP_OBJECT);
                    jobs.put(job, options);
                }
            }
        }
View Full Code Here

TOP

Related Classes of org.apache.karaf.scheduler.ScheduleOptions

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.