Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JBERET-532 jberet-support is not update with jberet.core 2.x #21

Merged
merged 11 commits into from
Jul 13, 2023
75 changes: 29 additions & 46 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,25 +18,23 @@
<parent>
<groupId>org.jberet</groupId>
<artifactId>jberet-parent</artifactId>
<version>1.4.8.Final</version>
<version>2.1.2.Final</version>
</parent>

<artifactId>jberet-support</artifactId>
<version>2.0.0.Beta1-SNAPSHOT</version>
<version>2.1.2.Final-SNAPSHOT</version>

<properties>
<modular.jdk.args/>
<surefire.system.args>-Xms512m -Xmx2g ${modular.jdk.args}</surefire.system.args>

<jvmArgs>-Xms512m -Xmx2g ${modular.jdk.args}</jvmArgs>
<version.org.jberet>${project.parent.version}</version.org.jberet>
<version.org.mongojack>2.8.2</version.org.mongojack>
<version.org.mongojack>2.10.0</version.org.mongojack>
<version.org.apache.kafka>0.9.0.0</version.org.apache.kafka>
<version.net.sf.jasperreports>6.17.0</version.net.sf.jasperreports>
<version.org.apache.activemq.artemis>2.19.1</version.org.apache.activemq.artemis>
<version.net.sf.jasperreports>6.20.0</version.net.sf.jasperreports>
<version.org.apache.activemq.artemis>2.26.0</version.org.apache.activemq.artemis>

<version.org.beanio>2.1.0</version.org.beanio>
<version.org.ow2.asm>5.0.4</version.org.ow2.asm>

</properties>

<dependencyManagement>
Expand Down Expand Up @@ -93,7 +91,7 @@
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>artemis-jms-server</artifactId>
<artifactId>artemis-jakarta-server</artifactId>
<version>${version.org.apache.activemq.artemis}</version>
<scope>test</scope>
</dependency>
Expand All @@ -114,11 +112,14 @@
</dependencies>
</dependencyManagement>


<dependencies>
<dependency>
<groupId>org.jboss.spec.javax.xml.bind</groupId>
<artifactId>jboss-jaxb-api_2.2_spec</artifactId>
<groupId>jakarta.enterprise</groupId>
<artifactId>jakarta.enterprise.cdi-api</artifactId>
</dependency>
<dependency>
<groupId>jakarta.xml.bind</groupId>
<artifactId>jakarta.xml.bind-api</artifactId>
</dependency>
<dependency>
<groupId>org.mongodb</groupId>
Expand All @@ -129,8 +130,8 @@
<artifactId>mongojack</artifactId>
</dependency>
<dependency>
<groupId>org.hibernate.javax.persistence</groupId>
<artifactId>hibernate-jpa-2.1-api</artifactId>
<groupId>jakarta.persistence</groupId>
<artifactId>jakarta.persistence-api</artifactId>
</dependency>

<dependency>
Expand Down Expand Up @@ -211,8 +212,8 @@

<!-- JMS reader & writer dependencies -->
<dependency>
<groupId>org.jboss.spec.javax.jms</groupId>
<artifactId>jboss-jms-api_2.0_spec</artifactId>
<groupId>jakarta.jms</groupId>
<artifactId>jakarta.jms-api</artifactId>
</dependency>

<!-- Kafka ItemReader & ItemWriter dependencies -->
Expand All @@ -223,20 +224,20 @@

<!-- Bean Validation dependencies -->
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
<groupId>jakarta.validation</groupId>
<artifactId>jakarta.validation-api</artifactId>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
</dependency>
<dependency>
<groupId>org.jboss.spec.javax.el</groupId>
<artifactId>jboss-el-api_3.0_spec</artifactId>
<groupId>jakarta.el</groupId>
<artifactId>jakarta.el-api</artifactId>
</dependency>
<dependency>
<groupId>org.glassfish</groupId>
<artifactId>javax.el</artifactId>
<artifactId>jakarta.el</artifactId>
</dependency>

<!-- JasperReports dependencies -->
Expand All @@ -247,8 +248,8 @@

<!-- JAX-RS dependencies -->
<dependency>
<groupId>org.jboss.spec.javax.ws.rs</groupId>
<artifactId>jboss-jaxrs-api_2.0_spec</artifactId>
<groupId>jakarta.ws.rs</groupId>
<artifactId>jakarta.ws.rs-api</artifactId>
</dependency>

<!-- Cassandra dependencies -->
Expand Down Expand Up @@ -280,20 +281,14 @@
<artifactId>weld-se-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss</groupId>
<artifactId>jandex</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.jboss.spec.javax.annotation</groupId>
<artifactId>jboss-annotations-api_1.3_spec</artifactId>
<groupId>jakarta.annotation</groupId>
<artifactId>jakarta.annotation-api</artifactId>
</dependency>
<dependency>
<groupId>org.jboss.spec.javax.transaction</groupId>
<artifactId>jboss-transaction-api_1.2_spec</artifactId>
<scope>test</scope>
<groupId>jakarta.transaction</groupId>
<artifactId>jakarta.transaction-api</artifactId>
</dependency>
<dependency>
<groupId>org.jboss.marshalling</groupId>
Expand All @@ -307,7 +302,7 @@
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>artemis-jms-server</artifactId>
<artifactId>artemis-jakarta-server</artifactId>
<scope>test</scope>
</dependency>
<dependency>
Expand All @@ -316,25 +311,13 @@
<version>${version.com.fasterxml.jackson}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jdk7</artifactId>
<version>2.5.3</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>${version.org.hibernate}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<version>${version.org.hibernate}</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>junit</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@
package org.jberet.support._private;

import java.util.Collection;
import javax.batch.operations.BatchRuntimeException;

import com.fasterxml.jackson.core.JsonLocation;
import org.jboss.logging.Messages;
import org.jboss.logging.annotations.Cause;
import org.jboss.logging.annotations.Message;
Expand All @@ -22,6 +20,10 @@
import org.supercsv.cellprocessor.ift.CellProcessor;
import org.supercsv.util.CsvContext;

import com.fasterxml.jackson.core.JsonLocation;

import jakarta.batch.operations.BatchRuntimeException;

@MessageBundle(projectCode = "JBERET")
@ValidIdRange(min = 60000, max = 60499)
public interface SupportMessages {
Expand Down
7 changes: 4 additions & 3 deletions src/main/java/org/jberet/support/io/ArrayItemReader.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,14 @@
import java.io.ByteArrayInputStream;
import java.io.Serializable;
import java.lang.reflect.Array;
import javax.enterprise.context.Dependent;
import javax.inject.Named;

import org.jberet.support._private.SupportLogger;

import jakarta.enterprise.context.Dependent;
import jakarta.inject.Named;

/**
* An implementation of {@code javax.batch.api.chunk.ItemReader} that reads from an array
* An implementation of {@code jakarta.batch.api.chunk.ItemReader} that reads from an array
* of data. The input {@link #resource} may be specified as a url or path to external resource,
* or an inlined content. In either case, the array resource content should be enclosed
* inside {@code []}. For example,
Expand Down
13 changes: 7 additions & 6 deletions src/main/java/org/jberet/support/io/ArtemisItemReader.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,20 @@
package org.jberet.support.io;

import java.io.Serializable;
import javax.batch.api.BatchProperty;
import javax.batch.api.chunk.ItemReader;
import javax.enterprise.context.Dependent;
import javax.inject.Inject;
import javax.inject.Named;

import org.apache.activemq.artemis.api.core.ActiveMQException;
import org.apache.activemq.artemis.api.core.client.ClientConsumer;
import org.apache.activemq.artemis.api.core.client.ClientMessage;
import org.jberet.support._private.SupportLogger;

import jakarta.batch.api.BatchProperty;
import jakarta.batch.api.chunk.ItemReader;
import jakarta.enterprise.context.Dependent;
import jakarta.inject.Inject;
import jakarta.inject.Named;

/**
* An implementation of {@code javax.batch.api.chunk.ItemReader} that reads data items from a Artemis address.
* An implementation of {@code jakarta.batch.api.chunk.ItemReader} that reads data items from a Artemis address.
* It handles the following types of Artemis messages:
* <p>
* <ul>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@
import java.io.Serializable;
import java.lang.reflect.Method;
import java.util.Map;
import javax.batch.api.BatchProperty;
import javax.enterprise.inject.Instance;
import javax.inject.Inject;

import org.apache.activemq.artemis.api.core.ActiveMQException;
import org.apache.activemq.artemis.api.core.SimpleString;
Expand All @@ -33,6 +30,10 @@
import org.jberet.support._private.SupportLogger;
import org.jberet.support._private.SupportMessages;

import jakarta.batch.api.BatchProperty;
import jakarta.enterprise.inject.Instance;
import jakarta.inject.Inject;

/**
* The base class for {@link ArtemisItemReader} and {@link ArtemisItemWriter}.
*
Expand All @@ -56,15 +57,15 @@ public abstract class ArtemisItemReaderWriterBase extends ItemReaderWriterBase {
* This field holds an optional injection of Artemis {@code ServerLocator}. When {@link #connectorFactoryParams} is
* not specified, and {@link #sessionFactoryInstance} is not satisfied, this field will be queried to obtain an
* instance of Artemis {@code ServerLocator}. The application may implement a
* {@code javax.enterprise.inject.Produces} method to satisfy this dependency injection.
* {@code jakarta.enterprise.inject.Produces} method to satisfy this dependency injection.
*/
@Inject
protected Instance<ServerLocator> serverLocatorInstance;

/**
* This field holds an optional injection of Artemis {@code ClientSessionFactory}. If this injection is satisfied,
* {@link #serverLocatorInstance} will be ignored. The application may implement a
* {@code javax.enterprise.inject.Produces} method to satisfy this dependency injection.
* {@code jakarta.enterprise.inject.Produces} method to satisfy this dependency injection.
*/
@Inject
protected Instance<ClientSessionFactory> sessionFactoryInstance;
Expand Down
13 changes: 7 additions & 6 deletions src/main/java/org/jberet/support/io/ArtemisItemWriter.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,20 @@

import java.io.Serializable;
import java.util.List;
import javax.batch.api.BatchProperty;
import javax.batch.api.chunk.ItemWriter;
import javax.enterprise.context.Dependent;
import javax.inject.Inject;
import javax.inject.Named;

import org.apache.activemq.artemis.api.core.ActiveMQException;
import org.apache.activemq.artemis.api.core.client.ClientMessage;
import org.apache.activemq.artemis.api.core.client.ClientProducer;
import org.jberet.support._private.SupportLogger;

import jakarta.batch.api.BatchProperty;
import jakarta.batch.api.chunk.ItemWriter;
import jakarta.enterprise.context.Dependent;
import jakarta.inject.Inject;
import jakarta.inject.Named;

/**
* An implementation of {@code javax.batch.api.chunk.ItemWriter} that sends data items to an Artemis address.
* An implementation of {@code jakarta.batch.api.chunk.ItemWriter} that sends data items to an Artemis address.
* It can send the following Artemis message types:
* <p>
* <ul>
Expand Down
13 changes: 7 additions & 6 deletions src/main/java/org/jberet/support/io/BeanIOItemReader.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,21 @@
import java.io.InputStreamReader;
import java.io.Reader;
import java.io.Serializable;
import javax.batch.api.BatchProperty;
import javax.batch.api.chunk.ItemReader;
import javax.enterprise.context.Dependent;
import javax.inject.Inject;
import javax.inject.Named;

import org.beanio.BeanReader;
import org.beanio.BeanReaderErrorHandler;
import org.beanio.StreamFactory;
import org.beanio.internal.util.LocaleUtil;
import org.jberet.support._private.SupportMessages;

import jakarta.batch.api.BatchProperty;
import jakarta.batch.api.chunk.ItemReader;
import jakarta.enterprise.context.Dependent;
import jakarta.inject.Inject;
import jakarta.inject.Named;

/**
* An implementation of {@code javax.batch.api.chunk.ItemReader} based on BeanIO. This reader class handles all
* An implementation of {@code jakarta.batch.api.chunk.ItemReader} based on BeanIO. This reader class handles all
* data formats that are supported by BeanIO, e.g., fixed length file, CSV file, XML, etc. It supports restart,
* ranged reading, custom error handler, and dynamic BeanIO mapping properties. {@link org.jberet.support.io.BeanIOItemReader}
* configurations are specified as reader properties in job xml, and BeanIO mapping xml file.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,17 @@
import java.util.Map;
import java.util.Properties;
import java.util.WeakHashMap;
import javax.batch.api.BatchProperty;
import javax.batch.runtime.context.JobContext;
import javax.inject.Inject;

import javax.naming.InitialContext;

import org.beanio.StreamFactory;
import org.jberet.support._private.SupportLogger;
import org.jberet.support._private.SupportMessages;

import jakarta.batch.api.BatchProperty;
import jakarta.batch.runtime.context.JobContext;
import jakarta.inject.Inject;

/**
* The base class of BeanIO-based reader and writer classes: {@link org.jberet.support.io.BeanIOItemReader} and
* {@link org.jberet.support.io.BeanIOItemWriter}.
Expand Down
14 changes: 7 additions & 7 deletions src/main/java/org/jberet/support/io/BeanIOItemWriter.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,17 @@
import java.io.Writer;
import java.util.List;

import javax.batch.api.BatchProperty;
import javax.batch.api.chunk.ItemWriter;
import javax.enterprise.context.Dependent;
import javax.inject.Inject;
import javax.inject.Named;

import org.beanio.BeanWriter;
import org.beanio.StreamFactory;

import jakarta.batch.api.BatchProperty;
import jakarta.batch.api.chunk.ItemWriter;
import jakarta.enterprise.context.Dependent;
import jakarta.inject.Inject;
import jakarta.inject.Named;

/**
* An implementation of {@code javax.batch.api.chunk.ItemWriter} based on BeanIO. This writer class handles all
* An implementation of {@code jakarta.batch.api.chunk.ItemWriter} based on BeanIO. This writer class handles all
* data formats that are supported by BeanIO, e.g., fixed length file, CSV file, XML, etc. It also supports
* dynamic BeanIO mapping properties, which are specified in job xml, injected into this class, and can be referenced
* in BeanIO mapping file. {@link org.jberet.support.io.BeanIOItemWriter} configurations are specified as
Expand Down
Loading