|
@ -43,15 +43,7 @@ public class ServiceFlowEventService {
|
|
|
|
|
|
/**
|
|
|
* 当外界组件通知一个新的processor处理器被定义时,该事件被触发。
|
|
|
*
|
|
|
* @param serviceFlow 本次processor处理器变化,所涉及的服务流程Code标识。
|
|
|
* @param packageName processor处理器定义涉及的class包名
|
|
|
* @param className processor处理器定义涉及的class类名
|
|
|
* @param path processor处理器定义涉及的class内容,如果zookeeper数据结构中class分片存储,在业务级接口层面上也进行了合并
|
|
|
*/
|
|
|
// public void serviceFlowAdded(String serviceFlow, String packageName, String className, String path) {
|
|
|
// sendMsg(ServiceFlowConstant.SERVICE_FLOW_ADDED, serviceFlow, packageName, className, path);
|
|
|
// }
|
|
|
public void serviceFlowAdded(ServiceFlow serviceFlow) {
|
|
|
this.sendMsg(ServiceFlowConstant.SERVICE_FLOW_ADDED, serviceFlow);
|
|
|
}
|
|
@ -59,17 +51,10 @@ public class ServiceFlowEventService {
|
|
|
/**
|
|
|
* 当外界组件通知一个已有的processor处理器data部分发生变化时,该事件被触发。
|
|
|
*/
|
|
|
// public void serviceFlowModifiedAdd(String routeCode, String packageName, String className, String path) {
|
|
|
// this.sendMsg(ServiceFlowConstant.SERVICE_FLOW_MODIFIED_ADD, routeCode, packageName, className, path);
|
|
|
// }
|
|
|
public void serviceFlowModifiedAdd(ServiceFlow serviceFlow) {
|
|
|
this.sendMsg(ServiceFlowConstant.SERVICE_FLOW_MODIFIED_ADD, serviceFlow);
|
|
|
}
|
|
|
|
|
|
// public void serviceFlowModifiedReduce(String routeCode, String packageName, String className) {
|
|
|
// this.sendMsg(ServiceFlowConstant.SERVICE_FLOW_MODIFIED_REDUCE, routeCode, packageName, className, null);
|
|
|
//
|
|
|
// }
|
|
|
|
|
|
public void serviceFlowModifiedReduce(ServiceFlow serviceFlow) {
|
|
|
this.sendMsg(ServiceFlowConstant.SERVICE_FLOW_MODIFIED_REDUCE, serviceFlow);
|
|
@ -78,93 +63,11 @@ public class ServiceFlowEventService {
|
|
|
/**
|
|
|
* 当外界组件通知一个新的RouteDefine路由被定义时,该事件被触发
|
|
|
*/
|
|
|
// public void serviceFlowDelete(String routeCode, String packageName, String className, String path) {
|
|
|
// this.sendMsg(ServiceFlowConstant.SERVICE_FLOW_DELETED, routeCode, packageName, className, path);
|
|
|
// }
|
|
|
|
|
|
public void serviceFlowDelete(ServiceFlow serviceFlow) {
|
|
|
this.sendMsg(ServiceFlowConstant.SERVICE_FLOW_DELETED, serviceFlow);
|
|
|
}
|
|
|
//
|
|
|
// /**
|
|
|
// * 当外界组件通知一个已有的RouteDefine路由定义被改变时,主要就是路由定义内容被改变时,该事件被触发。
|
|
|
// */
|
|
|
// public void routeDefineChanged(String routeCode, String packageName, String className, String path) {
|
|
|
// this.sendMsg(ServiceFlowConstant.ROUTE_DEFINE_CHANGED, routeCode, packageName, className, path);
|
|
|
// }
|
|
|
//
|
|
|
// public void routeDefineChanged(ServiceFlow serviceFlow) {
|
|
|
// this.sendMsg(ServiceFlowConstant.ROUTE_DEFINE_CHANGED, serviceFlow);
|
|
|
// }
|
|
|
//
|
|
|
// /**
|
|
|
// * 当外界组件通知一个已有的RouteDefine路由定义被删除时,该事件被触发。
|
|
|
// */
|
|
|
// public void routeDefineDelete(String routeCode, String packageName, String className) {
|
|
|
// this.sendMsg(ServiceFlowConstant.ROUTE_DEFINE_DELETED, routeCode, packageName, className, null);
|
|
|
// }
|
|
|
//
|
|
|
// public void routeDefineDelete(ServiceFlow serviceFlow) {
|
|
|
// this.sendMsg(ServiceFlowConstant.ROUTE_DEFINE_DELETED, serviceFlow);
|
|
|
// }
|
|
|
//
|
|
|
// public void routeClassAdded(String routeCode, String packageName, String className, String path, String cron) {
|
|
|
// this.sendGenMsg(ServiceFlowConstant.ROUTE_CLASS_ADDED, routeCode, packageName, className, path, cron);
|
|
|
// }
|
|
|
//
|
|
|
// public void routeClassAdded(ServiceFlow serviceFlow) {
|
|
|
// this.sendMsg(ServiceFlowConstant.ROUTE_CLASS_ADDED, serviceFlow);
|
|
|
// }
|
|
|
//
|
|
|
// public void routeClassChanged(String routeCode, String packageName, String className, String path, String cron) {
|
|
|
// this.sendGenMsg(ServiceFlowConstant.ROUTE_CLASS_CHANGED, routeCode, packageName, className, path, cron);
|
|
|
// }
|
|
|
//
|
|
|
// public void routeClassChanged(ServiceFlow serviceFlow) {
|
|
|
// this.sendMsg(ServiceFlowConstant.ROUTE_CLASS_CHANGED, serviceFlow);
|
|
|
// }
|
|
|
//
|
|
|
// public void processorClassAdded(String routeCode, String packageName, String className, String path) {
|
|
|
// this.sendMsg(ServiceFlowConstant.PROCESSOR_CLASS_ADDED, routeCode, packageName, className, path);
|
|
|
// }
|
|
|
//
|
|
|
// public void processorClassAdded(ServiceFlow serviceFlow) {
|
|
|
// this.sendMsg(ServiceFlowConstant.PROCESSOR_CLASS_ADDED, serviceFlow);
|
|
|
// }
|
|
|
//
|
|
|
// public void processorClassChanged(String routeCode, String packageName, String className, String path) {
|
|
|
// this.sendMsg(ServiceFlowConstant.PROCESSOR_CLASS_CHANGED, routeCode, packageName, className, path);
|
|
|
// }
|
|
|
//
|
|
|
// public void processorClassChanged(ServiceFlow serviceFlow) {
|
|
|
// this.sendMsg(ServiceFlowConstant.PROCESSOR_CLASS_CHANGED, serviceFlow);
|
|
|
// }
|
|
|
//
|
|
|
// private void sendMsg(String event, String routeCode, String packageName, String className, String path) {
|
|
|
// ServiceFlow flow = new ServiceFlow();
|
|
|
// flow.setRouteCode(routeCode);
|
|
|
// ServiceFlow.HandleFile handleFile = new ServiceFlow.HandleFile();
|
|
|
// handleFile.setPackageName(packageName);
|
|
|
// handleFile.setClassName(className);
|
|
|
// handleFile.setFilePath(path);
|
|
|
// handleFile.setFileType(ServiceFlowConstant.CLASS);
|
|
|
// handleFile.setRouteCode(routeCode);
|
|
|
// flow.addHandleFile(handleFile);
|
|
|
//
|
|
|
// this.sendMsg(event, flow);
|
|
|
// }
|
|
|
//
|
|
|
// private void sendGenMsg(String event, String routeCode, String packageName, String className, String path, String cron) {
|
|
|
// ServiceFlow flow = new ServiceFlow();
|
|
|
// flow.setRouteCode(routeCode);
|
|
|
// ServiceFlow.HandleFile handleFile = new ServiceFlow.HandleFile();
|
|
|
// handleFile.setPackageName(packageName);
|
|
|
// handleFile.setClassName(className);
|
|
|
// handleFile.setFilePath(path);
|
|
|
// handleFile.setFileType(ServiceFlowConstant.JAVA);
|
|
|
// handleFile.setRouteCode(routeCode);
|
|
|
// flow.addHandleFile(handleFile);
|
|
|
// this.sendMsg(event, flow);
|
|
|
// }
|
|
|
|
|
|
|
|
|
private void sendMsg(String event, ServiceFlow serviceFlow) {
|
|
|
try {
|