Package org.springframework.batch.repeat

Examples of org.springframework.batch.repeat.RepeatCallback


      throws Exception {

    final AtomicInteger filterCount = new AtomicInteger(0);
    final Chunk<O> output = new Chunk<O>();

    repeatTemplate.iterate(new RepeatCallback() {

      @Override
      public RepeatStatus doInIteration(RepeatContext context) throws Exception {
        I item = provide(contribution, chunk);
View Full Code Here


  @Override
  public Chunk<I> provide(final StepContribution contribution) throws Exception {

    final Chunk<I> inputs = new Chunk<I>();
    repeatOperations.iterate(new RepeatCallback() {

      @Override
      public RepeatStatus doInIteration(final RepeatContext context) throws Exception {
        I item = null;
        try {
View Full Code Here

  @Test
  public void testCommit() throws Exception {

    assertInitialState();

    repeatTemplate.iterate(new RepeatCallback() {
      @Override
      public RepeatStatus doInIteration(RepeatContext context) throws Exception {
        String text = (String) jmsTemplate.receiveAndConvert("queue");
        list.add(text);
        jdbcTemplate.update("INSERT into T_BARS (id,name,foo_date) values (?,?,null)", list.size(), text);
View Full Code Here

    assertInitialState();

    new TransactionTemplate(transactionManager).execute(new TransactionCallback<Void>() {
      @Override
      public Void doInTransaction(org.springframework.transaction.TransactionStatus status) {
        repeatTemplate.iterate(new RepeatCallback() {
          @Override
          public RepeatStatus doInIteration(RepeatContext context) throws Exception {
            String text = (String) jmsTemplate.receiveAndConvert("queue");
            list.add(text);
            jdbcTemplate.update("INSERT into T_BARS (id,name,foo_date) values (?,?,null)", list.size(), text);
View Full Code Here

    new TransactionTemplate(transactionManager).execute(new TransactionCallback<Void>() {
      @Override
      public Void doInTransaction(org.springframework.transaction.TransactionStatus status) {

        repeatTemplate.iterate(new RepeatCallback() {
          @Override
          public RepeatStatus doInIteration(RepeatContext context) throws Exception {
            String text = (String) txJmsTemplate.receiveAndConvert("queue");
            list.add(text);
            jdbcTemplate.update("INSERT into T_BARS (id,name,foo_date) values (?,?,null)", list.size(), text);
View Full Code Here

   */
  @Test
  public void testEarlyCompletionWithException() throws Exception {

    try {
      template.iterate(new RepeatCallback() {
                @Override
        public RepeatStatus doInIteration(RepeatContext context) throws Exception {
          count++;
          throw new IllegalStateException("foo!");
        }
View Full Code Here

            @Override
      public RepeatContext start(RepeatContext c) {
        return context;
      }
    });
    template.iterate(new RepeatCallback() {
            @Override
      public RepeatStatus doInIteration(RepeatContext context) throws Exception {
        count++;
        return RepeatStatus.continueIf(count < 1);
      }
View Full Code Here

        return context;
      }
    });

    try {
      template.iterate(new RepeatCallback() {
                @Override
        public RepeatStatus doInIteration(RepeatContext context) throws Exception {
          count++;
          throw new RuntimeException("foo");
        }
View Full Code Here

        throw (RuntimeException) throwable;
      }
    });

    try {
      template.iterate(new RepeatCallback() {
                @Override
        public RepeatStatus doInIteration(RepeatContext context) throws Exception {
          count++;
          throw new RuntimeException("foo");
        }
View Full Code Here

  @Test
  public void testNestedSession() throws Exception {
    RepeatTemplate outer = getRepeatTemplate();
    RepeatTemplate inner = getRepeatTemplate();
    outer.iterate(new NestedRepeatCallback(inner, new RepeatCallback() {
            @Override
      public RepeatStatus doInIteration(RepeatContext context) throws Exception {
        count++;
        assertNotNull(context);
        assertNotSame("Nested batch should have new session", context, context.getParent());
View Full Code Here

TOP

Related Classes of org.springframework.batch.repeat.RepeatCallback

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.