Browse Source

REPORT-11216 10.0远程设计问题解决

isRoot缓存下,不用每次都rpc
research/10.0
ju 6 years ago
parent
commit
d60c3e6936
  1. 14
      designer-base/src/main/java/com/fr/design/env/RemoteWorkspace.java

14
designer-base/src/main/java/com/fr/design/env/RemoteWorkspace.java vendored

@ -21,6 +21,8 @@ public class RemoteWorkspace implements Workspace {
private final WorkspaceConnectionInfo connection;
private volatile Boolean isRoot = null;
RemoteWorkspace(WorkspaceClient client, WorkspaceConnectionInfo connection) {
this.client = client;
@ -54,11 +56,15 @@ public class RemoteWorkspace implements Workspace {
@Override
public boolean isRoot() {
try {
return WorkContext.getCurrent().get(DecisionOperator.class).isRoot(getConnection().getUserName());
} catch (Exception e) {
return false;
if (isRoot == null) {
synchronized (this) {
if (isRoot == null) {
isRoot = WorkContext.getCurrent().get(DecisionOperator.class).isRoot(getConnection().getUserName());
}
}
}
return isRoot;
}
@Override

Loading…
Cancel
Save