Browse Source

Merge pull request #226 in DESIGN/design from ~ABEL.CHEN/design:release/10.0 to release/10.0

* commit '8daa87f8dd441add00640f60e71f015752e79a6b':
  改个名字
  fix
  设计器监听服务端配置修改
master
abel.chen 6 years ago
parent
commit
7ba6db706f
  1. 10
      designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java

10
designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java

@ -1,9 +1,11 @@
package com.fr.design.mainframe.socketio; package com.fr.design.mainframe.socketio;
import com.fr.config.RemoteConfigEvent;
import com.fr.decision.webservice.utils.DecisionServiceConstants; import com.fr.decision.webservice.utils.DecisionServiceConstants;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.loghandler.DesignerLogHandler; import com.fr.design.mainframe.loghandler.DesignerLogHandler;
import com.fr.env.operator.socket.SocketInfoOperator; import com.fr.env.operator.socket.SocketInfoOperator;
import com.fr.event.EventDispatcher;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.general.LogRecordTime; import com.fr.general.LogRecordTime;
import com.fr.general.LogUtils; import com.fr.general.LogUtils;
@ -58,6 +60,14 @@ public class DesignerSocketIO {
String uri = getSocketUri(current); String uri = getSocketUri(current);
socketIO = Optional.of(IO.socket(new URI(uri))); socketIO = Optional.of(IO.socket(new URI(uri)));
socketIO.get().on(WorkspaceConstants.WS_LOGRECORD, printLog); socketIO.get().on(WorkspaceConstants.WS_LOGRECORD, printLog);
socketIO.get().on(WorkspaceConstants.CONFIG_MODIFY, new Emitter.Listener() {
@Override
public void call(Object... objects) {
assert objects != null && objects.length == 1;
String param = (String) objects[0];
EventDispatcher.fire(RemoteConfigEvent.EDIT, param);
}
});
socketIO.get().on(Socket.EVENT_DISCONNECT, new Emitter.Listener() { socketIO.get().on(Socket.EVENT_DISCONNECT, new Emitter.Listener() {
@Override @Override
public void call(Object... objects) { public void call(Object... objects) {

Loading…
Cancel
Save