2017-01-05 5 views

答えて

0

あなたはJobListenerSupport

public class BatchJobRunTimeLogger extends JobListenerSupport { 

private Logger LOGGER = LoggerFactory.getLogger(BatchJobRunTimeLogger.class); 

@Override 
public String getName() { 
    return "BatchJobRunTimeLogger"; 
} 

public void jobWasExecuted(JobExecutionContext context, JobExecutionException jobException) { 
    String jobName = context.getJobDetail().getKey().getName(); 
    long runTime = context.getJobRunTime(); 

    LOGGER.info("JobName={} took RunTime={}", jobName, runTime); 
} 

}

を拡張するカスタムリスナを実装することができます
関連する問題