In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-26 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly introduces "the principle and application of ConfigFilterChainManager in nacos client". In daily operation, I believe that many people have doubts about the principle and application of ConfigFilterChainManager in nacos client. The editor consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful to answer the doubts about "the principle and application of ConfigFilterChainManager in nacos client". Next, please follow the editor to study!
Order
This paper mainly studies the ConfigFilterChainManager of nacos client.
IConfigFilterChain
Nacos-1.1.3/api/src/main/java/com/alibaba/nacos/api/config/filter/IConfigFilterChain.java
Public interface IConfigFilterChain {/ * * Filter aciton * * @ param request request * @ param response response * @ throws NacosException NacosException * / void doFilter (IConfigRequest request, IConfigResponse response) throws NacosException;}
The IConfigFilterChain interface defines the doFilter method
ConfigFilterChainManager
Nacos-1.1.3/client/src/main/java/com/alibaba/nacos/client/config/filter/impl/ConfigFilterChainManager.java
Public class ConfigFilterChainManager implements IConfigFilterChain {private List filters = Lists.newArrayList (); public synchronized ConfigFilterChainManager addFilter (IConfigFilter filter) {/ / insert int I = 0 in order of order size; while (I
< this.filters.size()) { IConfigFilter currentValue = this.filters.get(i); if (currentValue.getFilterName().equals(filter.getFilterName())) { break; } if (filter.getOrder() >= currentValue.getOrder () & & I < this.filters.size () {else {this.filters.add (I, filter); break;}} if (I = = this.filters.size ()) {this.filters.add (I, filter);} return this } @ Override public void doFilter (IConfigRequest request, IConfigResponse response) throws NacosException {new VirtualFilterChain (this.filters) .doFilter (request, response);} /.}
ConfigFilterChainManager implements the IConfigFilterChain interface, and its doFilter method uses filters to create the VirtualFilterChain, and then executes its doFilter method; it provides the addFilter method, which can be added to the filters according to the order order of the filter
VirtualFilterChain
Nacos-1.1.3/client/src/main/java/com/alibaba/nacos/client/config/filter/impl/ConfigFilterChainManager.java
Public class ConfigFilterChainManager implements IConfigFilterChain {/ /. Private static class VirtualFilterChain implements IConfigFilterChain {private final List
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.