Tabnine Logo
CompositeChunkListener.afterChunk
Code IndexAdd Tabnine to your IDE (free)

How to use
afterChunk
method
in
org.springframework.batch.core.listener.CompositeChunkListener

Best Java code snippets using org.springframework.batch.core.listener.CompositeChunkListener.afterChunk (Showing top 11 results out of 315)

origin: spring-projects/spring-batch

/**
 * @see org.springframework.batch.core.listener.CompositeChunkListener#afterChunk(ChunkContext context)
 */
@Override
public void afterChunk(ChunkContext context) {
  try {
    chunkListener.afterChunk(context);
  }
  catch (RuntimeException e) {
    throw new StepListenerFailedException("Error in afterChunk.", getTargetException(e));
  }
}
origin: spring-projects/spring-batch

@Override
public RepeatStatus doInChunkContext(RepeatContext repeatContext, ChunkContext chunkContext)
    throws Exception {
  StepExecution stepExecution = chunkContext.getStepContext().getStepExecution();
  // Before starting a new transaction, check for
  // interruption.
  interruptionPolicy.checkInterrupted(stepExecution);
  RepeatStatus result;
  try {
    result = new TransactionTemplate(transactionManager, transactionAttribute)
    .execute(new ChunkTransactionCallback(chunkContext, semaphore));
  }
  catch (UncheckedTransactionException e) {
    // Allow checked exceptions to be thrown inside callback
    throw (Exception) e.getCause();
  }
  chunkListener.afterChunk(chunkContext);
  // Check for interruption after transaction as well, so that
  // the interrupted exception is correctly propagated up to
  // caller
  interruptionPolicy.checkInterrupted(stepExecution);
  return result == null ? RepeatStatus.FINISHED : result;
}
origin: spring-projects/spring-batch

@Test
public void testAfterChunk(){
  listener.afterChunk(chunkContext);
  compositeListener.afterChunk(chunkContext);
}
origin: org.springframework.batch/org.springframework.batch.core

/**
 * 
 * @see org.springframework.batch.core.listener.CompositeChunkListener#afterChunk()
 */
public void afterChunk() {
  try {
    chunkListener.afterChunk();
  }
  catch (RuntimeException e) {
    throw new StepListenerFailedException("Error in afterChunk.", e);
  }
}
origin: org.springframework.batch.core/org.motechproject.org.springframework.batch.core

/**
 *
 * @see org.springframework.batch.core.listener.CompositeChunkListener#afterChunk(ChunkContext context)
 */
@Override
public void afterChunk(ChunkContext context) {
  try {
    chunkListener.afterChunk(context);
  }
  catch (RuntimeException e) {
    throw new StepListenerFailedException("Error in afterChunk.", e);
  }
}
origin: org.springframework.batch/spring-batch-core

/**
 * @see org.springframework.batch.core.listener.CompositeChunkListener#afterChunk(ChunkContext context)
 */
@Override
public void afterChunk(ChunkContext context) {
  try {
    chunkListener.afterChunk(context);
  }
  catch (RuntimeException e) {
    throw new StepListenerFailedException("Error in afterChunk.", getTargetException(e));
  }
}
origin: apache/servicemix-bundles

/**
 * @see org.springframework.batch.core.listener.CompositeChunkListener#afterChunk(ChunkContext context)
 */
@Override
public void afterChunk(ChunkContext context) {
  try {
    chunkListener.afterChunk(context);
  }
  catch (RuntimeException e) {
    throw new StepListenerFailedException("Error in afterChunk.", getTargetException(e));
  }
}
origin: org.springframework.batch/spring-batch-core

@Override
public RepeatStatus doInChunkContext(RepeatContext repeatContext, ChunkContext chunkContext)
    throws Exception {
  StepExecution stepExecution = chunkContext.getStepContext().getStepExecution();
  // Before starting a new transaction, check for
  // interruption.
  interruptionPolicy.checkInterrupted(stepExecution);
  RepeatStatus result;
  try {
    result = new TransactionTemplate(transactionManager, transactionAttribute)
    .execute(new ChunkTransactionCallback(chunkContext, semaphore));
  }
  catch (UncheckedTransactionException e) {
    // Allow checked exceptions to be thrown inside callback
    throw (Exception) e.getCause();
  }
  chunkListener.afterChunk(chunkContext);
  // Check for interruption after transaction as well, so that
  // the interrupted exception is correctly propagated up to
  // caller
  interruptionPolicy.checkInterrupted(stepExecution);
  return result == null ? RepeatStatus.FINISHED : result;
}
origin: apache/servicemix-bundles

@Override
public RepeatStatus doInChunkContext(RepeatContext repeatContext, ChunkContext chunkContext)
    throws Exception {
  StepExecution stepExecution = chunkContext.getStepContext().getStepExecution();
  // Before starting a new transaction, check for
  // interruption.
  interruptionPolicy.checkInterrupted(stepExecution);
  RepeatStatus result;
  try {
    result = new TransactionTemplate(transactionManager, transactionAttribute)
    .execute(new ChunkTransactionCallback(chunkContext, semaphore));
  }
  catch (UncheckedTransactionException e) {
    // Allow checked exceptions to be thrown inside callback
    throw (Exception) e.getCause();
  }
  chunkListener.afterChunk(chunkContext);
  // Check for interruption after transaction as well, so that
  // the interrupted exception is correctly propagated up to
  // caller
  interruptionPolicy.checkInterrupted(stepExecution);
  return result == null ? RepeatStatus.FINISHED : result;
}
origin: org.springframework.batch.core/org.motechproject.org.springframework.batch.core

@Override
public RepeatStatus doInChunkContext(RepeatContext repeatContext, ChunkContext chunkContext)
    throws Exception {
  StepExecution stepExecution = chunkContext.getStepContext().getStepExecution();
  // Before starting a new transaction, check for
  // interruption.
  interruptionPolicy.checkInterrupted(stepExecution);
  RepeatStatus result;
  try {
    result = new TransactionTemplate(transactionManager, transactionAttribute)
    .execute(new ChunkTransactionCallback(chunkContext, semaphore));
  }
  catch (UncheckedTransactionException e) {
    // Allow checked exceptions to be thrown inside callback
    throw (Exception) e.getCause();
  }
  chunkListener.afterChunk(chunkContext);
  // Check for interruption after transaction as well, so that
  // the interrupted exception is correctly propagated up to
  // caller
  interruptionPolicy.checkInterrupted(stepExecution);
  return result;
}
origin: org.springframework.batch/org.springframework.batch.core

@Override
public RepeatStatus doInChunkContext(RepeatContext repeatContext, ChunkContext chunkContext)
    throws Exception {
  StepExecution stepExecution = chunkContext.getStepContext().getStepExecution();
  // Before starting a new transaction, check for
  // interruption.
  interruptionPolicy.checkInterrupted(stepExecution);
  RepeatStatus result;
  try {
    result = (RepeatStatus) new TransactionTemplate(transactionManager, transactionAttribute)
        .execute(new ChunkTransactionCallback(chunkContext));
  }
  catch (UncheckedTransactionException e) {
    // Allow checked exceptions to be thrown inside callback
    throw (Exception) e.getCause();
  }
  chunkListener.afterChunk();
  // Check for interruption after transaction as well, so that
  // the interrupted exception is correctly propagated up to
  // caller
  interruptionPolicy.checkInterrupted(stepExecution);
  return result;
}
org.springframework.batch.core.listenerCompositeChunkListenerafterChunk

Javadoc

Call the registered listeners in order, respecting and prioritising those that implement Ordered.

Popular methods of CompositeChunkListener

  • beforeChunk
    Call the registered listeners in reverse order.
  • register
    Register additional listener.
  • afterChunkError
    Call the registered listeners in reverse order.
  • <init>

Popular in Java

  • Reading from database using SQL prepared statement
  • scheduleAtFixedRate (Timer)
  • setRequestProperty (URLConnection)
  • setScale (BigDecimal)
  • Iterator (java.util)
    An iterator over a sequence of objects, such as a collection.If a collection has been changed since
  • TreeMap (java.util)
    Walk the nodes of the tree left-to-right or right-to-left. Note that in descending iterations, next
  • Vector (java.util)
    Vector is an implementation of List, backed by an array and synchronized. All optional operations in
  • JFileChooser (javax.swing)
  • Join (org.hibernate.mapping)
  • Scheduler (org.quartz)
    This is the main interface of a Quartz Scheduler. A Scheduler maintains a registry of org.quartz.Job
  • Best IntelliJ plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now