zrlw edited a comment on issue #8895:
URL: https://github.com/apache/dubbo/issues/8895#issuecomment-928979463


   现在MockClusterInvoker同时使用Directory和Invoker,二者相互隐式引用,维护和扩展代码都容易出问题,
   ```
       @Override
       public boolean isDestroyed() {
           return directory.isDestroyed();  <== 1
       }
       ...
       @Override
       public void destroy() {
           this.invoker.destroy(); <== 2
       }
   ```
   建议重构一下:
   1. 
MockClusterInvoker构造方法入参类型改为AbstractClusterInvoker,通过AbstractClusterInvoker.getDirectory()访问Directory;
   2. MockClusterWrapper的join方法返回类型改为AbstractClusterInvoker<T>。
   
   @chickenlj 
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to