{"id":719,"date":"2024-08-30T23:20:22","date_gmt":"2024-08-30T15:20:22","guid":{"rendered":"https:\/\/www.xudongvp.com\/?p=719"},"modified":"2024-08-30T23:20:24","modified_gmt":"2024-08-30T15:20:24","slug":"dubbo%e8%bf%87%e6%bb%a4%e5%99%a8%e5%bc%80%e5%8f%91%e8%a6%81%e7%82%b9%e4%b8%8e%e9%81%bf%e5%9d%91%e6%8c%87%e5%8d%97","status":"publish","type":"post","link":"https:\/\/www.xudongvp.com\/?p=719","title":{"rendered":"Dubbo\u8fc7\u6ee4\u5668\u5f00\u53d1\u8981\u70b9\u4e0e\u907f\u5751\u6307\u5357"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Dubbo\u8fc7\u6ee4\u5668\u662fdubbo\u63d0\u4f9b\u7684\u5e38\u89c1\u6269\u5c55\u673a\u5236\u4e4b\u4e00\uff0c\u7528\u4e8e\u652f\u6301\u7528\u6237\u5728dubbo\u7684\u751f\u547d\u5468\u671f\u91cc\u9762\u8fdb\u884c\u7edf\u4e00\u7684\u62e6\u622a\u5904\u7406\u548c\u7279\u8272\u5b9a\u5236\uff0c\u800c\u4e0d\u9700\u8981\u5bf9\u4e0a\u5c42\u4e1a\u52a1\u4ee3\u7801\u5927\u52a8\u5e72\u6208\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u4ece\u539f\u7406\u548c\u8bbe\u8ba1\u7406\u5ff5\u4e0a\u6765\u8bb2\uff0cDubbo\u7684\u8fc7\u6ee4\u5668\u662f\u5fc5\u987b\u8981\u80fd\u591f\u505a\u5230\u4e0a\u5c42\u4e1a\u52a1\u65e0\u611f\u548c\u514d\u914d\u7f6e\u7684\uff0c\u5426\u5219\u548b\u8fdb\u884c\u7edf\u4e00\u62e6\u622a\uff0c\u548b\u5077\u5077\u6478\u6478\u5e72\u574f\u4e8b\u5462\u3002\u4f46\u662f\u5e38\u89c1\u7684DubboFilter\u76f8\u5173\u6587\u6863\u548c\u5b9e\u8df5\u8bf4\u660e\u65f6\uff0c\u5f80\u5f80\u53ea\u8bf4\u4e86\u534a\u622a\u548c\u6700\u521d\u7ea7\u7684Filter\u5f00\u53d1\u77e5\u8bc6\uff0c\u5305\u62ecDubbo\u5b98\u7f51\u7684Filter\u6559\u7a0b\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u5b98\u7f51Filter\u6559\u7a0b\uff1a<a href=\"https:\/\/cn.dubbo.apache.org\/zh-cn\/overview\/tasks\/extensibility\/filter\/\">https:\/\/cn.dubbo.apache.org\/zh-cn\/overview\/tasks\/extensibility\/filter\/<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u5bfc\u81f4\u5927\u5bb6\u51fa\u73b0\u8bef\u89e3\uff0c\u53ea\u80fd\u5728\u6bd4\u5982provider\u6216\u8005consumer\u7684\u914d\u7f6e\u4e2d\uff0c\u6216\u8005service\u7684\u914d\u7f6e\u4e2d\uff0c\u914d\u7f6e\u4e86\u5177\u4f53\u7684filter\uff0c\u624d\u80fd\u751f\u6548\u3002\u8fd9\u771f\u662f\u4e2a\u5929\u5927\u7684\u8bef\u89e3\u3002\u8981\u662f\u8fd9\u6837\u7684\u8bdd\uff0cdubbo\u81ea\u5df1\u7684\u5185\u7f6e\u7684\u4e00\u5806filter\u600e\u4e48\u4e32\u8fdb\u53bb\u7684\uff1f\u5947\u8ff9\u4e48\uff1f<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u8fd9\u91cc\u5c31\u8981\u63d0\u5230\u4e00\u4e2a\u6ce8\u89e3\uff1a@Activate\uff0c\u5b98\u65b9\u7684\u4e00\u4e2a\u4f7f\u7528\u4f8b\u5b50\u5982\u4e0b\uff1a<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/cn.dubbo.apache.org\/zh-cn\/blog\/2018\/07\/01\/%E7%AC%AC%E4%B8%80%E4%B8%AA-dubbo-filter\">https:\/\/cn.dubbo.apache.org\/zh-cn\/blog\/2018\/07\/01\/%E7%AC%AC%E4%B8%80%E4%B8%AA-dubbo-filter<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u4f46\u662f\u4f7f\u7528@Activate\u7684\u65f6\u5019\u5343\u4e07\u8981\u6ce8\u610f\u51e0\u4e2a\u5c5e\u6027\u7684\u7528\u6cd5\uff0c\u4e00\u4e0d\u5c0f\u5fc3\u5c31\u4e0d\u662f\u81ea\u52a8\u6fc0\u6d3b\u4e86\u3002<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(3 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#2e3440ff\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" data-code=\"\/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the &quot;License&quot;); you may not use this file except in compliance with\n * the License.  You may obtain a copy of the License at\n *\n *     http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an &quot;AS IS&quot; BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\/\npackage org.apache.dubbo.common.extension;\n\nimport org.apache.dubbo.common.URL;\n\nimport java.lang.annotation.Documented;\nimport java.lang.annotation.ElementType;\nimport java.lang.annotation.Retention;\nimport java.lang.annotation.RetentionPolicy;\nimport java.lang.annotation.Target;\n\n\/**\n * Activate. This annotation is useful for automatically activate certain extensions with the given criteria,\n * for examples: &lt;code&gt;@Activate&lt;\/code&gt; can be used to load certain &lt;code&gt;Filter&lt;\/code&gt; extension when there are\n * multiple implementations.\n * &lt;ol&gt;\n * &lt;li&gt;{@link Activate#group()} specifies group criteria. Framework SPI defines the valid group values.\n * &lt;li&gt;{@link Activate#value()} specifies parameter key in {@link URL} criteria.\n * &lt;\/ol&gt;\n * SPI provider can call {@link ExtensionLoader#getActivateExtension(URL, String, String)} to find out all activated\n * extensions with the given criteria.\n *\n * @see SPI\n * @see URL\n * @see ExtensionLoader\n *\/\n@Documented\n@Retention(RetentionPolicy.RUNTIME)\n@Target({ElementType.TYPE, ElementType.METHOD})\npublic @interface Activate {\n    \/**\n     * Activate the current extension when one of the groups matches. The group passed into\n     * {@link ExtensionLoader#getActivateExtension(URL, String, String)} will be used for matching.\n     *\n     * @return group names to match\n     * @see ExtensionLoader#getActivateExtension(URL, String, String)\n     *\/\n    String[] group() default {};\n\n    \/**\n     * Activate the current extension when the specified keys appear in the URL's parameters.\n     * &lt;p&gt;\n     * For example, given &lt;code&gt;@Activate(&quot;cache, validation&quot;)&lt;\/code&gt;, the current extension will be return only when\n     * there's either &lt;code&gt;cache&lt;\/code&gt; or &lt;code&gt;validation&lt;\/code&gt; key appeared in the URL's parameters.\n     * &lt;\/p&gt;\n     *\n     * @return URL parameter keys\n     * @see ExtensionLoader#getActivateExtension(URL, String)\n     * @see ExtensionLoader#getActivateExtension(URL, String, String)\n     *\/\n    String[] value() default {};\n\n    \/**\n     * Relative ordering info, optional\n     * Deprecated since 2.7.0\n     *\n     * @return extension list which should be put before the current one\n     *\/\n    @Deprecated\n    String[] before() default {};\n\n    \/**\n     * Relative ordering info, optional\n     * Deprecated since 2.7.0\n     *\n     * @return extension list which should be put after the current one\n     *\/\n    @Deprecated\n    String[] after() default {};\n\n    \/**\n     * Absolute ordering info, optional\n     *\n     * Ascending order, smaller values will be in the front o the list.\n     *\n     * @return absolute ordering info\n     *\/\n    int order() default 0;\n\n    \/**\n     * Activate loadClass when the current extension when the specified className all match\n     * @return className names to all match\n     *\/\n    String[] onClass() default {};\n}\" style=\"color:#d8dee9ff;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki nord\" style=\"background-color: #2e3440ff\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #616E88\">\/*<\/span><\/span>\n<span class=\"line\"><span style=\"color: #616E88\"> * Licensed to the Apache Software Foundation (ASF) under one or more<\/span><\/span>\n<span class=\"line\"><span style=\"color: #616E88\"> * contributor license agreements.  See the NOTICE file distributed with<\/span><\/span>\n<span class=\"line\"><span style=\"color: #616E88\"> * this work for additional information regarding copyright ownership.<\/span><\/span>\n<span class=\"line\"><span style=\"color: #616E88\"> * The ASF licenses this file to You under the Apache License, Version 2.0<\/span><\/span>\n<span class=\"line\"><span style=\"color: #616E88\"> * (the &quot;License&quot;); you may not use this file except in compliance with<\/span><\/span>\n<span class=\"line\"><span style=\"color: #616E88\"> * the License.  You may obtain a copy of the License at<\/span><\/span>\n<span class=\"line\"><span style=\"color: #616E88\"> *<\/span><\/span>\n<span class=\"line\"><span style=\"color: #616E88\"> *     http:\/\/www.apache.org\/licenses\/LICENSE-2.0<\/span><\/span>\n<span class=\"line\"><span style=\"color: #616E88\"> *<\/span><\/span>\n<span class=\"line\"><span style=\"color: #616E88\"> * Unless required by applicable law or agreed to in writing, software<\/span><\/span>\n<span class=\"line\"><span style=\"color: #616E88\"> * distributed under the License is distributed on an &quot;AS IS&quot; BASIS,<\/span><\/span>\n<span class=\"line\"><span style=\"color: #616E88\"> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.<\/span><\/span>\n<span class=\"line\"><span style=\"color: #616E88\"> * See the License for the specific language governing permissions and<\/span><\/span>\n<span class=\"line\"><span style=\"color: #616E88\"> * limitations under the License.<\/span><\/span>\n<span class=\"line\"><span style=\"color: #616E88\"> *\/<\/span><\/span>\n<span class=\"line\"><span style=\"color: #81A1C1\">package<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">org<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #8FBCBB\">apache<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #8FBCBB\">dubbo<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #8FBCBB\">common<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #8FBCBB\">extension<\/span><span style=\"color: #81A1C1\">;<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #81A1C1\">import<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">org<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #8FBCBB\">apache<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #8FBCBB\">dubbo<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #8FBCBB\">common<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #8FBCBB\">URL<\/span><span style=\"color: #81A1C1\">;<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #81A1C1\">import<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">java<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #8FBCBB\">lang<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #8FBCBB\">annotation<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #8FBCBB\">Documented<\/span><span style=\"color: #81A1C1\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #81A1C1\">import<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">java<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #8FBCBB\">lang<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #8FBCBB\">annotation<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #8FBCBB\">ElementType<\/span><span style=\"color: #81A1C1\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #81A1C1\">import<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">java<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #8FBCBB\">lang<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #8FBCBB\">annotation<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #8FBCBB\">Retention<\/span><span style=\"color: #81A1C1\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #81A1C1\">import<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">java<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #8FBCBB\">lang<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #8FBCBB\">annotation<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #8FBCBB\">RetentionPolicy<\/span><span style=\"color: #81A1C1\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #81A1C1\">import<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">java<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #8FBCBB\">lang<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #8FBCBB\">annotation<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #8FBCBB\">Target<\/span><span style=\"color: #81A1C1\">;<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #616E88\">\/**<\/span><\/span>\n<span class=\"line\"><span style=\"color: #616E88\"> * Activate. This annotation is useful for automatically activate certain extensions with the given criteria,<\/span><\/span>\n<span class=\"line\"><span style=\"color: #616E88\"> * for examples: &lt;code&gt;@Activate&lt;\/code&gt; can be used to load certain &lt;code&gt;Filter&lt;\/code&gt; extension when there are<\/span><\/span>\n<span class=\"line\"><span style=\"color: #616E88\"> * multiple implementations.<\/span><\/span>\n<span class=\"line\"><span style=\"color: #616E88\"> * &lt;ol&gt;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #616E88\"> * &lt;li&gt;{<\/span><span style=\"color: #8FBCBB\">@link<\/span><span style=\"color: #616E88\"> <\/span><span style=\"color: #8FBCBB\">Activate<\/span><span style=\"color: #616E88\">#<\/span><span style=\"color: #D8DEE9\">group()<\/span><span style=\"color: #616E88\">} specifies group criteria. Framework SPI defines the valid group values.<\/span><\/span>\n<span class=\"line\"><span style=\"color: #616E88\"> * &lt;li&gt;{<\/span><span style=\"color: #8FBCBB\">@link<\/span><span style=\"color: #616E88\"> <\/span><span style=\"color: #8FBCBB\">Activate<\/span><span style=\"color: #616E88\">#<\/span><span style=\"color: #D8DEE9\">value()<\/span><span style=\"color: #616E88\">} specifies parameter key in {@link URL} criteria.<\/span><\/span>\n<span class=\"line\"><span style=\"color: #616E88\"> * &lt;\/ol&gt;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #616E88\"> * SPI provider can call {<\/span><span style=\"color: #8FBCBB\">@link<\/span><span style=\"color: #616E88\"> <\/span><span style=\"color: #8FBCBB\">ExtensionLoader<\/span><span style=\"color: #616E88\">#<\/span><span style=\"color: #D8DEE9\">getActivateExtension(URL, String, String)<\/span><span style=\"color: #616E88\">} to find out all activated<\/span><\/span>\n<span class=\"line\"><span style=\"color: #616E88\"> * extensions with the given criteria.<\/span><\/span>\n<span class=\"line\"><span style=\"color: #616E88\"> *<\/span><\/span>\n<span class=\"line\"><span style=\"color: #616E88\"> * <\/span><span style=\"color: #8FBCBB\">@see<\/span><span style=\"color: #616E88\"> SPI<\/span><\/span>\n<span class=\"line\"><span style=\"color: #616E88\"> * <\/span><span style=\"color: #8FBCBB\">@see<\/span><span style=\"color: #616E88\"> URL<\/span><\/span>\n<span class=\"line\"><span style=\"color: #616E88\"> * <\/span><span style=\"color: #8FBCBB\">@see<\/span><span style=\"color: #616E88\"> ExtensionLoader<\/span><\/span>\n<span class=\"line\"><span style=\"color: #616E88\"> *\/<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ECEFF4\">@<\/span><span style=\"color: #D08770\">Documented<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ECEFF4\">@<\/span><span style=\"color: #D08770\">Retention<\/span><span style=\"color: #ECEFF4\">(<\/span><span style=\"color: #D8DEE9\">RetentionPolicy<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #D8DEE9\">RUNTIME<\/span><span style=\"color: #ECEFF4\">)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ECEFF4\">@<\/span><span style=\"color: #D08770\">Target<\/span><span style=\"color: #ECEFF4\">({<\/span><span style=\"color: #D8DEE9\">ElementType<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #D8DEE9\">TYPE<\/span><span style=\"color: #ECEFF4\">,<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">ElementType<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #D8DEE9\">METHOD<\/span><span style=\"color: #ECEFF4\">})<\/span><\/span>\n<span class=\"line\"><span style=\"color: #81A1C1\">public<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">@<\/span><span style=\"color: #81A1C1\">interface<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D08770\">Activate<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">{<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #616E88\">\/**<\/span><\/span>\n<span class=\"line\"><span style=\"color: #616E88\">     * Activate the current extension when one of the groups matches. The group passed into<\/span><\/span>\n<span class=\"line\"><span style=\"color: #616E88\">     * {@link ExtensionLoader#getActivateExtension(URL, String, String)} will be used for matching.<\/span><\/span>\n<span class=\"line\"><span style=\"color: #616E88\">     *<\/span><\/span>\n<span class=\"line\"><span style=\"color: #616E88\">     * @return group names to match<\/span><\/span>\n<span class=\"line\"><span style=\"color: #616E88\">     * @see ExtensionLoader#getActivateExtension(URL, String, String)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #616E88\">     *\/<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #8FBCBB\">String<\/span><span style=\"color: #ECEFF4\">[]<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #88C0D0\">group<\/span><span style=\"color: #ECEFF4\">()<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">default<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">{}<\/span><span style=\"color: #81A1C1\">;<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #616E88\">\/**<\/span><\/span>\n<span class=\"line\"><span style=\"color: #616E88\">     * Activate the current extension when the specified keys appear in the URL&#39;s parameters.<\/span><\/span>\n<span class=\"line\"><span style=\"color: #616E88\">     * &lt;p&gt;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #616E88\">     * For example, given &lt;code&gt;@Activate(&quot;cache, validation&quot;)&lt;\/code&gt;, the current extension will be return only when<\/span><\/span>\n<span class=\"line\"><span style=\"color: #616E88\">     * there&#39;s either &lt;code&gt;cache&lt;\/code&gt; or &lt;code&gt;validation&lt;\/code&gt; key appeared in the URL&#39;s parameters.<\/span><\/span>\n<span class=\"line\"><span style=\"color: #616E88\">     * &lt;\/p&gt;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #616E88\">     *<\/span><\/span>\n<span class=\"line\"><span style=\"color: #616E88\">     * @return URL parameter keys<\/span><\/span>\n<span class=\"line\"><span style=\"color: #616E88\">     * @see ExtensionLoader#getActivateExtension(URL, String)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #616E88\">     * @see ExtensionLoader#getActivateExtension(URL, String, String)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #616E88\">     *\/<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #8FBCBB\">String<\/span><span style=\"color: #ECEFF4\">[]<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #88C0D0\">value<\/span><span style=\"color: #ECEFF4\">()<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">default<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">{}<\/span><span style=\"color: #81A1C1\">;<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #616E88\">\/**<\/span><\/span>\n<span class=\"line\"><span style=\"color: #616E88\">     * Relative ordering info, optional<\/span><\/span>\n<span class=\"line\"><span style=\"color: #616E88\">     * Deprecated since 2.7.0<\/span><\/span>\n<span class=\"line\"><span style=\"color: #616E88\">     *<\/span><\/span>\n<span class=\"line\"><span style=\"color: #616E88\">     * @return extension list which should be put before the current one<\/span><\/span>\n<span class=\"line\"><span style=\"color: #616E88\">     *\/<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #ECEFF4\">@<\/span><span style=\"color: #D08770\">Deprecated<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #8FBCBB\">String<\/span><span style=\"color: #ECEFF4\">[]<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #88C0D0\">before<\/span><span style=\"color: #ECEFF4\">()<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">default<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">{}<\/span><span style=\"color: #81A1C1\">;<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #616E88\">\/**<\/span><\/span>\n<span class=\"line\"><span style=\"color: #616E88\">     * Relative ordering info, optional<\/span><\/span>\n<span class=\"line\"><span style=\"color: #616E88\">     * Deprecated since 2.7.0<\/span><\/span>\n<span class=\"line\"><span style=\"color: #616E88\">     *<\/span><\/span>\n<span class=\"line\"><span style=\"color: #616E88\">     * @return extension list which should be put after the current one<\/span><\/span>\n<span class=\"line\"><span style=\"color: #616E88\">     *\/<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #ECEFF4\">@<\/span><span style=\"color: #D08770\">Deprecated<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #8FBCBB\">String<\/span><span style=\"color: #ECEFF4\">[]<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #88C0D0\">after<\/span><span style=\"color: #ECEFF4\">()<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">default<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">{}<\/span><span style=\"color: #81A1C1\">;<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #616E88\">\/**<\/span><\/span>\n<span class=\"line\"><span style=\"color: #616E88\">     * Absolute ordering info, optional<\/span><\/span>\n<span class=\"line\"><span style=\"color: #616E88\">     *<\/span><\/span>\n<span class=\"line\"><span style=\"color: #616E88\">     * Ascending order, smaller values will be in the front o the list.<\/span><\/span>\n<span class=\"line\"><span style=\"color: #616E88\">     *<\/span><\/span>\n<span class=\"line\"><span style=\"color: #616E88\">     * @return absolute ordering info<\/span><\/span>\n<span class=\"line\"><span style=\"color: #616E88\">     *\/<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #81A1C1\">int<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #88C0D0\">order<\/span><span style=\"color: #ECEFF4\">()<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">default<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #B48EAD\">0<\/span><span style=\"color: #81A1C1\">;<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #616E88\">\/**<\/span><\/span>\n<span class=\"line\"><span style=\"color: #616E88\">     * Activate loadClass when the current extension when the specified className all match<\/span><\/span>\n<span class=\"line\"><span style=\"color: #616E88\">     * @return className names to all match<\/span><\/span>\n<span class=\"line\"><span style=\"color: #616E88\">     *\/<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #8FBCBB\">String<\/span><span style=\"color: #ECEFF4\">[]<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #88C0D0\">onClass<\/span><span style=\"color: #ECEFF4\">()<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">default<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">{}<\/span><span style=\"color: #81A1C1\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ECEFF4\">}<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">\u6700\u540e\u4e00\u4e2a\u5c5e\u6027\uff0c\u5728\u8001\u7248\u672c\u4e2d\u6ca1\u6709\uff0c\u5148\u4e0d\u7528\u7ba1\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u4e24\u4e2a\u8fc7\u671f\u7684before\uff0cafter\u4e5f\u4e0d\u8981\u7ba1\u3002order\u7528\u6765\u6392\u5e8f\u7684\u3002group\u4f7f\u7528\u6765\u8fdb\u884c\u5206\u7ec4\u5339\u914d\u7684\uff0c\u5e38\u89c1\u7684\u5206\u7ec4\u6709<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">org.apache.dubbo.common.constants.CommonConstants.CONSUMER<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">org.apache.dubbo.common.constants.CommonConstants.PROVIDER<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#2e3440ff\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" data-code=\"public interface CommonConstants {\n\n    String DUBBO = &quot;dubbo&quot;;\n\n    String TRIPLE = &quot;tri&quot;;\n\n    String PROVIDER = &quot;provider&quot;;\n\n    String CONSUMER = &quot;consumer&quot;;\" style=\"color:#d8dee9ff;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki nord\" style=\"background-color: #2e3440ff\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #81A1C1\">public<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">interface<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">CommonConstants<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">{<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #8FBCBB\">String<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">DUBBO<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #A3BE8C\">dubbo<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #81A1C1\">;<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #8FBCBB\">String<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">TRIPLE<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #A3BE8C\">tri<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #81A1C1\">;<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #8FBCBB\">String<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">PROVIDER<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #A3BE8C\">provider<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #81A1C1\">;<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #8FBCBB\">String<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">CONSUMER<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #A3BE8C\">consumer<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #81A1C1\">;<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">\u5728Filter\u7684\u8fdb\u884c\u5982\u4e0b\u6ce8\u89e3<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#2e3440ff\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" data-code=\"@Activate(group = {CONSUMER, PROVIDER})\npublic class CacheFilter implements Filter {\" style=\"color:#d8dee9ff;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki nord\" style=\"background-color: #2e3440ff\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #ECEFF4\">@<\/span><span style=\"color: #D08770\">Activate<\/span><span style=\"color: #ECEFF4\">(<\/span><span style=\"color: #D8DEE9\">group<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">{<\/span><span style=\"color: #D8DEE9FF\">CONSUMER<\/span><span style=\"color: #ECEFF4\">,<\/span><span style=\"color: #D8DEE9FF\"> PROVIDER<\/span><span style=\"color: #ECEFF4\">})<\/span><\/span>\n<span class=\"line\"><span style=\"color: #81A1C1\">public<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">class<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">CacheFilter<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">implements<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB; font-weight: bold\">Filter<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">{<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">\u770b\u4e00\u4e0bdubbo\u4ee3\u7801\u4e2d\u7684\u662f\u5426\u6fc0\u6d3b\u7684\u5339\u914d\u6761\u4ef6\uff0c\u53ef\u4ee5\u770b\u5230group\u8981\u8fdb\u884c\u5339\u914d\uff0c\u7136\u540evalue\u4e5f\u4f1a\u8fdb\u884c\u5339\u914d\u3002\u5982\u679c\u4e0d\u7b26\u5408\u6761\u4ef6\u5219\u4e0d\u6fc0\u6d3b\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u6240\u4ee5\uff0c\u5982\u679c\u4f60\u52a0\u4e86\u8fd9\u4e2a\u6ce8\u89e3\uff0c\u8fd8\u4e0d\u751f\u6548\uff0c\u770b\u770b\u662f\u4e0d\u662f\u81ea\u5df1\u753b\u86c7\u6dfb\u8db3\uff0c\u5199\u4e86\u4e2avalue\u5427\uff1f\u5982\u679c\u4e0d\u4e86\u89e3value\u7684\u7528\u6cd5\uff0c\u4e0d\u8981\u968f\u4fbf\u5199\u3002\u5199\u4e0a\u5c31\u65e0\u6cd5\u6fc0\u6d3b\u3002<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#2e3440ff\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" data-code=\"if (isMatchGroup(group, activateGroup)\n                        &amp;&amp; !namesSet.contains(name)\n                        &amp;&amp; !namesSet.contains(REMOVE_VALUE_PREFIX + name)\n                        &amp;&amp; isActive(cachedActivateValues.get(name), url)) {\n\n                    activateExtensionsMap.put(getExtensionClass(name), getExtension(name));\n                }\" style=\"color:#d8dee9ff;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki nord\" style=\"background-color: #2e3440ff\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #81A1C1\">if<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">(<\/span><span style=\"color: #88C0D0\">isMatchGroup<\/span><span style=\"color: #ECEFF4\">(<\/span><span style=\"color: #D8DEE9FF\">group<\/span><span style=\"color: #ECEFF4\">,<\/span><span style=\"color: #D8DEE9FF\"> activateGroup<\/span><span style=\"color: #ECEFF4\">)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">                        <\/span><span style=\"color: #81A1C1\">&amp;&amp;<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">!<\/span><span style=\"color: #D8DEE9\">namesSet<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #88C0D0\">contains<\/span><span style=\"color: #ECEFF4\">(<\/span><span style=\"color: #D8DEE9FF\">name<\/span><span style=\"color: #ECEFF4\">)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">                        <\/span><span style=\"color: #81A1C1\">&amp;&amp;<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">!<\/span><span style=\"color: #D8DEE9\">namesSet<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #88C0D0\">contains<\/span><span style=\"color: #ECEFF4\">(<\/span><span style=\"color: #D8DEE9FF\">REMOVE_VALUE_PREFIX <\/span><span style=\"color: #81A1C1\">+<\/span><span style=\"color: #D8DEE9FF\"> name<\/span><span style=\"color: #ECEFF4\">)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">                        <\/span><span style=\"color: #81A1C1\">&amp;&amp;<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #88C0D0\">isActive<\/span><span style=\"color: #ECEFF4\">(<\/span><span style=\"color: #D8DEE9\">cachedActivateValues<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #88C0D0\">get<\/span><span style=\"color: #ECEFF4\">(<\/span><span style=\"color: #D8DEE9FF\">name<\/span><span style=\"color: #ECEFF4\">),<\/span><span style=\"color: #D8DEE9FF\"> url<\/span><span style=\"color: #ECEFF4\">))<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">{<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">                    <\/span><span style=\"color: #D8DEE9\">activateExtensionsMap<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #88C0D0\">put<\/span><span style=\"color: #ECEFF4\">(<\/span><span style=\"color: #88C0D0\">getExtensionClass<\/span><span style=\"color: #ECEFF4\">(<\/span><span style=\"color: #D8DEE9FF\">name<\/span><span style=\"color: #ECEFF4\">),<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #88C0D0\">getExtension<\/span><span style=\"color: #ECEFF4\">(<\/span><span style=\"color: #D8DEE9FF\">name<\/span><span style=\"color: #ECEFF4\">))<\/span><span style=\"color: #81A1C1\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">                <\/span><span style=\"color: #ECEFF4\">}<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">\u53e6\u5916\u63d0\u793aFilter\u5f00\u53d1\u8fc7\u7a0b\u907f\u5751<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">1\u3001\u786e\u4fddMETA-INF\/dubbo\u8fd9\u4e24\u7ea7\u662f\u7528\u521b\u5efa\u76ee\u5f55\u7684\u65b9\u5f0f\u5efa\u7acb\u8d77\u6765\u7684\uff0c\u522b\u7528\u521b\u5efa\u5305\u7684\u65b9\u5f0f\u5efa\u7acb\uff0c\u4e0d\u786e\u5b9a\u7684\u8bdd\uff0c\u5c31\u53bb\u6587\u4ef6\u7cfb\u7edf\u4e0a\u8001\u5b9e\u521b\u5efa\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">2\u3001\u786e\u4fdd\u4ee5\u4e0a\u8d44\u6e90\u6587\u4ef6\uff0c\u88ab\u6b63\u786e\u6253\u5305\u8fdb\u4e86jar\u5305\u4e2d\u3002\u901a\u5e38\u9700\u8981\u6ce8\u610fmaven\u7684resource\u914d\u7f6e\uff0c\u786e\u8ba4\u5305\u542b\u4e86\u5982\u4e0a\u76ee\u5f55\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">3\u3001Filter\u7684\u5f02\u5e38\u5904\u7406\uff0c\u4e00\u5b9a\u8981\u5145\u5206\uff0c\u81ea\u5df1\u4ee3\u7801\u5199\u5f97\u4e0d\u597d\u62a5\u9519\u4e0d\u8981\u7d27\uff0c\u522b\u628a\u6574\u4f53\u5e26\u5d29\u4e86\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Dubbo\u8fc7\u6ee4\u5668\u662fdubbo\u63d0\u4f9b\u7684\u5e38\u89c1\u6269\u5c55\u673a\u5236\u4e4b\u4e00\uff0c\u7528\u4e8e\u652f\u6301\u7528\u6237\u5728dubbo\u7684\u751f\u547d\u5468\u671f\u91cc\u9762\u8fdb\u884c\u7edf\u4e00\u7684\u62e6\u622a\u5904\u7406\u548c\u7279\u8272\u5b9a\u5236\uff0c\u800c\u4e0d\u9700\u8981\u5bf9\u4e0a\u5c42\u4e1a\u52a1\u4ee3\u7801\u5927\u52a8\u5e72\u6208\u3002 \u4ece\u539f\u7406\u548c\u8bbe\u8ba1\u7406\u5ff5\u4e0a\u6765\u8bb2\uff0cDubbo\u7684\u8fc7\u6ee4\u5668\u662f\u5fc5\u987b\u8981\u80fd\u591f\u505a\u5230\u4e0a\u5c42\u4e1a\u52a1\u65e0\u611f\u548c\u514d\u914d\u7f6e\u7684\uff0c\u5426\u5219\u548b\u8fdb\u884c\u7edf\u4e00\u62e6\u622a\uff0c\u548b\u5077\u5077\u6478\u6478\u5e72\u574f\u4e8b\u5462\u3002\u4f46\u662f\u5e38\u89c1\u7684DubboFilter\u76f8\u5173\u6587\u6863\u548c\u5b9e\u8df5\u8bf4\u660e\u65f6\uff0c\u5f80\u5f80\u53ea\u8bf4\u4e86\u534a\u622a\u548c\u6700\u521d\u7ea7\u7684Filter\u5f00\u53d1\u77e5\u8bc6\uff0c\u5305\u62ecDubbo\u5b98\u7f51\u7684Filter\u6559\u7a0b\u3002 \u5b98\u7f51Filter\u6559\u7a0b\uff1ahttps:\/\/cn.dubbo.apache.org\/zh-cn\/overview\/tasks\/extensibility\/filter\/ \u5bfc\u81f4\u5927\u5bb6\u51fa\u73b0\u8bef\u89e3\uff0c\u53ea &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[23],"tags":[86,87],"class_list":["post-719","post","type-post","status-publish","format-standard","hentry","category-23","tag-dubbo","tag-filter"],"_links":{"self":[{"href":"https:\/\/www.xudongvp.com\/index.php?rest_route=\/wp\/v2\/posts\/719","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.xudongvp.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.xudongvp.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.xudongvp.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.xudongvp.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=719"}],"version-history":[{"count":1,"href":"https:\/\/www.xudongvp.com\/index.php?rest_route=\/wp\/v2\/posts\/719\/revisions"}],"predecessor-version":[{"id":720,"href":"https:\/\/www.xudongvp.com\/index.php?rest_route=\/wp\/v2\/posts\/719\/revisions\/720"}],"wp:attachment":[{"href":"https:\/\/www.xudongvp.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=719"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.xudongvp.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=719"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.xudongvp.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=719"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}