From ebb917574c5b2d20ee475daa4498716a9d67470a Mon Sep 17 00:00:00 2001 From: CL <824983662@qq.com> Date: Thu, 7 Jun 2018 18:35:06 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=BE=E8=AE=A1=E5=99=A8=E7=9B=91=E5=90=AC?= =?UTF-8?q?=E6=9C=8D=E5=8A=A1=E7=AB=AF=E9=85=8D=E7=BD=AE=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../loghandler/socketio/DesignerSocketIO.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/designer-base/src/com/fr/design/mainframe/loghandler/socketio/DesignerSocketIO.java b/designer-base/src/com/fr/design/mainframe/loghandler/socketio/DesignerSocketIO.java index ac5a2ab01..51c1a8a85 100644 --- a/designer-base/src/com/fr/design/mainframe/loghandler/socketio/DesignerSocketIO.java +++ b/designer-base/src/com/fr/design/mainframe/loghandler/socketio/DesignerSocketIO.java @@ -1,5 +1,7 @@ package com.fr.design.mainframe.loghandler.socketio; +import com.fr.config.ConfigEvent; +import com.fr.config.Configuration; import com.fr.core.env.EnvConfig; import com.fr.core.env.EnvConstants; import com.fr.core.env.EnvContext; @@ -79,6 +81,18 @@ public class DesignerSocketIO { socketIO = Optional.of(IO.socket(new URI(uri))); socketIO.get().on(EnvConstants.WS_LOGRECORD, printLog); + socketIO.get().on(EnvConstants.CONFIG, new Emitter.Listener() { + @Override + public void call(Object... objects) { + if (objects == null || objects.length != 1) { + throw new IllegalArgumentException("config should have only one param"); + } + Object param = objects[0]; + if (param instanceof Class) { + EventDispatcher.fire(ConfigEvent.EDIT, (Class) param); + } + } + }); socketIO.get().connect(); } catch (Exception e) { FineLoggerFactory.getLogger().error(e.getMessage(), e);