Skip to content

Commit

Permalink
feature: saga-remove spring (apache#6370)
Browse files Browse the repository at this point in the history
  • Loading branch information
wt-better committed Feb 29, 2024
1 parent 1939a9f commit 709bd30
Show file tree
Hide file tree
Showing 67 changed files with 669 additions and 451 deletions.
10 changes: 2 additions & 8 deletions all/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -316,19 +316,13 @@
</dependency>
<dependency>
<groupId>org.apache.seata</groupId>
<artifactId>seata-saga-tm</artifactId>
<artifactId>seata-saga-engine-store</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.seata</groupId>
<artifactId>seata-saga-engine-store</artifactId>
<artifactId>seata-saga-spring</artifactId>
<version>${project.version}</version>
<exclusions>
<exclusion>
<groupId>${project.groupId}</groupId>
<artifactId>seata-serializer-all</artifactId>
</exclusion>
</exclusions>
</dependency>

<!-- spring -->
Expand Down
5 changes: 0 additions & 5 deletions bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -333,11 +333,6 @@
<artifactId>seata-saga-rm</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.seata</groupId>
<artifactId>seata-saga-tm</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.seata</groupId>
<artifactId>seata-saga-engine-store</artifactId>
Expand Down
1 change: 1 addition & 0 deletions changes/en-us/2.x.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ Add changes here for all PR submitted to the 2.x branch.
<!-- Please add the `changes` to the following location(feature/bugfix/optimize/test) based on the type of PR -->

### feature:
- [[#6370](https://github.com/seata/seata/pull/6370)] seata saga decouple spring, optimize architecture.
- [[#6205](https://github.com/apache/incubator-seata/pull/6205)] mock server
- [[#6169](https://github.com/apache/incubator-seata/pull/6169)] full support for states in the refactored state machine designer

Expand Down
1 change: 1 addition & 0 deletions changes/zh-cn/2.x.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<!-- 请根据PR的类型添加 `变更记录` 到以下对应位置(feature/bugfix/optimize/test) 下 -->

### feature:
- [[#6370](https://github.com/seata/seata/pull/6370)] seata saga spring接耦、架构优化。
- [[#6205](https://github.com/apache/incubator-seata/pull/6205)] 提供mock server
- [[#6169](https://github.com/apache/incubator-seata/pull/6169)] 支持新版本状态机设计器

Expand Down
19 changes: 19 additions & 0 deletions common/src/main/java/org/apache/seata/common/util/StringUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -427,4 +427,23 @@ public static String join(Iterator iterator, String separator) {
return builder.toString();
}

public static boolean hasLength(CharSequence str) {
return str != null && str.length() > 0;
}


public static boolean hasText(CharSequence str) {
if (str == null || str.length() == 0) {
return false;
}

int strLen = str.length();
for (int i = 0; i < strLen; i++) {
if (!Character.isWhitespace(str.charAt(i))) {
return true;
}
}
return false;
}

}
12 changes: 1 addition & 11 deletions compatible/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,7 @@
<dependencies>
<dependency>
<groupId>org.apache.seata</groupId>
<artifactId>seata-saga-engine</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.seata</groupId>
<artifactId>seata-saga-engine-store</artifactId>
<artifactId>seata-saga-spring</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
Expand Down Expand Up @@ -82,11 +77,6 @@
<artifactId>seata-rm-datasource</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.seata</groupId>
<artifactId>seata-integration-tx-api</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
import org.apache.seata.saga.engine.store.StateLogStore;
import org.apache.seata.saga.engine.strategy.StatusDecisionStrategy;
import org.apache.seata.saga.proctrl.eventing.impl.ProcessCtrlEventPublisher;
import org.springframework.context.ApplicationContext;

import javax.script.ScriptEngineManager;
import java.util.concurrent.ThreadPoolExecutor;
Expand Down Expand Up @@ -121,13 +120,6 @@ public interface StateMachineConfig {
*/
ProcessCtrlEventPublisher getAsyncProcessCtrlEventPublisher();

/**
* Gets get application context.
*
* @return the get application context
*/
ApplicationContext getApplicationContext();

/**
* Gets get thread pool executor.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@
import org.springframework.beans.factory.InitializingBean;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.core.io.Resource;

import javax.script.ScriptEngineManager;
import java.io.IOException;
import java.io.InputStream;
import java.util.List;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.stream.Collectors;
Expand Down Expand Up @@ -146,8 +146,8 @@ public StateMachine registryStateMachine(StateMachine stateMachine) {
}

@Override
public void registryByResources(Resource[] resources, String tenantId) throws IOException {
repository.registryByResources(resources, tenantId);
public void registryByResources(InputStream[] resourceAsStreamArray, String tenantId) throws IOException{
repository.registryByResources(resourceAsStreamArray, tenantId);
}
};
}
Expand Down Expand Up @@ -189,7 +189,6 @@ public void setAsyncProcessCtrlEventPublisher(ProcessCtrlEventPublisher asyncPro
actual.setAsyncProcessCtrlEventPublisher(asyncProcessCtrlEventPublisher);
}

@Override
public ApplicationContext getApplicationContext() {
return actual.getApplicationContext();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,14 @@
*/
public enum InvocationHandlerType {

GlobalTransactional, TwoPhaseAnnotation
/**
* GlobalTransactional InvocationHandler
*/
GlobalTransactional,

/**
* TwoPhase InvocationHandler
*/
TwoPhaseAnnotation

}
2 changes: 1 addition & 1 deletion saga/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@
<module>seata-saga-statelang</module>
<module>seata-saga-engine</module>
<module>seata-saga-rm</module>
<module>seata-saga-tm</module>
<module>seata-saga-engine-store</module>
<module>seata-saga-spring</module>
</modules>

<dependencies>
Expand Down
11 changes: 3 additions & 8 deletions saga/seata-saga-engine-store/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,22 +33,17 @@
<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>seata-saga-engine</artifactId>
<artifactId>seata-saga-statelang</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>seata-saga-rm</artifactId>
<artifactId>seata-saga-processctrl</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>seata-saga-tm</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>seata-serializer-all</artifactId>
<artifactId>seata-common</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,4 @@ public interface StateLangStore {
* @return whether the store state machine action is successful
*/
boolean storeStateMachine(StateMachine stateMachine);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -114,4 +114,4 @@ public interface StateLogStore {
* clear the LocalThread
*/
void clearUp();
}
}

This file was deleted.

16 changes: 7 additions & 9 deletions saga/seata-saga-engine/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,20 +38,18 @@
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>seata-saga-processctrl</artifactId>
<artifactId>seata-saga-engine-store</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
<groupId>${project.groupId}</groupId>
<artifactId>seata-saga-processctrl</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-expression</artifactId>
<groupId>${project.groupId}</groupId>
<artifactId>seata-tm</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
*/
package org.apache.seata.saga.engine;

import java.util.concurrent.ThreadPoolExecutor;

import org.apache.seata.saga.engine.expression.ExpressionFactoryManager;
import org.apache.seata.saga.engine.expression.ExpressionResolver;
import org.apache.seata.saga.engine.invoker.ServiceInvokerManager;
Expand All @@ -28,9 +26,9 @@
import org.apache.seata.saga.engine.store.StateLogStore;
import org.apache.seata.saga.engine.strategy.StatusDecisionStrategy;
import org.apache.seata.saga.proctrl.eventing.impl.ProcessCtrlEventPublisher;
import org.springframework.context.ApplicationContext;

import javax.script.ScriptEngineManager;
import java.util.concurrent.ThreadPoolExecutor;

/**
* StateMachineConfig
Expand Down Expand Up @@ -122,13 +120,6 @@ public interface StateMachineConfig {
*/
ProcessCtrlEventPublisher getAsyncProcessCtrlEventPublisher();

/**
* Gets get application context.
*
* @return the get application context
*/
ApplicationContext getApplicationContext();

/**
* Gets get thread pool executor.
*
Expand Down
Loading

0 comments on commit 709bd30

Please sign in to comment.