Browse Source

RPC调用自定义异常处理方法做抽象

research/11.0
Maksim 5 years ago
parent
commit
3ad25dcd1a
  1. 2
      designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java
  2. 7
      designer-base/src/main/java/com/fr/design/env/RemoteWorkspace.java

2
designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java

@ -279,7 +279,7 @@ public class EnvChangeEntrance {
} }
return noExistServiceSet; return noExistServiceSet;
} catch (Exception e){ } catch (Exception e){
e.printStackTrace(); FineLoggerFactory.getLogger().error(e.getMessage(),e);
return null; return null;
} }
} }

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

@ -1,6 +1,7 @@
package com.fr.design.env; package com.fr.design.env;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.rpc.ExceptionMethod;
import com.fr.stable.AssistUtils; import com.fr.stable.AssistUtils;
import com.fr.workspace.WorkContext; import com.fr.workspace.WorkContext;
import com.fr.workspace.Workspace; import com.fr.workspace.Workspace;
@ -83,11 +84,11 @@ public class RemoteWorkspace implements Workspace {
} }
@Override @Override
public <T> T get(Class<T> type, Method defaultMethod){ public <T> T get(Class<T> type, ExceptionMethod exceptionMethod){
if(defaultMethod != null) { if(exceptionMethod != null) {
WorkObjectPool objectPool = client.getPool(); WorkObjectPool objectPool = client.getPool();
if (objectPool instanceof WorkspaceProxyPool) { if (objectPool instanceof WorkspaceProxyPool) {
return ((WorkspaceProxyPool) objectPool).get(type, defaultMethod); return ((WorkspaceProxyPool) objectPool).get(type, exceptionMethod);
}else { }else {
return client.getPool().get(type); return client.getPool().get(type);
} }

Loading…
Cancel
Save