|
|
@ -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) { |
|
|
|