Upgrade dependencies to major versions for Spring Batch 5

* Upgrade to Jakarta EE 9
* Upgrade to Spring Framework 6
* Upgrade to Spring Integration 6
* Upgrade to Spring Data 3
* Upgrade to Spring AMQP 3
* Upgrade to Spring for Apache Kafka 3

LDIF support is still in progress waiting for the next
major version of Spring LDAP.

Closes #4027
Closes #3656
This commit is contained in:
Mahmoud Ben Hassine
2021-09-23 08:29:13 +02:00
parent 2a9904bae1
commit 5dc17b190e
197 changed files with 1295 additions and 1172 deletions

46
pom.xml
View File

@@ -52,28 +52,29 @@
<java.version>17</java.version>
<!-- production dependencies -->
<spring-framework.version>5.3.10-SNAPSHOT</spring-framework.version>
<spring-framework.version>6.0.0-SNAPSHOT</spring-framework.version>
<spring-retry.version>1.3.1</spring-retry.version>
<spring-integration.version>5.5.4-SNAPSHOT</spring-integration.version>
<spring-integration.version>6.0.0-SNAPSHOT</spring-integration.version>
<micrometer.version>1.7.4-SNAPSHOT</micrometer.version>
<jackson.version>2.12.3</jackson.version>
<!-- optional production dependencies -->
<spring-data-geode.version>2.6.0-SNAPSHOT</spring-data-geode.version>
<spring-data-commons.version>2.6.0-SNAPSHOT</spring-data-commons.version>
<spring-data-jpa.version>2.6.0-SNAPSHOT</spring-data-jpa.version>
<spring-data-mongodb.version>3.3.0-SNAPSHOT</spring-data-mongodb.version>
<spring-kafka.version>2.7.7-SNAPSHOT</spring-kafka.version>
<spring-amqp.version>2.4.0-SNAPSHOT</spring-amqp.version>
<spring-data-geode.version>3.0.0-SNAPSHOT</spring-data-geode.version>
<spring-data-commons.version>3.0.0-SNAPSHOT</spring-data-commons.version>
<spring-data-jpa.version>3.0.0-SNAPSHOT</spring-data-jpa.version>
<spring-data-mongodb.version>4.0.0-SNAPSHOT</spring-data-mongodb.version>
<spring-kafka.version>3.0.0-SNAPSHOT</spring-kafka.version>
<spring-amqp.version>3.0.0-SNAPSHOT</spring-amqp.version>
<spring-ldap.version>2.3.5.BUILD-SNAPSHOT</spring-ldap.version>
<avro.version>1.9.2</avro.version>
<gson.version>2.8.6</gson.version>
<hibernate-core.version>5.4.30.Final</hibernate-core.version>
<javax.annotation-api.version>1.3.2</javax.annotation-api.version>
<javax.mail-api.version>1.6.2</javax.mail-api.version>
<javax.jms-api.version>2.0.1</javax.jms-api.version>
<javax.batch-api.version>1.0</javax.batch-api.version>
<validation-api.version>2.0.1.Final</validation-api.version>
<hibernate-core-jakarta.version>5.6.1.Final</hibernate-core-jakarta.version>
<jakarta.annotation-api.version>2.0.0</jakarta.annotation-api.version>
<jakarta.mail-api.version>2.0.1</jakarta.mail-api.version>
<jakarta.jms-api.version>3.0.0</jakarta.jms-api.version>
<jakarta.batch-api.version>2.0.0</jakarta.batch-api.version>
<jakarta.validation-api.version>3.0.0</jakarta.validation-api.version>
<jakarta.persistence-api.version>3.0.0</jakarta.persistence-api.version>
<neo4j-ogm-core.version>3.2.21</neo4j-ogm-core.version>
<mongodb-driver-sync.version>4.2.3</mongodb-driver-sync.version>
<xstream.version>1.4.16</xstream.version>
@@ -92,12 +93,15 @@
<h2.version>1.4.200</h2.version>
<sqlite.version>3.34.0</sqlite.version>
<derby.version>10.14.2.0</derby.version>
<activemq.version>5.15.14</activemq.version>
<jaxb-api.version>2.3.1</jaxb-api.version>
<jaxb-core.version>2.3.0.1</jaxb-core.version>
<artemis.version>2.19.0</artemis.version>
<jaxb-core.version>3.0.0</jaxb-core.version>
<log4j.version>2.14.1</log4j.version>
<hibernate-validator.version>6.2.0.Final</hibernate-validator.version>
<javax.el.version>3.0.0</javax.el.version>
<hibernate-validator.version>7.0.1.Final</hibernate-validator.version>
<jakarta.el-api.version>4.0.0</jakarta.el-api.version>
<jakarta.el.version>4.0.2</jakarta.el.version>
<jakarta.inject-api.version>2.0.0</jakarta.inject-api.version>
<jakarta.xml.bind-api.version>3.0.1</jakarta.xml.bind-api.version>
<jakarta.mail.version>2.0.1</jakarta.mail.version>
<woodstox-core.version>6.2.5</woodstox-core.version>
<aspectj.version>1.9.6</aspectj.version>
<mysql-connector-java.version>8.0.23</mysql-connector-java.version>
@@ -108,12 +112,10 @@
<jtds.version>1.3.1</jtds.version>
<testcontainers.version>1.15.3</testcontainers.version>
<com.ibm.jbatch-tck-spi.version>1.0</com.ibm.jbatch-tck-spi.version>
<javax.inject.version>1</javax.inject.version>
<jsonassert.version>1.5.0</jsonassert.version>
<!-- samples dependencies -->
<hibernate-entitymanager.version>5.4.30.Final</hibernate-entitymanager.version>
<spring-rabbit.version>2.4.0-SNAPSHOT</spring-rabbit.version>
<spring-rabbit.version>3.0.0-SNAPSHOT</spring-rabbit.version>
<quartz.version>2.3.2</quartz.version>
<prometheus_pushgateway.version>0.10.0</prometheus_pushgateway.version>
<groovy.version>2.5.14</groovy.version>

View File

@@ -51,9 +51,9 @@
<version>${jackson.version}</version>
</dependency>
<dependency>
<groupId>javax.batch</groupId>
<artifactId>javax.batch-api</artifactId>
<version>${javax.batch-api.version}</version>
<groupId>jakarta.batch</groupId>
<artifactId>jakarta.batch-api</artifactId>
<version>${jakarta.batch-api.version}</version>
</dependency>
<dependency>
<groupId>io.micrometer</groupId>
@@ -63,9 +63,9 @@
<!-- optional production dependencies -->
<dependency>
<groupId>javax.annotation</groupId>
<artifactId>javax.annotation-api</artifactId>
<version>${javax.annotation-api.version}</version>
<groupId>jakarta.annotation</groupId>
<artifactId>jakarta.annotation-api</artifactId>
<version>${jakarta.annotation-api.version}</version>
<optional>true</optional>
</dependency>
<dependency>
@@ -239,9 +239,9 @@
<scope>test</scope>
</dependency>
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>${jaxb-api.version}</version>
<groupId>jakarta.xml.bind</groupId>
<artifactId>jakarta.xml.bind-api</artifactId>
<version>${jakarta.xml.bind-api.version}</version>
<scope>test</scope>
</dependency>
<dependency>
@@ -263,9 +263,9 @@
<scope>test</scope>
</dependency>
<dependency>
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
<version>${javax.inject.version}</version>
<groupId>jakarta.inject</groupId>
<artifactId>jakarta.inject-api</artifactId>
<version>${jakarta.inject-api.version}</version>
<scope>test</scope>
</dependency>
</dependencies>

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2006-2018 the original author or authors.
* Copyright 2006-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -113,21 +113,21 @@ public enum BatchStatus {
*
* @return JSR-352 equivalent to the current status
*/
public javax.batch.runtime.BatchStatus getBatchStatus() {
public jakarta.batch.runtime.BatchStatus getBatchStatus() {
if(this == ABANDONED) {
return javax.batch.runtime.BatchStatus.ABANDONED;
return jakarta.batch.runtime.BatchStatus.ABANDONED;
} else if(this == COMPLETED) {
return javax.batch.runtime.BatchStatus.COMPLETED;
return jakarta.batch.runtime.BatchStatus.COMPLETED;
} else if(this == STARTED) {
return javax.batch.runtime.BatchStatus.STARTED;
return jakarta.batch.runtime.BatchStatus.STARTED;
} else if(this == STARTING) {
return javax.batch.runtime.BatchStatus.STARTING;
return jakarta.batch.runtime.BatchStatus.STARTING;
} else if(this == STOPPED) {
return javax.batch.runtime.BatchStatus.STOPPED;
return jakarta.batch.runtime.BatchStatus.STOPPED;
} else if(this == STOPPING) {
return javax.batch.runtime.BatchStatus.STOPPING;
return jakarta.batch.runtime.BatchStatus.STOPPING;
} else {
return javax.batch.runtime.BatchStatus.FAILED;
return jakarta.batch.runtime.BatchStatus.FAILED;
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2006-2018 the original author or authors.
* Copyright 2006-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -30,7 +30,7 @@ import org.springframework.util.Assert;
* @see Job
* @see JobParameters
* @see JobExecution
* @see javax.batch.runtime.JobInstance
* @see jakarta.batch.runtime.JobInstance
*
* @author Lucas Ward
* @author Dave Syer
@@ -40,7 +40,7 @@ import org.springframework.util.Assert;
*
*/
@SuppressWarnings("serial")
public class JobInstance extends Entity implements javax.batch.runtime.JobInstance{
public class JobInstance extends Entity implements jakarta.batch.runtime.JobInstance{
private final String jobName;

View File

@@ -15,7 +15,7 @@
*/
package org.springframework.batch.core.configuration.annotation;
import javax.annotation.PostConstruct;
import jakarta.annotation.PostConstruct;
import javax.sql.DataSource;
import org.springframework.batch.core.configuration.BatchConfigurationException;

View File

@@ -25,13 +25,13 @@ import java.util.Map;
import java.util.Queue;
import java.util.Set;
import java.util.concurrent.locks.ReentrantLock;
import javax.batch.api.chunk.listener.RetryProcessListener;
import javax.batch.api.chunk.listener.RetryReadListener;
import javax.batch.api.chunk.listener.RetryWriteListener;
import javax.batch.api.chunk.listener.SkipProcessListener;
import javax.batch.api.chunk.listener.SkipReadListener;
import javax.batch.api.chunk.listener.SkipWriteListener;
import javax.batch.api.partition.PartitionCollector;
import jakarta.batch.api.chunk.listener.RetryProcessListener;
import jakarta.batch.api.chunk.listener.RetryReadListener;
import jakarta.batch.api.chunk.listener.RetryWriteListener;
import jakarta.batch.api.chunk.listener.SkipProcessListener;
import jakarta.batch.api.chunk.listener.SkipReadListener;
import jakarta.batch.api.chunk.listener.SkipWriteListener;
import jakarta.batch.api.partition.PartitionCollector;
import org.springframework.batch.core.ChunkListener;
import org.springframework.batch.core.ItemProcessListener;
@@ -242,14 +242,14 @@ public class StepParserStepFactoryBean<I, O> implements FactoryBean<Step>, BeanN
private StepExecutionAggregator stepExecutionAggregator;
/**
* @param queue The {@link Queue} that is used for communication between {@link javax.batch.api.partition.PartitionCollector} and {@link javax.batch.api.partition.PartitionAnalyzer}
* @param queue The {@link Queue} that is used for communication between {@link jakarta.batch.api.partition.PartitionCollector} and {@link jakarta.batch.api.partition.PartitionAnalyzer}
*/
public void setPartitionQueue(Queue<Serializable> queue) {
this.partitionQueue = queue;
}
/**
* Used to coordinate access to the partition queue between the {@link javax.batch.api.partition.PartitionCollector} and {@link javax.batch.api.partition.AbstractPartitionAnalyzer}
* Used to coordinate access to the partition queue between the {@link jakarta.batch.api.partition.PartitionCollector} and {@link jakarta.batch.api.partition.AbstractPartitionAnalyzer}
*
* @param lock a lock that will be locked around accessing the partition queue
*/
@@ -312,8 +312,8 @@ public class StepParserStepFactoryBean<I, O> implements FactoryBean<Step>, BeanN
for (Object listener : stepExecutionListeners) {
if(listener instanceof StepExecutionListener) {
builder.listener((StepExecutionListener) listener);
} else if(listener instanceof javax.batch.api.listener.StepListener) {
builder.listener(new StepListenerAdapter((javax.batch.api.listener.StepListener) listener));
} else if(listener instanceof jakarta.batch.api.listener.StepListener) {
builder.listener(new StepListenerAdapter((jakarta.batch.api.listener.StepListener) listener));
}
}
}
@@ -833,40 +833,40 @@ public class StepParserStepFactoryBean<I, O> implements FactoryBean<Step>, BeanN
StepExecutionListener stepExecutionListener = (StepExecutionListener) listener;
stepExecutionListeners.add(stepExecutionListener);
}
if(listener instanceof javax.batch.api.listener.StepListener) {
StepExecutionListener stepExecutionListener = new StepListenerAdapter((javax.batch.api.listener.StepListener) listener);
if(listener instanceof jakarta.batch.api.listener.StepListener) {
StepExecutionListener stepExecutionListener = new StepListenerAdapter((jakarta.batch.api.listener.StepListener) listener);
stepExecutionListeners.add(stepExecutionListener);
}
if (listener instanceof ChunkListener) {
ChunkListener chunkListener = (ChunkListener) listener;
chunkListeners.add(chunkListener);
}
if(listener instanceof javax.batch.api.chunk.listener.ChunkListener) {
ChunkListener chunkListener = new ChunkListenerAdapter((javax.batch.api.chunk.listener.ChunkListener) listener);
if(listener instanceof jakarta.batch.api.chunk.listener.ChunkListener) {
ChunkListener chunkListener = new ChunkListenerAdapter((jakarta.batch.api.chunk.listener.ChunkListener) listener);
chunkListeners.add(chunkListener);
}
if (listener instanceof ItemReadListener) {
ItemReadListener<I> readListener = (ItemReadListener<I>) listener;
readListeners.add(readListener);
}
if(listener instanceof javax.batch.api.chunk.listener.ItemReadListener) {
ItemReadListener<I> itemListener = new ItemReadListenerAdapter<>((javax.batch.api.chunk.listener.ItemReadListener) listener);
if(listener instanceof jakarta.batch.api.chunk.listener.ItemReadListener) {
ItemReadListener<I> itemListener = new ItemReadListenerAdapter<>((jakarta.batch.api.chunk.listener.ItemReadListener) listener);
readListeners.add(itemListener);
}
if (listener instanceof ItemWriteListener) {
ItemWriteListener<O> writeListener = (ItemWriteListener<O>) listener;
writeListeners.add(writeListener);
}
if(listener instanceof javax.batch.api.chunk.listener.ItemWriteListener) {
ItemWriteListener<O> itemListener = new ItemWriteListenerAdapter<>((javax.batch.api.chunk.listener.ItemWriteListener) listener);
if(listener instanceof jakarta.batch.api.chunk.listener.ItemWriteListener) {
ItemWriteListener<O> itemListener = new ItemWriteListenerAdapter<>((jakarta.batch.api.chunk.listener.ItemWriteListener) listener);
writeListeners.add(itemListener);
}
if (listener instanceof ItemProcessListener) {
ItemProcessListener<I, O> processListener = (ItemProcessListener<I, O>) listener;
processListeners.add(processListener);
}
if(listener instanceof javax.batch.api.chunk.listener.ItemProcessListener) {
ItemProcessListener<I,O> itemListener = new ItemProcessListenerAdapter<>((javax.batch.api.chunk.listener.ItemProcessListener) listener);
if(listener instanceof jakarta.batch.api.chunk.listener.ItemProcessListener) {
ItemProcessListener<I,O> itemListener = new ItemProcessListenerAdapter<>((jakarta.batch.api.chunk.listener.ItemProcessListener) listener);
processListeners.add(itemListener);
}
if(listener instanceof RetryReadListener) {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2013-2014 the original author or authors.
* Copyright 2013-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,7 +15,7 @@
*/
package org.springframework.batch.core.jsr;
import javax.batch.operations.BatchRuntimeException;
import jakarta.batch.operations.BatchRuntimeException;
import org.springframework.batch.core.ChunkListener;
import org.springframework.batch.core.scope.context.ChunkContext;
@@ -23,20 +23,21 @@ import org.springframework.batch.core.step.tasklet.UncheckedTransactionException
import org.springframework.util.Assert;
/**
* Wrapper class to adapt the {@link javax.batch.api.chunk.listener.ChunkListener} to
* Wrapper class to adapt the {@link jakarta.batch.api.chunk.listener.ChunkListener} to
* a {@link ChunkListener}.
*
* @author Michael Minella
* @author Mahmoud Ben Hassine
* @since 3.0
*/
public class ChunkListenerAdapter implements ChunkListener {
private final javax.batch.api.chunk.listener.ChunkListener delegate;
private final jakarta.batch.api.chunk.listener.ChunkListener delegate;
/**
* @param delegate to be called within the step chunk lifecycle
*/
public ChunkListenerAdapter(javax.batch.api.chunk.listener.ChunkListener delegate) {
public ChunkListenerAdapter(jakarta.batch.api.chunk.listener.ChunkListener delegate) {
Assert.notNull(delegate, "A ChunkListener is required");
this.delegate = delegate;
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2013-2018 the original author or authors.
* Copyright 2013-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,14 +15,14 @@
*/
package org.springframework.batch.core.jsr;
import javax.batch.operations.BatchRuntimeException;
import jakarta.batch.operations.BatchRuntimeException;
import org.springframework.batch.core.ItemProcessListener;
import org.springframework.lang.Nullable;
import org.springframework.util.Assert;
/**
* Wrapper class for {@link javax.batch.api.chunk.listener.ItemProcessListener}
* Wrapper class for {@link jakarta.batch.api.chunk.listener.ItemProcessListener}
*
* @author Michael Minella
* @author Mahmoud Ben Hassine
@@ -33,12 +33,12 @@ import org.springframework.util.Assert;
*/
public class ItemProcessListenerAdapter<T,S> implements ItemProcessListener<T, S> {
private javax.batch.api.chunk.listener.ItemProcessListener delegate;
private jakarta.batch.api.chunk.listener.ItemProcessListener delegate;
/**
* @param delegate to be called within the batch lifecycle
*/
public ItemProcessListenerAdapter(javax.batch.api.chunk.listener.ItemProcessListener delegate) {
public ItemProcessListenerAdapter(jakarta.batch.api.chunk.listener.ItemProcessListener delegate) {
Assert.notNull(delegate, "An ItemProcessListener is required");
this.delegate = delegate;
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2018 the original author or authors.
* Copyright 2018-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,14 +15,14 @@
*/
package org.springframework.batch.core.jsr;
import javax.batch.operations.BatchRuntimeException;
import jakarta.batch.operations.BatchRuntimeException;
import org.springframework.batch.core.ItemReadListener;
import org.springframework.batch.item.ItemReader;
import org.springframework.util.Assert;
/**
* Wrapper class to adapt the {@link javax.batch.api.chunk.listener.ItemReadListener} to
* Wrapper class to adapt the {@link jakarta.batch.api.chunk.listener.ItemReadListener} to
* a {@link ItemReadListener}.
*
* @author Michael Minella
@@ -33,9 +33,9 @@ import org.springframework.util.Assert;
*/
public class ItemReadListenerAdapter<T> implements ItemReadListener<T> {
private javax.batch.api.chunk.listener.ItemReadListener delegate;
private jakarta.batch.api.chunk.listener.ItemReadListener delegate;
public ItemReadListenerAdapter(javax.batch.api.chunk.listener.ItemReadListener delegate) {
public ItemReadListenerAdapter(jakarta.batch.api.chunk.listener.ItemReadListener delegate) {
Assert.notNull(delegate, "An ItemReadListener is required");
this.delegate = delegate;
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2013 the original author or authors.
* Copyright 2013-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -17,26 +17,27 @@ package org.springframework.batch.core.jsr;
import java.util.List;
import javax.batch.operations.BatchRuntimeException;
import jakarta.batch.operations.BatchRuntimeException;
import org.springframework.batch.core.ItemWriteListener;
import org.springframework.batch.item.ItemWriter;
import org.springframework.util.Assert;
/**
* Wrapper class to adapt the {@link javax.batch.api.chunk.listener.ItemWriteListener} to
* Wrapper class to adapt the {@link jakarta.batch.api.chunk.listener.ItemWriteListener} to
* a {@link ItemWriteListener}.
*
* @author Michael Minella
* @author Mahmoud Ben Hassine
*
* @param <S> type to be written by the associated {@link ItemWriter}
* @since 3.0
*/
public class ItemWriteListenerAdapter<S> implements ItemWriteListener<S> {
private javax.batch.api.chunk.listener.ItemWriteListener delegate;
private jakarta.batch.api.chunk.listener.ItemWriteListener delegate;
public ItemWriteListenerAdapter(javax.batch.api.chunk.listener.ItemWriteListener delegate) {
public ItemWriteListenerAdapter(jakarta.batch.api.chunk.listener.ItemWriteListener delegate) {
Assert.notNull(delegate, "An ItemWriteListener is required");
this.delegate = delegate;
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2013 the original author or authors.
* Copyright 2013-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,8 +15,8 @@
*/
package org.springframework.batch.core.jsr;
import javax.batch.api.listener.JobListener;
import javax.batch.operations.BatchRuntimeException;
import jakarta.batch.api.listener.JobListener;
import jakarta.batch.operations.BatchRuntimeException;
import org.springframework.batch.core.JobExecution;
import org.springframework.batch.core.JobExecutionListener;
@@ -27,6 +27,7 @@ import org.springframework.util.Assert;
* a {@link JobExecutionListener}.
*
* @author Michael Minella
* @author Mahmoud Ben Hassine
* @since 3.0
*/
public class JobListenerAdapter implements JobExecutionListener {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2013-2018 the original author or authors.
* Copyright 2013-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -18,7 +18,7 @@ package org.springframework.batch.core.jsr;
import java.util.Properties;
import java.util.concurrent.atomic.AtomicBoolean;
import javax.batch.runtime.BatchStatus;
import jakarta.batch.runtime.BatchStatus;
import org.springframework.batch.core.ExitStatus;
import org.springframework.batch.core.JobExecution;
@@ -26,7 +26,7 @@ import org.springframework.lang.Nullable;
import org.springframework.util.Assert;
/**
* Wrapper class to provide the {@link javax.batch.runtime.context.JobContext} functionality
* Wrapper class to provide the {@link jakarta.batch.runtime.context.JobContext} functionality
* as specified in JSR-352. Wrapper delegates to the underlying {@link JobExecution} to
* obtain the related contextual information.
*
@@ -35,7 +35,7 @@ import org.springframework.util.Assert;
* @author Mahmoud Ben Hassine
* @since 3.0
*/
public class JsrJobContext implements javax.batch.runtime.context.JobContext {
public class JsrJobContext implements jakarta.batch.runtime.context.JobContext {
private Object transientUserData;
private Properties properties;
private JobExecution jobExecution;
@@ -51,7 +51,7 @@ public class JsrJobContext implements javax.batch.runtime.context.JobContext {
}
/* (non-Javadoc)
* @see javax.batch.runtime.context.JobContext#getJobName()
* @see jakarta.batch.runtime.context.JobContext#getJobName()
*/
@Override
public String getJobName() {
@@ -59,7 +59,7 @@ public class JsrJobContext implements javax.batch.runtime.context.JobContext {
}
/* (non-Javadoc)
* @see javax.batch.runtime.context.JobContext#getTransientUserData()
* @see jakarta.batch.runtime.context.JobContext#getTransientUserData()
*/
@Override
public Object getTransientUserData() {
@@ -67,7 +67,7 @@ public class JsrJobContext implements javax.batch.runtime.context.JobContext {
}
/* (non-Javadoc)
* @see javax.batch.runtime.context.JobContext#setTransientUserData(java.lang.Object)
* @see jakarta.batch.runtime.context.JobContext#setTransientUserData(java.lang.Object)
*/
@Override
public void setTransientUserData(Object data) {
@@ -75,7 +75,7 @@ public class JsrJobContext implements javax.batch.runtime.context.JobContext {
}
/* (non-Javadoc)
* @see javax.batch.runtime.context.JobContext#getInstanceId()
* @see jakarta.batch.runtime.context.JobContext#getInstanceId()
*/
@Override
public long getInstanceId() {
@@ -83,7 +83,7 @@ public class JsrJobContext implements javax.batch.runtime.context.JobContext {
}
/* (non-Javadoc)
* @see javax.batch.runtime.context.JobContext#getExecutionId()
* @see jakarta.batch.runtime.context.JobContext#getExecutionId()
*/
@Override
public long getExecutionId() {
@@ -91,7 +91,7 @@ public class JsrJobContext implements javax.batch.runtime.context.JobContext {
}
/* (non-Javadoc)
* @see javax.batch.runtime.context.JobContext#getProperties()
* @see jakarta.batch.runtime.context.JobContext#getProperties()
*/
@Override
public Properties getProperties() {
@@ -99,7 +99,7 @@ public class JsrJobContext implements javax.batch.runtime.context.JobContext {
}
/* (non-Javadoc)
* @see javax.batch.runtime.context.JobContext#getBatchStatus()
* @see jakarta.batch.runtime.context.JobContext#getBatchStatus()
*/
@Override
public BatchStatus getBatchStatus() {
@@ -107,7 +107,7 @@ public class JsrJobContext implements javax.batch.runtime.context.JobContext {
}
/* (non-Javadoc)
* @see javax.batch.runtime.context.JobContext#getExitStatus()
* @see jakarta.batch.runtime.context.JobContext#getExitStatus()
*/
@Override
@Nullable
@@ -116,7 +116,7 @@ public class JsrJobContext implements javax.batch.runtime.context.JobContext {
}
/* (non-Javadoc)
* @see javax.batch.runtime.context.JobContext#setExitStatus(java.lang.String)
* @see jakarta.batch.runtime.context.JobContext#setExitStatus(java.lang.String)
*/
@Override
public void setExitStatus(String status) {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2013 the original author or authors.
* Copyright 2013-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -17,8 +17,8 @@ package org.springframework.batch.core.jsr;
import java.util.Properties;
import javax.batch.runtime.StepExecution;
import javax.batch.runtime.context.JobContext;
import jakarta.batch.runtime.StepExecution;
import jakarta.batch.runtime.context.JobContext;
import org.springframework.batch.core.JobExecution;
import org.springframework.batch.core.jsr.configuration.support.BatchPropertyContext;
@@ -39,6 +39,7 @@ import org.springframework.util.Assert;
* </ul>
*
* @author Michael Minella
* @author Mahmoud Ben Hassine
* @since 3.0
*/
public class JsrJobContextFactoryBean implements FactoryBean<JobContext> {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2013 the original author or authors.
* Copyright 2013-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -18,19 +18,20 @@ package org.springframework.batch.core.jsr;
import java.util.Date;
import java.util.Properties;
import javax.batch.runtime.BatchStatus;
import jakarta.batch.runtime.BatchStatus;
import org.springframework.batch.core.converter.JobParametersConverter;
import org.springframework.util.Assert;
/**
* Wrapper class to adapt the {@link javax.batch.runtime.JobExecution} to
* Wrapper class to adapt the {@link jakarta.batch.runtime.JobExecution} to
* a {@link org.springframework.batch.core.JobExecution}.
*
* @author Michael Minella
* @author Mahmoud Ben Hassine
* @since 3.0
*/
public class JsrJobExecution implements javax.batch.runtime.JobExecution {
public class JsrJobExecution implements jakarta.batch.runtime.JobExecution {
private org.springframework.batch.core.JobExecution execution;
private JobParametersConverter parametersConverter;
@@ -47,7 +48,7 @@ public class JsrJobExecution implements javax.batch.runtime.JobExecution {
}
/* (non-Javadoc)
* @see javax.batch.runtime.JobExecution#getExecutionId()
* @see jakarta.batch.runtime.JobExecution#getExecutionId()
*/
@Override
public long getExecutionId() {
@@ -55,7 +56,7 @@ public class JsrJobExecution implements javax.batch.runtime.JobExecution {
}
/* (non-Javadoc)
* @see javax.batch.runtime.JobExecution#getJobName()
* @see jakarta.batch.runtime.JobExecution#getJobName()
*/
@Override
public String getJobName() {
@@ -63,7 +64,7 @@ public class JsrJobExecution implements javax.batch.runtime.JobExecution {
}
/* (non-Javadoc)
* @see javax.batch.runtime.JobExecution#getBatchStatus()
* @see jakarta.batch.runtime.JobExecution#getBatchStatus()
*/
@Override
public BatchStatus getBatchStatus() {
@@ -71,7 +72,7 @@ public class JsrJobExecution implements javax.batch.runtime.JobExecution {
}
/* (non-Javadoc)
* @see javax.batch.runtime.JobExecution#getStartTime()
* @see jakarta.batch.runtime.JobExecution#getStartTime()
*/
@Override
public Date getStartTime() {
@@ -79,7 +80,7 @@ public class JsrJobExecution implements javax.batch.runtime.JobExecution {
}
/* (non-Javadoc)
* @see javax.batch.runtime.JobExecution#getEndTime()
* @see jakarta.batch.runtime.JobExecution#getEndTime()
*/
@Override
public Date getEndTime() {
@@ -87,7 +88,7 @@ public class JsrJobExecution implements javax.batch.runtime.JobExecution {
}
/* (non-Javadoc)
* @see javax.batch.runtime.JobExecution#getExitStatus()
* @see jakarta.batch.runtime.JobExecution#getExitStatus()
*/
@Override
public String getExitStatus() {
@@ -95,7 +96,7 @@ public class JsrJobExecution implements javax.batch.runtime.JobExecution {
}
/* (non-Javadoc)
* @see javax.batch.runtime.JobExecution#getCreateTime()
* @see jakarta.batch.runtime.JobExecution#getCreateTime()
*/
@Override
public Date getCreateTime() {
@@ -103,7 +104,7 @@ public class JsrJobExecution implements javax.batch.runtime.JobExecution {
}
/* (non-Javadoc)
* @see javax.batch.runtime.JobExecution#getLastUpdatedTime()
* @see jakarta.batch.runtime.JobExecution#getLastUpdatedTime()
*/
@Override
public Date getLastUpdatedTime() {
@@ -111,7 +112,7 @@ public class JsrJobExecution implements javax.batch.runtime.JobExecution {
}
/* (non-Javadoc)
* @see javax.batch.runtime.JobExecution#getJobParameters()
* @see jakarta.batch.runtime.JobExecution#getJobParameters()
*/
@Override
public Properties getJobParameters() {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2013 the original author or authors.
* Copyright 2013-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -19,7 +19,7 @@ import java.lang.annotation.Annotation;
import java.util.HashMap;
import java.util.Map;
import javax.batch.api.listener.JobListener;
import jakarta.batch.api.listener.JobListener;
import org.springframework.batch.core.listener.ListenerMetaData;
@@ -28,6 +28,7 @@ import org.springframework.batch.core.listener.ListenerMetaData;
* of methods, their interfaces, annotation, and expected arguments.
*
* @author Michael Minella
* @author Mahmoud Ben Hassine
* @since 3.0
*/
public enum JsrJobListenerMetaData implements ListenerMetaData {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2013 the original author or authors.
* Copyright 2013-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -20,8 +20,8 @@ import java.util.List;
import java.util.Properties;
import java.util.concurrent.atomic.AtomicBoolean;
import javax.batch.runtime.BatchStatus;
import javax.batch.runtime.Metric;
import jakarta.batch.runtime.BatchStatus;
import jakarta.batch.runtime.Metric;
import org.springframework.batch.core.ExitStatus;
import org.springframework.batch.core.StepExecution;
@@ -30,15 +30,16 @@ import org.springframework.util.Assert;
import org.springframework.util.ClassUtils;
/**
* Wrapper class to provide the {@link javax.batch.runtime.context.StepContext} functionality
* Wrapper class to provide the {@link jakarta.batch.runtime.context.StepContext} functionality
* as specified in JSR-352. Wrapper delegates to the underlying {@link StepExecution} to
* obtain the related contextual information.
*
* @author Michael Minella
* @author Chris Schaefer
* @author Mahmoud Ben Hassine
* @since 3.0
*/
public class JsrStepContext implements javax.batch.runtime.context.StepContext {
public class JsrStepContext implements jakarta.batch.runtime.context.StepContext {
private final static String PERSISTENT_USER_DATA_KEY = "batch_jsr_persistentUserData";
private StepExecution stepExecution;
private Object transientUserData;
@@ -54,7 +55,7 @@ public class JsrStepContext implements javax.batch.runtime.context.StepContext {
}
/* (non-Javadoc)
* @see javax.batch.runtime.context.StepContext#getStepName()
* @see jakarta.batch.runtime.context.StepContext#getStepName()
*/
@Override
public String getStepName() {
@@ -62,7 +63,7 @@ public class JsrStepContext implements javax.batch.runtime.context.StepContext {
}
/* (non-Javadoc)
* @see javax.batch.runtime.context.StepContext#getTransientUserData()
* @see jakarta.batch.runtime.context.StepContext#getTransientUserData()
*/
@Override
public Object getTransientUserData() {
@@ -70,7 +71,7 @@ public class JsrStepContext implements javax.batch.runtime.context.StepContext {
}
/* (non-Javadoc)
* @see javax.batch.runtime.context.StepContext#setTransientUserData(java.lang.Object)
* @see jakarta.batch.runtime.context.StepContext#setTransientUserData(java.lang.Object)
*/
@Override
public void setTransientUserData(Object data) {
@@ -78,7 +79,7 @@ public class JsrStepContext implements javax.batch.runtime.context.StepContext {
}
/* (non-Javadoc)
* @see javax.batch.runtime.context.StepContext#getStepExecutionId()
* @see jakarta.batch.runtime.context.StepContext#getStepExecutionId()
*/
@Override
public long getStepExecutionId() {
@@ -86,7 +87,7 @@ public class JsrStepContext implements javax.batch.runtime.context.StepContext {
}
/* (non-Javadoc)
* @see javax.batch.runtime.context.StepContext#getProperties()
* @see jakarta.batch.runtime.context.StepContext#getProperties()
*/
@Override
public Properties getProperties() {
@@ -94,7 +95,7 @@ public class JsrStepContext implements javax.batch.runtime.context.StepContext {
}
/* (non-Javadoc)
* @see javax.batch.runtime.context.StepContext#getPersistentUserData()
* @see jakarta.batch.runtime.context.StepContext#getPersistentUserData()
*/
@Override
public Serializable getPersistentUserData() {
@@ -102,7 +103,7 @@ public class JsrStepContext implements javax.batch.runtime.context.StepContext {
}
/* (non-Javadoc)
* @see javax.batch.runtime.context.StepContext#setPersistentUserData(java.io.Serializable)
* @see jakarta.batch.runtime.context.StepContext#setPersistentUserData(java.io.Serializable)
*/
@Override
public void setPersistentUserData(Serializable data) {
@@ -110,7 +111,7 @@ public class JsrStepContext implements javax.batch.runtime.context.StepContext {
}
/* (non-Javadoc)
* @see javax.batch.runtime.context.StepContext#getBatchStatus()
* @see jakarta.batch.runtime.context.StepContext#getBatchStatus()
*/
@Override
public BatchStatus getBatchStatus() {
@@ -118,7 +119,7 @@ public class JsrStepContext implements javax.batch.runtime.context.StepContext {
}
/* (non-Javadoc)
* @see javax.batch.runtime.context.StepContext#getExitStatus()
* @see jakarta.batch.runtime.context.StepContext#getExitStatus()
*/
@Override
public String getExitStatus() {
@@ -126,7 +127,7 @@ public class JsrStepContext implements javax.batch.runtime.context.StepContext {
}
/* (non-Javadoc)
* @see javax.batch.runtime.context.StepContext#setExitStatus(java.lang.String)
* @see jakarta.batch.runtime.context.StepContext#setExitStatus(java.lang.String)
*/
@Override
public void setExitStatus(String status) {
@@ -142,7 +143,7 @@ public class JsrStepContext implements javax.batch.runtime.context.StepContext {
* instead of {@link Exception}, it will be wrapped in an {@link Exception} and
* then returned.
*
* @see javax.batch.runtime.context.StepContext#getException()
* @see jakarta.batch.runtime.context.StepContext#getException()
*/
@Override
public Exception getException() {
@@ -161,20 +162,20 @@ public class JsrStepContext implements javax.batch.runtime.context.StepContext {
}
/* (non-Javadoc)
* @see javax.batch.runtime.context.StepContext#getMetrics()
* @see jakarta.batch.runtime.context.StepContext#getMetrics()
*/
@Override
public Metric[] getMetrics() {
Metric[] metrics = new Metric[8];
metrics[0] = new SimpleMetric(javax.batch.runtime.Metric.MetricType.COMMIT_COUNT, stepExecution.getCommitCount());
metrics[1] = new SimpleMetric(javax.batch.runtime.Metric.MetricType.FILTER_COUNT, stepExecution.getFilterCount());
metrics[2] = new SimpleMetric(javax.batch.runtime.Metric.MetricType.PROCESS_SKIP_COUNT, stepExecution.getProcessSkipCount());
metrics[3] = new SimpleMetric(javax.batch.runtime.Metric.MetricType.READ_COUNT, stepExecution.getReadCount());
metrics[4] = new SimpleMetric(javax.batch.runtime.Metric.MetricType.READ_SKIP_COUNT, stepExecution.getReadSkipCount());
metrics[5] = new SimpleMetric(javax.batch.runtime.Metric.MetricType.ROLLBACK_COUNT, stepExecution.getRollbackCount());
metrics[6] = new SimpleMetric(javax.batch.runtime.Metric.MetricType.WRITE_COUNT, stepExecution.getWriteCount());
metrics[7] = new SimpleMetric(javax.batch.runtime.Metric.MetricType.WRITE_SKIP_COUNT, stepExecution.getWriteSkipCount());
metrics[0] = new SimpleMetric(jakarta.batch.runtime.Metric.MetricType.COMMIT_COUNT, stepExecution.getCommitCount());
metrics[1] = new SimpleMetric(jakarta.batch.runtime.Metric.MetricType.FILTER_COUNT, stepExecution.getFilterCount());
metrics[2] = new SimpleMetric(jakarta.batch.runtime.Metric.MetricType.PROCESS_SKIP_COUNT, stepExecution.getProcessSkipCount());
metrics[3] = new SimpleMetric(jakarta.batch.runtime.Metric.MetricType.READ_COUNT, stepExecution.getReadCount());
metrics[4] = new SimpleMetric(jakarta.batch.runtime.Metric.MetricType.READ_SKIP_COUNT, stepExecution.getReadSkipCount());
metrics[5] = new SimpleMetric(jakarta.batch.runtime.Metric.MetricType.ROLLBACK_COUNT, stepExecution.getRollbackCount());
metrics[6] = new SimpleMetric(jakarta.batch.runtime.Metric.MetricType.WRITE_COUNT, stepExecution.getWriteCount());
metrics[7] = new SimpleMetric(jakarta.batch.runtime.Metric.MetricType.WRITE_SKIP_COUNT, stepExecution.getWriteSkipCount());
return metrics;
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2013 the original author or authors.
* Copyright 2013-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -17,7 +17,7 @@ package org.springframework.batch.core.jsr;
import java.util.Properties;
import javax.batch.runtime.context.StepContext;
import jakarta.batch.runtime.context.StepContext;
import org.springframework.batch.core.jsr.configuration.support.BatchPropertyContext;
import org.springframework.batch.core.scope.context.StepSynchronizationManager;
@@ -28,18 +28,19 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.Assert;
/**
* {@link FactoryBean} implementation used to create {@link javax.batch.runtime.context.StepContext}
* {@link FactoryBean} implementation used to create {@link jakarta.batch.runtime.context.StepContext}
* instances within the step scope.
*
* @author Michael Minella
* @author Chris Schaefer
* @author Mahmoud Ben Hassine
* @since 3.0
*/
public class JsrStepContextFactoryBean implements FactoryBean<StepContext>, InitializingBean {
@Autowired
private BatchPropertyContext batchPropertyContext;
private static final ThreadLocal<javax.batch.runtime.context.StepContext> contextHolder = new ThreadLocal<>();
private static final ThreadLocal<jakarta.batch.runtime.context.StepContext> contextHolder = new ThreadLocal<>();
protected void setBatchPropertyContext(BatchPropertyContext batchPropertyContext) {
this.batchPropertyContext = batchPropertyContext;
@@ -53,7 +54,7 @@ public class JsrStepContextFactoryBean implements FactoryBean<StepContext>, Init
return getCurrent();
}
private javax.batch.runtime.context.StepContext getCurrent() {
private jakarta.batch.runtime.context.StepContext getCurrent() {
org.springframework.batch.core.StepExecution curStepExecution = null;
if(StepSynchronizationManager.getContext() != null) {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2013 the original author or authors.
* Copyright 2013-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -18,8 +18,8 @@ package org.springframework.batch.core.jsr;
import java.io.Serializable;
import java.util.Date;
import javax.batch.runtime.BatchStatus;
import javax.batch.runtime.Metric;
import jakarta.batch.runtime.BatchStatus;
import jakarta.batch.runtime.Metric;
import org.springframework.batch.core.ExitStatus;
import org.springframework.batch.item.util.ExecutionContextUserSupport;
@@ -32,9 +32,10 @@ import org.springframework.util.ClassUtils;
* data.
*
* @author Michael Minella
* @author Mahmoud Ben Hassine
* @since 3.0
*/
public class JsrStepExecution implements javax.batch.runtime.StepExecution{
public class JsrStepExecution implements jakarta.batch.runtime.StepExecution{
private final static String PERSISTENT_USER_DATA_KEY = "batch_jsr_persistentUserData";
private final org.springframework.batch.core.StepExecution stepExecution;
@@ -52,7 +53,7 @@ public class JsrStepExecution implements javax.batch.runtime.StepExecution{
}
/* (non-Javadoc)
* @see javax.batch.runtime.JsrStepExecution#getStepExecutionId()
* @see jakarta.batch.runtime.JsrStepExecution#getStepExecutionId()
*/
@Override
public long getStepExecutionId() {
@@ -60,7 +61,7 @@ public class JsrStepExecution implements javax.batch.runtime.StepExecution{
}
/* (non-Javadoc)
* @see javax.batch.runtime.JsrStepExecution#getStepName()
* @see jakarta.batch.runtime.JsrStepExecution#getStepName()
*/
@Override
public String getStepName() {
@@ -68,7 +69,7 @@ public class JsrStepExecution implements javax.batch.runtime.StepExecution{
}
/* (non-Javadoc)
* @see javax.batch.runtime.JsrStepExecution#getBatchStatus()
* @see jakarta.batch.runtime.JsrStepExecution#getBatchStatus()
*/
@Override
public BatchStatus getBatchStatus() {
@@ -76,7 +77,7 @@ public class JsrStepExecution implements javax.batch.runtime.StepExecution{
}
/* (non-Javadoc)
* @see javax.batch.runtime.JsrStepExecution#getStartTime()
* @see jakarta.batch.runtime.JsrStepExecution#getStartTime()
*/
@Override
public Date getStartTime() {
@@ -84,7 +85,7 @@ public class JsrStepExecution implements javax.batch.runtime.StepExecution{
}
/* (non-Javadoc)
* @see javax.batch.runtime.JsrStepExecution#getEndTime()
* @see jakarta.batch.runtime.JsrStepExecution#getEndTime()
*/
@Override
public Date getEndTime() {
@@ -92,7 +93,7 @@ public class JsrStepExecution implements javax.batch.runtime.StepExecution{
}
/* (non-Javadoc)
* @see javax.batch.runtime.JsrStepExecution#getExitStatus()
* @see jakarta.batch.runtime.JsrStepExecution#getExitStatus()
*/
@Override
public String getExitStatus() {
@@ -106,7 +107,7 @@ public class JsrStepExecution implements javax.batch.runtime.StepExecution{
}
/* (non-Javadoc)
* @see javax.batch.runtime.JsrStepExecution#getPersistentUserData()
* @see jakarta.batch.runtime.JsrStepExecution#getPersistentUserData()
*/
@Override
public Serializable getPersistentUserData() {
@@ -114,20 +115,20 @@ public class JsrStepExecution implements javax.batch.runtime.StepExecution{
}
/* (non-Javadoc)
* @see javax.batch.runtime.JsrStepExecution#getMetrics()
* @see jakarta.batch.runtime.JsrStepExecution#getMetrics()
*/
@Override
public Metric[] getMetrics() {
Metric[] metrics = new Metric[8];
metrics[0] = new SimpleMetric(javax.batch.runtime.Metric.MetricType.COMMIT_COUNT, stepExecution.getCommitCount());
metrics[1] = new SimpleMetric(javax.batch.runtime.Metric.MetricType.FILTER_COUNT, stepExecution.getFilterCount());
metrics[2] = new SimpleMetric(javax.batch.runtime.Metric.MetricType.PROCESS_SKIP_COUNT, stepExecution.getProcessSkipCount());
metrics[3] = new SimpleMetric(javax.batch.runtime.Metric.MetricType.READ_COUNT, stepExecution.getReadCount());
metrics[4] = new SimpleMetric(javax.batch.runtime.Metric.MetricType.READ_SKIP_COUNT, stepExecution.getReadSkipCount());
metrics[5] = new SimpleMetric(javax.batch.runtime.Metric.MetricType.ROLLBACK_COUNT, stepExecution.getRollbackCount());
metrics[6] = new SimpleMetric(javax.batch.runtime.Metric.MetricType.WRITE_COUNT, stepExecution.getWriteCount());
metrics[7] = new SimpleMetric(javax.batch.runtime.Metric.MetricType.WRITE_SKIP_COUNT, stepExecution.getWriteSkipCount());
metrics[0] = new SimpleMetric(jakarta.batch.runtime.Metric.MetricType.COMMIT_COUNT, stepExecution.getCommitCount());
metrics[1] = new SimpleMetric(jakarta.batch.runtime.Metric.MetricType.FILTER_COUNT, stepExecution.getFilterCount());
metrics[2] = new SimpleMetric(jakarta.batch.runtime.Metric.MetricType.PROCESS_SKIP_COUNT, stepExecution.getProcessSkipCount());
metrics[3] = new SimpleMetric(jakarta.batch.runtime.Metric.MetricType.READ_COUNT, stepExecution.getReadCount());
metrics[4] = new SimpleMetric(jakarta.batch.runtime.Metric.MetricType.READ_SKIP_COUNT, stepExecution.getReadSkipCount());
metrics[5] = new SimpleMetric(jakarta.batch.runtime.Metric.MetricType.ROLLBACK_COUNT, stepExecution.getRollbackCount());
metrics[6] = new SimpleMetric(jakarta.batch.runtime.Metric.MetricType.WRITE_COUNT, stepExecution.getWriteCount());
metrics[7] = new SimpleMetric(jakarta.batch.runtime.Metric.MetricType.WRITE_SKIP_COUNT, stepExecution.getWriteSkipCount());
return metrics;
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2013 the original author or authors.
* Copyright 2013-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -20,17 +20,17 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.batch.api.chunk.listener.ChunkListener;
import javax.batch.api.chunk.listener.ItemProcessListener;
import javax.batch.api.chunk.listener.ItemReadListener;
import javax.batch.api.chunk.listener.ItemWriteListener;
import javax.batch.api.chunk.listener.RetryProcessListener;
import javax.batch.api.chunk.listener.RetryReadListener;
import javax.batch.api.chunk.listener.RetryWriteListener;
import javax.batch.api.chunk.listener.SkipProcessListener;
import javax.batch.api.chunk.listener.SkipReadListener;
import javax.batch.api.chunk.listener.SkipWriteListener;
import javax.batch.api.listener.StepListener;
import jakarta.batch.api.chunk.listener.ChunkListener;
import jakarta.batch.api.chunk.listener.ItemProcessListener;
import jakarta.batch.api.chunk.listener.ItemReadListener;
import jakarta.batch.api.chunk.listener.ItemWriteListener;
import jakarta.batch.api.chunk.listener.RetryProcessListener;
import jakarta.batch.api.chunk.listener.RetryReadListener;
import jakarta.batch.api.chunk.listener.RetryWriteListener;
import jakarta.batch.api.chunk.listener.SkipProcessListener;
import jakarta.batch.api.chunk.listener.SkipReadListener;
import jakarta.batch.api.chunk.listener.SkipWriteListener;
import jakarta.batch.api.listener.StepListener;
import org.springframework.batch.core.listener.ListenerMetaData;
import org.springframework.batch.core.listener.StepListenerFactoryBean;
@@ -41,6 +41,7 @@ import org.springframework.batch.core.listener.StepListenerFactoryBean;
*
* @author Michael Minella
* @author Chris Schaefer
* @author Mahmoud Ben Hassine
* @since 3.0
* @see StepListenerFactoryBean
*/

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2013 the original author or authors.
* Copyright 2013-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,8 +15,8 @@
*/
package org.springframework.batch.core.jsr;
import javax.batch.api.chunk.listener.RetryProcessListener;
import javax.batch.operations.BatchRuntimeException;
import jakarta.batch.api.chunk.listener.RetryProcessListener;
import jakarta.batch.operations.BatchRuntimeException;
/**
* <p>
@@ -24,6 +24,7 @@ import javax.batch.operations.BatchRuntimeException;
* </p>
*
* @author Chris Schaefer
* @author Mahmoud Ben Hassine
* @since 3.0
*/
public class RetryProcessListenerAdapter implements RetryListener, RetryProcessListener {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2013 the original author or authors.
* Copyright 2013-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,8 +15,8 @@
*/
package org.springframework.batch.core.jsr;
import javax.batch.api.chunk.listener.RetryReadListener;
import javax.batch.operations.BatchRuntimeException;
import jakarta.batch.api.chunk.listener.RetryReadListener;
import jakarta.batch.operations.BatchRuntimeException;
/**
* <p>
@@ -24,6 +24,7 @@ import javax.batch.operations.BatchRuntimeException;
* </p>
*
* @author Chris Schaefer
* @author Mahmoud Ben Hassine
* @since 3.0
*/
public class RetryReadListenerAdapter implements RetryListener, RetryReadListener {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2013 the original author or authors.
* Copyright 2013-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -16,8 +16,8 @@
package org.springframework.batch.core.jsr;
import java.util.List;
import javax.batch.api.chunk.listener.RetryWriteListener;
import javax.batch.operations.BatchRuntimeException;
import jakarta.batch.api.chunk.listener.RetryWriteListener;
import jakarta.batch.operations.BatchRuntimeException;
/**
* <p>
@@ -25,6 +25,7 @@ import javax.batch.operations.BatchRuntimeException;
* </p>
*
* @author Chris Schaefer
* @author Mahmoud Ben Hassine
* @since 3.0
*/
public class RetryWriteListenerAdapter implements RetryListener, RetryWriteListener {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2013 the original author or authors.
* Copyright 2013-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,7 +15,7 @@
*/
package org.springframework.batch.core.jsr;
import javax.batch.runtime.Metric;
import jakarta.batch.runtime.Metric;
import org.springframework.util.Assert;
@@ -23,6 +23,7 @@ import org.springframework.util.Assert;
* Simple implementation of the {@link Metric} interface as required by JSR-352.
*
* @author Michael Minella
* @author Mahmoud Ben Hassine
* @since 3.0
*/
public class SimpleMetric implements Metric {
@@ -45,7 +46,7 @@ public class SimpleMetric implements Metric {
}
/* (non-Javadoc)
* @see javax.batch.runtime.Metric#getType()
* @see jakarta.batch.runtime.Metric#getType()
*/
@Override
public MetricType getType() {
@@ -53,7 +54,7 @@ public class SimpleMetric implements Metric {
}
/* (non-Javadoc)
* @see javax.batch.runtime.Metric#getValue()
* @see jakarta.batch.runtime.Metric#getValue()
*/
@Override
public long getValue() {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2013-2014 the original author or authors.
* Copyright 2013-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,10 +15,10 @@
*/
package org.springframework.batch.core.jsr;
import javax.batch.api.chunk.listener.SkipProcessListener;
import javax.batch.api.chunk.listener.SkipReadListener;
import javax.batch.api.chunk.listener.SkipWriteListener;
import javax.batch.operations.BatchRuntimeException;
import jakarta.batch.api.chunk.listener.SkipProcessListener;
import jakarta.batch.api.chunk.listener.SkipReadListener;
import jakarta.batch.api.chunk.listener.SkipWriteListener;
import jakarta.batch.operations.BatchRuntimeException;
import org.springframework.batch.core.SkipListener;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2013-2019 the original author or authors.
* Copyright 2013-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,8 +15,8 @@
*/
package org.springframework.batch.core.jsr;
import javax.batch.api.listener.StepListener;
import javax.batch.operations.BatchRuntimeException;
import jakarta.batch.api.listener.StepListener;
import jakarta.batch.operations.BatchRuntimeException;
import org.springframework.batch.core.ExitStatus;
import org.springframework.batch.core.StepExecution;
@@ -29,6 +29,7 @@ import org.springframework.util.Assert;
* a {@link StepExecutionListener}.
*
* @author Michael Minella
* @author Mahmoud Ben Hassine
* @since 3.0
*/
public class StepListenerAdapter implements StepExecutionListener {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2013 the original author or authors.
* Copyright 2013-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -18,7 +18,7 @@ package org.springframework.batch.core.jsr.configuration.support;
import java.lang.annotation.Annotation;
import java.lang.reflect.AccessibleObject;
import javax.batch.api.BatchProperty;
import jakarta.batch.api.BatchProperty;
import org.springframework.beans.factory.annotation.InjectionMetadata;

View File

@@ -98,7 +98,7 @@ class SpringAutowiredAnnotationBeanPostProcessor implements SmartInstantiationAw
/**
* Create a new AutowiredAnnotationBeanPostProcessor
* for Spring's standard {@link org.springframework.beans.factory.annotation.Autowired} annotation.
* <p>Also supports JSR-330's {@link javax.inject.Inject} annotation, if available.
* <p>Also supports JSR-330's {@link jakarta.inject.Inject} annotation, if available.
*/
@SuppressWarnings("unchecked")
public SpringAutowiredAnnotationBeanPostProcessor() {
@@ -106,8 +106,8 @@ class SpringAutowiredAnnotationBeanPostProcessor implements SmartInstantiationAw
this.autowiredAnnotationTypes.add(Value.class);
ClassLoader cl = SpringAutowiredAnnotationBeanPostProcessor.class.getClassLoader();
try {
this.autowiredAnnotationTypes.add((Class<? extends Annotation>) cl.loadClass("javax.inject.Inject"));
logger.info("JSR-330 'javax.inject.Inject' annotation found and supported for autowiring");
this.autowiredAnnotationTypes.add((Class<? extends Annotation>) cl.loadClass("jakarta.inject.Inject"));
logger.info("JSR-330 'jakarta.inject.Inject' annotation found and supported for autowiring");
}
catch (ClassNotFoundException ex) {
// JSR-330 API not available - simply skip.

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2013 the original author or authors.
* Copyright 2013-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,7 +15,7 @@
*/
package org.springframework.batch.core.jsr.configuration.xml;
import javax.batch.api.Decider;
import jakarta.batch.api.Decider;
import org.springframework.batch.core.Step;
import org.springframework.batch.core.jsr.step.DecisionStep;
@@ -28,6 +28,7 @@ import org.springframework.util.Assert;
* {@link FactoryBean} for creating a {@link DecisionStep}.
*
* @author Michael Minella
* @author Mahmoud Ben Hassine
* @since 3.0
*/
public class DecisionStepFactoryBean implements FactoryBean<Step>, InitializingBean {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2013 the original author or authors.
* Copyright 2013-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,7 +15,7 @@
*/
package org.springframework.batch.core.jsr.configuration.xml;
import javax.batch.api.listener.JobListener;
import jakarta.batch.api.listener.JobListener;
import org.springframework.batch.core.JobExecutionListener;
import org.springframework.batch.core.JobParametersIncrementer;
@@ -37,6 +37,7 @@ import org.springframework.util.StringUtils;
* configurable on the &lt;job/&gt;.
*
* @author Michael Minella
* @author Mahmoud Ben Hassine
* @since 3.0
*/
public class JobFactoryBean implements SmartFactoryBean<FlowJob> {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2013 the original author or authors.
* Copyright 2013-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -19,7 +19,7 @@ import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import javax.batch.api.listener.JobListener;
import jakarta.batch.api.listener.JobListener;
import org.springframework.batch.core.JobExecutionListener;
import org.springframework.batch.core.jsr.JsrJobListenerMetaData;
@@ -32,6 +32,7 @@ import org.springframework.beans.factory.FactoryBean;
* {@link JobExecutionListener} objects.
*
* @author Michael Minella
* @author Mahmoud Ben Hassine
* @since 3.0
*/
public class JsrJobListenerFactoryBean extends org.springframework.batch.core.listener.JobListenerFactoryBean {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2013-2014 the original author or authors.
* Copyright 2013-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,12 +15,12 @@
*/
package org.springframework.batch.core.jsr.configuration.xml;
import javax.batch.api.Batchlet;
import javax.batch.api.chunk.CheckpointAlgorithm;
import javax.batch.api.chunk.ItemProcessor;
import javax.batch.api.chunk.ItemReader;
import javax.batch.api.chunk.ItemWriter;
import javax.batch.api.partition.PartitionReducer;
import jakarta.batch.api.Batchlet;
import jakarta.batch.api.chunk.CheckpointAlgorithm;
import jakarta.batch.api.chunk.ItemProcessor;
import jakarta.batch.api.chunk.ItemReader;
import jakarta.batch.api.chunk.ItemWriter;
import jakarta.batch.api.partition.PartitionReducer;
import org.springframework.batch.core.Step;
import org.springframework.batch.core.configuration.xml.StepParserStepFactoryBean;
@@ -55,6 +55,7 @@ import org.springframework.util.Assert;
*
* @author Michael Minella
* @author Chris Schaefer
* @author Mahmoud Ben Hassine
* @since 3.0
*/
public class StepFactoryBean<I, O> extends StepParserStepFactoryBean<I, O> {
@@ -198,7 +199,7 @@ public class StepFactoryBean<I, O> extends StepParserStepFactoryBean<I, O> {
super.setTasklet(new BatchletAdapter((Batchlet) tasklet));
} else {
throw new IllegalArgumentException("The field tasklet must reference an implementation of " +
"either org.springframework.batch.core.step.tasklet.Tasklet or javax.batch.api.Batchlet");
"either org.springframework.batch.core.step.tasklet.Tasklet or jakarta.batch.api.Batchlet");
}
}
@@ -217,7 +218,7 @@ public class StepFactoryBean<I, O> extends StepParserStepFactoryBean<I, O> {
super.setItemReader(new ItemReaderAdapter<>((ItemReader) itemReader));
} else {
throw new IllegalArgumentException("The definition of an item reader must implement either " +
"org.springframework.batch.item.ItemReader or javax.batch.api.chunk.ItemReader");
"org.springframework.batch.item.ItemReader or jakarta.batch.api.chunk.ItemReader");
}
}
@@ -236,7 +237,7 @@ public class StepFactoryBean<I, O> extends StepParserStepFactoryBean<I, O> {
super.setItemProcessor(new ItemProcessorAdapter<>((ItemProcessor) itemProcessor));
} else {
throw new IllegalArgumentException("The definition of an item processor must implement either " +
"org.springframework.batch.item.ItemProcessor or javax.batch.api.chunk.ItemProcessor");
"org.springframework.batch.item.ItemProcessor or jakarta.batch.api.chunk.ItemProcessor");
}
}
@@ -255,7 +256,7 @@ public class StepFactoryBean<I, O> extends StepParserStepFactoryBean<I, O> {
super.setItemWriter(new ItemWriterAdapter<>((ItemWriter) itemWriter));
} else {
throw new IllegalArgumentException("The definition of an item writer must implement either " +
"org.springframework.batch.item.ItemWriter or javax.batch.api.chunk.ItemWriter");
"org.springframework.batch.item.ItemWriter or jakarta.batch.api.chunk.ItemWriter");
}
}
@@ -273,7 +274,7 @@ public class StepFactoryBean<I, O> extends StepParserStepFactoryBean<I, O> {
super.setChunkCompletionPolicy(new CheckpointAlgorithmAdapter((CheckpointAlgorithm) chunkCompletionPolicy));
} else {
throw new IllegalArgumentException("The definition of a chunk completion policy must implement either " +
"org.springframework.batch.repeat.CompletionPolicy or javax.batch.api.chunk.CheckpointAlgorithm");
"org.springframework.batch.repeat.CompletionPolicy or jakarta.batch.api.chunk.CheckpointAlgorithm");
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2013-2019 the original author or authors.
* Copyright 2013-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -26,22 +26,22 @@ import java.util.Properties;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.Semaphore;
import javax.batch.operations.BatchRuntimeException;
import javax.batch.operations.JobExecutionAlreadyCompleteException;
import javax.batch.operations.JobExecutionIsRunningException;
import javax.batch.operations.JobExecutionNotMostRecentException;
import javax.batch.operations.JobExecutionNotRunningException;
import javax.batch.operations.JobOperator;
import javax.batch.operations.JobRestartException;
import javax.batch.operations.JobSecurityException;
import javax.batch.operations.JobStartException;
import javax.batch.operations.NoSuchJobException;
import javax.batch.operations.NoSuchJobExecutionException;
import javax.batch.operations.NoSuchJobInstanceException;
import javax.batch.runtime.BatchRuntime;
import javax.batch.runtime.JobExecution;
import javax.batch.runtime.JobInstance;
import javax.batch.runtime.StepExecution;
import jakarta.batch.operations.BatchRuntimeException;
import jakarta.batch.operations.JobExecutionAlreadyCompleteException;
import jakarta.batch.operations.JobExecutionIsRunningException;
import jakarta.batch.operations.JobExecutionNotMostRecentException;
import jakarta.batch.operations.JobExecutionNotRunningException;
import jakarta.batch.operations.JobOperator;
import jakarta.batch.operations.JobRestartException;
import jakarta.batch.operations.JobSecurityException;
import jakarta.batch.operations.JobStartException;
import jakarta.batch.operations.NoSuchJobException;
import jakarta.batch.operations.NoSuchJobExecutionException;
import jakarta.batch.operations.NoSuchJobInstanceException;
import jakarta.batch.runtime.BatchRuntime;
import jakarta.batch.runtime.JobExecution;
import jakarta.batch.runtime.JobInstance;
import jakarta.batch.runtime.StepExecution;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -240,7 +240,7 @@ public class JsrJobOperator implements JobOperator, ApplicationContextAware, Ini
}
/* (non-Javadoc)
* @see javax.batch.operations.JobOperator#abandon(long)
* @see jakarta.batch.operations.JobOperator#abandon(long)
*/
@Override
public void abandon(long jobExecutionId) throws NoSuchJobExecutionException,
@@ -260,7 +260,7 @@ public class JsrJobOperator implements JobOperator, ApplicationContextAware, Ini
}
/* (non-Javadoc)
* @see javax.batch.operations.JobOperator#getJobExecution(long)
* @see jakarta.batch.operations.JobOperator#getJobExecution(long)
*/
@Override
public JobExecution getJobExecution(long executionId)
@@ -275,7 +275,7 @@ public class JsrJobOperator implements JobOperator, ApplicationContextAware, Ini
}
/* (non-Javadoc)
* @see javax.batch.operations.JobOperator#getJobExecutions(javax.batch.runtime.JobInstance)
* @see jakarta.batch.operations.JobOperator#getJobExecutions(jakarta.batch.runtime.JobInstance)
*/
@Override
public List<JobExecution> getJobExecutions(JobInstance jobInstance)
@@ -300,7 +300,7 @@ public class JsrJobOperator implements JobOperator, ApplicationContextAware, Ini
}
/* (non-Javadoc)
* @see javax.batch.operations.JobOperator#getJobInstance(long)
* @see jakarta.batch.operations.JobOperator#getJobInstance(long)
*/
@Override
public JobInstance getJobInstance(long executionId)
@@ -315,7 +315,7 @@ public class JsrJobOperator implements JobOperator, ApplicationContextAware, Ini
}
/* (non-Javadoc)
* @see javax.batch.operations.JobOperator#getJobInstanceCount(java.lang.String)
* @see jakarta.batch.operations.JobOperator#getJobInstanceCount(java.lang.String)
*/
@Override
public int getJobInstanceCount(String jobName) throws NoSuchJobException,
@@ -334,7 +334,7 @@ public class JsrJobOperator implements JobOperator, ApplicationContextAware, Ini
}
/* (non-Javadoc)
* @see javax.batch.operations.JobOperator#getJobInstances(java.lang.String, int, int)
* @see jakarta.batch.operations.JobOperator#getJobInstances(java.lang.String, int, int)
*/
@Override
public List<JobInstance> getJobInstances(String jobName, int start, int count)
@@ -349,7 +349,7 @@ public class JsrJobOperator implements JobOperator, ApplicationContextAware, Ini
}
/* (non-Javadoc)
* @see javax.batch.operations.JobOperator#getJobNames()
* @see jakarta.batch.operations.JobOperator#getJobNames()
*/
@Override
public Set<String> getJobNames() throws JobSecurityException {
@@ -357,7 +357,7 @@ public class JsrJobOperator implements JobOperator, ApplicationContextAware, Ini
}
/* (non-Javadoc)
* @see javax.batch.operations.JobOperator#getParameters(long)
* @see jakarta.batch.operations.JobOperator#getParameters(long)
*/
@Override
public Properties getParameters(long executionId)
@@ -375,7 +375,7 @@ public class JsrJobOperator implements JobOperator, ApplicationContextAware, Ini
}
/* (non-Javadoc)
* @see javax.batch.operations.JobOperator#getRunningExecutions(java.lang.String)
* @see jakarta.batch.operations.JobOperator#getRunningExecutions(java.lang.String)
*/
@Override
public List<Long> getRunningExecutions(String name)
@@ -396,7 +396,7 @@ public class JsrJobOperator implements JobOperator, ApplicationContextAware, Ini
}
/* (non-Javadoc)
* @see javax.batch.operations.JobOperator#getStepExecutions(long)
* @see jakarta.batch.operations.JobOperator#getStepExecutions(long)
*/
@Override
public List<StepExecution> getStepExecutions(long executionId)

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2013-2014 the original author or authors.
* Copyright 2013-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -22,7 +22,7 @@ import java.util.HashSet;
import java.util.Properties;
import java.util.Set;
import javax.batch.api.BatchProperty;
import jakarta.batch.api.BatchProperty;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -50,6 +50,7 @@ import org.springframework.util.StringUtils;
*
* @author Chris Schaefer
* @author Michael Minella
* @author Mahmoud Ben Hassine
* @since 3.0
*/
@SuppressWarnings("unchecked")
@@ -65,9 +66,9 @@ public class BatchPropertyBeanPostProcessor implements BeanPostProcessor, BeanFa
ClassLoader cl = BatchPropertyBeanPostProcessor.class.getClassLoader();
try {
REQUIRED_ANNOTATIONS.add((Class<? extends Annotation>) cl.loadClass("javax.inject.Inject"));
REQUIRED_ANNOTATIONS.add((Class<? extends Annotation>) cl.loadClass("jakarta.inject.Inject"));
} catch (ClassNotFoundException ex) {
LOGGER.warn("javax.inject.Inject not found - @BatchProperty marked fields will not be processed.");
LOGGER.warn("jakarta.inject.Inject not found - @BatchProperty marked fields will not be processed.");
}
REQUIRED_ANNOTATIONS.add(BatchProperty.class);

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2013-2018 the original author or authors.
* Copyright 2013-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -30,10 +30,10 @@ import java.util.concurrent.FutureTask;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.locks.ReentrantLock;
import javax.batch.api.partition.PartitionAnalyzer;
import javax.batch.api.partition.PartitionCollector;
import javax.batch.api.partition.PartitionMapper;
import javax.batch.api.partition.PartitionPlan;
import jakarta.batch.api.partition.PartitionAnalyzer;
import jakarta.batch.api.partition.PartitionCollector;
import jakarta.batch.api.partition.PartitionMapper;
import jakarta.batch.api.partition.PartitionPlan;
import org.springframework.batch.core.BatchStatus;
import org.springframework.batch.core.ExitStatus;
@@ -443,7 +443,7 @@ public class JsrPartitionHandler implements PartitionHandler, InitializingBean {
}
/* (non-Javadoc)
* @see javax.batch.api.partition.PartitionPlan#getPartitionProperties()
* @see jakarta.batch.api.partition.PartitionPlan#getPartitionProperties()
*/
@Override
public Properties[] getPartitionProperties() {
@@ -451,7 +451,7 @@ public class JsrPartitionHandler implements PartitionHandler, InitializingBean {
}
/* (non-Javadoc)
* @see javax.batch.api.partition.PartitionPlan#getPartitions()
* @see jakarta.batch.api.partition.PartitionPlan#getPartitions()
*/
@Override
public int getPartitions() {
@@ -459,7 +459,7 @@ public class JsrPartitionHandler implements PartitionHandler, InitializingBean {
}
/* (non-Javadoc)
* @see javax.batch.api.partition.PartitionPlan#getThreads()
* @see jakarta.batch.api.partition.PartitionPlan#getThreads()
*/
@Override
public int getThreads() {
@@ -467,7 +467,7 @@ public class JsrPartitionHandler implements PartitionHandler, InitializingBean {
}
/* (non-Javadoc)
* @see javax.batch.api.partition.PartitionPlan#setPartitions(int)
* @see jakarta.batch.api.partition.PartitionPlan#setPartitions(int)
*/
@Override
public void setPartitions(int count) {
@@ -475,7 +475,7 @@ public class JsrPartitionHandler implements PartitionHandler, InitializingBean {
}
/* (non-Javadoc)
* @see javax.batch.api.partition.PartitionPlan#setPartitionsOverride(boolean)
* @see jakarta.batch.api.partition.PartitionPlan#setPartitionsOverride(boolean)
*/
@Override
public void setPartitionsOverride(boolean override) {
@@ -483,7 +483,7 @@ public class JsrPartitionHandler implements PartitionHandler, InitializingBean {
}
/* (non-Javadoc)
* @see javax.batch.api.partition.PartitionPlan#getPartitionsOverride()
* @see jakarta.batch.api.partition.PartitionPlan#getPartitionsOverride()
*/
@Override
public boolean getPartitionsOverride() {
@@ -491,7 +491,7 @@ public class JsrPartitionHandler implements PartitionHandler, InitializingBean {
}
/* (non-Javadoc)
* @see javax.batch.api.partition.PartitionPlan#setThreads(int)
* @see jakarta.batch.api.partition.PartitionPlan#setThreads(int)
*/
@Override
public void setThreads(int count) {
@@ -499,7 +499,7 @@ public class JsrPartitionHandler implements PartitionHandler, InitializingBean {
}
/* (non-Javadoc)
* @see javax.batch.api.partition.PartitionPlan#setPartitionProperties(java.util.Properties[])
* @see jakarta.batch.api.partition.PartitionPlan#setPartitionProperties(java.util.Properties[])
*/
@Override
public void setPartitionProperties(Properties[] props) {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2013-2018 the original author or authors.
* Copyright 2013-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -19,8 +19,8 @@ import java.io.Serializable;
import java.util.Queue;
import java.util.concurrent.locks.ReentrantLock;
import javax.batch.api.partition.PartitionCollector;
import javax.batch.operations.BatchRuntimeException;
import jakarta.batch.api.partition.PartitionCollector;
import jakarta.batch.operations.BatchRuntimeException;
import org.springframework.batch.core.ChunkListener;
import org.springframework.batch.core.scope.context.ChunkContext;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2013 the original author or authors.
* Copyright 2013-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -24,9 +24,9 @@ import org.springframework.beans.factory.config.BeanFactoryPostProcessor;
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
import org.springframework.beans.factory.config.RuntimeBeanReference;
import javax.batch.api.partition.PartitionAnalyzer;
import javax.batch.api.partition.PartitionMapper;
import javax.batch.api.partition.PartitionReducer;
import jakarta.batch.api.partition.PartitionAnalyzer;
import jakarta.batch.api.partition.PartitionMapper;
import jakarta.batch.api.partition.PartitionReducer;
/**
* In order for property resolution to occur correctly within the scope of a JSR-352
@@ -36,6 +36,7 @@ import javax.batch.api.partition.PartitionReducer;
* lazy initialization (equivalent to lazy-init="true").
*
* @author Michael Minella
* @author Mahmoud Ben Hassine
* @since 3.0
*/
public class JsrBeanScopeBeanFactoryPostProcessor implements BeanFactoryPostProcessor {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2013-2014 the original author or authors.
* Copyright 2013-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -19,7 +19,7 @@ import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import javax.batch.api.Decider;
import jakarta.batch.api.Decider;
import org.springframework.batch.core.ExitStatus;
import org.springframework.batch.core.Step;
@@ -31,10 +31,11 @@ import org.springframework.batch.item.ExecutionContext;
/**
* Implements a {@link Step} to follow the rules for a decision state
* as defined by JSR-352. Currently does not support the JSR requirement
* to provide all of the last {@link javax.batch.runtime.StepExecution}s from
* to provide all of the last {@link jakarta.batch.runtime.StepExecution}s from
* a split.
*
* @author Michael Minella
* @author Mahmoud Ben Hassine
* @since 3.0
*/
public class DecisionStep extends AbstractStep {
@@ -52,7 +53,7 @@ public class DecisionStep extends AbstractStep {
@Override
protected void doExecute(StepExecution stepExecution) throws Exception {
ExecutionContext executionContext = stepExecution.getJobExecution().getExecutionContext();
List<javax.batch.runtime.StepExecution> stepExecutions = new ArrayList<>();
List<jakarta.batch.runtime.StepExecution> stepExecutions = new ArrayList<>();
if(executionContext.containsKey("batch.lastSteps")) {
List<String> stepNames = (List<String>) executionContext.get("batch.lastSteps");
@@ -78,7 +79,7 @@ public class DecisionStep extends AbstractStep {
}
try {
ExitStatus exitStatus = new ExitStatus(decider.decide(stepExecutions.toArray(new javax.batch.runtime.StepExecution[0])));
ExitStatus exitStatus = new ExitStatus(decider.decide(stepExecutions.toArray(new jakarta.batch.runtime.StepExecution[0])));
stepExecution.getJobExecution().setExitStatus(exitStatus);
stepExecution.setExitStatus(exitStatus);

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2013-2019 the original author or authors.
* Copyright 2013-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -17,8 +17,8 @@ package org.springframework.batch.core.jsr.step;
import java.util.Collection;
import javax.batch.api.partition.PartitionReducer;
import javax.batch.api.partition.PartitionReducer.PartitionStatus;
import jakarta.batch.api.partition.PartitionReducer;
import jakarta.batch.api.partition.PartitionReducer.PartitionStatus;
import org.springframework.batch.core.BatchStatus;
import org.springframework.batch.core.JobExecutionException;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2013-2019 the original author or authors.
* Copyright 2013-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,8 +15,8 @@
*/
package org.springframework.batch.core.jsr.step.batchlet;
import javax.batch.api.Batchlet;
import javax.batch.operations.BatchRuntimeException;
import jakarta.batch.api.Batchlet;
import jakarta.batch.operations.BatchRuntimeException;
import org.springframework.batch.core.ExitStatus;
import org.springframework.batch.core.StepContribution;
@@ -30,6 +30,7 @@ import org.springframework.util.StringUtils;
/**
*
* @author Michael Minella
* @author Mahmoud Ben Hassine
* @since 3.0
*/
public class BatchletAdapter implements StoppableTasklet {

View File

@@ -1,5 +1,5 @@
/**
* Classes for supporting JSR-352's {@link javax.batch.api.Batchlet}.
* Classes for supporting JSR-352's {@link jakarta.batch.api.Batchlet}.
*
* @author Michael Minella
* @author Mahmoud Ben Hassine

View File

@@ -15,7 +15,7 @@
*/
package org.springframework.batch.core.jsr.step.builder;
import javax.batch.api.partition.PartitionReducer;
import jakarta.batch.api.partition.PartitionReducer;
import org.springframework.batch.core.Step;
import org.springframework.batch.core.jsr.step.PartitionStep;
@@ -31,6 +31,7 @@ import org.springframework.core.task.SyncTaskExecutor;
* so that JSR-352 specific semantics are honored.
*
* @author Michael Minella
* @author Mahmoud Ben Hassine
* @since 3.0
*/
public class JsrPartitionStepBuilder extends PartitionStepBuilder {

View File

@@ -40,7 +40,7 @@ import org.springframework.retry.RetryContext;
import org.springframework.retry.RetryException;
import org.springframework.util.Assert;
import javax.batch.operations.BatchRuntimeException;
import jakarta.batch.operations.BatchRuntimeException;
import java.util.List;
/**

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2013 the original author or authors.
* Copyright 2013-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -17,7 +17,7 @@ package org.springframework.batch.core.listener;
import java.util.Iterator;
import java.util.List;
import javax.batch.api.chunk.listener.RetryProcessListener;
import jakarta.batch.api.chunk.listener.RetryProcessListener;
/**
* <p>
@@ -25,6 +25,7 @@ import javax.batch.api.chunk.listener.RetryProcessListener;
* </p>
*
* @author Chris Schaefer
* @author Mahmoud Ben Hassine
* @since 3.0
*/
public class CompositeRetryProcessListener implements RetryProcessListener {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2013 the original author or authors.
* Copyright 2013-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -17,7 +17,7 @@ package org.springframework.batch.core.listener;
import java.util.Iterator;
import java.util.List;
import javax.batch.api.chunk.listener.RetryReadListener;
import jakarta.batch.api.chunk.listener.RetryReadListener;
/**
* <p>
@@ -25,6 +25,7 @@ import javax.batch.api.chunk.listener.RetryReadListener;
* </p>
*
* @author Chris Schaefer
* @author Mahmoud Ben Hassine
* @since 3.0
*/
public class CompositeRetryReadListener implements RetryReadListener {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2013 the original author or authors.
* Copyright 2013-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -17,7 +17,7 @@ package org.springframework.batch.core.listener;
import java.util.Iterator;
import java.util.List;
import javax.batch.api.chunk.listener.RetryWriteListener;
import jakarta.batch.api.chunk.listener.RetryWriteListener;
/**
* <p>
@@ -25,6 +25,7 @@ import javax.batch.api.chunk.listener.RetryWriteListener;
* </p>
*
* @author Chris Schaefer
* @author Mahmoud Ben Hassine
* @since 3.0
*/
public class CompositeRetryWriteListener implements RetryWriteListener {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2006-2019 the original author or authors.
* Copyright 2006-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -18,10 +18,10 @@ package org.springframework.batch.core.listener;
import java.lang.reflect.InvocationTargetException;
import java.util.List;
import javax.batch.api.chunk.listener.RetryProcessListener;
import javax.batch.api.chunk.listener.RetryReadListener;
import javax.batch.api.chunk.listener.RetryWriteListener;
import javax.batch.operations.BatchRuntimeException;
import jakarta.batch.api.chunk.listener.RetryProcessListener;
import jakarta.batch.api.chunk.listener.RetryReadListener;
import jakarta.batch.api.chunk.listener.RetryWriteListener;
import jakarta.batch.operations.BatchRuntimeException;
import org.springframework.batch.core.ChunkListener;
import org.springframework.batch.core.ExitStatus;
import org.springframework.batch.core.ItemProcessListener;

View File

@@ -25,7 +25,7 @@ import java.util.List;
import java.util.Map;
import java.util.Set;
import javax.batch.operations.BatchRuntimeException;
import jakarta.batch.operations.BatchRuntimeException;
import org.springframework.batch.core.ChunkListener;
import org.springframework.batch.core.JobInterruptedException;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2006-2007 the original author or authors.
* Copyright 2006-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -30,6 +30,7 @@ import org.junit.Test;
/**
* @author Dave Syer
* @author Mahmoud Ben Hassine
*
*/
public class BatchStatusTests {
@@ -121,12 +122,12 @@ public class BatchStatusTests {
@Test
public void testJsrConversion() {
assertEquals(javax.batch.runtime.BatchStatus.ABANDONED, BatchStatus.ABANDONED.getBatchStatus());
assertEquals(javax.batch.runtime.BatchStatus.COMPLETED, BatchStatus.COMPLETED.getBatchStatus());
assertEquals(javax.batch.runtime.BatchStatus.STARTED, BatchStatus.STARTED.getBatchStatus());
assertEquals(javax.batch.runtime.BatchStatus.STARTING, BatchStatus.STARTING.getBatchStatus());
assertEquals(javax.batch.runtime.BatchStatus.STOPPED, BatchStatus.STOPPED.getBatchStatus());
assertEquals(javax.batch.runtime.BatchStatus.STOPPING, BatchStatus.STOPPING.getBatchStatus());
assertEquals(javax.batch.runtime.BatchStatus.FAILED, BatchStatus.FAILED.getBatchStatus());
assertEquals(jakarta.batch.runtime.BatchStatus.ABANDONED, BatchStatus.ABANDONED.getBatchStatus());
assertEquals(jakarta.batch.runtime.BatchStatus.COMPLETED, BatchStatus.COMPLETED.getBatchStatus());
assertEquals(jakarta.batch.runtime.BatchStatus.STARTED, BatchStatus.STARTED.getBatchStatus());
assertEquals(jakarta.batch.runtime.BatchStatus.STARTING, BatchStatus.STARTING.getBatchStatus());
assertEquals(jakarta.batch.runtime.BatchStatus.STOPPED, BatchStatus.STOPPED.getBatchStatus());
assertEquals(jakarta.batch.runtime.BatchStatus.STOPPING, BatchStatus.STOPPING.getBatchStatus());
assertEquals(jakarta.batch.runtime.BatchStatus.FAILED, BatchStatus.FAILED.getBatchStatus());
}
}

View File

@@ -25,7 +25,7 @@ import org.springframework.jdbc.datasource.init.DatabasePopulatorUtils;
import org.springframework.jdbc.datasource.init.ResourceDatabasePopulator;
import org.springframework.util.ClassUtils;
import javax.annotation.PostConstruct;
import jakarta.annotation.PostConstruct;
import javax.sql.DataSource;
@Configuration

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2019 the original author or authors.
* Copyright 2012-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -17,7 +17,7 @@ package org.springframework.batch.core.configuration.annotation;
import static org.junit.Assert.assertEquals;
import javax.annotation.PostConstruct;
import jakarta.annotation.PostConstruct;
import org.junit.Test;
@@ -46,6 +46,7 @@ import org.springframework.lang.Nullable;
/**
* @author Dave Syer
* @author Mahmoud Ben Hassine
*
*/
public class JobLoaderConfigurationTests {

View File

@@ -20,7 +20,7 @@ import static org.junit.Assert.assertTrue;
import java.util.Date;
import javax.annotation.Resource;
import jakarta.annotation.Resource;
import org.junit.Test;
import org.junit.runner.RunWith;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2014 the original author or authors.
* Copyright 2014-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -19,15 +19,16 @@ import java.util.Date;
import java.util.Properties;
import java.util.concurrent.TimeoutException;
import javax.batch.operations.JobOperator;
import javax.batch.runtime.BatchRuntime;
import javax.batch.runtime.BatchStatus;
import javax.batch.runtime.JobExecution;
import javax.batch.runtime.Metric;
import javax.batch.runtime.StepExecution;
import jakarta.batch.operations.JobOperator;
import jakarta.batch.runtime.BatchRuntime;
import jakarta.batch.runtime.BatchStatus;
import jakarta.batch.runtime.JobExecution;
import jakarta.batch.runtime.Metric;
import jakarta.batch.runtime.StepExecution;
/**
* @author mminella
* @author Mahmoud Ben Hassine
*/
public abstract class AbstractJsrTestCase {
@@ -38,15 +39,15 @@ public abstract class AbstractJsrTestCase {
}
/**
* Executes a job and waits for it's status to be any of {@link javax.batch.runtime.BatchStatus#STOPPED},
* {@link javax.batch.runtime.BatchStatus#COMPLETED}, or {@link javax.batch.runtime.BatchStatus#FAILED}. If the job does not
* Executes a job and waits for it's status to be any of {@link jakarta.batch.runtime.BatchStatus#STOPPED},
* {@link jakarta.batch.runtime.BatchStatus#COMPLETED}, or {@link jakarta.batch.runtime.BatchStatus#FAILED}. If the job does not
* reach one of those statuses within the given timeout, a {@link java.util.concurrent.TimeoutException} is
* thrown.
*
* @param jobName Name of the job to run
* @param properties Properties to pass the job
* @param timeout length of time to wait for a job to finish
* @return the {@link javax.batch.runtime.JobExecution} for the final state of the job
* @return the {@link jakarta.batch.runtime.JobExecution} for the final state of the job
* @throws java.util.concurrent.TimeoutException if the timeout occurs
*/
public static JobExecution runJob(String jobName, Properties properties, long timeout) throws TimeoutException {

View File

@@ -19,8 +19,8 @@ import static org.mockito.Mockito.doThrow;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import javax.batch.api.chunk.listener.ChunkListener;
import javax.batch.operations.BatchRuntimeException;
import jakarta.batch.api.chunk.listener.ChunkListener;
import jakarta.batch.operations.BatchRuntimeException;
import org.junit.Before;
import org.junit.Rule;

View File

@@ -18,8 +18,8 @@ package org.springframework.batch.core.jsr;
import static org.mockito.Mockito.doThrow;
import static org.mockito.Mockito.verify;
import javax.batch.api.chunk.listener.ItemProcessListener;
import javax.batch.operations.BatchRuntimeException;
import jakarta.batch.api.chunk.listener.ItemProcessListener;
import jakarta.batch.operations.BatchRuntimeException;
import org.junit.Before;
import org.junit.Rule;

View File

@@ -18,8 +18,8 @@ package org.springframework.batch.core.jsr;
import static org.mockito.Mockito.doThrow;
import static org.mockito.Mockito.verify;
import javax.batch.api.chunk.listener.ItemReadListener;
import javax.batch.operations.BatchRuntimeException;
import jakarta.batch.api.chunk.listener.ItemReadListener;
import jakarta.batch.operations.BatchRuntimeException;
import org.junit.Before;
import org.junit.Rule;

View File

@@ -21,8 +21,8 @@ import static org.mockito.Mockito.verify;
import java.util.ArrayList;
import java.util.List;
import javax.batch.api.chunk.listener.ItemWriteListener;
import javax.batch.operations.BatchRuntimeException;
import jakarta.batch.api.chunk.listener.ItemWriteListener;
import jakarta.batch.operations.BatchRuntimeException;
import org.junit.Before;
import org.junit.Rule;

View File

@@ -18,8 +18,8 @@ package org.springframework.batch.core.jsr;
import static org.mockito.Mockito.doThrow;
import static org.mockito.Mockito.verify;
import javax.batch.api.listener.JobListener;
import javax.batch.operations.BatchRuntimeException;
import jakarta.batch.api.listener.JobListener;
import jakarta.batch.operations.BatchRuntimeException;
import org.junit.Before;
import org.junit.Rule;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2013-2018 the original author or authors.
* Copyright 2013-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -26,7 +26,7 @@ import java.util.Set;
import java.util.concurrent.Callable;
import java.util.concurrent.Future;
import javax.batch.runtime.context.JobContext;
import jakarta.batch.runtime.context.JobContext;
import org.junit.After;
import org.junit.Before;

View File

@@ -111,7 +111,7 @@ public class JsrJobContextTests {
public void testGetBatchStatus() {
when(execution.getStatus()).thenReturn(BatchStatus.COMPLETED);
assertEquals(javax.batch.runtime.BatchStatus.COMPLETED, context.getBatchStatus());
assertEquals(jakarta.batch.runtime.BatchStatus.COMPLETED, context.getBatchStatus());
}
@Test

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2014 the original author or authors.
* Copyright 2014-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -61,7 +61,7 @@ public class JsrJobExecutionTests {
@Test
public void testGetBasicValues() {
assertEquals(javax.batch.runtime.BatchStatus.FAILED, adapter.getBatchStatus());
assertEquals(jakarta.batch.runtime.BatchStatus.FAILED, adapter.getBatchStatus());
assertEquals(new Date(0), adapter.getCreateTime());
assertEquals(new Date(999999999L), adapter.getEndTime());
assertEquals(5L, adapter.getExecutionId());

View File

@@ -27,7 +27,7 @@ import java.util.Set;
import java.util.concurrent.Callable;
import java.util.concurrent.Future;
import javax.batch.runtime.context.StepContext;
import jakarta.batch.runtime.context.StepContext;
import org.junit.After;
import org.junit.Before;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2013 the original author or authors.
* Copyright 2013-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -22,8 +22,8 @@ import static org.junit.Assert.fail;
import java.util.Properties;
import javax.batch.runtime.Metric;
import javax.batch.runtime.context.StepContext;
import jakarta.batch.runtime.Metric;
import jakarta.batch.runtime.context.StepContext;
import org.junit.Before;
import org.junit.Test;
@@ -71,7 +71,7 @@ public class JsrStepContextTests {
@Test
public void testBasicProperties() {
assertEquals(javax.batch.runtime.BatchStatus.STARTED, stepContext.getBatchStatus());
assertEquals(jakarta.batch.runtime.BatchStatus.STARTED, stepContext.getBatchStatus());
assertEquals(null, stepContext.getExitStatus());
stepContext.setExitStatus("customExitStatus");
assertEquals("customExitStatus", stepContext.getExitStatus());

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2014 the original author or authors.
* Copyright 2014-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -21,7 +21,7 @@ import static org.junit.Assert.fail;
import java.util.Date;
import javax.batch.runtime.Metric;
import jakarta.batch.runtime.Metric;
import org.junit.Before;
import org.junit.Test;
@@ -36,7 +36,7 @@ import org.springframework.util.ClassUtils;
public class JsrStepExecutionTests {
private StepExecution stepExecution;
private javax.batch.runtime.StepExecution jsrStepExecution;
private jakarta.batch.runtime.StepExecution jsrStepExecution;
//The API that sets the persisted user data is on the JsrStepContext so the key within the ExecutionContext is JsrStepContext
private ExecutionContextUserSupport executionContextUserSupport = new ExecutionContextUserSupport(ClassUtils.getShortName(JsrStepContext.class));
@@ -79,7 +79,7 @@ public class JsrStepExecutionTests {
public void testBaseValues() {
assertEquals(5L, jsrStepExecution.getStepExecutionId());
assertEquals("testStep", jsrStepExecution.getStepName());
assertEquals(javax.batch.runtime.BatchStatus.STARTED, jsrStepExecution.getBatchStatus());
assertEquals(jakarta.batch.runtime.BatchStatus.STARTED, jsrStepExecution.getBatchStatus());
assertEquals(new Date(0), jsrStepExecution.getStartTime());
assertEquals(new Date(10000000), jsrStepExecution.getEndTime());
assertEquals("customExitStatus", jsrStepExecution.getExitStatus());

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2013-2014 the original author or authors.
* Copyright 2013-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -17,8 +17,8 @@ package org.springframework.batch.core.jsr;
import static org.junit.Assert.assertEquals;
import javax.batch.runtime.Metric;
import javax.batch.runtime.Metric.MetricType;
import jakarta.batch.runtime.Metric;
import jakarta.batch.runtime.Metric.MetricType;
import org.junit.Test;

View File

@@ -20,8 +20,8 @@ import static org.mockito.Mockito.doThrow;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import javax.batch.api.listener.StepListener;
import javax.batch.operations.BatchRuntimeException;
import jakarta.batch.api.listener.StepListener;
import jakarta.batch.operations.BatchRuntimeException;
import org.junit.Before;
import org.junit.Rule;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2013 the original author or authors.
* Copyright 2013-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -19,7 +19,7 @@ import static org.junit.Assert.assertEquals;
import java.util.List;
import javax.batch.api.chunk.AbstractItemWriter;
import jakarta.batch.api.chunk.AbstractItemWriter;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -85,7 +85,7 @@ public class ChunkListenerParsingTests {
}
}
public static class JsrChunkListener implements javax.batch.api.chunk.listener.ChunkListener {
public static class JsrChunkListener implements jakarta.batch.api.chunk.listener.ChunkListener {
protected int beforeChunkCount = 0;
protected int afterChunkCount = 0;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2013 the original author or authors.
* Copyright 2013-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,7 +15,7 @@
*/
package org.springframework.batch.core.jsr.configuration.xml;
import javax.batch.api.chunk.ItemProcessor;
import jakarta.batch.api.chunk.ItemProcessor;
public class CountingItemProcessor implements ItemProcessor {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2014 the original author or authors.
* Copyright 2014-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -19,9 +19,9 @@ import java.util.Date;
import java.util.Properties;
import java.util.concurrent.TimeoutException;
import javax.batch.operations.JobOperator;
import javax.batch.runtime.BatchStatus;
import javax.batch.runtime.JobExecution;
import jakarta.batch.operations.JobOperator;
import jakarta.batch.runtime.BatchStatus;
import jakarta.batch.runtime.JobExecution;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -32,6 +32,7 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
/**
* @author Michael Minella
* @author Mahmoud Ben Hassine
*/
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2013 the original author or authors.
* Copyright 2013-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -18,8 +18,8 @@ package org.springframework.batch.core.jsr.configuration.xml;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import javax.batch.api.Decider;
import javax.batch.runtime.StepExecution;
import jakarta.batch.api.Decider;
import jakarta.batch.runtime.StepExecution;
import org.junit.Before;
import org.junit.Test;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2013 the original author or authors.
* Copyright 2013-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -18,15 +18,15 @@ package org.springframework.batch.core.jsr.configuration.xml;
import org.junit.Test;
import org.springframework.batch.core.jsr.AbstractJsrTestCase;
import javax.batch.api.BatchProperty;
import javax.batch.api.chunk.ItemProcessor;
import javax.batch.operations.JobOperator;
import javax.batch.runtime.BatchRuntime;
import javax.batch.runtime.BatchStatus;
import javax.batch.runtime.JobExecution;
import javax.batch.runtime.Metric;
import javax.batch.runtime.StepExecution;
import javax.inject.Inject;
import jakarta.batch.api.BatchProperty;
import jakarta.batch.api.chunk.ItemProcessor;
import jakarta.batch.operations.JobOperator;
import jakarta.batch.runtime.BatchRuntime;
import jakarta.batch.runtime.BatchStatus;
import jakarta.batch.runtime.JobExecution;
import jakarta.batch.runtime.Metric;
import jakarta.batch.runtime.StepExecution;
import jakarta.inject.Inject;
import java.util.List;
import java.util.Properties;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2013-2014 the original author or authors.
* Copyright 2013-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -19,13 +19,13 @@ import org.junit.Test;
import org.springframework.batch.core.ExitStatus;
import org.springframework.batch.core.jsr.AbstractJsrTestCase;
import javax.batch.api.AbstractBatchlet;
import javax.batch.operations.JobOperator;
import javax.batch.runtime.BatchRuntime;
import javax.batch.runtime.JobExecution;
import javax.batch.runtime.StepExecution;
import javax.batch.runtime.context.StepContext;
import javax.inject.Inject;
import jakarta.batch.api.AbstractBatchlet;
import jakarta.batch.operations.JobOperator;
import jakarta.batch.runtime.BatchRuntime;
import jakarta.batch.runtime.JobExecution;
import jakarta.batch.runtime.StepExecution;
import jakarta.batch.runtime.context.StepContext;
import jakarta.inject.Inject;
import java.util.List;
import java.util.Properties;
@@ -38,6 +38,7 @@ import static org.junit.Assert.assertTrue;
* </p>
*
* @author Chris Schaefer
* @author Mahmoud Ben Hassine
* @since 3.0
*/
public class FlowParserTests extends AbstractJsrTestCase {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2013-2019 the original author or authors.
* Copyright 2013-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -127,7 +127,7 @@ public class ItemListenerParsingTests {
}
}
public static class JsrItemListener implements javax.batch.api.chunk.listener.ItemReadListener, javax.batch.api.chunk.listener.ItemProcessListener, javax.batch.api.chunk.listener.ItemWriteListener {
public static class JsrItemListener implements jakarta.batch.api.chunk.listener.ItemReadListener, jakarta.batch.api.chunk.listener.ItemProcessListener, jakarta.batch.api.chunk.listener.ItemWriteListener {
protected int beforeReadCount = 0;
protected int afterReadCount = 0;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2013-2019 the original author or authors.
* Copyright 2013-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -22,14 +22,14 @@ import org.springframework.batch.item.ItemReader;
import org.springframework.batch.item.ItemWriter;
import org.springframework.lang.Nullable;
import javax.batch.api.chunk.listener.SkipProcessListener;
import javax.batch.api.chunk.listener.SkipReadListener;
import javax.batch.api.chunk.listener.SkipWriteListener;
import javax.batch.operations.JobOperator;
import javax.batch.runtime.BatchRuntime;
import javax.batch.runtime.BatchStatus;
import javax.batch.runtime.Metric;
import javax.batch.runtime.StepExecution;
import jakarta.batch.api.chunk.listener.SkipProcessListener;
import jakarta.batch.api.chunk.listener.SkipReadListener;
import jakarta.batch.api.chunk.listener.SkipWriteListener;
import jakarta.batch.operations.JobOperator;
import jakarta.batch.runtime.BatchRuntime;
import jakarta.batch.runtime.BatchStatus;
import jakarta.batch.runtime.Metric;
import jakarta.batch.runtime.StepExecution;
import java.util.ArrayList;
import java.util.List;
import java.util.Properties;
@@ -40,7 +40,7 @@ public class ItemSkipParsingTests extends AbstractJsrTestCase {
@Test
public void test() throws Exception {
javax.batch.runtime.JobExecution execution = runJob("ItemSkipParsingTests-context", new Properties(), 10000l);
jakarta.batch.runtime.JobExecution execution = runJob("ItemSkipParsingTests-context", new Properties(), 10000l);
JobOperator jobOperator = BatchRuntime.getJobOperator();
assertEquals(BatchStatus.FAILED, execution.getBatchStatus());

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2013 the original author or authors.
* Copyright 2013-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -18,7 +18,7 @@ package org.springframework.batch.core.jsr.configuration.xml;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import javax.batch.api.listener.JobListener;
import jakarta.batch.api.listener.JobListener;
import org.junit.Test;
import org.junit.runner.RunWith;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2013 the original author or authors.
* Copyright 2013-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -17,11 +17,11 @@ package org.springframework.batch.core.jsr.configuration.xml;
import java.io.Serializable;
import java.util.List;
import javax.batch.api.BatchProperty;
import javax.batch.api.chunk.ItemProcessor;
import javax.batch.api.chunk.ItemReader;
import javax.batch.api.chunk.ItemWriter;
import javax.inject.Inject;
import jakarta.batch.api.BatchProperty;
import jakarta.batch.api.chunk.ItemProcessor;
import jakarta.batch.api.chunk.ItemReader;
import jakarta.batch.api.chunk.ItemWriter;
import jakarta.inject.Inject;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.batch.core.ExitStatus;
@@ -42,6 +42,7 @@ import static org.junit.Assert.assertEquals;
* TODO: enhance test cases with more complex substitutions
*
* @author Chris Schaefer
* @author Mahmoud Ben Hassine
* @since 3.0
*/
@ContextConfiguration

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2013-2019 the original author or authors.
* Copyright 2013-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -18,18 +18,18 @@ package org.springframework.batch.core.jsr.configuration.xml;
import java.io.Serializable;
import java.util.List;
import java.util.Properties;
import javax.batch.api.BatchProperty;
import javax.batch.api.Batchlet;
import javax.batch.api.Decider;
import javax.batch.api.chunk.CheckpointAlgorithm;
import javax.batch.api.chunk.ItemProcessor;
import javax.batch.api.chunk.ItemReader;
import javax.batch.api.chunk.ItemWriter;
import javax.batch.api.listener.StepListener;
import javax.batch.runtime.BatchStatus;
import javax.batch.runtime.JobExecution;
import javax.batch.runtime.context.JobContext;
import javax.inject.Inject;
import jakarta.batch.api.BatchProperty;
import jakarta.batch.api.Batchlet;
import jakarta.batch.api.Decider;
import jakarta.batch.api.chunk.CheckpointAlgorithm;
import jakarta.batch.api.chunk.ItemProcessor;
import jakarta.batch.api.chunk.ItemReader;
import jakarta.batch.api.chunk.ItemWriter;
import jakarta.batch.api.listener.StepListener;
import jakarta.batch.runtime.BatchStatus;
import jakarta.batch.runtime.JobExecution;
import jakarta.batch.runtime.context.JobContext;
import jakarta.inject.Inject;
import org.junit.Test;
@@ -48,6 +48,7 @@ import static org.junit.Assert.assertEquals;
* </p>
*
* @author Chris Schaefer
* @author Mahmoud Ben Hassine
* @since 3.0
*/
public class JobPropertyTests extends AbstractJsrTestCase {
@@ -75,7 +76,7 @@ public class JobPropertyTests extends AbstractJsrTestCase {
@Inject @BatchProperty String jobPropertyName2;
@Inject JobContext injectAnnotatedOnlyField;
@BatchProperty String batchAnnotatedOnlyField;
@Inject javax.batch.runtime.context.StepContext stepContext;
@Inject jakarta.batch.runtime.context.StepContext stepContext;
@Override
public void open(Serializable serializable) throws Exception {
@@ -214,7 +215,7 @@ public class JobPropertyTests extends AbstractJsrTestCase {
@Inject @BatchProperty(name = "notDefinedAnnotationNamedProperty") String notDefinedAnnotationNamedProperty;
@Override
public String decide(javax.batch.runtime.StepExecution[] executions) throws Exception {
public String decide(jakarta.batch.runtime.StepExecution[] executions) throws Exception {
org.springframework.util.Assert.isTrue("deciderPropertyValue1".equals(deciderPropertyName1), "The value of deciderPropertyValue1 does not equal deciderPropertyValue1");
org.springframework.util.Assert.isTrue("deciderPropertyValue2".equals(deciderPropertyName2), "The value of deciderPropertyValue2 does not equal deciderPropertyValue2");
org.springframework.util.Assert.isTrue("annotationNamedDeciderPropertyValue".equals(annotationNamedProperty), "The value of annotationNamedDeciderPropertyValue does not equal annotationNamedDeciderPropertyValue");
@@ -252,7 +253,7 @@ public class JobPropertyTests extends AbstractJsrTestCase {
@Inject @BatchProperty(name = "annotationNamedBatchletPropertyName") String annotationNamedProperty;
@Inject @BatchProperty String notDefinedProperty;
@Inject @BatchProperty(name = "notDefinedAnnotationNamedProperty") String notDefinedAnnotationNamedProperty;
@Inject javax.batch.runtime.context.StepContext stepContext;
@Inject jakarta.batch.runtime.context.StepContext stepContext;
@Inject @BatchProperty(name = "infile.name") String infile;
@Inject @BatchProperty(name = "y") String y;
@Inject @BatchProperty(name = "x") String x;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2013-2017 the original author or authors.
* Copyright 2013-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -18,8 +18,8 @@ package org.springframework.batch.core.jsr.configuration.xml;
import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;
import javax.batch.api.Batchlet;
import javax.batch.runtime.JobExecution;
import jakarta.batch.api.Batchlet;
import jakarta.batch.runtime.JobExecution;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -47,6 +47,7 @@ import static org.junit.Assert.assertTrue;
* </p>
*
* @author Chris Schaefer
* @author Mahmoud Ben Hassine
*/
public class JsrBeanDefinitionDocumentReaderTests extends AbstractJsrTestCase {
private static final String JOB_PARAMETERS_BEAN_DEFINITION_NAME = "jsr_jobParameters";

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2013 the original author or authors.
* Copyright 2013-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -17,7 +17,7 @@ package org.springframework.batch.core.jsr.configuration.xml;
import static org.junit.Assert.assertEquals;
import javax.batch.api.Decider;
import jakarta.batch.api.Decider;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -50,7 +50,7 @@ public class JsrDecisionParsingTests {
public static class JsrDecider implements Decider {
@Override
public String decide(javax.batch.runtime.StepExecution[] executions)
public String decide(jakarta.batch.runtime.StepExecution[] executions)
throws Exception {
return "next";
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2013-2020 the original author or authors.
* Copyright 2013-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -26,17 +26,17 @@ import java.util.Vector;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import javax.batch.api.BatchProperty;
import javax.batch.api.Batchlet;
import javax.batch.api.chunk.AbstractItemReader;
import javax.batch.api.chunk.AbstractItemWriter;
import javax.batch.api.partition.PartitionPlan;
import javax.batch.api.partition.PartitionPlanImpl;
import javax.batch.runtime.BatchStatus;
import javax.batch.runtime.JobExecution;
import javax.batch.runtime.context.JobContext;
import javax.batch.runtime.context.StepContext;
import javax.inject.Inject;
import jakarta.batch.api.BatchProperty;
import jakarta.batch.api.Batchlet;
import jakarta.batch.api.chunk.AbstractItemReader;
import jakarta.batch.api.chunk.AbstractItemWriter;
import jakarta.batch.api.partition.PartitionPlan;
import jakarta.batch.api.partition.PartitionPlanImpl;
import jakarta.batch.runtime.BatchStatus;
import jakarta.batch.runtime.JobExecution;
import jakarta.batch.runtime.context.JobContext;
import jakarta.batch.runtime.context.StepContext;
import jakarta.inject.Inject;
import org.junit.Before;
import org.junit.Test;
@@ -174,7 +174,7 @@ public class PartitionParserTests extends AbstractJsrTestCase {
return count;
}
public static class PartitionReducer implements javax.batch.api.partition.PartitionReducer {
public static class PartitionReducer implements jakarta.batch.api.partition.PartitionReducer {
public static String name;
@@ -208,7 +208,7 @@ public class PartitionParserTests extends AbstractJsrTestCase {
}
}
public static class PartitionAnalyzer implements javax.batch.api.partition.PartitionAnalyzer {
public static class PartitionAnalyzer implements jakarta.batch.api.partition.PartitionAnalyzer {
public static String name;
@@ -235,7 +235,7 @@ public class PartitionParserTests extends AbstractJsrTestCase {
}
}
public static class PartitionCollector implements javax.batch.api.partition.PartitionCollector {
public static class PartitionCollector implements jakarta.batch.api.partition.PartitionCollector {
protected static Set<String> artifactNames = Collections.synchronizedSet(new HashSet<>());
@@ -250,7 +250,7 @@ public class PartitionParserTests extends AbstractJsrTestCase {
}
}
public static class PropertyPartitionMapper implements javax.batch.api.partition.PartitionMapper {
public static class PropertyPartitionMapper implements jakarta.batch.api.partition.PartitionMapper {
@Override
public PartitionPlan mapPartitions() throws Exception {
@@ -271,7 +271,7 @@ public class PartitionParserTests extends AbstractJsrTestCase {
}
}
public static class PartitionMapper implements javax.batch.api.partition.PartitionMapper {
public static class PartitionMapper implements jakarta.batch.api.partition.PartitionMapper {
public static String name;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2013 the original author or authors.
* Copyright 2013-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -18,13 +18,13 @@ package org.springframework.batch.core.jsr.configuration.xml;
import java.io.Serializable;
import java.util.Collection;
import java.util.List;
import javax.batch.api.chunk.ItemProcessor;
import javax.batch.api.chunk.ItemReader;
import javax.batch.api.chunk.ItemWriter;
import javax.batch.api.chunk.listener.RetryProcessListener;
import javax.batch.api.chunk.listener.RetryReadListener;
import javax.batch.api.chunk.listener.RetryWriteListener;
import javax.batch.operations.BatchRuntimeException;
import jakarta.batch.api.chunk.ItemProcessor;
import jakarta.batch.api.chunk.ItemReader;
import jakarta.batch.api.chunk.ItemWriter;
import jakarta.batch.api.chunk.listener.RetryProcessListener;
import jakarta.batch.api.chunk.listener.RetryReadListener;
import jakarta.batch.api.chunk.listener.RetryWriteListener;
import jakarta.batch.operations.BatchRuntimeException;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.junit.Test;
@@ -47,6 +47,7 @@ import static org.junit.Assert.assertTrue;
* </p>
*
* @author Chris Schaefer
* @author Mahmoud Ben Hassine
* @since 3.0
*/
public class RetryListenerTests {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2013 the original author or authors.
* Copyright 2013-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -20,8 +20,8 @@ import static org.junit.Assert.assertEquals;
import java.io.Serializable;
import java.util.List;
import javax.batch.api.chunk.CheckpointAlgorithm;
import javax.batch.api.chunk.ItemWriter;
import jakarta.batch.api.chunk.CheckpointAlgorithm;
import jakarta.batch.api.chunk.ItemWriter;
import org.junit.Test;
import org.junit.runner.RunWith;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2013 the original author or authors.
* Copyright 2013-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -18,7 +18,7 @@ package org.springframework.batch.core.jsr.configuration.xml;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import javax.batch.api.Batchlet;
import jakarta.batch.api.Batchlet;
import org.junit.Test;
import org.junit.runner.RunWith;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2013-2019 the original author or authors.
* Copyright 2013-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -17,7 +17,7 @@ package org.springframework.batch.core.jsr.configuration.xml;
import static org.junit.Assert.assertEquals;
import javax.batch.api.listener.StepListener;
import jakarta.batch.api.listener.StepListener;
import org.junit.Test;
import org.junit.runner.RunWith;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2013 the original author or authors.
* Copyright 2013-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -18,8 +18,8 @@ package org.springframework.batch.core.jsr.configuration.xml;
import org.junit.Test;
import org.springframework.batch.core.jsr.AbstractJsrTestCase;
import javax.batch.runtime.BatchStatus;
import javax.batch.runtime.JobExecution;
import jakarta.batch.runtime.BatchStatus;
import jakarta.batch.runtime.JobExecution;
import static org.junit.Assert.assertEquals;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2013-2018 the original author or authors.
* Copyright 2013-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,11 +15,11 @@
*/
package org.springframework.batch.core.jsr.configuration.xml;
import javax.batch.api.BatchProperty;
import javax.batch.api.Batchlet;
import javax.batch.runtime.context.JobContext;
import javax.batch.runtime.context.StepContext;
import javax.inject.Inject;
import jakarta.batch.api.BatchProperty;
import jakarta.batch.api.Batchlet;
import jakarta.batch.runtime.context.JobContext;
import jakarta.batch.runtime.context.StepContext;
import jakarta.inject.Inject;
import org.springframework.util.Assert;

View File

@@ -50,7 +50,7 @@ import org.springframework.jdbc.datasource.embedded.EmbeddedDatabase;
import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder;
import org.springframework.lang.Nullable;
import javax.batch.api.Decider;
import jakarta.batch.api.Decider;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
@@ -480,7 +480,7 @@ public class JsrFlowJobTests {
Decider decider = new Decider() {
@Override
public String decide(javax.batch.runtime.StepExecution[] executions)
public String decide(jakarta.batch.runtime.StepExecution[] executions)
throws Exception {
assertNotNull(executions);
return "SWITCH";
@@ -733,7 +733,7 @@ public class JsrFlowJobTests {
public void execute(StepExecution stepExecution) throws JobInterruptedException {
stepExecution.setStatus(BatchStatus.COMPLETED);
try {
stepExecution.setExitStatus(new ExitStatus(decider.decide(new javax.batch.runtime.StepExecution [] {new JsrStepExecution(stepExecution)})));
stepExecution.setExitStatus(new ExitStatus(decider.decide(new jakarta.batch.runtime.StepExecution [] {new JsrStepExecution(stepExecution)})));
} catch (Exception e) {
throw new RuntimeException(e);
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2013 the original author or authors.
* Copyright 2013-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -17,9 +17,9 @@ package org.springframework.batch.core.jsr.job.flow.support.state;
import static org.junit.Assert.assertEquals;
import javax.batch.api.AbstractBatchlet;
import javax.batch.runtime.BatchStatus;
import javax.batch.runtime.JobExecution;
import jakarta.batch.api.AbstractBatchlet;
import jakarta.batch.runtime.BatchStatus;
import jakarta.batch.runtime.JobExecution;
import org.junit.Test;
@@ -29,6 +29,7 @@ import org.springframework.batch.core.jsr.AbstractJsrTestCase;
* Tests for the JSR-352 version of {@link JsrEndState}
*
* @author Michael Minella
* @author Mahmoud Ben Hassine
*/
public class JsrEndStateTests extends AbstractJsrTestCase {

View File

@@ -21,17 +21,17 @@ import java.util.HashSet;
import java.util.List;
import java.util.Properties;
import java.util.Set;
import javax.batch.api.AbstractBatchlet;
import javax.batch.api.Batchlet;
import javax.batch.operations.JobExecutionIsRunningException;
import javax.batch.operations.JobOperator;
import javax.batch.operations.JobRestartException;
import javax.batch.operations.JobStartException;
import javax.batch.operations.NoSuchJobException;
import javax.batch.operations.NoSuchJobExecutionException;
import javax.batch.operations.NoSuchJobInstanceException;
import javax.batch.runtime.BatchRuntime;
import javax.batch.runtime.BatchStatus;
import jakarta.batch.api.AbstractBatchlet;
import jakarta.batch.api.Batchlet;
import jakarta.batch.operations.JobExecutionIsRunningException;
import jakarta.batch.operations.JobOperator;
import jakarta.batch.operations.JobRestartException;
import jakarta.batch.operations.JobStartException;
import jakarta.batch.operations.NoSuchJobException;
import jakarta.batch.operations.NoSuchJobExecutionException;
import jakarta.batch.operations.NoSuchJobInstanceException;
import jakarta.batch.runtime.BatchRuntime;
import jakarta.batch.runtime.BatchStatus;
import javax.sql.DataSource;
import org.junit.Before;
@@ -243,7 +243,7 @@ public class JsrJobOperatorTests extends AbstractJsrTestCase {
when(jobExplorer.getJobExecutions(jobInstance)).thenReturn(executions);
List<javax.batch.runtime.JobExecution> jobExecutions = jsrJobOperator.getJobExecutions(jobInstance);
List<jakarta.batch.runtime.JobExecution> jobExecutions = jsrJobOperator.getJobExecutions(jobInstance);
assertEquals(1, jobExecutions.size());
assertEquals(2L, executions.get(0).getId().longValue());
}
@@ -279,7 +279,7 @@ public class JsrJobOperatorTests extends AbstractJsrTestCase {
when(jobExplorer.getJobExecution(5L)).thenReturn(execution);
when(jobExplorer.getJobInstance(1L)).thenReturn(instance);
javax.batch.runtime.JobInstance jobInstance = jsrJobOperator.getJobInstance(5L);
jakarta.batch.runtime.JobInstance jobInstance = jsrJobOperator.getJobInstance(5L);
assertEquals(1L, jobInstance.getInstanceId());
assertEquals("my job", jobInstance.getJobName());
@@ -324,7 +324,7 @@ public class JsrJobOperatorTests extends AbstractJsrTestCase {
when(jobExplorer.getJobInstances("myJob", 0, 3)).thenReturn(instances);
List<javax.batch.runtime.JobInstance> jobInstances = jsrJobOperator.getJobInstances("myJob", 0, 3);
List<jakarta.batch.runtime.JobInstance> jobInstances = jsrJobOperator.getJobInstances("myJob", 0, 3);
assertEquals(3, jobInstances.size());
assertEquals(1L, jobInstances.get(0).getInstanceId());
@@ -409,7 +409,7 @@ public class JsrJobOperatorTests extends AbstractJsrTestCase {
when(jobExplorer.getStepExecution(5L, 1L)).thenReturn(new StepExecution("step1", jobExecution, 1L));
when(jobExplorer.getStepExecution(5L, 2L)).thenReturn(new StepExecution("step2", jobExecution, 2L));
List<javax.batch.runtime.StepExecution> results = jsrJobOperator.getStepExecutions(5L);
List<jakarta.batch.runtime.StepExecution> results = jsrJobOperator.getStepExecutions(5L);
assertEquals("step1", results.get(0).getStepName());
assertEquals("step2", results.get(1).getStepName());
@@ -435,7 +435,7 @@ public class JsrJobOperatorTests extends AbstractJsrTestCase {
when(jobExplorer.getStepExecution(5L, 1L)).thenReturn(new StepExecution("step1", jobExecution, 1L));
when(jobExplorer.getStepExecution(5L, 2L)).thenReturn(new StepExecution("step2", jobExecution, 2L));
List<javax.batch.runtime.StepExecution> results = jsrJobOperator.getStepExecutions(5L);
List<jakarta.batch.runtime.StepExecution> results = jsrJobOperator.getStepExecutions(5L);
assertEquals("step1", results.get(0).getStepName());
assertEquals("step2", results.get(1).getStepName());
@@ -447,14 +447,14 @@ public class JsrJobOperatorTests extends AbstractJsrTestCase {
when(jobExplorer.getJobExecution(5L)).thenReturn(jobExecution);
List<javax.batch.runtime.StepExecution> results = jsrJobOperator.getStepExecutions(5L);
List<jakarta.batch.runtime.StepExecution> results = jsrJobOperator.getStepExecutions(5L);
assertEquals(0, results.size());
}
@Test
public void testStartRoseyScenario() throws Exception {
javax.batch.runtime.JobExecution execution = runJob("jsrJobOperatorTestJob", new Properties(), TIMEOUT);
jakarta.batch.runtime.JobExecution execution = runJob("jsrJobOperatorTestJob", new Properties(), TIMEOUT);
assertEquals(BatchStatus.COMPLETED, execution.getBatchStatus());
}
@@ -470,9 +470,9 @@ public class JsrJobOperatorTests extends AbstractJsrTestCase {
} catch (NoSuchJobException ignore) {
}
javax.batch.runtime.JobExecution execution1 = runJob("jsrJobOperatorTestJob", new Properties(), TIMEOUT);
javax.batch.runtime.JobExecution execution2 = runJob("jsrJobOperatorTestJob", new Properties(), TIMEOUT);
javax.batch.runtime.JobExecution execution3 = runJob("jsrJobOperatorTestJob", new Properties(), TIMEOUT);
jakarta.batch.runtime.JobExecution execution1 = runJob("jsrJobOperatorTestJob", new Properties(), TIMEOUT);
jakarta.batch.runtime.JobExecution execution2 = runJob("jsrJobOperatorTestJob", new Properties(), TIMEOUT);
jakarta.batch.runtime.JobExecution execution3 = runJob("jsrJobOperatorTestJob", new Properties(), TIMEOUT);
assertEquals(BatchStatus.COMPLETED, execution1.getBatchStatus());
assertEquals(BatchStatus.COMPLETED, execution2.getBatchStatus());
@@ -485,7 +485,7 @@ public class JsrJobOperatorTests extends AbstractJsrTestCase {
@Test
public void testRestartRoseyScenario() throws Exception {
javax.batch.runtime.JobExecution execution = runJob("jsrJobOperatorTestRestartJob", new Properties(), TIMEOUT);
jakarta.batch.runtime.JobExecution execution = runJob("jsrJobOperatorTestRestartJob", new Properties(), TIMEOUT);
assertEquals(BatchStatus.FAILED, execution.getBatchStatus());
@@ -496,7 +496,7 @@ public class JsrJobOperatorTests extends AbstractJsrTestCase {
@Test(expected = JobRestartException.class)
public void testNonRestartableJob() throws Exception {
javax.batch.runtime.JobExecution jobExecutionStart = runJob("jsrJobOperatorTestNonRestartableJob", new Properties(), TIMEOUT);
jakarta.batch.runtime.JobExecution jobExecutionStart = runJob("jsrJobOperatorTestNonRestartableJob", new Properties(), TIMEOUT);
assertEquals(BatchStatus.FAILED, jobExecutionStart.getBatchStatus());
restartJob(jobExecutionStart.getExecutionId(), null, TIMEOUT);
@@ -505,7 +505,7 @@ public class JsrJobOperatorTests extends AbstractJsrTestCase {
@Test(expected = JobRestartException.class)
public void testRestartAbandoned() throws Exception {
jsrJobOperator = BatchRuntime.getJobOperator();
javax.batch.runtime.JobExecution execution = runJob("jsrJobOperatorTestRestartAbandonJob", null, TIMEOUT);
jakarta.batch.runtime.JobExecution execution = runJob("jsrJobOperatorTestRestartAbandonJob", null, TIMEOUT);
assertEquals(BatchStatus.FAILED, execution.getBatchStatus());
@@ -616,7 +616,7 @@ public class JsrJobOperatorTests extends AbstractJsrTestCase {
@Test
public void testApplicationContextClosingAfterJobSuccessful() throws Exception {
for(int i = 0; i < 3; i++) {
javax.batch.runtime.JobExecution execution = runJob("contextClosingTests", new Properties(), TIMEOUT);
jakarta.batch.runtime.JobExecution execution = runJob("contextClosingTests", new Properties(), TIMEOUT);
assertEquals(BatchStatus.COMPLETED, execution.getBatchStatus());

View File

@@ -34,15 +34,15 @@ import org.springframework.jdbc.datasource.embedded.EmbeddedDatabase;
import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder;
import org.springframework.util.StopWatch;
import javax.batch.api.BatchProperty;
import javax.batch.api.partition.PartitionAnalyzer;
import javax.batch.api.partition.PartitionCollector;
import javax.batch.api.partition.PartitionMapper;
import javax.batch.api.partition.PartitionPlan;
import javax.batch.api.partition.PartitionPlanImpl;
import javax.batch.api.partition.PartitionReducer;
import javax.batch.runtime.BatchStatus;
import javax.inject.Inject;
import jakarta.batch.api.BatchProperty;
import jakarta.batch.api.partition.PartitionAnalyzer;
import jakarta.batch.api.partition.PartitionCollector;
import jakarta.batch.api.partition.PartitionMapper;
import jakarta.batch.api.partition.PartitionPlan;
import jakarta.batch.api.partition.PartitionPlanImpl;
import jakarta.batch.api.partition.PartitionReducer;
import jakarta.batch.runtime.BatchStatus;
import jakarta.inject.Inject;
import java.io.Serializable;
import java.util.Collection;
import java.util.Properties;
@@ -261,7 +261,7 @@ public class JsrPartitionHandlerTests extends AbstractJsrTestCase {
@Test
public void testRestartNoOverride() throws Exception {
javax.batch.runtime.JobExecution execution1 = runJob("jsrPartitionHandlerRestartWithOverrideJob", null, 1000000L);
jakarta.batch.runtime.JobExecution execution1 = runJob("jsrPartitionHandlerRestartWithOverrideJob", null, 1000000L);
assertEquals(BatchStatus.FAILED, execution1.getBatchStatus());
assertEquals(1, MyPartitionReducer.beginCount);
assertEquals(0, MyPartitionReducer.beforeCount);
@@ -272,7 +272,7 @@ public class JsrPartitionHandlerTests extends AbstractJsrTestCase {
MyPartitionReducer.reset();
CountingPartitionCollector.reset();
javax.batch.runtime.JobExecution execution2 = restartJob(execution1.getExecutionId(), null, 1000000L);
jakarta.batch.runtime.JobExecution execution2 = restartJob(execution1.getExecutionId(), null, 1000000L);
assertEquals(BatchStatus.COMPLETED, execution2.getBatchStatus());
assertEquals(1, MyPartitionReducer.beginCount);
assertEquals(1, MyPartitionReducer.beforeCount);
@@ -287,7 +287,7 @@ public class JsrPartitionHandlerTests extends AbstractJsrTestCase {
Properties jobParameters = new Properties();
jobParameters.put("mapper.override", "true");
javax.batch.runtime.JobExecution execution1 = runJob("jsrPartitionHandlerRestartWithOverrideJob", jobParameters, 1000000L);
jakarta.batch.runtime.JobExecution execution1 = runJob("jsrPartitionHandlerRestartWithOverrideJob", jobParameters, 1000000L);
assertEquals(BatchStatus.FAILED, execution1.getBatchStatus());
assertEquals(1, MyPartitionReducer.beginCount);
assertEquals(0, MyPartitionReducer.beforeCount);
@@ -298,7 +298,7 @@ public class JsrPartitionHandlerTests extends AbstractJsrTestCase {
MyPartitionReducer.reset();
CountingPartitionCollector.reset();
javax.batch.runtime.JobExecution execution2 = restartJob(execution1.getExecutionId(), jobParameters, 1000000L);
jakarta.batch.runtime.JobExecution execution2 = restartJob(execution1.getExecutionId(), jobParameters, 1000000L);
assertEquals(BatchStatus.COMPLETED, execution2.getBatchStatus());
assertEquals(1, MyPartitionReducer.beginCount);
assertEquals(1, MyPartitionReducer.beforeCount);

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2013 the original author or authors.
* Copyright 2013-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -22,7 +22,7 @@ import java.util.Queue;
import java.util.concurrent.ConcurrentLinkedQueue;
import java.util.concurrent.locks.ReentrantLock;
import javax.batch.api.partition.PartitionCollector;
import jakarta.batch.api.partition.PartitionCollector;
import org.junit.Test;
import org.springframework.batch.core.scope.context.ChunkContext;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2013-2020 the original author or authors.
* Copyright 2013-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -18,11 +18,11 @@ package org.springframework.batch.core.jsr.step;
import java.util.List;
import java.util.Properties;
import javax.batch.api.Decider;
import javax.batch.runtime.BatchRuntime;
import javax.batch.runtime.BatchStatus;
import javax.batch.runtime.JobExecution;
import javax.batch.runtime.StepExecution;
import jakarta.batch.api.Decider;
import jakarta.batch.runtime.BatchRuntime;
import jakarta.batch.runtime.BatchStatus;
import jakarta.batch.runtime.JobExecution;
import jakarta.batch.runtime.StepExecution;
import org.junit.Test;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2020 the original author or authors.
* Copyright 2020-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -22,15 +22,15 @@ import java.util.List;
import java.util.Properties;
import java.util.Set;
import javax.batch.api.AbstractBatchlet;
import javax.batch.api.Decider;
import javax.batch.operations.JobOperator;
import javax.batch.runtime.BatchRuntime;
import javax.batch.runtime.BatchStatus;
import javax.batch.runtime.JobExecution;
import javax.batch.runtime.StepExecution;
import javax.batch.runtime.context.JobContext;
import javax.inject.Inject;
import jakarta.batch.api.AbstractBatchlet;
import jakarta.batch.api.Decider;
import jakarta.batch.operations.JobOperator;
import jakarta.batch.runtime.BatchRuntime;
import jakarta.batch.runtime.BatchStatus;
import jakarta.batch.runtime.JobExecution;
import jakarta.batch.runtime.StepExecution;
import jakarta.batch.runtime.context.JobContext;
import jakarta.inject.Inject;
import org.junit.Test;

View File

@@ -20,8 +20,8 @@ import static org.mockito.Mockito.doThrow;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import javax.batch.api.Batchlet;
import javax.batch.operations.BatchRuntimeException;
import jakarta.batch.api.Batchlet;
import jakarta.batch.operations.BatchRuntimeException;
import org.junit.Before;
import org.junit.Rule;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2013 the original author or authors.
* Copyright 2013-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,7 +15,7 @@
*/
package org.springframework.batch.core.jsr.step.batchlet;
import javax.batch.api.Batchlet;
import jakarta.batch.api.Batchlet;
public class BatchletSupport implements Batchlet {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2013 the original author or authors.
* Copyright 2013-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,7 +15,7 @@
*/
package org.springframework.batch.core.jsr.step.batchlet;
import javax.batch.api.Batchlet;
import jakarta.batch.api.Batchlet;
/**
* <p>
@@ -23,6 +23,7 @@ import javax.batch.api.Batchlet;
* </p>
*
* @author Chris Schaefer
* @author Mahmoud Ben Hassine
*/
public class FailingBatchlet implements Batchlet {
@Override

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2013 the original author or authors.
* Copyright 2013-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,7 +15,7 @@
*/
package org.springframework.batch.core.jsr.step.batchlet;
import javax.batch.api.Batchlet;
import jakarta.batch.api.Batchlet;
public class RestartBatchlet implements Batchlet {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2014 the original author or authors.
* Copyright 2014-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,10 +15,10 @@
*/
package org.springframework.batch.core.jsr.step.listener;
import javax.batch.api.BatchProperty;
import javax.batch.api.listener.StepListener;
import javax.batch.runtime.context.JobContext;
import javax.inject.Inject;
import jakarta.batch.api.BatchProperty;
import jakarta.batch.api.listener.StepListener;
import jakarta.batch.runtime.context.JobContext;
import jakarta.inject.Inject;
/**
* <p>
@@ -27,6 +27,7 @@ import javax.inject.Inject;
* </p>
*
* @author Chris Schaefer
* @author Mahmoud Ben Hassine
* @since 3.0
*/
public class ExitStatusSettingStepListener implements StepListener {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2005-2014 the original author or authors.
* Copyright 2005-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -23,6 +23,7 @@ import java.io.FileReader;
import java.net.MalformedURLException;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.batch.core.ExitStatus;
@@ -39,6 +40,7 @@ import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.util.Assert;
@Ignore
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = {"/simple-job-launcher-context.xml", "/applicationContext-test1.xml"})
public class LdifReaderTests {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2005-2014 the original author or authors.
* Copyright 2005-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -22,6 +22,7 @@ import java.io.InputStreamReader;
import java.net.MalformedURLException;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.slf4j.Logger;
@@ -41,6 +42,7 @@ import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.util.Assert;
@Ignore
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = {"/simple-job-launcher-context.xml", "/applicationContext-test2.xml"})
public class MappingLdifReaderTests {

Some files were not shown because too many files have changed in this diff Show More