/** * Runs this object as a separate thread, printing the contents of the InputStream * supplied during instantiation, to either stdout or stderr */ @Override public void run() { BufferedReader br = null; try { br = new BufferedReader(new InputStreamReader(is)); String line; while ((line = br.readLine()) != null) { if(type.equalsIgnoreCase("stderr")) { getLog().warn(type + ">" + line); } else { getLog().info(type + ">" + line); } } } catch (IOException ioe) { getLog().error("Error consuming " + type + " stream of spawned process.", ioe); } finally { if(br != null) { try { br.close(); } catch(Exception ignore) {} } } } }
getLog().info("About to run " + cmd[0] + " " + cmd[1] + " " + (cmd.length>2 ? cmd[2] : "") + " ..."); Process proc = rt.exec(cmd); StreamConsumer stdoutConsumer = new StreamConsumer(proc.getInputStream(), "stdout"); StreamConsumer stderrConsumer = new StreamConsumer(proc.getErrorStream(), "stderr"); stdoutConsumer.start(); stderrConsumer.start();
long newDate = getLastModifiedDate(fileName); listener.fileUpdated(fileName); } else if (log.isDebugEnabled()) { log.debug("File '"+fileName+"' unchanged.");
/** * <p> * Create a <code>ObjectAlreadyExistsException</code> and auto-generate a message using the name/group from the given <code>JobDetail</code>. * </p> * <p> * The message will read: <BR> * "Unable to store Job with name: '__' and group: '__', because one already exists with this identification." * </p> */ public ObjectAlreadyExistsException(JobDetail offendingJob) { super("Unable to store Job : '" + offendingJob.getName() + "', because one already exists with this identification."); }
@Override public JobDataMap getJobDataMap() { if (jobDataMap == null) { jobDataMap = new JobDataMap(); } return jobDataMap; }
public void execute(JobExecutionContext context) throws JobExecutionException { JobDataMap data = context.getMergedJobDataMap(); String command = data.getString(PROP_COMMAND); String parameters = data.getString(PROP_PARAMETERS); if (parameters == null) { parameters = ""; } boolean wait = true; if(data.containsKey(PROP_WAIT_FOR_PROCESS)) { wait = data.getBooleanValue(PROP_WAIT_FOR_PROCESS); } boolean consumeStreams = false; if(data.containsKey(PROP_CONSUME_STREAMS)) { consumeStreams = data.getBooleanValue(PROP_CONSUME_STREAMS); } Integer exitCode = this.runNativeCommand(command, parameters, wait, consumeStreams); context.setResult(exitCode); }
File[] updatedFiles = getUpdatedOrNewFiles(dirName, lastDate, maxAgeDate); listener.filesUpdatedOrAdded(updatedFiles); } else if (log.isDebugEnabled()) { log.debug("Directory '"+dirName+"' contents unchanged.");
/** * <p> * Create a <code>ObjectAlreadyExistsException</code> and auto-generate a message using the name/group from the given <code>JobDetail</code>. * </p> * <p> * The message will read: <BR> * "Unable to store Job with name: '__' and group: '__', because one already exists with this identification." * </p> */ public ObjectAlreadyExistsException(JobDetail offendingJob) { super("Unable to store Job : '" + offendingJob.getName() + "', because one already exists with this identification."); }
@Override public JobDataMap getJobDataMap() { if (jobDataMap == null) { jobDataMap = new JobDataMap(); } return jobDataMap; }
JobWrapper(JobDetail jobDetail) { this.jobDetail = jobDetail; key = jobDetail.getName(); }
@Override public JobDataMap getJobDataMap() { if (jobDataMap == null) { jobDataMap = new JobDataMap(); } return jobDataMap; }
JobWrapper(JobDetail jobDetail) { this.jobDetail = jobDetail; key = jobDetail.getName(); }
@Override public JobDataMap getJobDataMap() { if (jobDataMap == null) { jobDataMap = new JobDataMap(); } return jobDataMap; }
JobWrapper(JobDetail jobDetail) { this.jobDetail = jobDetail; key = jobDetail.getName(); }
@Override public JobDataMap getJobDataMap() { if (jobDataMap == null) { jobDataMap = new JobDataMap(); } return jobDataMap; }
/** * Create a <code>ObjectAlreadyExistsException</code> and auto-generate a message using the * name/group from the given <code>JobDetail</code>. * * <p>The message will read: <br> * "Unable to store Job with name: '__' and group: '__', because one already exists with this * identification." */ public ObjectAlreadyExistsException(JobDetail offendingJob) { super( "Unable to store Job : '" + offendingJob.getName() + "', because one already exists with this identification."); }
@Override public JobDataMap getJobDataMap() { if (jobDataMap == null) { jobDataMap = new JobDataMap(); } return jobDataMap; }
public JobDataMap shallowCopy() { return new JobDataMap(this); } }
public JobDataMap shallowCopy() { return new JobDataMap(this); } }
public JobDataMap shallowCopy() { return new JobDataMap(this); } }