use of org.lastaflute.job.LaJobRuntime in project fess by codelibs.
the class ExecJob method createSystemProperties.
protected void createSystemProperties(final List<String> cmdList, final File propFile) {
try (FileOutputStream out = new FileOutputStream(propFile)) {
final Properties prop = new Properties();
prop.putAll(ComponentUtil.getSystemProperties());
final LaJobRuntime jobRuntime = ComponentUtil.getJobHelper().getJobRuntime();
if (jobRuntime != null) {
final ScheduledJob job = (ScheduledJob) jobRuntime.getParameterMap().get(Constants.SCHEDULED_JOB);
if (job != null) {
prop.setProperty("job.runtime.id", job.getId());
prop.setProperty("job.runtime.name", job.getName());
}
}
prop.store(out, cmdList.toString());
} catch (final IOException e) {
throw new IORuntimeException(e);
}
}
Aggregations