slievrly commented on code in PR #6420:
URL: https://github.com/apache/incubator-seata/pull/6420#discussion_r1527503866


##########
config/seata-config-core/src/main/java/org/apache/seata/config/CachedConfigurationChangeListener.java:
##########
@@ -0,0 +1,28 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.seata.config;
+
+public interface CachedConfigurationChangeListener extends 
ConfigurationChangeListener {
+
+    ConfigurationCache CONFIGURATION_CACHE = ConfigurationCache.getInstance();
+
+    @Override
+    default void afterEvent(ConfigurationChangeEvent event) {
+        ConfigurationChangeListener listener = 
(ConfigurationChangeListener)CONFIGURATION_CACHE;
+        listener.onProcessEvent(event);

Review Comment:
   > > CachedConfigurationChangeListener is an instance that holds state.
   > 
   > Since we must notify ConfigurationCache, and ConfigurationCache also 
implements ConfigurationChangeListener, why do we need to use it to make it 
strong, instead of defining it in a member variable? 
既然必定要通知到ConfigurationCache,而且ConfigurationCache 
也是实现了ConfigurationChangeListener,为什么要在使用使强壮,而不再成员变量中定义好?
   
   Sorry, I'm unable to understand the logic expressed here.
   



-- 
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