Package se.ikama.bauta.batch.tasklet
Class CloseDbConnectionsTasklet
- java.lang.Object
-
- se.ikama.bauta.batch.tasklet.ReportTasklet
-
- se.ikama.bauta.batch.tasklet.CloseDbConnectionsTasklet
-
- All Implemented Interfaces:
org.springframework.batch.core.step.tasklet.Tasklet,org.springframework.beans.factory.InitializingBean,ReportGenerator
public class CloseDbConnectionsTasklet extends ReportTasklet implements ReportGenerator, org.springframework.beans.factory.InitializingBean
Closes all idle connections in the StagingDB connection pool. Used in situations where you must ensure that all DB sessions are closed. For instance, if you must drop the Staging DB schema.
-
-
Field Summary
-
Fields inherited from class se.ikama.bauta.batch.tasklet.ReportTasklet
failIfValidationFailures, reportDir
-
-
Constructor Summary
Constructors Constructor Description CloseDbConnectionsTasklet()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidafterPropertiesSet()ReportGenerationResultgenerateReport(java.io.File reportFile, org.springframework.batch.core.StepContribution sc, org.springframework.batch.core.scope.context.ChunkContext cc)Generate a report-
Methods inherited from class se.ikama.bauta.batch.tasklet.ReportTasklet
addReportGenerator, execute, setReportGenerators
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface se.ikama.bauta.batch.tasklet.ReportGenerator
getReportFilename, getReportName
-
-
-
-
Method Detail
-
afterPropertiesSet
public void afterPropertiesSet() throws java.lang.Exception- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean- Throws:
java.lang.Exception
-
generateReport
@Transactional(readOnly=true, transactionManager="stagingTransactionManager") public ReportGenerationResult generateReport(java.io.File reportFile, org.springframework.batch.core.StepContribution sc, org.springframework.batch.core.scope.context.ChunkContext cc) throws java.lang.ExceptionDescription copied from interface:ReportGeneratorGenerate a report- Specified by:
generateReportin interfaceReportGenerator- Parameters:
reportFile- The file to write the report tosc- The current step contributioncc- The current ChunkContext- Returns:
- A ReportGenerationResult. Typically with the status OK.
For certain types of report generators with a notion of "failure", it may make sense to return Failed, to support. See @
SqlValidationTasklet - Throws:
java.lang.Exception
-
-