Package de.innovationgate.wgpublisher.scheduler

Examples of de.innovationgate.wgpublisher.scheduler.Task


        Iterator jobs = csConfig.getJobDefinitions().iterator();
        while (jobs.hasNext()) {
            JobDefinition job = (JobDefinition) jobs.next();
            String jobName = db.getDbReference() + "." + job.getName();
            try {
                Task task = null;
               
                if (job.getType() == JobDefinition.TYPE_TMLSCRIPTMODULE) {
                    ScriptTask scriptTask = new ScriptTask();
                    scriptTask.setCancelJobOnFail(true);
                    scriptTask.setDatabase(db.getDbReference());
                    scriptTask.setModule(job.getResource());
                    task = scriptTask;
                }
                else if (job.getType() == JobDefinition.TYPE_JAVA) {
                    JavaTask javaTask = new JavaTask();
                    javaTask.setClassName(job.getResource());
                    task = javaTask;
                }
                else {
                    getLog().error("Error adding job '" + jobName + "'. Unknown job type: " + job.getType());
                    continue;
                }
               
                task.setDescription(job.getDescription());
               
                JobSchedule schedule = null;
                if (job.getSchedule() != null && !job.getSchedule().trim().equals("")) {
                    schedule = new JobSchedule();
                    schedule.setEnabled(true);
View Full Code Here


        Class clazz = Class.forName(taskImplementation);
        if (!Task.class.isAssignableFrom(clazz)) {
            throw new IllegalArgumentException("Class " + taskName + " does not implement " + Task.class.getName());
        }
       
        Task task = (Task) clazz.newInstance();
       
        Job job = getScheduler().addCustomTaskJob(taskName, task, true, null);
        getScheduler().run(job.getName(), "WGA Scheduler Custom Task Runner", options, null);
        return job.getName();
View Full Code Here

TOP

Related Classes of de.innovationgate.wgpublisher.scheduler.Task

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.