diff --git a/.springjavaformatconfig b/.springjavaformatconfig
deleted file mode 100644
index 6d408bb83..000000000
--- a/.springjavaformatconfig
+++ /dev/null
@@ -1 +0,0 @@
-java-baseline=8
diff --git a/pigx-app-server/pigx-app-server-api/pom.xml b/pigx-app-server/pigx-app-server-api/pom.xml
index f4b999884..cc11facec 100644
--- a/pigx-app-server/pigx-app-server-api/pom.xml
+++ b/pigx-app-server/pigx-app-server-api/pom.xml
@@ -7,7 +7,7 @@
com.pig4cloud
pigx-app-server
- 5.1.0
+ 5.2.0-snapshot
pigx-app-server-api
diff --git a/pigx-app-server/pigx-app-server-biz/pom.xml b/pigx-app-server/pigx-app-server-biz/pom.xml
index 64e4c68e0..fcc52f199 100644
--- a/pigx-app-server/pigx-app-server-biz/pom.xml
+++ b/pigx-app-server/pigx-app-server-biz/pom.xml
@@ -7,7 +7,7 @@
com.pig4cloud
pigx-app-server
- 5.1.0
+ 5.2.0-snapshot
pigx-app-server-biz
@@ -62,7 +62,7 @@
com.pig4cloud
pigx-app-server-api
- 5.1.0
+ 5.2.0-snapshot
diff --git a/pigx-app-server/pom.xml b/pigx-app-server/pom.xml
index 988444e5c..72935dd40 100644
--- a/pigx-app-server/pom.xml
+++ b/pigx-app-server/pom.xml
@@ -7,7 +7,7 @@
com.pig4cloud
pigx
- 5.1.0
+ 5.2.0-snapshot
pigx-app-server
diff --git a/pigx-auth/pom.xml b/pigx-auth/pom.xml
index d2b2f79ce..8c9a53bf3 100644
--- a/pigx-auth/pom.xml
+++ b/pigx-auth/pom.xml
@@ -24,7 +24,7 @@
com.pig4cloud
pigx
- 5.1.0
+ 5.2.0-snapshot
pigx-auth
diff --git a/pigx-common/pigx-common-audit/pom.xml b/pigx-common/pigx-common-audit/pom.xml
index e4342b9dd..3b2823a4c 100644
--- a/pigx-common/pigx-common-audit/pom.xml
+++ b/pigx-common/pigx-common-audit/pom.xml
@@ -5,7 +5,7 @@
com.pig4cloud
pigx-common
- 5.1.0
+ 5.2.0-snapshot
pigx-common-audit
diff --git a/pigx-common/pigx-common-bom/pom.xml b/pigx-common/pigx-common-bom/pom.xml
index 00ff3f6c9..06e45a16e 100644
--- a/pigx-common/pigx-common-bom/pom.xml
+++ b/pigx-common/pigx-common-bom/pom.xml
@@ -17,7 +17,7 @@
pigx 公共版本控制
- 5.1.0
+ 5.2.0-snapshot
3.5.3.1
1.4.5
3.6.0
@@ -44,7 +44,6 @@
1.6.1
7.1
2.17.1
- 0.0.23
0.33.0
1.0.0
1.8.4
diff --git a/pigx-common/pigx-common-core/pom.xml b/pigx-common/pigx-common-core/pom.xml
index 6414fbf1e..8db380af3 100644
--- a/pigx-common/pigx-common-core/pom.xml
+++ b/pigx-common/pigx-common-core/pom.xml
@@ -24,7 +24,7 @@
com.pig4cloud
pigx-common
- 5.1.0
+ 5.2.0-snapshot
pigx-common-core
diff --git a/pigx-common/pigx-common-data/pom.xml b/pigx-common/pigx-common-data/pom.xml
index 585135e45..fc8a8e6d3 100644
--- a/pigx-common/pigx-common-data/pom.xml
+++ b/pigx-common/pigx-common-data/pom.xml
@@ -24,7 +24,7 @@
com.pig4cloud
pigx-common
- 5.1.0
+ 5.2.0-snapshot
pigx-common-data
diff --git a/pigx-common/pigx-common-datasource/pom.xml b/pigx-common/pigx-common-datasource/pom.xml
index 204e40315..14b1fde24 100644
--- a/pigx-common/pigx-common-datasource/pom.xml
+++ b/pigx-common/pigx-common-datasource/pom.xml
@@ -5,7 +5,7 @@
pigx-common
com.pig4cloud
- 5.1.0
+ 5.2.0-snapshot
4.0.0
diff --git a/pigx-common/pigx-common-encrypt-api/pom.xml b/pigx-common/pigx-common-encrypt-api/pom.xml
index cc510db3b..14f469647 100644
--- a/pigx-common/pigx-common-encrypt-api/pom.xml
+++ b/pigx-common/pigx-common-encrypt-api/pom.xml
@@ -24,7 +24,7 @@
com.pig4cloud
pigx-common
- 5.1.0
+ 5.2.0-snapshot
pigx-common-encrypt-api
diff --git a/pigx-common/pigx-common-excel/pom.xml b/pigx-common/pigx-common-excel/pom.xml
index af82ad335..cbd39297b 100644
--- a/pigx-common/pigx-common-excel/pom.xml
+++ b/pigx-common/pigx-common-excel/pom.xml
@@ -24,7 +24,7 @@
com.pig4cloud
pigx-common
- 5.1.0
+ 5.2.0-snapshot
pigx-common-excel
diff --git a/pigx-common/pigx-common-feign/pom.xml b/pigx-common/pigx-common-feign/pom.xml
index babe93b74..a3bec2cd7 100755
--- a/pigx-common/pigx-common-feign/pom.xml
+++ b/pigx-common/pigx-common-feign/pom.xml
@@ -5,7 +5,7 @@
com.pig4cloud
pigx-common
- 5.1.0
+ 5.2.0-snapshot
4.0.0
diff --git a/pigx-common/pigx-common-gateway/pom.xml b/pigx-common/pigx-common-gateway/pom.xml
index 5c7ea2973..d0e71e6f4 100644
--- a/pigx-common/pigx-common-gateway/pom.xml
+++ b/pigx-common/pigx-common-gateway/pom.xml
@@ -24,7 +24,7 @@
com.pig4cloud
pigx-common
- 5.1.0
+ 5.2.0-snapshot
pigx-common-gateway
diff --git a/pigx-common/pigx-common-gray/pom.xml b/pigx-common/pigx-common-gray/pom.xml
index 6def8ded3..7f76a24b1 100644
--- a/pigx-common/pigx-common-gray/pom.xml
+++ b/pigx-common/pigx-common-gray/pom.xml
@@ -24,7 +24,7 @@
com.pig4cloud
pigx-common
- 5.1.0
+ 5.2.0-snapshot
pigx-common-gray
diff --git a/pigx-common/pigx-common-idempotent/pom.xml b/pigx-common/pigx-common-idempotent/pom.xml
index bf9728c5b..2282bb4a4 100644
--- a/pigx-common/pigx-common-idempotent/pom.xml
+++ b/pigx-common/pigx-common-idempotent/pom.xml
@@ -5,7 +5,7 @@
com.pig4cloud
pigx-common
- 5.1.0
+ 5.2.0-snapshot
pigx-common-idempotent
diff --git a/pigx-common/pigx-common-job/pom.xml b/pigx-common/pigx-common-job/pom.xml
index 3dd9eb800..9ff8fa0e4 100644
--- a/pigx-common/pigx-common-job/pom.xml
+++ b/pigx-common/pigx-common-job/pom.xml
@@ -24,7 +24,7 @@
com.pig4cloud
pigx-common
- 5.1.0
+ 5.2.0-snapshot
pigx-common-job
diff --git a/pigx-common/pigx-common-log/pom.xml b/pigx-common/pigx-common-log/pom.xml
index 1db78e8bd..e9cc4b9c4 100644
--- a/pigx-common/pigx-common-log/pom.xml
+++ b/pigx-common/pigx-common-log/pom.xml
@@ -24,7 +24,7 @@
com.pig4cloud
pigx-common
- 5.1.0
+ 5.2.0-snapshot
pigx-common-log
diff --git a/pigx-common/pigx-common-oss/pom.xml b/pigx-common/pigx-common-oss/pom.xml
index 92e4f9abd..f81654c0f 100755
--- a/pigx-common/pigx-common-oss/pom.xml
+++ b/pigx-common/pigx-common-oss/pom.xml
@@ -6,7 +6,7 @@
com.pig4cloud
pigx-common
- 5.1.0
+ 5.2.0-snapshot
pigx-common-oss
diff --git a/pigx-common/pigx-common-seata/pom.xml b/pigx-common/pigx-common-seata/pom.xml
index 69f8dc81f..d8b7bde05 100644
--- a/pigx-common/pigx-common-seata/pom.xml
+++ b/pigx-common/pigx-common-seata/pom.xml
@@ -23,7 +23,7 @@
com.pig4cloud
pigx-common
- 5.1.0
+ 5.2.0-snapshot
pigx-common-seata
diff --git a/pigx-common/pigx-common-security/pom.xml b/pigx-common/pigx-common-security/pom.xml
index 3923914dd..7605e794f 100644
--- a/pigx-common/pigx-common-security/pom.xml
+++ b/pigx-common/pigx-common-security/pom.xml
@@ -23,7 +23,7 @@
com.pig4cloud
pigx-common
- 5.1.0
+ 5.2.0-snapshot
pigx-common-security
diff --git a/pigx-common/pigx-common-sentinel/pom.xml b/pigx-common/pigx-common-sentinel/pom.xml
index 8db4ea5ed..a5bcaa8e8 100755
--- a/pigx-common/pigx-common-sentinel/pom.xml
+++ b/pigx-common/pigx-common-sentinel/pom.xml
@@ -5,7 +5,7 @@
com.pig4cloud
pigx-common
- 5.1.0
+ 5.2.0-snapshot
4.0.0
diff --git a/pigx-common/pigx-common-sequence/pom.xml b/pigx-common/pigx-common-sequence/pom.xml
index fbb08ee1b..748d47fab 100755
--- a/pigx-common/pigx-common-sequence/pom.xml
+++ b/pigx-common/pigx-common-sequence/pom.xml
@@ -6,7 +6,7 @@
com.pig4cloud
pigx-common
- 5.1.0
+ 5.2.0-snapshot
pigx-common-sequence
diff --git a/pigx-common/pigx-common-swagger/pom.xml b/pigx-common/pigx-common-swagger/pom.xml
index 0a63ce543..7d295af95 100644
--- a/pigx-common/pigx-common-swagger/pom.xml
+++ b/pigx-common/pigx-common-swagger/pom.xml
@@ -24,7 +24,7 @@
com.pig4cloud
pigx-common
- 5.1.0
+ 5.2.0-snapshot
pigx-common-swagger
diff --git a/pigx-common/pigx-common-websocket/pom.xml b/pigx-common/pigx-common-websocket/pom.xml
index beab15c57..2976f0ec5 100755
--- a/pigx-common/pigx-common-websocket/pom.xml
+++ b/pigx-common/pigx-common-websocket/pom.xml
@@ -6,7 +6,7 @@
com.pig4cloud
pigx-common
- 5.1.0
+ 5.2.0-snapshot
pigx-common-websocket
diff --git a/pigx-common/pigx-common-xss/pom.xml b/pigx-common/pigx-common-xss/pom.xml
index 99b52cf79..7b761ec0a 100755
--- a/pigx-common/pigx-common-xss/pom.xml
+++ b/pigx-common/pigx-common-xss/pom.xml
@@ -6,7 +6,7 @@
com.pig4cloud
pigx-common
- 5.1.0
+ 5.2.0-snapshot
pigx-common-xss
diff --git a/pigx-common/pom.xml b/pigx-common/pom.xml
index 8c6f1be95..976e14810 100644
--- a/pigx-common/pom.xml
+++ b/pigx-common/pom.xml
@@ -24,7 +24,7 @@
com.pig4cloud
pigx
- 5.1.0
+ 5.2.0-snapshot
pigx-common
diff --git a/pigx-gateway/pom.xml b/pigx-gateway/pom.xml
index 457378923..6f7244d8d 100644
--- a/pigx-gateway/pom.xml
+++ b/pigx-gateway/pom.xml
@@ -24,7 +24,7 @@
com.pig4cloud
pigx
- 5.1.0
+ 5.2.0-snapshot
pigx-gateway
diff --git a/pigx-register/pom.xml b/pigx-register/pom.xml
index 24e1d3d6f..97c9d341f 100755
--- a/pigx-register/pom.xml
+++ b/pigx-register/pom.xml
@@ -18,7 +18,7 @@
com.pig4cloud
pigx
- 5.1.0
+ 5.2.0-snapshot
pigx-register
diff --git a/pigx-upms/pigx-upms-api/pom.xml b/pigx-upms/pigx-upms-api/pom.xml
index 1b732d86b..051d062e0 100644
--- a/pigx-upms/pigx-upms-api/pom.xml
+++ b/pigx-upms/pigx-upms-api/pom.xml
@@ -24,7 +24,7 @@
com.pig4cloud
pigx-upms
- 5.1.0
+ 5.2.0-snapshot
pigx-upms-api
diff --git a/pigx-upms/pigx-upms-biz/pom.xml b/pigx-upms/pigx-upms-biz/pom.xml
index e43396f28..e967a8a2a 100644
--- a/pigx-upms/pigx-upms-biz/pom.xml
+++ b/pigx-upms/pigx-upms-biz/pom.xml
@@ -24,7 +24,7 @@
com.pig4cloud
pigx-upms
- 5.1.0
+ 5.2.0-snapshot
pigx-upms-biz
diff --git a/pigx-upms/pom.xml b/pigx-upms/pom.xml
index 6147df3f4..7466ed576 100644
--- a/pigx-upms/pom.xml
+++ b/pigx-upms/pom.xml
@@ -24,7 +24,7 @@
com.pig4cloud
pigx
- 5.1.0
+ 5.2.0-snapshot
pigx-upms
diff --git a/pigx-visual/pigx-codegen/pom.xml b/pigx-visual/pigx-codegen/pom.xml
index 3a77982cd..4cb7fbb97 100755
--- a/pigx-visual/pigx-codegen/pom.xml
+++ b/pigx-visual/pigx-codegen/pom.xml
@@ -6,7 +6,7 @@
com.pig4cloud
pigx-visual
- 5.1.0
+ 5.2.0-snapshot
pigx-codegen
diff --git a/pigx-visual/pigx-daemon-elastic-job/pom.xml b/pigx-visual/pigx-daemon-elastic-job/pom.xml
index 9e53db5cd..2d5a9b781 100644
--- a/pigx-visual/pigx-daemon-elastic-job/pom.xml
+++ b/pigx-visual/pigx-daemon-elastic-job/pom.xml
@@ -23,7 +23,7 @@
com.pig4cloud
pigx-visual
- 5.1.0
+ 5.2.0-snapshot
pigx-daemon-elastic-job
diff --git a/pigx-visual/pigx-daemon-quartz/pom.xml b/pigx-visual/pigx-daemon-quartz/pom.xml
index 54fb05a70..2c99a57f8 100644
--- a/pigx-visual/pigx-daemon-quartz/pom.xml
+++ b/pigx-visual/pigx-daemon-quartz/pom.xml
@@ -5,7 +5,7 @@
com.pig4cloud
pigx-visual
- 5.1.0
+ 5.2.0-snapshot
4.0.0
diff --git a/pigx-visual/pigx-jimu-platform/pom.xml b/pigx-visual/pigx-jimu-platform/pom.xml
index 86e7008ee..438738dbf 100755
--- a/pigx-visual/pigx-jimu-platform/pom.xml
+++ b/pigx-visual/pigx-jimu-platform/pom.xml
@@ -5,7 +5,7 @@
com.pig4cloud
pigx-visual
- 5.1.0
+ 5.2.0-snapshot
pigx-jimu-platform
diff --git a/pigx-visual/pigx-monitor/pom.xml b/pigx-visual/pigx-monitor/pom.xml
index f1044d84c..c83612f0a 100644
--- a/pigx-visual/pigx-monitor/pom.xml
+++ b/pigx-visual/pigx-monitor/pom.xml
@@ -24,7 +24,7 @@
com.pig4cloud
pigx-visual
- 5.1.0
+ 5.2.0-snapshot
pigx-monitor
diff --git a/pigx-visual/pigx-mp-platform/pom.xml b/pigx-visual/pigx-mp-platform/pom.xml
index 9b8da8316..5458b6d61 100755
--- a/pigx-visual/pigx-mp-platform/pom.xml
+++ b/pigx-visual/pigx-mp-platform/pom.xml
@@ -6,7 +6,7 @@
com.pig4cloud
pigx-visual
- 5.1.0
+ 5.2.0-snapshot
pigx-mp-platform
diff --git a/pigx-visual/pigx-oa-platform/pom.xml b/pigx-visual/pigx-oa-platform/pom.xml
index 18fabdb98..c71c7a7da 100644
--- a/pigx-visual/pigx-oa-platform/pom.xml
+++ b/pigx-visual/pigx-oa-platform/pom.xml
@@ -23,7 +23,7 @@
com.pig4cloud
pigx-visual
- 5.1.0
+ 5.2.0-snapshot
pigx-oa-platform
diff --git a/pigx-visual/pigx-pay-platform/pom.xml b/pigx-visual/pigx-pay-platform/pom.xml
index 6c57a8da6..a69c1e4b4 100755
--- a/pigx-visual/pigx-pay-platform/pom.xml
+++ b/pigx-visual/pigx-pay-platform/pom.xml
@@ -6,7 +6,7 @@
com.pig4cloud
pigx-visual
- 5.1.0
+ 5.2.0-snapshot
pigx-pay-platform
diff --git a/pigx-visual/pigx-report-platform/pom.xml b/pigx-visual/pigx-report-platform/pom.xml
index 551da532f..54dd5b33d 100644
--- a/pigx-visual/pigx-report-platform/pom.xml
+++ b/pigx-visual/pigx-report-platform/pom.xml
@@ -5,7 +5,7 @@
com.pig4cloud
pigx-visual
- 5.1.0
+ 5.2.0-snapshot
pigx-report-platform
diff --git a/pigx-visual/pigx-seata-server/Dockerfile b/pigx-visual/pigx-seata-server/Dockerfile
deleted file mode 100644
index a1c9fc558..000000000
--- a/pigx-visual/pigx-seata-server/Dockerfile
+++ /dev/null
@@ -1,18 +0,0 @@
-FROM pig4cloud/java:8-jre
-
-MAINTAINER wangiegie@gmail.com
-
-ENV TZ=Asia/Shanghai
-ENV JAVA_OPTS="-Xms128m -Xmx256m -Djava.security.egd=file:/dev/./urandom"
-
-RUN ln -sf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
-
-RUN mkdir -p /pigx-seata-server
-
-WORKDIR /pigx-seata-server
-
-EXPOSE 8091
-
-ADD ./target/pigx-seata-server.jar ./
-
-CMD sleep 180;java $JAVA_OPTS -jar pigx-seata-server.jar
diff --git a/pigx-visual/pigx-seata-server/pom.xml b/pigx-visual/pigx-seata-server/pom.xml
deleted file mode 100644
index 4ff679096..000000000
--- a/pigx-visual/pigx-seata-server/pom.xml
+++ /dev/null
@@ -1,218 +0,0 @@
-
-
-
-
- com.pig4cloud
- pigx-visual
- 5.1.0
-
- 4.0.0
- pigx-seata-server
- jar
- pigx-seata-server
-
-
- 1.6.1
- 6.5
- 0.2.0-RC2
- 1.72
- 27.0.1-jre
-
-
-
-
-
-
- io.seata
- seata-dependencies
- ${seata.version}
- pom
- import
-
-
-
-
-
-
-
- io.seata
- seata-spring-autoconfigure-server
- ${seata.version}
-
-
-
- io.seata
- seata-core
- ${seata.version}
-
-
- io.seata
- seata-config-all
- ${seata.version}
-
-
- log4j
- log4j
-
-
-
-
- io.seata
- seata-discovery-all
- ${seata.version}
-
-
- io.seata
- seata-serializer-all
- ${seata.version}
-
-
- io.seata
- seata-compressor-all
- ${seata.version}
-
-
-
- io.seata
- seata-metrics-all
- ${seata.version}
-
-
-
- io.seata
- seata-console
- ${seata.version}
-
-
-
-
- com.alibaba
- druid
-
-
- org.apache.commons
- commons-dbcp2
-
-
- com.zaxxer
- HikariCP
-
-
- com.h2database
- h2
-
-
-
- com.mysql
- mysql-connector-j
-
-
- org.postgresql
- postgresql
-
-
-
-
- com.beust
- jcommander
-
-
-
-
- com.google.guava
- guava
-
-
-
-
- redis.clients
- jedis
-
-
-
- com.github.microwww
- redis-server
- test
-
-
-
- com.alibaba
- fastjson
-
-
-
-
- ch.qos.logback
- logback-classic
-
-
- ch.qos.logback
- logback-core
-
-
-
- net.logstash.logback
- logstash-logback-encoder
-
-
- com.github.danielwegener
- logback-kafka-appender
-
-
-
-
- org.springframework.boot
- spring-boot-starter-web
-
-
-
- org.springframework.boot
- spring-boot-starter-undertow
-
-
-
-
-
-
- pigx-seata-server
-
-
- org.apache.maven.plugins
- maven-deploy-plugin
-
- true
-
-
-
- org.springframework.boot
- spring-boot-maven-plugin
- ${spring-boot.version}
-
- io.seata.server.PigxSeataServer
-
-
-
-
-
diff --git a/pigx-visual/pigx-seata-server/src/main/java/io/seata/server/AbstractTCInboundHandler.java b/pigx-visual/pigx-seata-server/src/main/java/io/seata/server/AbstractTCInboundHandler.java
deleted file mode 100644
index c824abf66..000000000
--- a/pigx-visual/pigx-seata-server/src/main/java/io/seata/server/AbstractTCInboundHandler.java
+++ /dev/null
@@ -1,326 +0,0 @@
-/*
- * Copyright 1999-2019 Seata.io Group.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.seata.server;
-
-import io.seata.common.exception.StoreException;
-import io.seata.core.exception.AbstractExceptionHandler;
-import io.seata.core.exception.TransactionException;
-import io.seata.core.exception.TransactionExceptionCode;
-import io.seata.core.model.GlobalStatus;
-import io.seata.core.protocol.transaction.*;
-import io.seata.core.rpc.RpcContext;
-import io.seata.server.session.GlobalSession;
-import io.seata.server.session.SessionHolder;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * The type Abstract tc inbound handler.
- *
- * @author sharajava
- */
-public abstract class AbstractTCInboundHandler extends AbstractExceptionHandler implements TCInboundHandler {
-
- private static final Logger LOGGER = LoggerFactory.getLogger(AbstractTCInboundHandler.class);
-
- @Override
- public GlobalBeginResponse handle(GlobalBeginRequest request, final RpcContext rpcContext) {
- GlobalBeginResponse response = new GlobalBeginResponse();
- exceptionHandleTemplate(new AbstractCallback() {
- @Override
- public void execute(GlobalBeginRequest request, GlobalBeginResponse response) throws TransactionException {
- try {
- doGlobalBegin(request, response, rpcContext);
- }
- catch (StoreException e) {
- throw new TransactionException(TransactionExceptionCode.FailedStore, String.format(
- "begin global request failed. xid=%s, msg=%s", response.getXid(), e.getMessage()), e);
- }
- }
- }, request, response);
- return response;
- }
-
- /**
- * Do global begin.
- * @param request the request
- * @param response the response
- * @param rpcContext the rpc context
- * @throws TransactionException the transaction exception
- */
- protected abstract void doGlobalBegin(GlobalBeginRequest request, GlobalBeginResponse response,
- RpcContext rpcContext) throws TransactionException;
-
- @Override
- public GlobalCommitResponse handle(GlobalCommitRequest request, final RpcContext rpcContext) {
- GlobalCommitResponse response = new GlobalCommitResponse();
- response.setGlobalStatus(GlobalStatus.Committing);
- exceptionHandleTemplate(new AbstractCallback() {
- @Override
- public void execute(GlobalCommitRequest request, GlobalCommitResponse response)
- throws TransactionException {
- try {
- doGlobalCommit(request, response, rpcContext);
- }
- catch (StoreException e) {
- throw new TransactionException(TransactionExceptionCode.FailedStore, String.format(
- "global commit request failed. xid=%s, msg=%s", request.getXid(), e.getMessage()), e);
- }
- }
-
- @Override
- public void onTransactionException(GlobalCommitRequest request, GlobalCommitResponse response,
- TransactionException tex) {
- super.onTransactionException(request, response, tex);
- checkTransactionStatus(request, response);
- }
-
- @Override
- public void onException(GlobalCommitRequest request, GlobalCommitResponse response, Exception rex) {
- super.onException(request, response, rex);
- checkTransactionStatus(request, response);
- }
-
- }, request, response);
- return response;
- }
-
- /**
- * Do global commit.
- * @param request the request
- * @param response the response
- * @param rpcContext the rpc context
- * @throws TransactionException the transaction exception
- */
- protected abstract void doGlobalCommit(GlobalCommitRequest request, GlobalCommitResponse response,
- RpcContext rpcContext) throws TransactionException;
-
- @Override
- public GlobalRollbackResponse handle(GlobalRollbackRequest request, final RpcContext rpcContext) {
- GlobalRollbackResponse response = new GlobalRollbackResponse();
- response.setGlobalStatus(GlobalStatus.Rollbacking);
- exceptionHandleTemplate(new AbstractCallback() {
- @Override
- public void execute(GlobalRollbackRequest request, GlobalRollbackResponse response)
- throws TransactionException {
- try {
- doGlobalRollback(request, response, rpcContext);
- }
- catch (StoreException e) {
- throw new TransactionException(TransactionExceptionCode.FailedStore, String.format(
- "global rollback request failed. xid=%s, msg=%s", request.getXid(), e.getMessage()), e);
- }
- }
-
- @Override
- public void onTransactionException(GlobalRollbackRequest request, GlobalRollbackResponse response,
- TransactionException tex) {
- super.onTransactionException(request, response, tex);
- // may be appears StoreException outer layer method catch
- checkTransactionStatus(request, response);
- }
-
- @Override
- public void onException(GlobalRollbackRequest request, GlobalRollbackResponse response, Exception rex) {
- super.onException(request, response, rex);
- // may be appears StoreException outer layer method catch
- checkTransactionStatus(request, response);
- }
- }, request, response);
- return response;
- }
-
- /**
- * Do global rollback.
- * @param request the request
- * @param response the response
- * @param rpcContext the rpc context
- * @throws TransactionException the transaction exception
- */
- protected abstract void doGlobalRollback(GlobalRollbackRequest request, GlobalRollbackResponse response,
- RpcContext rpcContext) throws TransactionException;
-
- @Override
- public BranchRegisterResponse handle(BranchRegisterRequest request, final RpcContext rpcContext) {
- BranchRegisterResponse response = new BranchRegisterResponse();
- exceptionHandleTemplate(new AbstractCallback() {
- @Override
- public void execute(BranchRegisterRequest request, BranchRegisterResponse response)
- throws TransactionException {
- try {
- doBranchRegister(request, response, rpcContext);
- }
- catch (StoreException e) {
- throw new TransactionException(TransactionExceptionCode.FailedStore, String.format(
- "branch register request failed. xid=%s, msg=%s", request.getXid(), e.getMessage()), e);
- }
- }
- }, request, response);
- return response;
- }
-
- /**
- * Do branch register.
- * @param request the request
- * @param response the response
- * @param rpcContext the rpc context
- * @throws TransactionException the transaction exception
- */
- protected abstract void doBranchRegister(BranchRegisterRequest request, BranchRegisterResponse response,
- RpcContext rpcContext) throws TransactionException;
-
- @Override
- public BranchReportResponse handle(BranchReportRequest request, final RpcContext rpcContext) {
- BranchReportResponse response = new BranchReportResponse();
- exceptionHandleTemplate(new AbstractCallback() {
- @Override
- public void execute(BranchReportRequest request, BranchReportResponse response)
- throws TransactionException {
- try {
- doBranchReport(request, response, rpcContext);
- }
- catch (StoreException e) {
- throw new TransactionException(TransactionExceptionCode.FailedStore,
- String.format("branch report request failed. xid=%s, branchId=%s, msg=%s", request.getXid(),
- request.getBranchId(), e.getMessage()),
- e);
- }
- }
- }, request, response);
- return response;
- }
-
- /**
- * Do branch report.
- * @param request the request
- * @param rpcContext the rpc context
- * @throws TransactionException the transaction exception
- */
- protected abstract void doBranchReport(BranchReportRequest request, BranchReportResponse response,
- RpcContext rpcContext) throws TransactionException;
-
- @Override
- public GlobalLockQueryResponse handle(GlobalLockQueryRequest request, final RpcContext rpcContext) {
- GlobalLockQueryResponse response = new GlobalLockQueryResponse();
- exceptionHandleTemplate(new AbstractCallback() {
- @Override
- public void execute(GlobalLockQueryRequest request, GlobalLockQueryResponse response)
- throws TransactionException {
- try {
- doLockCheck(request, response, rpcContext);
- }
- catch (StoreException e) {
- throw new TransactionException(TransactionExceptionCode.FailedStore, String.format(
- "global lock query request failed. xid=%s, msg=%s", request.getXid(), e.getMessage()), e);
- }
- }
- }, request, response);
- return response;
- }
-
- /**
- * Do lock check.
- * @param request the request
- * @param response the response
- * @param rpcContext the rpc context
- * @throws TransactionException the transaction exception
- */
- protected abstract void doLockCheck(GlobalLockQueryRequest request, GlobalLockQueryResponse response,
- RpcContext rpcContext) throws TransactionException;
-
- @Override
- public GlobalStatusResponse handle(GlobalStatusRequest request, final RpcContext rpcContext) {
- GlobalStatusResponse response = new GlobalStatusResponse();
- response.setGlobalStatus(GlobalStatus.UnKnown);
- exceptionHandleTemplate(new AbstractCallback() {
- @Override
- public void execute(GlobalStatusRequest request, GlobalStatusResponse response)
- throws TransactionException {
- try {
- doGlobalStatus(request, response, rpcContext);
- }
- catch (StoreException e) {
- throw new TransactionException(TransactionExceptionCode.FailedStore, String.format(
- "global status request failed. xid=%s, msg=%s", request.getXid(), e.getMessage()), e);
- }
- }
-
- @Override
- public void onTransactionException(GlobalStatusRequest request, GlobalStatusResponse response,
- TransactionException tex) {
- super.onTransactionException(request, response, tex);
- checkTransactionStatus(request, response);
- }
-
- @Override
- public void onException(GlobalStatusRequest request, GlobalStatusResponse response, Exception rex) {
- super.onException(request, response, rex);
- checkTransactionStatus(request, response);
- }
- }, request, response);
- return response;
- }
-
- /**
- * Do global status.
- * @param request the request
- * @param response the response
- * @param rpcContext the rpc context
- * @throws TransactionException the transaction exception
- */
- protected abstract void doGlobalStatus(GlobalStatusRequest request, GlobalStatusResponse response,
- RpcContext rpcContext) throws TransactionException;
-
- @Override
- public GlobalReportResponse handle(GlobalReportRequest request, final RpcContext rpcContext) {
- GlobalReportResponse response = new GlobalReportResponse();
- response.setGlobalStatus(request.getGlobalStatus());
- exceptionHandleTemplate(new AbstractCallback() {
- @Override
- public void execute(GlobalReportRequest request, GlobalReportResponse response)
- throws TransactionException {
- doGlobalReport(request, response, rpcContext);
- }
- }, request, response);
- return response;
- }
-
- /**
- * Do global report.
- * @param request the request
- * @param response the response
- * @param rpcContext the rpc context
- * @throws TransactionException the transaction exception
- */
- protected abstract void doGlobalReport(GlobalReportRequest request, GlobalReportResponse response,
- RpcContext rpcContext) throws TransactionException;
-
- private void checkTransactionStatus(AbstractGlobalEndRequest request, AbstractGlobalEndResponse response) {
- try {
- GlobalSession globalSession = SessionHolder.findGlobalSession(request.getXid(), false);
- if (globalSession != null) {
- response.setGlobalStatus(globalSession.getStatus());
- }
- else {
- response.setGlobalStatus(GlobalStatus.Finished);
- }
- }
- catch (Exception exx) {
- LOGGER.error("check transaction status error,{}]", exx.getMessage());
- }
- }
-
-}
diff --git a/pigx-visual/pigx-seata-server/src/main/java/io/seata/server/ParameterParser.java b/pigx-visual/pigx-seata-server/src/main/java/io/seata/server/ParameterParser.java
deleted file mode 100644
index 4c9d21f22..000000000
--- a/pigx-visual/pigx-seata-server/src/main/java/io/seata/server/ParameterParser.java
+++ /dev/null
@@ -1,200 +0,0 @@
-/*
- * Copyright 1999-2019 Seata.io Group.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.seata.server;
-
-import com.beust.jcommander.JCommander;
-import com.beust.jcommander.Parameter;
-import com.beust.jcommander.ParameterException;
-import io.seata.common.util.StringUtils;
-import io.seata.config.Configuration;
-import io.seata.config.ConfigurationFactory;
-import io.seata.server.env.ContainerHelper;
-import io.seata.server.store.StoreConfig;
-
-import static io.seata.config.ConfigurationFactory.ENV_PROPERTY_KEY;
-
-/**
- * The type Parameter parser.
- *
- * @author xingfudeshi @gmail.com
- */
-public class ParameterParser {
-
- private static final String PROGRAM_NAME = "sh seata-server.sh(for linux and mac) or cmd seata-server.bat(for windows)";
-
- private static final Configuration CONFIG = ConfigurationFactory.getInstance();
-
- @Parameter(names = "--help", help = true)
- private boolean help;
-
- @Parameter(names = { "--host", "-h" }, description = "The ip to register to registry center.", order = 1)
- private String host;
-
- @Parameter(names = { "--port", "-p" }, description = "The port to listen.", order = 2)
- private int port;
-
- @Parameter(names = { "--storeMode", "-m" }, description = "log store mode : file, db, redis", order = 3)
- private String storeMode;
-
- @Parameter(names = { "--serverNode", "-n" },
- description = "server node id, such as 1, 2, 3.it will be generated according to the snowflake by default",
- order = 4)
- private Long serverNode;
-
- @Parameter(names = { "--seataEnv", "-e" }, description = "The name used for multi-configuration isolation.",
- order = 5)
- private String seataEnv;
-
- @Parameter(names = { "--sessionStoreMode", "-ssm" }, description = "session log store mode : file, db, redis",
- order = 6)
- private String sessionStoreMode;
-
- @Parameter(names = { "--lockStoreMode", "-lsm" }, description = "lock log store mode : file, db, redis", order = 7)
- private String lockStoreMode;
-
- /**
- * Instantiates a new Parameter parser.
- * @param args the args
- */
- public ParameterParser(String... args) {
- this.init(args);
- }
-
- /**
- * startup args > docker env
- * @param args
- */
- private void init(String[] args) {
- try {
- getCommandParameters(args);
- getEnvParameters();
- if (StringUtils.isNotBlank(seataEnv)) {
- System.setProperty(ENV_PROPERTY_KEY, seataEnv);
- }
- StoreConfig.setStartupParameter(storeMode, sessionStoreMode, lockStoreMode);
- }
- catch (ParameterException e) {
- printError(e);
- }
-
- }
-
- private void getCommandParameters(String[] args) {
- JCommander jCommander = JCommander.newBuilder().addObject(this).build();
- jCommander.parse(args);
- if (help) {
- jCommander.setProgramName(PROGRAM_NAME);
- jCommander.usage();
- System.exit(0);
- }
- }
-
- private void getEnvParameters() {
- if (StringUtils.isBlank(seataEnv)) {
- seataEnv = ContainerHelper.getEnv();
- }
- if (StringUtils.isBlank(host)) {
- host = ContainerHelper.getHost();
- }
- if (port == 0) {
- port = ContainerHelper.getPort();
- }
- if (serverNode == null) {
- serverNode = ContainerHelper.getServerNode();
- }
- }
-
- private void printError(ParameterException e) {
- System.err.println("Option error " + e.getMessage());
- e.getJCommander().setProgramName(PROGRAM_NAME);
- e.usage();
- System.exit(0);
- }
-
- /**
- * Gets host.
- * @return the host
- */
- public String getHost() {
- return host;
- }
-
- /**
- * Gets port.
- * @return the port
- */
- public int getPort() {
- return port;
- }
-
- /**
- * Gets store mode.
- * @return the store mode
- */
- public String getStoreMode() {
- return storeMode;
- }
-
- /**
- * Gets lock store mode.
- * @return the store mode
- */
- public String getLockStoreMode() {
- return lockStoreMode;
- }
-
- /**
- * Gets session store mode.
- * @return the store mode
- */
- public String getSessionStoreMode() {
- return sessionStoreMode;
- }
-
- /**
- * Is help boolean.
- * @return the boolean
- */
- public boolean isHelp() {
- return help;
- }
-
- /**
- * Gets server node.
- * @return the server node
- */
- public Long getServerNode() {
- return serverNode;
- }
-
- /**
- * Gets seata env
- * @return the name used for multi-configuration isolation.
- */
- public String getSeataEnv() {
- return seataEnv;
- }
-
- /**
- * Clean up.
- */
- public void cleanUp() {
- if (null != System.getProperty(ENV_PROPERTY_KEY)) {
- System.clearProperty(ENV_PROPERTY_KEY);
- }
- }
-
-}
diff --git a/pigx-visual/pigx-seata-server/src/main/java/io/seata/server/PigxSeataServer.java b/pigx-visual/pigx-seata-server/src/main/java/io/seata/server/PigxSeataServer.java
deleted file mode 100644
index a37280235..000000000
--- a/pigx-visual/pigx-seata-server/src/main/java/io/seata/server/PigxSeataServer.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright 1999-2019 Seata.io Group.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.seata.server;
-
-import org.springframework.boot.SpringApplication;
-import org.springframework.boot.autoconfigure.SpringBootApplication;
-
-import java.io.IOException;
-
-/**
- * @author spilledyear@outlook.com
- */
-@SpringBootApplication(scanBasePackages = { "io.seata" })
-public class PigxSeataServer {
-
- public static void main(String[] args) throws IOException {
- // run the spring-boot application
- SpringApplication.run(PigxSeataServer.class, args);
- }
-
-}
diff --git a/pigx-visual/pigx-seata-server/src/main/java/io/seata/server/Server.java b/pigx-visual/pigx-seata-server/src/main/java/io/seata/server/Server.java
deleted file mode 100644
index e366d5fda..000000000
--- a/pigx-visual/pigx-seata-server/src/main/java/io/seata/server/Server.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * Copyright 1999-2019 Seata.io Group.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.seata.server;
-
-import io.seata.common.XID;
-import io.seata.common.thread.NamedThreadFactory;
-import io.seata.common.util.NetUtil;
-import io.seata.common.util.StringUtils;
-import io.seata.config.ConfigurationFactory;
-import io.seata.core.rpc.netty.NettyRemotingServer;
-import io.seata.core.rpc.netty.NettyServerConfig;
-import io.seata.server.coordinator.DefaultCoordinator;
-import io.seata.server.lock.LockerManagerFactory;
-import io.seata.server.metrics.MetricsManager;
-import io.seata.server.session.SessionHolder;
-
-import java.util.concurrent.LinkedBlockingQueue;
-import java.util.concurrent.ThreadPoolExecutor;
-import java.util.concurrent.TimeUnit;
-
-import static io.seata.spring.boot.autoconfigure.StarterConstants.REGEX_SPLIT_CHAR;
-import static io.seata.spring.boot.autoconfigure.StarterConstants.REGISTRY_PREFERED_NETWORKS;
-
-/**
- * The type Server.
- *
- * @author slievrly
- */
-public class Server {
-
- /**
- * The entry point of application.
- * @param args the input arguments
- */
- public static void start(String[] args) {
- // initialize the parameter parser
- // Note that the parameter parser should always be the first line to execute.
- // Because, here we need to parse the parameters needed for startup.
- ParameterParser parameterParser = new ParameterParser(args);
-
- // initialize the metrics
- MetricsManager.get().init();
-
- ThreadPoolExecutor workingThreads = new ThreadPoolExecutor(NettyServerConfig.getMinServerPoolSize(),
- NettyServerConfig.getMaxServerPoolSize(), NettyServerConfig.getKeepAliveTime(), TimeUnit.SECONDS,
- new LinkedBlockingQueue<>(NettyServerConfig.getMaxTaskQueueSize()),
- new NamedThreadFactory("ServerHandlerThread", NettyServerConfig.getMaxServerPoolSize()),
- new ThreadPoolExecutor.CallerRunsPolicy());
-
- // 127.0.0.1 and 0.0.0.0 are not valid here.
- if (NetUtil.isValidIp(parameterParser.getHost(), false)) {
- XID.setIpAddress(parameterParser.getHost());
- }
- else {
- String preferredNetworks = ConfigurationFactory.getInstance().getConfig(REGISTRY_PREFERED_NETWORKS);
- if (StringUtils.isNotBlank(preferredNetworks)) {
- XID.setIpAddress(NetUtil.getLocalIp(preferredNetworks.split(REGEX_SPLIT_CHAR)));
- }
- else {
- XID.setIpAddress(NetUtil.getLocalIp());
- }
- }
-
- NettyRemotingServer nettyRemotingServer = new NettyRemotingServer(workingThreads);
- XID.setPort(nettyRemotingServer.getListenPort());
- UUIDGenerator.init(parameterParser.getServerNode());
- // log store mode : file, db, redis
- SessionHolder.init();
- LockerManagerFactory.init();
- DefaultCoordinator coordinator = DefaultCoordinator.getInstance(nettyRemotingServer);
- coordinator.init();
- nettyRemotingServer.setHandler(coordinator);
-
- // let ServerRunner do destroy instead ShutdownHook, see
- // https://github.com/seata/seata/issues/4028
- ServerRunner.addDisposable(coordinator);
-
- nettyRemotingServer.init();
- }
-
-}
diff --git a/pigx-visual/pigx-seata-server/src/main/java/io/seata/server/ServerApplicationListener.java b/pigx-visual/pigx-seata-server/src/main/java/io/seata/server/ServerApplicationListener.java
deleted file mode 100644
index 3c3ddb817..000000000
--- a/pigx-visual/pigx-seata-server/src/main/java/io/seata/server/ServerApplicationListener.java
+++ /dev/null
@@ -1,129 +0,0 @@
-/*
- * Copyright 1999-2019 Seata.io Group.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.seata.server;
-
-import io.seata.common.holder.ObjectHolder;
-import io.seata.common.util.StringUtils;
-import io.seata.server.store.StoreConfig;
-import io.seata.spring.boot.autoconfigure.SeataCoreEnvironmentPostProcessor;
-import io.seata.spring.boot.autoconfigure.SeataServerEnvironmentPostProcessor;
-import org.springframework.boot.context.event.ApplicationEnvironmentPreparedEvent;
-import org.springframework.boot.context.logging.LoggingApplicationListener;
-import org.springframework.context.ApplicationEvent;
-import org.springframework.context.event.GenericApplicationListener;
-import org.springframework.core.ResolvableType;
-import org.springframework.core.env.ConfigurableEnvironment;
-import org.springframework.core.env.PropertiesPropertySource;
-
-import java.util.Properties;
-
-import static io.seata.common.Constants.OBJECT_KEY_SPRING_CONFIGURABLE_ENVIRONMENT;
-import static io.seata.common.DefaultValues.SERVICE_OFFSET_SPRING_BOOT;
-import static io.seata.core.constants.ConfigurationKeys.*;
-
-/**
- * @author slievrly
- * @author funkye
- */
-public class ServerApplicationListener implements GenericApplicationListener {
-
- @Override
- public boolean supportsEventType(ResolvableType eventType) {
- return eventType.getRawClass() != null
- && ApplicationEnvironmentPreparedEvent.class.isAssignableFrom(eventType.getRawClass());
- }
-
- @Override
- public void onApplicationEvent(ApplicationEvent event) {
- if (!(event instanceof ApplicationEnvironmentPreparedEvent)) {
- return;
- }
- ApplicationEnvironmentPreparedEvent environmentPreparedEvent = (ApplicationEnvironmentPreparedEvent) event;
- ConfigurableEnvironment environment = environmentPreparedEvent.getEnvironment();
- ObjectHolder.INSTANCE.setObject(OBJECT_KEY_SPRING_CONFIGURABLE_ENVIRONMENT, environment);
- SeataCoreEnvironmentPostProcessor.init();
- SeataServerEnvironmentPostProcessor.init();
- // Load by priority
- System.setProperty("sessionMode", StoreConfig.getSessionMode().getName());
- System.setProperty("lockMode", StoreConfig.getLockMode().getName());
-
- String[] args = environmentPreparedEvent.getArgs();
-
- // port: -p > -D > env > yml > default
-
- // -p 8091
- if (args != null && args.length >= 2) {
- for (int i = 0; i < args.length; ++i) {
- if ("-p".equalsIgnoreCase(args[i]) && i < args.length - 1) {
- setTargetPort(environment, args[i + 1], true);
- return;
- }
- }
- }
-
- // -Dserver.servicePort=8091
- String dPort = environment.getProperty(SERVER_SERVICE_PORT_CAMEL, String.class);
- if (StringUtils.isNotBlank(dPort)) {
- setTargetPort(environment, dPort, true);
- return;
- }
-
- // docker -e SEATA_PORT=8091
- String envPort = environment.getProperty(ENV_SEATA_PORT_KEY, String.class);
- if (StringUtils.isNotBlank(envPort)) {
- setTargetPort(environment, envPort, true);
- return;
- }
-
- // yml properties server.service-port=8091
- String configPort = environment.getProperty(SERVER_SERVICE_PORT_CONFIG, String.class);
- if (StringUtils.isNotBlank(configPort)) {
- setTargetPort(environment, configPort, false);
- return;
- }
-
- // server.port=7091
- String serverPort = environment.getProperty("server.port", String.class);
- if (StringUtils.isBlank(serverPort)) {
- serverPort = "8080";
- }
- String servicePort = String.valueOf(Integer.parseInt(serverPort) + SERVICE_OFFSET_SPRING_BOOT);
- setTargetPort(environment, servicePort, true);
- }
-
- private void setTargetPort(ConfigurableEnvironment environment, String port, boolean needAddPropertySource) {
- // get rpc port first, use to logback-spring.xml, @see the class named
- // `SystemPropertyLoggerContextListener`
- System.setProperty(SERVER_SERVICE_PORT_CAMEL, port);
-
- if (needAddPropertySource) {
- // add property source to the first position
- Properties pro = new Properties();
- pro.setProperty(SERVER_SERVICE_PORT_CONFIG, port);
- environment.getPropertySources().addFirst(new PropertiesPropertySource("serverProperties", pro));
- }
- }
-
- /**
- * higher than LoggingApplicationListener
- * @return the order
- */
- @Override
- public int getOrder() {
- return LoggingApplicationListener.DEFAULT_ORDER - 1;
- }
-
-}
diff --git a/pigx-visual/pigx-seata-server/src/main/java/io/seata/server/ServerRunner.java b/pigx-visual/pigx-seata-server/src/main/java/io/seata/server/ServerRunner.java
deleted file mode 100644
index 4129b307a..000000000
--- a/pigx-visual/pigx-seata-server/src/main/java/io/seata/server/ServerRunner.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * Copyright 1999-2019 Seata.io Group.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.seata.server;
-
-import io.seata.core.rpc.Disposable;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.DisposableBean;
-import org.springframework.boot.CommandLineRunner;
-import org.springframework.stereotype.Component;
-
-import java.util.List;
-import java.util.concurrent.CopyOnWriteArrayList;
-
-/**
- * @author spilledyear@outlook.com
- */
-@Component
-public class ServerRunner implements CommandLineRunner, DisposableBean {
-
- private static final Logger LOGGER = LoggerFactory.getLogger(ServerRunner.class);
-
- private boolean started = Boolean.FALSE;
-
- private static final List DISPOSABLE_LIST = new CopyOnWriteArrayList<>();
-
- public static void addDisposable(Disposable disposable) {
- DISPOSABLE_LIST.add(disposable);
- }
-
- @Override
- public void run(String... args) {
- try {
- long start = System.currentTimeMillis();
- Server.start(args);
- started = true;
-
- long cost = System.currentTimeMillis() - start;
- LOGGER.info("seata server started in {} millSeconds", cost);
- }
- catch (Throwable e) {
- started = Boolean.FALSE;
- LOGGER.error("seata server start error: {} ", e.getMessage(), e);
- System.exit(-1);
- }
- }
-
- public boolean started() {
- return started;
- }
-
- @Override
- public void destroy() throws Exception {
-
- if (LOGGER.isDebugEnabled()) {
- LOGGER.debug("destoryAll starting");
- }
-
- for (Disposable disposable : DISPOSABLE_LIST) {
- disposable.destroy();
- }
-
- if (LOGGER.isDebugEnabled()) {
- LOGGER.debug("destoryAll finish");
- }
- }
-
-}
diff --git a/pigx-visual/pigx-seata-server/src/main/java/io/seata/server/UUIDGenerator.java b/pigx-visual/pigx-seata-server/src/main/java/io/seata/server/UUIDGenerator.java
deleted file mode 100644
index dee5a338b..000000000
--- a/pigx-visual/pigx-seata-server/src/main/java/io/seata/server/UUIDGenerator.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright 1999-2019 Seata.io Group.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.seata.server;
-
-import io.seata.common.util.IdWorker;
-
-/**
- * The type Uuid generator.
- *
- * @author sharajava
- */
-public class UUIDGenerator {
-
- private static volatile IdWorker idWorker;
-
- /**
- * generate UUID using snowflake algorithm
- * @return UUID
- */
- public static long generateUUID() {
- if (idWorker == null) {
- synchronized (UUIDGenerator.class) {
- if (idWorker == null) {
- init(null);
- }
- }
- }
- return idWorker.nextId();
- }
-
- /**
- * init IdWorker
- * @param serverNode the server node id, consider as machine id in snowflake
- */
- public static void init(Long serverNode) {
- idWorker = new IdWorker(serverNode);
- }
-
-}
diff --git a/pigx-visual/pigx-seata-server/src/main/java/io/seata/server/auth/AbstractCheckAuthHandler.java b/pigx-visual/pigx-seata-server/src/main/java/io/seata/server/auth/AbstractCheckAuthHandler.java
deleted file mode 100644
index ca297602f..000000000
--- a/pigx-visual/pigx-seata-server/src/main/java/io/seata/server/auth/AbstractCheckAuthHandler.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Copyright 1999-2019 Seata.io Group.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.seata.server.auth;
-
-import io.seata.config.ConfigurationFactory;
-import io.seata.core.constants.ConfigurationKeys;
-import io.seata.core.protocol.RegisterRMRequest;
-import io.seata.core.protocol.RegisterTMRequest;
-import io.seata.core.rpc.RegisterCheckAuthHandler;
-
-import static io.seata.common.DefaultValues.DEFAULT_SERVER_ENABLE_CHECK_AUTH;
-
-/**
- * @author slievrly
- */
-public abstract class AbstractCheckAuthHandler implements RegisterCheckAuthHandler {
-
- private static final Boolean ENABLE_CHECK_AUTH = ConfigurationFactory.getInstance()
- .getBoolean(ConfigurationKeys.SERVER_ENABLE_CHECK_AUTH, DEFAULT_SERVER_ENABLE_CHECK_AUTH);
-
- @Override
- public boolean regTransactionManagerCheckAuth(RegisterTMRequest request) {
- if (!ENABLE_CHECK_AUTH) {
- return true;
- }
- return doRegTransactionManagerCheck(request);
- }
-
- public abstract boolean doRegTransactionManagerCheck(RegisterTMRequest request);
-
- @Override
- public boolean regResourceManagerCheckAuth(RegisterRMRequest request) {
- if (!ENABLE_CHECK_AUTH) {
- return true;
- }
- return doRegResourceManagerCheck(request);
- }
-
- public abstract boolean doRegResourceManagerCheck(RegisterRMRequest request);
-
-}
diff --git a/pigx-visual/pigx-seata-server/src/main/java/io/seata/server/auth/DefaultCheckAuthHandler.java b/pigx-visual/pigx-seata-server/src/main/java/io/seata/server/auth/DefaultCheckAuthHandler.java
deleted file mode 100644
index 8fe75e898..000000000
--- a/pigx-visual/pigx-seata-server/src/main/java/io/seata/server/auth/DefaultCheckAuthHandler.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright 1999-2019 Seata.io Group.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.seata.server.auth;
-
-import io.seata.common.loader.LoadLevel;
-import io.seata.core.protocol.RegisterRMRequest;
-import io.seata.core.protocol.RegisterTMRequest;
-
-/**
- * @author slievrly
- */
-@LoadLevel(name = "defaultCheckAuthHandler", order = 100)
-public class DefaultCheckAuthHandler extends AbstractCheckAuthHandler {
-
- @Override
- public boolean doRegTransactionManagerCheck(RegisterTMRequest request) {
- return true;
- }
-
- @Override
- public boolean doRegResourceManagerCheck(RegisterRMRequest request) {
- return true;
- }
-
-}
diff --git a/pigx-visual/pigx-seata-server/src/main/java/io/seata/server/console/controller/BranchSessionController.java b/pigx-visual/pigx-seata-server/src/main/java/io/seata/server/console/controller/BranchSessionController.java
deleted file mode 100644
index 849343131..000000000
--- a/pigx-visual/pigx-seata-server/src/main/java/io/seata/server/console/controller/BranchSessionController.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright 1999-2019 Seata.io Group.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.seata.server.console.controller;
-
-import io.seata.server.console.service.BranchSessionService;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-import javax.annotation.Resource;
-
-/**
- * Branch Session Controller
- *
- * @author zhongxiang.wang
- */
-@RestController
-@RequestMapping("console/branchSession")
-public class BranchSessionController {
-
- @Resource(type = BranchSessionService.class)
- private BranchSessionService branchSessionService;
-
-}
diff --git a/pigx-visual/pigx-seata-server/src/main/java/io/seata/server/console/controller/GlobalLockController.java b/pigx-visual/pigx-seata-server/src/main/java/io/seata/server/console/controller/GlobalLockController.java
deleted file mode 100644
index 1c5034eb7..000000000
--- a/pigx-visual/pigx-seata-server/src/main/java/io/seata/server/console/controller/GlobalLockController.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Copyright 1999-2019 Seata.io Group.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.seata.server.console.controller;
-
-import io.seata.console.result.PageResult;
-import io.seata.server.console.param.GlobalLockParam;
-import io.seata.server.console.service.GlobalLockService;
-import io.seata.server.console.vo.GlobalLockVO;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.ModelAttribute;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-import javax.annotation.Resource;
-
-/**
- * Global Lock Controller
- *
- * @author zhongxiang.wang
- */
-@RestController
-@RequestMapping("/api/v1/console/globalLock")
-public class GlobalLockController {
-
- @Resource(type = GlobalLockService.class)
- private GlobalLockService globalLockService;
-
- /**
- * Query locks by param
- * @param param the param
- * @return the list of GlobalLockVO
- */
- @GetMapping("query")
- public PageResult query(@ModelAttribute GlobalLockParam param) {
- return globalLockService.query(param);
- }
-
-}
diff --git a/pigx-visual/pigx-seata-server/src/main/java/io/seata/server/console/controller/GlobalSessionController.java b/pigx-visual/pigx-seata-server/src/main/java/io/seata/server/console/controller/GlobalSessionController.java
deleted file mode 100644
index 0d1bdc95f..000000000
--- a/pigx-visual/pigx-seata-server/src/main/java/io/seata/server/console/controller/GlobalSessionController.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Copyright 1999-2019 Seata.io Group.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.seata.server.console.controller;
-
-import io.seata.console.result.PageResult;
-import io.seata.server.console.param.GlobalSessionParam;
-import io.seata.server.console.service.GlobalSessionService;
-import io.seata.server.console.vo.GlobalSessionVO;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.ModelAttribute;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-import javax.annotation.Resource;
-
-/**
- * Global Session Controller
- *
- * @author zhongxiang.wang
- */
-@RestController
-@RequestMapping("/api/v1/console/globalSession")
-public class GlobalSessionController {
-
- @Resource(type = GlobalSessionService.class)
- private GlobalSessionService globalSessionService;
-
- /**
- * Query all globalSession
- * @param param param for query globalSession
- * @return the list of GlobalSessionVO
- */
- @GetMapping("query")
- public PageResult query(@ModelAttribute GlobalSessionParam param) {
- return globalSessionService.query(param);
- }
-
-}
diff --git a/pigx-visual/pigx-seata-server/src/main/java/io/seata/server/console/impl/db/BranchSessionDBServiceImpl.java b/pigx-visual/pigx-seata-server/src/main/java/io/seata/server/console/impl/db/BranchSessionDBServiceImpl.java
deleted file mode 100644
index a92864bfb..000000000
--- a/pigx-visual/pigx-seata-server/src/main/java/io/seata/server/console/impl/db/BranchSessionDBServiceImpl.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * Copyright 1999-2019 Seata.io Group.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.seata.server.console.impl.db;
-
-import io.seata.common.ConfigurationKeys;
-import io.seata.common.exception.StoreException;
-import io.seata.common.loader.EnhancedServiceLoader;
-import io.seata.common.util.IOUtil;
-import io.seata.common.util.StringUtils;
-import io.seata.config.Configuration;
-import io.seata.config.ConfigurationFactory;
-import io.seata.console.result.PageResult;
-import io.seata.core.store.db.DataSourceProvider;
-import io.seata.core.store.db.sql.log.LogStoreSqlsFactory;
-import io.seata.server.console.service.BranchSessionService;
-import io.seata.server.console.vo.BranchSessionVO;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression;
-import org.springframework.stereotype.Component;
-
-import javax.sql.DataSource;
-import java.sql.Connection;
-import java.sql.PreparedStatement;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.util.ArrayList;
-import java.util.List;
-
-import static io.seata.common.DefaultValues.DEFAULT_STORE_DB_BRANCH_TABLE;
-
-/**
- * Branch Session DataBase ServiceImpl
- *
- * @author zhongxiang.wang
- * @author lvekee 734843455@qq.com
- */
-@Component
-@org.springframework.context.annotation.Configuration
-@ConditionalOnExpression("#{'db'.equals('${sessionMode}')}")
-public class BranchSessionDBServiceImpl implements BranchSessionService {
-
- private String branchTable;
-
- private String dbType;
-
- private DataSource dataSource;
-
- public BranchSessionDBServiceImpl() {
- Configuration configuration = ConfigurationFactory.getInstance();
- branchTable = configuration.getConfig(ConfigurationKeys.STORE_DB_BRANCH_TABLE, DEFAULT_STORE_DB_BRANCH_TABLE);
- dbType = configuration.getConfig(ConfigurationKeys.STORE_DB_TYPE);
- if (StringUtils.isBlank(dbType)) {
- throw new IllegalArgumentException(ConfigurationKeys.STORE_DB_TYPE + " should not be blank");
- }
- String dbDataSource = configuration.getConfig(ConfigurationKeys.STORE_DB_DATASOURCE_TYPE);
- if (StringUtils.isBlank(dbDataSource)) {
- throw new IllegalArgumentException(ConfigurationKeys.STORE_DB_DATASOURCE_TYPE + " should not be blank");
- }
- dataSource = EnhancedServiceLoader.load(DataSourceProvider.class, dbDataSource).provide();
- }
-
- @Override
- public PageResult queryByXid(String xid) {
- if (StringUtils.isBlank(xid)) {
- throw new IllegalArgumentException("xid should not be blank");
- }
-
- String whereCondition = " where xid = ? ";
- String branchSessionSQL = LogStoreSqlsFactory.getLogStoreSqls(dbType).getAllBranchSessionSQL(branchTable,
- whereCondition);
-
- List list = new ArrayList<>();
- ResultSet rs = null;
-
- try (Connection conn = dataSource.getConnection();
- PreparedStatement ps = conn.prepareStatement(branchSessionSQL)) {
- ps.setObject(1, xid);
- rs = ps.executeQuery();
- while (rs.next()) {
- list.add(BranchSessionVO.convert(rs));
- }
- }
- catch (SQLException e) {
- throw new StoreException(e);
- }
- finally {
- IOUtil.close(rs);
- }
- return PageResult.success(list, list.size(), 0, 0, 0);
- }
-
-}
diff --git a/pigx-visual/pigx-seata-server/src/main/java/io/seata/server/console/impl/db/GlobalLockDBServiceImpl.java b/pigx-visual/pigx-seata-server/src/main/java/io/seata/server/console/impl/db/GlobalLockDBServiceImpl.java
deleted file mode 100644
index fdba6ef35..000000000
--- a/pigx-visual/pigx-seata-server/src/main/java/io/seata/server/console/impl/db/GlobalLockDBServiceImpl.java
+++ /dev/null
@@ -1,146 +0,0 @@
-/*
- * Copyright 1999-2019 Seata.io Group.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.seata.server.console.impl.db;
-
-import io.seata.common.ConfigurationKeys;
-import io.seata.common.exception.StoreException;
-import io.seata.common.loader.EnhancedServiceLoader;
-import io.seata.common.util.IOUtil;
-import io.seata.common.util.PageUtil;
-import io.seata.common.util.StringUtils;
-import io.seata.config.Configuration;
-import io.seata.config.ConfigurationFactory;
-import io.seata.console.result.PageResult;
-import io.seata.core.store.db.DataSourceProvider;
-import io.seata.core.store.db.sql.lock.LockStoreSqlFactory;
-import io.seata.server.console.param.GlobalLockParam;
-import io.seata.server.console.service.GlobalLockService;
-import io.seata.server.console.vo.GlobalLockVO;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression;
-import org.springframework.stereotype.Component;
-
-import javax.sql.DataSource;
-import java.sql.Connection;
-import java.sql.PreparedStatement;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.util.ArrayList;
-import java.util.List;
-
-import static io.seata.common.DefaultValues.DEFAULT_LOCK_DB_TABLE;
-
-/**
- * Global Lock DB ServiceImpl
- *
- * @author zhongxiang.wang
- * @author lvekee 734843455@qq.com
- */
-@Component
-@org.springframework.context.annotation.Configuration
-@ConditionalOnExpression("#{'db'.equals('${lockMode}')}")
-public class GlobalLockDBServiceImpl implements GlobalLockService {
-
- private String lockTable;
-
- private String dbType;
-
- private DataSource dataSource;
-
- public GlobalLockDBServiceImpl() {
- Configuration configuration = ConfigurationFactory.getInstance();
- lockTable = configuration.getConfig(ConfigurationKeys.LOCK_DB_TABLE, DEFAULT_LOCK_DB_TABLE);
- dbType = configuration.getConfig(ConfigurationKeys.STORE_DB_TYPE);
- if (StringUtils.isBlank(dbType)) {
- throw new IllegalArgumentException(ConfigurationKeys.STORE_DB_TYPE + " should not be blank");
- }
- String dbDataSource = configuration.getConfig(ConfigurationKeys.STORE_DB_DATASOURCE_TYPE);
- if (StringUtils.isBlank(dbDataSource)) {
- throw new IllegalArgumentException(ConfigurationKeys.STORE_DB_DATASOURCE_TYPE + " should not be blank");
- }
- dataSource = EnhancedServiceLoader.load(DataSourceProvider.class, dbDataSource).provide();
- }
-
- @Override
- public PageResult query(GlobalLockParam param) {
- PageUtil.checkParam(param.getPageNum(), param.getPageSize());
-
- List