You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "chickenlj (via GitHub)" <gi...@apache.org> on 2023/08/14 03:02:42 UTC

[GitHub] [dubbo] chickenlj commented on a diff in pull request #12528: Feature improvement, only register one url for port unification.

chickenlj commented on code in PR #12528:
URL: https://github.com/apache/dubbo/pull/12528#discussion_r1292929195


##########
dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/deploy/DefaultApplicationDeployer.java:
##########
@@ -747,23 +747,27 @@ private void startModules() {
     }
 
     @Override
-    public void prepareApplicationInstance() {
+    public void prepareApplicationInstance(ModuleModel moduleModel) {

Review Comment:
   DefaultApplicationDeployer.java
   ```java
       public void notifyModuleChanged(ModuleModel moduleModel, DeployState state) {
           checkState(moduleModel, state);
       }
   
       public void checkState(ModuleModel moduleModel, DeployState moduleState) {
           synchronized (stateLock) {
               if (!moduleModel.isInternal() && moduleState == DeployState.STARTED) {
                   prepareApplicationInstance(moduleModel);
               }
   }
   ```
   
   It's currently designed to work this way: 
   1. when the state of a ModuleModel changes, it will call `notifyModuleChanged`
   2. `checkState` will then check if this ModelModel isInternal, if true, `prepareApplicationInstance(moduleModel);` will be called.
   
   ApplicationDeployer depends on ModuleModel mainly querying for statuses such as 'STARTED', 'isInternal', and 'hasRegistryInteraction'. All these statuses can be wrapped into an Event or something, but I think this can be further optimized with this issue 



-- 
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: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org