|
|
|
@ -33,6 +33,7 @@ import com.fr.workspace.Workspace;
|
|
|
|
|
import com.fr.workspace.base.WorkspaceConstants; |
|
|
|
|
import com.fr.workspace.connect.WorkspaceConnectionInfo; |
|
|
|
|
import com.fr.workspace.engine.exception.WorkspaceConnectionException; |
|
|
|
|
import com.fr.workspace.server.remote.RemoteCacheAttributeManager; |
|
|
|
|
import com.fr.workspace.server.socket.CustomLogEvent; |
|
|
|
|
import com.fr.workspace.server.socket.LogEventConverter; |
|
|
|
|
import io.socket.client.IO; |
|
|
|
@ -118,6 +119,7 @@ public class DesignerSocketIO {
|
|
|
|
|
socket = IO.socket(new URI(connectionInfo.getUri()), connectionInfo.getSocketConfig().createOptions()); |
|
|
|
|
socket.on(WorkspaceConstants.WS_LOGRECORD, printLog); |
|
|
|
|
socket.on(WorkspaceConstants.CONFIG_MODIFY, modifyConfig); |
|
|
|
|
socket.on(WorkspaceConstants.AUTHOR_SERVER_DATA_IT, authorServerDataIt); |
|
|
|
|
socket.on(Socket.EVENT_CONNECT_ERROR, failRetry); |
|
|
|
|
socket.on(Socket.EVENT_DISCONNECT, disConnectHint); |
|
|
|
|
socket.on(Socket.EVENT_CONNECT, handleConnect); |
|
|
|
@ -183,6 +185,7 @@ public class DesignerSocketIO {
|
|
|
|
|
if (disConnectHintTimer != null) { |
|
|
|
|
FineLoggerFactory.getLogger().info("cancel disConnectHintTimer"); |
|
|
|
|
disConnectHintTimer.cancel(); |
|
|
|
|
RemoteCacheAttributeManager.getInstance().stopPolling(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
@ -201,6 +204,7 @@ public class DesignerSocketIO {
|
|
|
|
|
dealWithSocketDisconnect(); |
|
|
|
|
} |
|
|
|
|
status = Status.Disconnected; |
|
|
|
|
RemoteCacheAttributeManager.getInstance().startPolling(); |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
@ -311,6 +315,14 @@ public class DesignerSocketIO {
|
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
private static final Emitter.Listener authorServerDataIt = new Emitter.Listener() { |
|
|
|
|
@Override |
|
|
|
|
public void call(Object... objects) { |
|
|
|
|
FineLoggerFactory.getLogger().info("[AuthServerDataSetNamesIt] update server data author"); |
|
|
|
|
RemoteCacheAttributeManager.getInstance().updateValue(WorkspaceConstants.AUTHOR_SERVER_DATA_IT); |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
private static void printLog(Object[] objects, PrintEventLog printEventLog, String prefix) { |
|
|
|
|
for (Object object : objects) { |
|
|
|
|
if (object instanceof Throwable) { |
|
|
|
|