本文整理汇总了Java中org.springframework.batch.core.ExitStatus.COMPLETED属性的典型用法代码示例。如果您正苦于以下问题:Java ExitStatus.COMPLETED属性的具体用法?Java ExitStatus.COMPLETED怎么用?Java ExitStatus.COMPLETED使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.springframework.batch.core.ExitStatus
的用法示例。
在下文中一共展示了ExitStatus.COMPLETED属性的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: packArchive
/**
* @param source The directory containing the DwC/A files
* @param target The absolute filepath for where to write the archive
* @return
*/
public static final ExitStatus packArchive(final String source, final String target) {
logger.info("Attempting to pack " + source + " to " + target);
try { //to wrap things we can de-reference immediately
File sourceDir = new File(source);
if(!sourceDir.exists()) {
throw new FileNotFoundException("Unable to find filesystem resource - " + source);
}
if(!sourceDir.isDirectory()) {
throw new IllegalArgumentException(source + " is not a folder");
}
zip(source, target);
return ExitStatus.COMPLETED;
} catch (Exception e) {
logger.error("Error writing " + source + " to " + target, e);
return ExitStatus.FAILED;
}
}
示例2: afterStep
public ExitStatus afterStep(StepExecution stepExecution)
{
if (stepExecution.getReadCount() == 0)
{
LogUtil.getCoreLog().info("Job executed but readCount is 0 (No record or no one valid line)");
return ExitStatus.FAILED;
}
return ExitStatus.COMPLETED;
}
示例3: afterStep
public ExitStatus afterStep(StepExecution sStepExecution) {
synchronized (lock) {
initialized = false;
keys = null;
}
return ExitStatus.COMPLETED;
}
示例4: afterStep
@Override
public ExitStatus afterStep(StepExecution stepExecution) {
if (someItemsGotSkippedDueToTaxWebServiceExceptions(stepExecution)) {
//stepExecution.setStatus(BatchStatus.FAILED);
return ExitStatus.FAILED;
}
return ExitStatus.COMPLETED;
}
示例5: afterStep
@Override
public ExitStatus afterStep(StepExecution stepExecution) {
log.debug("after step tasks: ");
scjObjectDeleter.deleteScChambersWithoutJudgments();
scjObjectDeleter.deleteScChamberDivisionsWithoutJudgments();
scjObjectDeleter.deleteScjFormsWithoutJudgments();
judgmentObjectDeleter.deleteMeansOfAppealWithoutJudgments(CourtType.SUPREME);
judgmentObjectDeleter.deleteJudgmentResultsWithoutJudgments(CourtType.SUPREME);
return ExitStatus.COMPLETED;
}
示例6: afterStep
@Override
public ExitStatus afterStep(StepExecution stepExecution) {
judgmentObjectDeleter.deleteMeansOfAppealWithoutJudgments(CourtType.CONSTITUTIONAL_TRIBUNAL);
judgmentObjectDeleter.deleteJudgmentResultsWithoutJudgments(CourtType.CONSTITUTIONAL_TRIBUNAL);
return ExitStatus.COMPLETED;
}
示例7: afterStep
@Override
public ExitStatus afterStep(StepExecution stepExecution) {
judgmentObjectDeleter.deleteMeansOfAppealWithoutJudgments(CourtType.NATIONAL_APPEAL_CHAMBER);
judgmentObjectDeleter.deleteJudgmentResultsWithoutJudgments(CourtType.NATIONAL_APPEAL_CHAMBER);
return ExitStatus.COMPLETED;
}
示例8: afterStep
@Override
public ExitStatus afterStep(StepExecution stepExecution) {
// To make the job execution fail, set the step execution to fail
// and return failed ExitStatus
// stepExecution.setStatus(BatchStatus.FAILED);
// return ExitStatus.FAILED;
return ExitStatus.COMPLETED;
}
示例9: afterStep
@AfterStep
public ExitStatus afterStep(StepExecution stepExecution) {
log.info("스텝 완료 후 호출됩니다. StepName=[{}], ExitStatus=[{}]",
stepExecution.getStepName(), stepExecution.getExitStatus());
return ExitStatus.COMPLETED;
}
示例10: mapResult
private ExitStatus mapResult(Object result) {
if (result instanceof ExitStatus) {
return (ExitStatus) result;
}
return ExitStatus.COMPLETED;
}
示例11: afterStep
@Override
public ExitStatus afterStep(StepExecution stepExecution) {
LOGGER.info("afterStep");
return ExitStatus.COMPLETED;
}
示例12: unpackArchive
/**
*
* @param archiveName
* The name of the archive file to unpack
* @param unpackDirectory
* The directory to unpack the file into
* @return an exit status indicating whether this
* step was successfully completed
*/
public final ExitStatus unpackArchive(final String archiveName,
final String unpackDirectory) {
try {
File directory = new File(unpackDirectory);
if (!directory.exists()) {
directory.mkdir();
}
BufferedOutputStream bufferedOutputStream = null;
BufferedInputStream bufferedInputStream = null;
ZipEntry entry;
ZipFile zipfile = new ZipFile(archiveName);
Enumeration entries = zipfile.entries();
while (entries.hasMoreElements()) {
entry = (ZipEntry) entries.nextElement();
if(entry.getName().indexOf("/") != -1) {
// entry is in a subdir
String subDirectoryName = entry.getName().substring(0, entry.getName().indexOf("/"));
File subDirectory = new File(directory,subDirectoryName);
if(!subDirectory.exists()) {
subDirectory.mkdirs();
}
}
logger.debug("Extracting: " + entry + " from " + archiveName);
bufferedInputStream = new BufferedInputStream(
zipfile.getInputStream(entry));
int count;
byte[] data = new byte[BUFFER];
FileOutputStream fileOutputStream = new FileOutputStream(
new File(directory, entry.getName()));
bufferedOutputStream = new BufferedOutputStream(
fileOutputStream, BUFFER);
while (
(count
= bufferedInputStream.read(data, 0, BUFFER)) != -1) {
bufferedOutputStream.write(data, 0, count);
}
bufferedOutputStream.flush();
bufferedOutputStream.close();
bufferedInputStream.close();
}
} catch (IOException ioe) {
logger.error("Input Output Exception unpacking "
+ archiveName + " " + ioe.getLocalizedMessage());
return ExitStatus.FAILED;
}
return ExitStatus.COMPLETED;
}
示例13: afterStep
@Override
public ExitStatus afterStep(StepExecution sStepExecution) {
return ExitStatus.COMPLETED;
}
示例14: afterStep
@Override
public ExitStatus afterStep(StepExecution stepExecution) {
return ExitStatus.COMPLETED;
}