Package de.innovationgate.wgpublisher.scheduler

Examples of de.innovationgate.wgpublisher.scheduler.Job


            response.sendError(HttpServletResponse.SC_FORBIDDEN, "You must be logged in as WGA administrator!");
            return;
        }

        String jobToShow = request.getParameter("name");
        Job job = getCore().getScheduler().getJob(jobToShow);
        if (job == null) {
            response.sendError(HttpServletResponse.SC_BAD_REQUEST, "Unknown job: " + jobToShow);
            return;
        }

        response.setContentType("text/html");
        Writer out = response.getWriter();
        out.write("<HTML><HEAD>");

        out.write("\n<script language=\"javascript\">\nvar running=" + Boolean.valueOf(job.isRunning()).toString() + ";\n</script>\n");

        /*
         * if (job.isRunning()) {
         * out.write("<META HTTP-EQUIV=\"refresh\" CONTENT=\"3\"/>"); } else {
         * out.write("<META HTTP-EQUIV=\"refresh\" CONTENT=\"6\"/>"); }
         */
        out.write("</HEAD>");
        out.write("<BODY style=\"background-color:white; font-family:sans-serif; font-size:10pt\">");
        String log = job.getLog();
        LineNumberReader reader = new LineNumberReader(new StringReader(log));
        String line;
        while ((line = reader.readLine()) != null) {
            out.write(line);
            out.write("<BR/>");
        }

        if (!job.isRunning() && job.getEndMessage() != null) {
            out.write("<p>");
            out.write("<table border=\"1\" cellpadding=\"5\"><tr><td>");
            out.write(job.getEndMessage());
            out.write("</td></tr></table>");
            out.write("</p>");
        }
        out.write("<a id=\"bottomLink\" name=\"bottom\">&nbsp;</a></BODY></HTML>");

View Full Code Here


            List jobsToRemove = new ArrayList(_scheduler.getJobNames());
            jobsToRemove.removeAll(currentJobs);
            Iterator removeIt = jobsToRemove.iterator();
            while (removeIt.hasNext()) {
                String jobName = (String) removeIt.next();
                Job job = _scheduler.getJob(jobName);
                if (job != null && job.getOrigin() == Job.ORIGIN_WGACONFIG) {
                    _scheduler.removeJob(jobName);
                }
            }
        }
        catch (RuntimeException e) {
View Full Code Here

                    schedule.setEnabled(true);
                    schedule.setScheduleData(job.getSchedule());
                    schedule.setType(JobSchedule.TYPE_CRON);
                }
               
                Job schedulerJob = getScheduler().addCustomTaskJob(jobName, task, false, schedule);
                schedulerJob.setDescription(job.getDescription());
                schedulerJob.getOptions().put("database", db.getDbReference());
                info.getEnforcedJobDefinitions().add(schedulerJob.getName());
            }
            catch (Exception e) {
                getLog().error("Error adding job '" + jobName + "' from content store configuration", e);
            }
        }
View Full Code Here

            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.Job

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.