Package javax.batch.runtime

Examples of javax.batch.runtime.BatchStatus


            }

            jobContext.destroyArtifact(mapper, reducer, analyzer);
            jobContext.destroyArtifact(stepListeners);

            BatchStatus stepStatus = batchContext.getBatchStatus();
            switch (stepStatus) {
                case STARTED:
                    batchContext.setBatchStatus(BatchStatus.COMPLETED);
                    break;
                case FAILED:
View Full Code Here


                completedPartitionThreads.take();
            }
            ConcurrencyService.submit(runner1);
        }

        BatchStatus consolidatedBatchStatus = BatchStatus.STARTED;
        List<StepExecutionImpl> fromAllPartitions = new ArrayList<StepExecutionImpl>();
        ut.begin();
        try {
            while (fromAllPartitions.size() < numOfPartitions) {
                Serializable data = collectorDataQueue.take();
                if (data instanceof StepExecutionImpl) {
                    StepExecutionImpl s = (StepExecutionImpl) data;
                    fromAllPartitions.add(s);
                    BatchStatus bs = s.getBatchStatus();

                    if (bs == BatchStatus.FAILED || bs == BatchStatus.STOPPED) {
                        List<Integer> idxes = s.getPartitionPropertiesIndex();
                        Integer idx = null;
                        if (idxes != null && idxes.size() > 0) {
View Full Code Here

    PartitionCollector.artifactNames = Collections.synchronizedSet(new HashSet<String>());
  }

  @Test
  public void testBatchletNoProperties() throws Exception {
    BatchStatus curBatchStatus = runJob("partitionParserTestsBatchlet", new Properties(), TIMEOUT).getBatchStatus();

    assertEquals(BatchStatus.COMPLETED, curBatchStatus);
    assertEquals(10, MyBatchlet.processed);
    assertEquals(10, MyBatchlet.threadNames.size());
  }
View Full Code Here

  public static JobExecution runJob(String jobName, Properties properties, long timeout) throws TimeoutException {
    long executionId = operator.start(jobName, properties);
    JobExecution execution = operator.getJobExecution(executionId);

    Date curDate = new Date();
    BatchStatus curBatchStatus = execution.getBatchStatus();

    while(true) {
      if(curBatchStatus == BatchStatus.STOPPED || curBatchStatus == BatchStatus.COMPLETED || curBatchStatus == BatchStatus.FAILED) {
        break;
      }
View Full Code Here

  public static JobExecution restartJob(long executionId, Properties properties, long timeout) throws TimeoutException {
    long restartId = operator.restart(executionId, properties);
    JobExecution execution = operator.getJobExecution(restartId);

    Date curDate = new Date();
    BatchStatus curBatchStatus = execution.getBatchStatus();

    while(true) {
      if(curBatchStatus == BatchStatus.STOPPED || curBatchStatus == BatchStatus.COMPLETED || curBatchStatus == BatchStatus.FAILED) {
        break;
      }
View Full Code Here

  public static JobExecution runJob(String jobName, Properties properties, long timeout) throws TimeoutException{
    long executionId = operator.start(jobName, properties);
    JobExecution execution = operator.getJobExecution(executionId);

    Date curDate = new Date();
    BatchStatus curBatchStatus = execution.getBatchStatus();

    while(true) {
      if(curBatchStatus == BatchStatus.STOPPED || curBatchStatus == BatchStatus.COMPLETED || curBatchStatus == BatchStatus.FAILED) {
        break;
      }
View Full Code Here

  public static JobExecution restartJob(long executionId, Properties properties, long timeout) throws TimeoutException {
    long restartId = operator.restart(executionId, properties);
    JobExecution execution = operator.getJobExecution(restartId);

    Date curDate = new Date();
    BatchStatus curBatchStatus = execution.getBatchStatus();

    while(true) {
      if(curBatchStatus == BatchStatus.STOPPED || curBatchStatus == BatchStatus.COMPLETED || curBatchStatus == BatchStatus.FAILED) {
        break;
      }
View Full Code Here

            JobExecutionNotRunningException, JobSecurityException {
        final JobExecutionImpl jobExecution = (JobExecutionImpl) repository.getJobExecution(executionId);
        if (jobExecution == null) {
            throw MESSAGES.noSuchJobExecution(executionId);
        }
        final BatchStatus s = jobExecution.getBatchStatus();
        if (s == BatchStatus.STOPPED || s == BatchStatus.FAILED || s == BatchStatus.ABANDONED ||
                s == BatchStatus.COMPLETED) {
            throw MESSAGES.jobExecutionNotRunningException(executionId, s);
        } else if (s == BatchStatus.STOPPING) {
            //in process of stopping, do nothing
View Full Code Here

        final List<Long> result = new ArrayList<Long>();
        boolean jobExists = false;
        for (final JobExecution e : repository.getJobExecutions(null)) {
            if (e.getJobName().equals(jobName)) {
                jobExists = true;
                final BatchStatus s = e.getBatchStatus();
                if (s == BatchStatus.STARTING || s == BatchStatus.STARTED) {
                    result.add(e.getExecutionId());
                }
            }
        }
View Full Code Here

        long newExecutionId = 0;
        final JobExecutionImpl originalToRestart = (JobExecutionImpl) getJobExecution(executionId);
        if (originalToRestart == null) {
            throw MESSAGES.noSuchJobExecution(executionId);
        }
        final BatchStatus previousStatus = originalToRestart.getBatchStatus();
        if (previousStatus == BatchStatus.COMPLETED) {
            throw MESSAGES.jobExecutionAlreadyCompleteException(executionId);
        }
        if (previousStatus == BatchStatus.ABANDONED ||
                previousStatus == BatchStatus.STARTED ||
View Full Code Here

TOP

Related Classes of javax.batch.runtime.BatchStatus

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.