diff --git a/pigx-visual/pigx-seata-server/pom.xml b/pigx-visual/pigx-seata-server/pom.xml
index 26d7f66dc..9ca5fbb5d 100644
--- a/pigx-visual/pigx-seata-server/pom.xml
+++ b/pigx-visual/pigx-seata-server/pom.xml
@@ -28,111 +28,171 @@
pigx-seata-server
- 1.4.2
+ 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-core
- ${seata.version}
-
-
- io.seata
- seata-config-all
- ${seata.version}
-
-
- io.seata
- seata-discovery-all
- ${seata.version}
-
-
- io.seata
- seata-serializer-all
- ${seata.version}
-
-
- io.seata
- seata-compressor-all
- ${seata.version}
-
+
+ io.seata
+ seata-spring-autoconfigure-server
+ ${seata.version}
+
-
- io.seata
- seata-metrics-all
- ${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}
+
-
-
- com.alibaba
- druid
-
-
- org.apache.commons
- commons-dbcp2
-
-
- com.zaxxer
- HikariCP
-
-
- com.h2database
- h2
-
-
- mysql
- mysql-connector-java
-
-
- org.postgresql
- postgresql
-
-
- com.beust
- jcommander
- ${jcommander.version}
-
+
+ io.seata
+ seata-metrics-all
+ ${seata.version}
+
-
-
- com.google.guava
- guava
- ${guava.version}
-
+
+ io.seata
+ seata-console
+ ${seata.version}
+
-
-
- ch.qos.logback
- logback-classic
-
+
+
+ com.alibaba
+ druid
+
+
+ org.apache.commons
+ commons-dbcp2
+
+
+ com.zaxxer
+ HikariCP
+
+
+ com.h2database
+ h2
+
+
+
+ mysql
+ mysql-connector-java
+
+
+ org.postgresql
+ postgresql
+
+
-
-
- redis.clients
- jedis
-
+
+ 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
+
-
- com.alibaba
- fastjson
-
-
- net.logstash.logback
- logstash-logback-encoder
- ${logstash-logback-encoder.version}
-
-
- com.github.danielwegener
- logback-kafka-appender
- ${kafka-appender.version}
-
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
index 4ba44b6af..fdf0d28cc 100644
--- 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
@@ -20,25 +20,7 @@ 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.AbstractGlobalEndRequest;
-import io.seata.core.protocol.transaction.AbstractGlobalEndResponse;
-import io.seata.core.protocol.transaction.BranchRegisterRequest;
-import io.seata.core.protocol.transaction.BranchRegisterResponse;
-import io.seata.core.protocol.transaction.BranchReportRequest;
-import io.seata.core.protocol.transaction.BranchReportResponse;
-import io.seata.core.protocol.transaction.GlobalBeginRequest;
-import io.seata.core.protocol.transaction.GlobalBeginResponse;
-import io.seata.core.protocol.transaction.GlobalCommitRequest;
-import io.seata.core.protocol.transaction.GlobalCommitResponse;
-import io.seata.core.protocol.transaction.GlobalLockQueryRequest;
-import io.seata.core.protocol.transaction.GlobalLockQueryResponse;
-import io.seata.core.protocol.transaction.GlobalReportRequest;
-import io.seata.core.protocol.transaction.GlobalReportResponse;
-import io.seata.core.protocol.transaction.GlobalRollbackRequest;
-import io.seata.core.protocol.transaction.GlobalRollbackResponse;
-import io.seata.core.protocol.transaction.GlobalStatusRequest;
-import io.seata.core.protocol.transaction.GlobalStatusResponse;
-import io.seata.core.protocol.transaction.TCInboundHandler;
+import io.seata.core.protocol.transaction.*;
import io.seata.core.rpc.RpcContext;
import io.seata.server.session.GlobalSession;
import io.seata.server.session.SessionHolder;
@@ -52,293 +34,294 @@ import org.slf4j.LoggerFactory;
*/
public abstract class AbstractTCInboundHandler extends AbstractExceptionHandler implements TCInboundHandler {
- private static final Logger LOGGER = LoggerFactory.getLogger(AbstractTCInboundHandler.class);
+ 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;
- }
+ @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;
+ /**
+ * 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 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 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);
+ }
- @Override
- public void onException(GlobalCommitRequest request, GlobalCommitResponse response, Exception rex) {
- super.onException(request, response, rex);
- checkTransactionStatus(request, response);
- }
- }, request, response);
- return 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;
+ /**
+ * 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 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 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;
- }
+ @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;
+ /**
+ * 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;
- }
+ @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;
+ /**
+ * 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;
- }
+ @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;
+ /**
+ * 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;
- }
+ @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;
+ /**
+ * 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 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 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;
- }
+ @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;
+ /**
+ * 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;
- }
+ @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());
- }
- }
+ /**
+ * 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
index e3a533e70..55690fcaf 100644
--- 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
@@ -19,12 +19,11 @@ 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.core.constants.ConfigurationKeys;
import io.seata.server.env.ContainerHelper;
+import io.seata.server.store.StoreConfig;
-import static io.seata.common.DefaultValues.SERVER_DEFAULT_PORT;
-import static io.seata.common.DefaultValues.SERVER_DEFAULT_STORE_MODE;
import static io.seata.config.ConfigurationFactory.ENV_PROPERTY_KEY;
/**
@@ -34,131 +33,168 @@ import static io.seata.config.ConfigurationFactory.ENV_PROPERTY_KEY;
*/
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 String PROGRAM_NAME
+ = "sh seata-server.sh(for linux and mac) or cmd seata-server.bat(for windows)";
- @Parameter(names = "--help", help = true)
- private boolean help;
+ private static final Configuration CONFIG = ConfigurationFactory.getInstance();
- @Parameter(names = { "--host", "-h" }, description = "The ip to register to registry center.", order = 1)
- private String host;
+ @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;
- @Parameter(names = { "--port", "-p" }, description = "The port to listen.", order = 2)
- private int port = SERVER_DEFAULT_PORT;
+ /**
+ * Instantiates a new Parameter parser.
+ *
+ * @param args the args
+ */
+ public ParameterParser(String... args) {
+ this.init(args);
+ }
- @Parameter(names = { "--storeMode", "-m" }, description = "log store mode : file, db", order = 3)
- private String storeMode;
+ /**
+ * 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);
+ }
- @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;
+ 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);
+ }
+ }
- /**
- * Instantiates a new Parameter parser.
- * @param args the args
- */
- public ParameterParser(String[] args) {
- this.init(args);
- }
+ 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 init(String[] args) {
- try {
- if (ContainerHelper.isRunningInContainer()) {
- this.seataEnv = ContainerHelper.getEnv();
- this.host = ContainerHelper.getHost();
- this.port = ContainerHelper.getPort();
- this.serverNode = ContainerHelper.getServerNode();
- this.storeMode = ContainerHelper.getStoreMode();
- }
- else {
- JCommander jCommander = JCommander.newBuilder().addObject(this).build();
- jCommander.parse(args);
- if (help) {
- jCommander.setProgramName(PROGRAM_NAME);
- jCommander.usage();
- System.exit(0);
- }
- }
- if (StringUtils.isNotBlank(seataEnv)) {
- System.setProperty(ENV_PROPERTY_KEY, seataEnv);
- }
- if (StringUtils.isBlank(storeMode)) {
- storeMode = ConfigurationFactory.getInstance().getConfig(ConfigurationKeys.STORE_MODE,
- SERVER_DEFAULT_STORE_MODE);
- }
- }
- catch (ParameterException e) {
- printError(e);
- }
+ 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;
+ }
- private void printError(ParameterException e) {
- System.err.println("Option error " + e.getMessage());
- e.getJCommander().setProgramName(PROGRAM_NAME);
- e.usage();
- System.exit(0);
- }
+ /**
+ * Gets port.
+ *
+ * @return the port
+ */
+ public int getPort() {
+ return port;
+ }
- /**
- * Gets host.
- * @return the host
- */
- public String getHost() {
- return host;
- }
+ /**
+ * Gets store mode.
+ *
+ * @return the store mode
+ */
+ public String getStoreMode() {
+ return storeMode;
+ }
- /**
- * Gets port.
- * @return the port
- */
- public int getPort() {
- return port;
- }
+ /**
+ * Gets lock store mode.
+ *
+ * @return the store mode
+ */
+ public String getLockStoreMode() {
+ return lockStoreMode;
+ }
- /**
- * Gets store mode.
- * @return the store mode
- */
- public String getStoreMode() {
- return storeMode;
- }
+ /**
+ * Gets session store mode.
+ *
+ * @return the store mode
+ */
+ public String getSessionStoreMode() {
+ return sessionStoreMode;
+ }
- /**
- * Is help boolean.
- * @return the boolean
- */
- public boolean isHelp() {
- return help;
- }
+ /**
+ * Is help boolean.
+ *
+ * @return the boolean
+ */
+ public boolean isHelp() {
+ return help;
+ }
- /**
- * Gets server node.
- * @return the server node
- */
- public Long getServerNode() {
- return serverNode;
- }
+ /**
+ * 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;
- }
+ /**
+ * 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);
- }
- }
+ /**
+ * 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 665175b6f..000000000
--- a/pigx-visual/pigx-seata-server/src/main/java/io/seata/server/PigxSeataServer.java
+++ /dev/null
@@ -1,111 +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.core.constants.ConfigurationKeys;
-import io.seata.core.rpc.ShutdownHook;
-import io.seata.core.rpc.netty.NettyRemotingServer;
-import io.seata.core.rpc.netty.NettyServerConfig;
-import io.seata.server.coordinator.DefaultCoordinator;
-import io.seata.server.env.ContainerHelper;
-import io.seata.server.env.PortHelper;
-import io.seata.server.metrics.MetricsManager;
-import io.seata.server.session.SessionHolder;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.IOException;
-import java.util.concurrent.LinkedBlockingQueue;
-import java.util.concurrent.ThreadPoolExecutor;
-import java.util.concurrent.TimeUnit;
-
-/**
- * The type Server.
- *
- * @author slievrly
- */
-public class PigxSeataServer {
-
- /**
- * The entry point of application.
- * @param args the input arguments
- * @throws IOException the io exception
- */
- public static void main(String[] args) throws IOException {
- // get port first, use to logback.xml
- int port = PortHelper.getPort(args);
- System.setProperty(ConfigurationKeys.SERVER_PORT, Integer.toString(port));
-
- // create logger
- final Logger logger = LoggerFactory.getLogger(PigxSeataServer.class);
- if (ContainerHelper.isRunningInContainer()) {
- logger.info("The server is running in container.");
- }
-
- // 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();
-
- System.setProperty(ConfigurationKeys.STORE_MODE, parameterParser.getStoreMode());
-
- ThreadPoolExecutor workingThreads = new ThreadPoolExecutor(NettyServerConfig.getMinServerPoolSize(),
- NettyServerConfig.getMaxServerPoolSize(), NettyServerConfig.getKeepAliveTime(), TimeUnit.SECONDS,
- new LinkedBlockingQueue<>(NettyServerConfig.getMaxTaskQueueSize()),
- new NamedThreadFactory("ServerHandlerThread", NettyServerConfig.getMaxServerPoolSize()),
- new ThreadPoolExecutor.CallerRunsPolicy());
-
- NettyRemotingServer nettyRemotingServer = new NettyRemotingServer(workingThreads);
- // server port
- nettyRemotingServer.setListenPort(parameterParser.getPort());
- UUIDGenerator.init(parameterParser.getServerNode());
- // log store mode : file, db, redis
- SessionHolder.init(parameterParser.getStoreMode());
-
- DefaultCoordinator coordinator = new DefaultCoordinator(nettyRemotingServer);
- coordinator.init();
- nettyRemotingServer.setHandler(coordinator);
- // register ShutdownHook
- ShutdownHook.getInstance().addDisposable(coordinator);
- ShutdownHook.getInstance().addDisposable(nettyRemotingServer);
-
- // 127.0.0.1 and 0.0.0.0 are not valid here.
- if (NetUtil.isValidIp(parameterParser.getHost(), false)) {
- XID.setIpAddress(parameterParser.getHost());
- }
- else {
- XID.setIpAddress(NetUtil.getLocalIp());
- }
- XID.setPort(nettyRemotingServer.getListenPort());
-
- try {
- nettyRemotingServer.init();
- }
- catch (Throwable e) {
- logger.error("nettyServer init error:{}", e.getMessage(), e);
- System.exit(-1);
- }
-
- System.exit(0);
- }
-
-}
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
new file mode 100644
index 000000000..81eb1119e
--- /dev/null
+++ b/pigx-visual/pigx-seata-server/src/main/java/io/seata/server/Server.java
@@ -0,0 +1,89 @@
+/*
+ * 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/ServerApplication.java b/pigx-visual/pigx-seata-server/src/main/java/io/seata/server/ServerApplication.java
new file mode 100644
index 000000000..9b2df000d
--- /dev/null
+++ b/pigx-visual/pigx-seata-server/src/main/java/io/seata/server/ServerApplication.java
@@ -0,0 +1,32 @@
+/*
+ * 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 ServerApplication {
+ public static void main(String[] args) throws IOException {
+ // run the spring-boot application
+ SpringApplication.run(ServerApplication.class, args);
+ }
+}
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
new file mode 100644
index 000000000..e26301d75
--- /dev/null
+++ b/pigx-visual/pigx-seata-server/src/main/java/io/seata/server/ServerApplicationListener.java
@@ -0,0 +1,128 @@
+/*
+ * 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
new file mode 100644
index 000000000..d19233a06
--- /dev/null
+++ b/pigx-visual/pigx-seata-server/src/main/java/io/seata/server/ServerRunner.java
@@ -0,0 +1,81 @@
+/*
+ * 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
index dee5a338b..11aa492e9 100644
--- 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
@@ -24,29 +24,28 @@ import io.seata.common.util.IdWorker;
*/
public class UUIDGenerator {
- private static volatile IdWorker idWorker;
+ 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);
- }
+ /**
+ * 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
index bf0d531b3..ecfbfc12d 100644
--- 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
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package io.seata.server.auth;
import io.seata.config.ConfigurationFactory;
@@ -29,27 +28,26 @@ import static io.seata.common.DefaultValues.DEFAULT_SERVER_ENABLE_CHECK_AUTH;
*/
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);
+ 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);
- }
+ @Override
+ public boolean regTransactionManagerCheckAuth(RegisterTMRequest request) {
+ if (!ENABLE_CHECK_AUTH) {
+ return true;
+ }
+ return doRegTransactionManagerCheck(request);
+ }
- public abstract boolean doRegTransactionManagerCheck(RegisterTMRequest 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);
+ @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
index e98da6338..ed3e9343c 100644
--- 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
@@ -13,7 +13,6 @@
* 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;
@@ -26,14 +25,13 @@ import io.seata.core.protocol.RegisterTMRequest;
@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;
- }
+ @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/logging/logback/ansi/AnsiStyle.java b/pigx-visual/pigx-seata-server/src/main/java/io/seata/server/console/controller/BranchSessionController.java
similarity index 53%
rename from pigx-visual/pigx-seata-server/src/main/java/io/seata/server/logging/logback/ansi/AnsiStyle.java
rename to pigx-visual/pigx-seata-server/src/main/java/io/seata/server/console/controller/BranchSessionController.java
index 1080d9fc7..f5e7a89d7 100644
--- a/pigx-visual/pigx-seata-server/src/main/java/io/seata/server/logging/logback/ansi/AnsiStyle.java
+++ b/pigx-visual/pigx-seata-server/src/main/java/io/seata/server/console/controller/BranchSessionController.java
@@ -13,53 +13,24 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package io.seata.server.logging.logback.ansi;
+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;
/**
- * {@link AnsiElement Ansi} styles.
- *
- * @author Phillip Webb
- * @origin Copied from spring-boot.jar by wang.liang
+ * Branch Session Controller
+ * @author zhongxiang.wang
*/
-public enum AnsiStyle implements AnsiElement {
+@RestController
+@RequestMapping("console/branchSession")
+public class BranchSessionController {
- /**
- * normal
- */
- NORMAL("0"),
+ @Resource(type = BranchSessionService.class)
+ private BranchSessionService branchSessionService;
- /**
- * bold
- */
- BOLD("1"),
-
- /**
- * faint
- */
- FAINT("2"),
-
- /**
- * italic
- */
- ITALIC("3"),
-
- /**
- * underline
- */
- UNDERLINE("4");
-
- /**
- * code of style
- */
- private final String code;
-
- AnsiStyle(String code) {
- this.code = code;
- }
-
- @Override
- public String toString() {
- return this.code;
- }
}
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
new file mode 100644
index 000000000..d8ea221ce
--- /dev/null
+++ b/pigx-visual/pigx-seata-server/src/main/java/io/seata/server/console/controller/GlobalLockController.java
@@ -0,0 +1,51 @@
+/*
+ * 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
new file mode 100644
index 000000000..db34ace88
--- /dev/null
+++ b/pigx-visual/pigx-seata-server/src/main/java/io/seata/server/console/controller/GlobalSessionController.java
@@ -0,0 +1,50 @@
+/*
+ * 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
new file mode 100644
index 000000000..963b273cd
--- /dev/null
+++ b/pigx-visual/pigx-seata-server/src/main/java/io/seata/server/console/impl/db/BranchSessionDBServiceImpl.java
@@ -0,0 +1,101 @@
+/*
+ * 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
new file mode 100644
index 000000000..41d61efee
--- /dev/null
+++ b/pigx-visual/pigx-seata-server/src/main/java/io/seata/server/console/impl/db/GlobalLockDBServiceImpl.java
@@ -0,0 +1,145 @@
+/*
+ * 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