From 6e439e8cc4f3832b9ed2e8a45920d02539e180ae Mon Sep 17 00:00:00 2001
From: wuxw <928255095@qq.com>
Date: 星期五, 11 十一月 2022 12:19:54 +0800
Subject: [PATCH] 测试工商银行 支付 可能会编译失败
---
java110-core/src/main/java/com/java110/core/event/cmd/ServiceCmdEventPublishing.java | 58 ++++++++++++++++++++++++++--------------------------------
1 files changed, 26 insertions(+), 32 deletions(-)
diff --git a/java110-core/src/main/java/com/java110/core/event/cmd/ServiceCmdEventPublishing.java b/java110-core/src/main/java/com/java110/core/event/cmd/ServiceCmdEventPublishing.java
index 02dfd5d..add6586 100644
--- a/java110-core/src/main/java/com/java110/core/event/cmd/ServiceCmdEventPublishing.java
+++ b/java110-core/src/main/java/com/java110/core/event/cmd/ServiceCmdEventPublishing.java
@@ -3,22 +3,21 @@
import com.alibaba.fastjson.JSONObject;
import com.java110.core.context.ICmdDataFlowContext;
import com.java110.core.event.center.DataFlowListenerOrderComparator;
+import com.java110.core.factory.GenerateCodeFactory;
+import com.java110.core.log.LoggerFactory;
import com.java110.dto.CmdListenerDto;
+import com.java110.dto.logSystemError.LogSystemErrorDto;
+import com.java110.po.logSystemError.LogSystemErrorPo;
import com.java110.utils.constant.CommonConstant;
import com.java110.utils.constant.ResponseConstant;
import com.java110.utils.exception.BusinessException;
-import com.java110.utils.exception.CmdException;
import com.java110.utils.exception.ListenerExecuteException;
import com.java110.utils.factory.ApplicationContextFactory;
import com.java110.utils.log.LoggerEngine;
import com.java110.utils.util.Assert;
+import com.java110.utils.util.ExceptionUtil;
import org.slf4j.Logger;
-import com.java110.core.log.LoggerFactory;
-import sun.misc.ProxyGenerator;
-
-import java.io.File;
-import java.io.FileOutputStream;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
@@ -109,7 +108,7 @@
*
* @param cmdDataFlowContext
*/
- public static void multicastEvent(ICmdDataFlowContext cmdDataFlowContext) throws BusinessException {
+ public static void multicastEvent(ICmdDataFlowContext cmdDataFlowContext) throws Exception {
Assert.notNull(cmdDataFlowContext.getServiceCode(), "褰撳墠娌℃湁鍙鐞嗙殑涓氬姟淇℃伅锛�");
multicastEvent(cmdDataFlowContext.getServiceCode(), cmdDataFlowContext, null);
}
@@ -121,7 +120,7 @@
* @param serviceCode
* @param dataFlowContext
*/
- public static void multicastEvent(String serviceCode, ICmdDataFlowContext dataFlowContext) throws BusinessException {
+ public static void multicastEvent(String serviceCode, ICmdDataFlowContext dataFlowContext) throws Exception {
multicastEvent(serviceCode, dataFlowContext, null);
}
@@ -131,14 +130,15 @@
* @param serviceCode
* @param dataFlowContext 杩欎釜璁㈠崟淇℃伅锛屼互渚夸簬 渚﹀惉閭h竟闇�瑕佺敤
*/
- public static void multicastEvent(String serviceCode, ICmdDataFlowContext dataFlowContext, String asyn) throws BusinessException {
+ public static void multicastEvent(String serviceCode, ICmdDataFlowContext dataFlowContext, String asyn) throws Exception {
try {
CmdEvent targetDataFlowEvent = new CmdEvent(serviceCode, dataFlowContext);
multicastEvent(serviceCode, targetDataFlowEvent, asyn);
} catch (Exception e) {
logger.error("鍙戝竷渚﹀惉澶辫触锛屽け璐ュ師鍥犱负锛�", e);
- throw new BusinessException(ResponseConstant.RESULT_CODE_INNER_ERROR, e.getMessage());
+ //throw new BusinessException(ResponseConstant.RESULT_CODE_INNER_ERROR, e.getMessage());
+ throw e;
}
}
@@ -150,7 +150,7 @@
* @param event
* @param asyn A 琛ㄧず寮傛澶勭悊
*/
- public static void multicastEvent(String serviceCode, final CmdEvent event, String asyn) {
+ public static void multicastEvent(String serviceCode, final CmdEvent event, String asyn) throws Exception {
List<ServiceCmdListener> listeners = getListeners(serviceCode);
//杩欓噷鍒ゆ柇 serviceCode + httpMethod 鐨勪睛鍚紝濡傛灉娌℃湁娉ㄥ唽鐩存帴鎶ラ敊銆�
if (listeners == null || listeners.size() == 0) {
@@ -165,7 +165,11 @@
executor.execute(new Runnable() {
@Override
public void run() {
- invokeListener(listener, event);
+ try {
+ invokeListener(listener, event);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
}
});
break;
@@ -195,36 +199,26 @@
* @since 4.1
*/
@SuppressWarnings({"unchecked", "rawtypes"})
- protected static void invokeListener(ServiceCmdListener listener, CmdEvent event) {
+ protected static void invokeListener(ServiceCmdListener listener, CmdEvent event) throws Exception {
try {
// //杩欓噷澶勭悊涓氬姟閫昏緫鏁版嵁
- ICmdDataFlowContext dataFlowContext = event.getCmdDataFlowContext();
- //鑾峰彇璇锋眰鏁版嵁
- JSONObject reqJson = dataFlowContext.getReqJson();
+ ICmdDataFlowContext dataFlowContext = event.getCmdDataFlowContext();
+ //鑾峰彇璇锋眰鏁版嵁
+ JSONObject reqJson = dataFlowContext.getReqJson();
- logger.debug("API鏈嶅姟 --- 璇锋眰鍙傛暟涓猴細{}", reqJson.toJSONString());
+ logger.debug("API鏈嶅姟 --- 璇锋眰鍙傛暟涓猴細{}", reqJson.toJSONString());
listener.validate(event, dataFlowContext, reqJson);
listener.doCmd(event, dataFlowContext, reqJson);
- //logger.debug("API鏈嶅姟 --- 杩斿洖鎶ユ枃淇℃伅锛歿}", dataFlowContext.getResponseEntity());
- // listener.cmd(event);
- } catch (CmdException e) {
- LoggerEngine.error("鍙戝竷渚﹀惉澶辫触", e);
+ //logger.debug("API鏈嶅姟 --- 杩斿洖鎶ユ枃淇℃伅锛歿}", dataFlowContext.getResponseEntity());
+ // listener.cmd(event);
+ } catch (Throwable e) {
+ LoggerEngine.error("鍙戝竷渚﹀惉澶辫触" + e);
throw e;
}
}
- public static void testPoxy(Class clazz){
- byte[] bytes = ProxyGenerator.generateProxyClass("$Proxy", new Class[]{clazz});
- try(
- FileOutputStream fos =new FileOutputStream(new File("D:/$Proxy.class"))
- ){
- fos.write(bytes);
- fos.flush();
- }catch (Exception e){
- e.printStackTrace();
- }
- }
+
}
--
Gitblit v1.8.0