Examples of StepContext


Examples of javax.batch.runtime.context.StepContext

    when(propertyContext.getStepProperties("step3")).thenReturn(props);

    StepSynchronizationManager.register(new StepExecution("step3", new JobExecution(5L), 3L));

    StepContext context1 = factory.getObject();
    StepContext context2 = factory.getObject();

    assertTrue(context1 == context2);
    assertEquals(3L, context1.getStepExecutionId());
    assertEquals("value1", context1.getProperties().get("key1"));
View Full Code Here

Examples of javax.batch.runtime.context.StepContext

        @Override
        public StepContext call() throws Exception {
          try {
            StepSynchronizationManager.register(new StepExecution("step" + count, new JobExecution(count)));
            StepContext context = factory.getObject();
            Thread.sleep(1000L);
            return context;
          } catch (Throwable ignore) {
            return null;
          }finally {
View Full Code Here

Examples of javax.batch.runtime.context.StepContext

        @Override
        public StepContext call() throws Exception {
          try {
            StepSynchronizationManager.register(new StepExecution("step" + count, new JobExecution(count)));
            StepContext context = factory.getObject();
            Thread.sleep(1000L);
            return context;
          } catch (Throwable ignore) {
            return null;
          }finally {
View Full Code Here

Examples of javax.batch.runtime.context.StepContext

    if(curStepExecution == null) {
      throw new FactoryBeanNotInitializedException("A StepExecution is required");
    }

    StepContext context = contextHolder.get();

    // If the current context applies to the current step, use it
    if(context != null && context.getStepExecutionId() == curStepExecution.getId()) {
      return context;
    }

    Properties stepProperties = batchPropertyContext.getStepProperties(curStepExecution.getStepName());
View Full Code Here

Examples of org.jenkinsci.plugins.workflow.steps.StepContext

        private static @CheckForNull StepContext finish(@CheckForNull String cookie) {
            if (cookie == null) {
                return null;
            }
            synchronized (runningTasks) {
                StepContext context = runningTasks.remove(cookie);
                if (context == null) {
                    LOGGER.log(Level.FINE, "no running task corresponds to {0}", cookie);
                }
                runningTasks.notifyAll();
                return context;
View Full Code Here

Examples of org.jenkinsci.plugins.workflow.steps.StepContext

            @Override public void onSuccess(Object returnValue) {
                LOGGER.log(Level.FINE, "onSuccess {0}", cookie);
                lease.release();
                lease = null;
                StepContext context = finish(cookie);
                if (context != null) {
                    context.onSuccess(returnValue);
                }
            }
View Full Code Here

Examples of org.jenkinsci.plugins.workflow.steps.StepContext

            @Override public void onFailure(Throwable t) {
                LOGGER.log(Level.FINE, "onFailure {0}", cookie);
                lease.release();
                lease = null;
                StepContext context = finish(cookie);
                if (context != null) {
                    context.onFailure(t);
                }
            }
View Full Code Here

Examples of org.springframework.batch.core.scope.context.StepContext

public class JobTasklet extends JobExecutor implements Tasklet {


  public RepeatStatus execute(final StepContribution contribution, ChunkContext chunkContext) throws Exception {

    StepContext context = StepSynchronizationManager.getContext();
    final StepExecution stepExecution = (context != null) ? context.getStepExecution() : null;

    final AtomicBoolean done = new AtomicBoolean(false);

    final JobListener jobListener = new JobListener() {
View Full Code Here

Examples of org.springframework.batch.core.scope.context.StepContext

    @Override
    public RepeatStatus execute(StepContribution contribution, ChunkContext chunkContext) throws Exception {
      SimpleAsyncTaskExecutor asyncTX = new SimpleAsyncTaskExecutor();

      StepContext context = StepSynchronizationManager.getContext();
      final StepExecution stepExecution = (context != null) ? context.getStepExecution() : null;

      final AtomicBoolean done = new AtomicBoolean(false);

      final Thread[] th = new Thread[1];
View Full Code Here

Examples of org.springframework.batch.core.scope.context.StepContext

                return RepeatStatus.FINISHED;
            }
        };
        StepContribution contribution = Mockito.mock(StepContribution.class);
        StepExecution stepExecution = createStepExecution("testExecuteJob", "testExecuteStep");
        StepContext stepContext = Mockito.mock(StepContext.class);
        Mockito.when(stepContext.getStepExecution()).thenReturn(stepExecution);

        ChunkContext chunkContext = Mockito.mock(ChunkContext.class);
        Mockito.when(chunkContext.getStepContext()).thenReturn(stepContext);
        tasklet.execute(contribution, chunkContext);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.