Skip to content

Commit

Permalink
Move transaction to shardingsphere-kernel module (apache#12119)
Browse files Browse the repository at this point in the history
* Move shardingsphere-transaction into kernel module

* Move shardingsphere-transaction into kernel module

* Rename shardingsphere-transaction to shardingsphere-kernel-transaction

* Rename shardingsphere-transaction to shardingsphere-kernel-transaction
  • Loading branch information
terrymanu authored Aug 30, 2021
1 parent 672dc2a commit 858a1ec
Show file tree
Hide file tree
Showing 147 changed files with 71 additions and 120 deletions.
10 changes: 5 additions & 5 deletions examples/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -95,27 +95,27 @@
</dependency>
<dependency>
<groupId>org.apache.shardingsphere</groupId>
<artifactId>shardingsphere-transaction-core</artifactId>
<artifactId>shardingsphere-kernel-transaction-core</artifactId>
<version>${shardingsphere.version}</version>
</dependency>
<dependency>
<groupId>org.apache.shardingsphere</groupId>
<artifactId>shardingsphere-transaction-xa-core</artifactId>
<artifactId>shardingsphere-kernel-transaction-xa-core</artifactId>
<version>${shardingsphere.version}</version>
</dependency>
<dependency>
<groupId>org.apache.shardingsphere</groupId>
<artifactId>shardingsphere-transaction-xa-bitronix</artifactId>
<artifactId>shardingsphere-kernel-transaction-xa-bitronix</artifactId>
<version>${shardingsphere.version}</version>
</dependency>
<dependency>
<groupId>org.apache.shardingsphere</groupId>
<artifactId>shardingsphere-transaction-xa-narayana</artifactId>
<artifactId>shardingsphere-kernel-transaction-xa-narayana</artifactId>
<version>${shardingsphere.version}</version>
</dependency>
<dependency>
<groupId>org.apache.shardingsphere</groupId>
<artifactId>shardingsphere-transaction-base-seata-at</artifactId>
<artifactId>shardingsphere-kernel-transaction-base-seata-at</artifactId>
<version>${shardingsphere.version}</version>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
</dependency>
<dependency>
<groupId>org.apache.shardingsphere</groupId>
<artifactId>shardingsphere-transaction-xa-core</artifactId>
<artifactId>shardingsphere-kernel-transaction-xa-core</artifactId>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@
</dependency>
<dependency>
<groupId>org.apache.shardingsphere</groupId>
<artifactId>shardingsphere-transaction-xa-core</artifactId>
<artifactId>shardingsphere-kernel-transaction-xa-core</artifactId>
</dependency>
<dependency>
<groupId>org.apache.shardingsphere</groupId>
<artifactId>shardingsphere-transaction-xa-bitronix</artifactId>
<artifactId>shardingsphere-kernel-transaction-xa-bitronix</artifactId>
</dependency>
<dependency>
<groupId>org.codehaus.btm</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@
</dependency>
<dependency>
<groupId>org.apache.shardingsphere</groupId>
<artifactId>shardingsphere-transaction-xa-core</artifactId>
<artifactId>shardingsphere-kernel-transaction-xa-core</artifactId>
</dependency>
<dependency>
<groupId>org.apache.shardingsphere</groupId>
<artifactId>shardingsphere-transaction-xa-narayana</artifactId>
<artifactId>shardingsphere-kernel-transaction-xa-narayana</artifactId>
</dependency>
<dependency>
<groupId>org.jboss.narayana.jta</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<dependencies>
<dependency>
<groupId>org.apache.shardingsphere</groupId>
<artifactId>shardingsphere-transaction-xa-core</artifactId>
<artifactId>shardingsphere-kernel-transaction-xa-core</artifactId>
</dependency>
<dependency>
<groupId>org.apache.shardingsphere</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<dependencies>
<dependency>
<groupId>org.apache.shardingsphere</groupId>
<artifactId>shardingsphere-transaction-xa-core</artifactId>
<artifactId>shardingsphere-kernel-transaction-xa-core</artifactId>
</dependency>
<dependency>
<groupId>org.apache.shardingsphere</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
</dependency>
<dependency>
<groupId>org.apache.shardingsphere</groupId>
<artifactId>shardingsphere-transaction-base-seata-at</artifactId>
<artifactId>shardingsphere-kernel-transaction-base-seata-at</artifactId>
</dependency>
<dependency>
<groupId>io.seata</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<dependencies>
<dependency>
<groupId>org.apache.shardingsphere</groupId>
<artifactId>shardingsphere-transaction-base-seata-at</artifactId>
<artifactId>shardingsphere-kernel-transaction-base-seata-at</artifactId>
</dependency>
<dependency>
<groupId>org.apache.shardingsphere</groupId>
Expand Down
1 change: 0 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
<module>shardingsphere-features</module>
<module>shardingsphere-agent</module>
<module>shardingsphere-scaling</module>
<module>shardingsphere-transaction</module>

<module>shardingsphere-test</module>
<module>shardingsphere-distribution</module>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,17 @@

<dependency>
<groupId>org.apache.shardingsphere</groupId>
<artifactId>shardingsphere-transaction-xa-narayana</artifactId>
<artifactId>shardingsphere-kernel-transaction-xa-narayana</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.shardingsphere</groupId>
<artifactId>shardingsphere-transaction-xa-bitronix</artifactId>
<artifactId>shardingsphere-kernel-transaction-xa-bitronix</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.shardingsphere</groupId>
<artifactId>shardingsphere-transaction-base-seata-at</artifactId>
<artifactId>shardingsphere-kernel-transaction-base-seata-at</artifactId>
<version>${project.version}</version>
</dependency>

Expand Down
2 changes: 1 addition & 1 deletion shardingsphere-infra/shardingsphere-infra-context/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
</dependency>
<dependency>
<groupId>org.apache.shardingsphere</groupId>
<artifactId>shardingsphere-transaction-core</artifactId>
<artifactId>shardingsphere-kernel-transaction-core</artifactId>
<version>${project.version}</version>
</dependency>

Expand Down
2 changes: 1 addition & 1 deletion shardingsphere-jdbc/shardingsphere-jdbc-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<dependencies>
<dependency>
<groupId>org.apache.shardingsphere</groupId>
<artifactId>shardingsphere-transaction-core</artifactId>
<artifactId>shardingsphere-kernel-transaction-core</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<dependencies>
<dependency>
<groupId>org.apache.shardingsphere</groupId>
<artifactId>shardingsphere-transaction-core</artifactId>
<artifactId>shardingsphere-kernel-transaction-core</artifactId>
<version>${project.version}</version>
</dependency>

Expand Down
1 change: 1 addition & 0 deletions shardingsphere-kernel/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,6 @@

<modules>
<module>shardingsphere-kernel-authority</module>
<module>shardingsphere-kernel-transaction</module>
</modules>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,17 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.shardingsphere</groupId>
<artifactId>shardingsphere</artifactId>
<artifactId>shardingsphere-kernel</artifactId>
<version>5.0.0-RC1-SNAPSHOT</version>
</parent>
<artifactId>shardingsphere-transaction</artifactId>
<artifactId>shardingsphere-kernel-transaction</artifactId>
<packaging>pom</packaging>
<name>${project.artifactId}</name>

<modules>
<module>shardingsphere-transaction-core</module>
<module>shardingsphere-transaction-2pc</module>
<module>shardingsphere-transaction-base</module>
<module>shardingsphere-kernel-transaction-core</module>
<module>shardingsphere-kernel-transaction-2pc</module>
<module>shardingsphere-kernel-transaction-base</module>
</modules>

<dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.shardingsphere</groupId>
<artifactId>shardingsphere-transaction</artifactId>
<artifactId>shardingsphere-kernel-transaction</artifactId>
<version>5.0.0-RC1-SNAPSHOT</version>
</parent>
<artifactId>shardingsphere-transaction-2pc</artifactId>
<artifactId>shardingsphere-kernel-transaction-2pc</artifactId>
<packaging>pom</packaging>
<name>${project.artifactId}</name>

<modules>
<module>shardingsphere-transaction-xa</module>
<module>shardingsphere-kernel-transaction-xa</module>
</modules>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,19 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.shardingsphere</groupId>
<artifactId>shardingsphere-transaction-2pc</artifactId>
<artifactId>shardingsphere-kernel-transaction-2pc</artifactId>
<version>5.0.0-RC1-SNAPSHOT</version>
</parent>
<artifactId>shardingsphere-transaction-xa</artifactId>
<artifactId>shardingsphere-kernel-transaction-xa</artifactId>
<name>${project.artifactId}</name>
<packaging>pom</packaging>

<modules>
<module>shardingsphere-transaction-xa-spi</module>
<module>shardingsphere-transaction-xa-core</module>
<module>shardingsphere-kernel-transaction-xa-spi</module>
<module>shardingsphere-kernel-transaction-xa-core</module>

<module>shardingsphere-transaction-xa-atomikos</module>
<module>shardingsphere-transaction-xa-narayana</module>
<module>shardingsphere-transaction-xa-bitronix</module>
<module>shardingsphere-kernel-transaction-xa-atomikos</module>
<module>shardingsphere-kernel-transaction-xa-narayana</module>
<module>shardingsphere-kernel-transaction-xa-bitronix</module>
</modules>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,16 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.shardingsphere</groupId>
<artifactId>shardingsphere-transaction-xa</artifactId>
<artifactId>shardingsphere-kernel-transaction-xa</artifactId>
<version>5.0.0-RC1-SNAPSHOT</version>
</parent>
<artifactId>shardingsphere-transaction-xa-atomikos</artifactId>
<artifactId>shardingsphere-kernel-transaction-xa-atomikos</artifactId>
<name>${project.artifactId}</name>

<dependencies>
<dependency>
<groupId>org.apache.shardingsphere</groupId>
<artifactId>shardingsphere-transaction-xa-spi</artifactId>
<artifactId>shardingsphere-kernel-transaction-xa-spi</artifactId>
<version>${project.version}</version>
</dependency>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ public final class ReflectiveUtil {
* @return field
*/
private static Field getField(final Object target, final String fieldName) {
Class clazz = target.getClass();
while (clazz != null) {
Class<?> clazz = target.getClass();
while (null != clazz) {
try {
return clazz.getDeclaredField(fieldName);
} catch (final NoSuchFieldException ignored) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,16 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.shardingsphere</groupId>
<artifactId>shardingsphere-transaction-xa</artifactId>
<artifactId>shardingsphere-kernel-transaction-xa</artifactId>
<version>5.0.0-RC1-SNAPSHOT</version>
</parent>
<artifactId>shardingsphere-transaction-xa-bitronix</artifactId>
<artifactId>shardingsphere-kernel-transaction-xa-bitronix</artifactId>
<name>${project.artifactId}</name>

<dependencies>
<dependency>
<groupId>org.apache.shardingsphere</groupId>
<artifactId>shardingsphere-transaction-xa-spi</artifactId>
<artifactId>shardingsphere-kernel-transaction-xa-spi</artifactId>
<version>${project.version}</version>
</dependency>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,12 @@
package org.apache.shardingsphere.transaction.xa.bitronix.manager.fixture;

import com.google.common.base.Preconditions;
import java.lang.reflect.Field;
import lombok.AccessLevel;
import lombok.NoArgsConstructor;
import lombok.SneakyThrows;

import java.lang.reflect.Field;

/**
* Reflective utility.
*/
Expand All @@ -36,8 +37,8 @@ public final class ReflectiveUtil {
* @return field
*/
private static Field getField(final Object target, final String fieldName) {
Class clazz = target.getClass();
while (clazz != null) {
Class<?> clazz = target.getClass();
while (null != clazz) {
try {
return clazz.getDeclaredField(fieldName);
} catch (final NoSuchFieldException ignored) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,21 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.shardingsphere</groupId>
<artifactId>shardingsphere-transaction-xa</artifactId>
<artifactId>shardingsphere-kernel-transaction-xa</artifactId>
<version>5.0.0-RC1-SNAPSHOT</version>
</parent>
<artifactId>shardingsphere-transaction-xa-core</artifactId>
<artifactId>shardingsphere-kernel-transaction-xa-core</artifactId>
<name>${project.artifactId}</name>

<dependencies>
<dependency>
<groupId>org.apache.shardingsphere</groupId>
<artifactId>shardingsphere-transaction-xa-spi</artifactId>
<artifactId>shardingsphere-kernel-transaction-xa-spi</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.shardingsphere</groupId>
<artifactId>shardingsphere-transaction-xa-atomikos</artifactId>
<artifactId>shardingsphere-kernel-transaction-xa-atomikos</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,12 @@
@RequiredArgsConstructor
public final class OracleXAConnectionWrapper implements XAConnectionWrapper {

@SuppressWarnings("unchecked")
@SneakyThrows({SQLException.class, ReflectiveOperationException.class})
@Override
public XAConnection wrap(final XADataSource xaDataSource, final Connection connection) {
Connection physicalConnection = (Connection) connection.unwrap(Class.forName("oracle.jdbc.internal.OracleConnection"));
Class clazz = Class.forName("oracle.jdbc.xa.client.OracleXAConnection");
Constructor constructor = clazz.getConstructor(Connection.class);
Class<?> clazz = Class.forName("oracle.jdbc.xa.client.OracleXAConnection");
Constructor<?> constructor = clazz.getConstructor(Connection.class);
return (XAConnection) constructor.newInstance(physicalConnection);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,16 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.shardingsphere</groupId>
<artifactId>shardingsphere-transaction-xa</artifactId>
<artifactId>shardingsphere-kernel-transaction-xa</artifactId>
<version>5.0.0-RC1-SNAPSHOT</version>
</parent>
<artifactId>shardingsphere-transaction-xa-narayana</artifactId>
<artifactId>shardingsphere-kernel-transaction-xa-narayana</artifactId>
<name>${project.artifactId}</name>

<dependencies>
<dependency>
<groupId>org.apache.shardingsphere</groupId>
<artifactId>shardingsphere-transaction-xa-spi</artifactId>
<artifactId>shardingsphere-kernel-transaction-xa-spi</artifactId>
<version>${project.version}</version>
</dependency>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ public final class ReflectiveUtil {
* @return field
*/
private static Field getField(final Object target, final String fieldName) {
Class clazz = target.getClass();
while (clazz != null) {
Class<?> clazz = target.getClass();
while (null != clazz) {
try {
return clazz.getDeclaredField(fieldName);
} catch (final NoSuchFieldException ignored) {
Expand Down
Loading

0 comments on commit 858a1ec

Please sign in to comment.