From cce0bd81ecd1071bdc54eb530d447cb0238f245e Mon Sep 17 00:00:00 2001 From: huazhongming Date: Fri, 18 Nov 2022 10:03:05 +0800 Subject: [PATCH] update spi for native code (#10951) Signed-off-by: crazyhzm Signed-off-by: crazyhzm --- .../MetricsReporterFactory$Adaptive.java | 30 ++++++++++++++ .../threadpool/ThreadPool$Adaptive.java | 30 ++++++++++++++ ...lationExecutorSupportFactory$Adaptive.java | 33 ++++++++++++++++ .../MetricsReporterFactory$Adaptive.java | 30 ++++++++++++++ .../serialize/Serialization$Adaptive.java | 4 +- .../MetadataReportFactory$Adaptive.java | 2 +- .../registry/RegistryFactory$Adaptive.java | 2 +- .../PortUnificationTransporter$Adaptive.java | 39 +++++++++++++++++++ .../state/StateRouterFactory$Adaptive.java | 7 ++-- ...lationExecutorSupportFactory$Adaptive.java | 33 ++++++++++++++++ 10 files changed, 202 insertions(+), 8 deletions(-) create mode 100644 dubbo-native-plugin/src/main/java/org/apache/dubbo/common/metrics/MetricsReporterFactory$Adaptive.java create mode 100644 dubbo-native-plugin/src/main/java/org/apache/dubbo/common/threadpool/ThreadPool$Adaptive.java create mode 100644 dubbo-native-plugin/src/main/java/org/apache/dubbo/rpc/executor/IsolationExecutorSupportFactory$Adaptive.java create mode 100644 dubbo-native/src/main/java/org/apache/dubbo/common/metrics/MetricsReporterFactory$Adaptive.java create mode 100644 dubbo-native/src/main/java/org/apache/dubbo/remoting/api/pu/PortUnificationTransporter$Adaptive.java create mode 100644 dubbo-native/src/main/java/org/apache/dubbo/rpc/executor/IsolationExecutorSupportFactory$Adaptive.java diff --git a/dubbo-native-plugin/src/main/java/org/apache/dubbo/common/metrics/MetricsReporterFactory$Adaptive.java b/dubbo-native-plugin/src/main/java/org/apache/dubbo/common/metrics/MetricsReporterFactory$Adaptive.java new file mode 100644 index 0000000000..aa288ce381 --- /dev/null +++ b/dubbo-native-plugin/src/main/java/org/apache/dubbo/common/metrics/MetricsReporterFactory$Adaptive.java @@ -0,0 +1,30 @@ +/* + * 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.dubbo.common.metrics; +import org.apache.dubbo.rpc.model.ScopeModel; +import org.apache.dubbo.rpc.model.ScopeModelUtil; +public class MetricsReporterFactory$Adaptive implements org.apache.dubbo.common.metrics.MetricsReporterFactory { +public org.apache.dubbo.common.metrics.MetricsReporter createMetricsReporter(org.apache.dubbo.common.URL arg0) { +if (arg0 == null) throw new IllegalArgumentException("url == null"); +org.apache.dubbo.common.URL url = arg0; +String extName = ( url.getProtocol() == null ? "nop" : url.getProtocol() ); +if(extName == null) throw new IllegalStateException("Failed to get extension (org.apache.dubbo.common.metrics.MetricsReporterFactory) name from url (" + url.toString() + ") use keys([protocol])"); +ScopeModel scopeModel = ScopeModelUtil.getOrDefault(url.getScopeModel(), org.apache.dubbo.common.metrics.MetricsReporterFactory.class); +org.apache.dubbo.common.metrics.MetricsReporterFactory extension = (org.apache.dubbo.common.metrics.MetricsReporterFactory)scopeModel.getExtensionLoader(org.apache.dubbo.common.metrics.MetricsReporterFactory.class).getExtension(extName); +return extension.createMetricsReporter(arg0); +} +} diff --git a/dubbo-native-plugin/src/main/java/org/apache/dubbo/common/threadpool/ThreadPool$Adaptive.java b/dubbo-native-plugin/src/main/java/org/apache/dubbo/common/threadpool/ThreadPool$Adaptive.java new file mode 100644 index 0000000000..194958ed19 --- /dev/null +++ b/dubbo-native-plugin/src/main/java/org/apache/dubbo/common/threadpool/ThreadPool$Adaptive.java @@ -0,0 +1,30 @@ +/* + * 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.dubbo.common.threadpool; +import org.apache.dubbo.rpc.model.ScopeModel; +import org.apache.dubbo.rpc.model.ScopeModelUtil; +public class ThreadPool$Adaptive implements org.apache.dubbo.common.threadpool.ThreadPool { +public java.util.concurrent.Executor getExecutor(org.apache.dubbo.common.URL arg0) { +if (arg0 == null) throw new IllegalArgumentException("url == null"); +org.apache.dubbo.common.URL url = arg0; +String extName = url.getParameter("threadpool", "fixed"); +if(extName == null) throw new IllegalStateException("Failed to get extension (org.apache.dubbo.common.threadpool.ThreadPool) name from url (" + url.toString() + ") use keys([threadpool])"); +ScopeModel scopeModel = ScopeModelUtil.getOrDefault(url.getScopeModel(), org.apache.dubbo.common.threadpool.ThreadPool.class); +org.apache.dubbo.common.threadpool.ThreadPool extension = (org.apache.dubbo.common.threadpool.ThreadPool)scopeModel.getExtensionLoader(org.apache.dubbo.common.threadpool.ThreadPool.class).getExtension(extName); +return extension.getExecutor(arg0); +} +} diff --git a/dubbo-native-plugin/src/main/java/org/apache/dubbo/rpc/executor/IsolationExecutorSupportFactory$Adaptive.java b/dubbo-native-plugin/src/main/java/org/apache/dubbo/rpc/executor/IsolationExecutorSupportFactory$Adaptive.java new file mode 100644 index 0000000000..6360d71c54 --- /dev/null +++ b/dubbo-native-plugin/src/main/java/org/apache/dubbo/rpc/executor/IsolationExecutorSupportFactory$Adaptive.java @@ -0,0 +1,33 @@ +/* + * 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.dubbo.rpc.executor; +import org.apache.dubbo.rpc.model.ScopeModel; +import org.apache.dubbo.rpc.model.ScopeModelUtil; +public class IsolationExecutorSupportFactory$Adaptive implements org.apache.dubbo.rpc.executor.IsolationExecutorSupportFactory { +public org.apache.dubbo.rpc.executor.ExecutorSupport getIsolationExecutorSupport(org.apache.dubbo.common.URL arg0) { +throw new UnsupportedOperationException("The method public static org.apache.dubbo.rpc.executor.ExecutorSupport org.apache.dubbo.rpc.executor.IsolationExecutorSupportFactory.getIsolationExecutorSupport(org.apache.dubbo.common.URL) of interface org.apache.dubbo.rpc.executor.IsolationExecutorSupportFactory is not adaptive method!"); +} +public org.apache.dubbo.rpc.executor.ExecutorSupport createIsolationExecutorSupport(org.apache.dubbo.common.URL arg0) { +if (arg0 == null) throw new IllegalArgumentException("url == null"); +org.apache.dubbo.common.URL url = arg0; +String extName = ( url.getProtocol() == null ? "adaptive" : url.getProtocol() ); +if(extName == null) throw new IllegalStateException("Failed to get extension (org.apache.dubbo.rpc.executor.IsolationExecutorSupportFactory) name from url (" + url.toString() + ") use keys([protocol])"); +ScopeModel scopeModel = ScopeModelUtil.getOrDefault(url.getScopeModel(), org.apache.dubbo.rpc.executor.IsolationExecutorSupportFactory.class); +org.apache.dubbo.rpc.executor.IsolationExecutorSupportFactory extension = (org.apache.dubbo.rpc.executor.IsolationExecutorSupportFactory)scopeModel.getExtensionLoader(org.apache.dubbo.rpc.executor.IsolationExecutorSupportFactory.class).getExtension(extName); +return extension.createIsolationExecutorSupport(arg0); +} +} diff --git a/dubbo-native/src/main/java/org/apache/dubbo/common/metrics/MetricsReporterFactory$Adaptive.java b/dubbo-native/src/main/java/org/apache/dubbo/common/metrics/MetricsReporterFactory$Adaptive.java new file mode 100644 index 0000000000..aa288ce381 --- /dev/null +++ b/dubbo-native/src/main/java/org/apache/dubbo/common/metrics/MetricsReporterFactory$Adaptive.java @@ -0,0 +1,30 @@ +/* + * 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.dubbo.common.metrics; +import org.apache.dubbo.rpc.model.ScopeModel; +import org.apache.dubbo.rpc.model.ScopeModelUtil; +public class MetricsReporterFactory$Adaptive implements org.apache.dubbo.common.metrics.MetricsReporterFactory { +public org.apache.dubbo.common.metrics.MetricsReporter createMetricsReporter(org.apache.dubbo.common.URL arg0) { +if (arg0 == null) throw new IllegalArgumentException("url == null"); +org.apache.dubbo.common.URL url = arg0; +String extName = ( url.getProtocol() == null ? "nop" : url.getProtocol() ); +if(extName == null) throw new IllegalStateException("Failed to get extension (org.apache.dubbo.common.metrics.MetricsReporterFactory) name from url (" + url.toString() + ") use keys([protocol])"); +ScopeModel scopeModel = ScopeModelUtil.getOrDefault(url.getScopeModel(), org.apache.dubbo.common.metrics.MetricsReporterFactory.class); +org.apache.dubbo.common.metrics.MetricsReporterFactory extension = (org.apache.dubbo.common.metrics.MetricsReporterFactory)scopeModel.getExtensionLoader(org.apache.dubbo.common.metrics.MetricsReporterFactory.class).getExtension(extName); +return extension.createMetricsReporter(arg0); +} +} diff --git a/dubbo-native/src/main/java/org/apache/dubbo/common/serialize/Serialization$Adaptive.java b/dubbo-native/src/main/java/org/apache/dubbo/common/serialize/Serialization$Adaptive.java index 9bf19889e7..ae3a0b6d6a 100644 --- a/dubbo-native/src/main/java/org/apache/dubbo/common/serialize/Serialization$Adaptive.java +++ b/dubbo-native/src/main/java/org/apache/dubbo/common/serialize/Serialization$Adaptive.java @@ -27,7 +27,7 @@ throw new UnsupportedOperationException("The method public abstract java.lang.St public org.apache.dubbo.common.serialize.ObjectInput deserialize(org.apache.dubbo.common.URL arg0, java.io.InputStream arg1) throws java.io.IOException { if (arg0 == null) throw new IllegalArgumentException("url == null"); org.apache.dubbo.common.URL url = arg0; -String extName = url.getParameter("serialization", "hessian2"); +String extName = url.getParameter("serialization", "adaptive"); if(extName == null) throw new IllegalStateException("Failed to get extension (org.apache.dubbo.common.serialize.Serialization) name from url (" + url.toString() + ") use keys([serialization])"); ScopeModel scopeModel = ScopeModelUtil.getOrDefault(url.getScopeModel(), org.apache.dubbo.common.serialize.Serialization.class); org.apache.dubbo.common.serialize.Serialization extension = (org.apache.dubbo.common.serialize.Serialization)scopeModel.getExtensionLoader(org.apache.dubbo.common.serialize.Serialization.class).getExtension(extName); @@ -36,7 +36,7 @@ return extension.deserialize(arg0, arg1); public org.apache.dubbo.common.serialize.ObjectOutput serialize(org.apache.dubbo.common.URL arg0, java.io.OutputStream arg1) throws java.io.IOException { if (arg0 == null) throw new IllegalArgumentException("url == null"); org.apache.dubbo.common.URL url = arg0; -String extName = url.getParameter("serialization", "hessian2"); +String extName = url.getParameter("serialization", "adaptive"); if(extName == null) throw new IllegalStateException("Failed to get extension (org.apache.dubbo.common.serialize.Serialization) name from url (" + url.toString() + ") use keys([serialization])"); ScopeModel scopeModel = ScopeModelUtil.getOrDefault(url.getScopeModel(), org.apache.dubbo.common.serialize.Serialization.class); org.apache.dubbo.common.serialize.Serialization extension = (org.apache.dubbo.common.serialize.Serialization)scopeModel.getExtensionLoader(org.apache.dubbo.common.serialize.Serialization.class).getExtension(extName); diff --git a/dubbo-native/src/main/java/org/apache/dubbo/metadata/report/MetadataReportFactory$Adaptive.java b/dubbo-native/src/main/java/org/apache/dubbo/metadata/report/MetadataReportFactory$Adaptive.java index 069e3b940f..0816ad1ec3 100644 --- a/dubbo-native/src/main/java/org/apache/dubbo/metadata/report/MetadataReportFactory$Adaptive.java +++ b/dubbo-native/src/main/java/org/apache/dubbo/metadata/report/MetadataReportFactory$Adaptive.java @@ -28,6 +28,6 @@ org.apache.dubbo.metadata.report.MetadataReportFactory extension = (org.apache.d return extension.getMetadataReport(arg0); } public void destroy() { -throw new UnsupportedOperationException("The method public abstract void org.apache.dubbo.metadata.report.MetadataReportFactory.destroy() of interface org.apache.dubbo.metadata.report.MetadataReportFactory is not adaptive method!"); +throw new UnsupportedOperationException("The method public default void org.apache.dubbo.metadata.report.MetadataReportFactory.destroy() of interface org.apache.dubbo.metadata.report.MetadataReportFactory is not adaptive method!"); } } diff --git a/dubbo-native/src/main/java/org/apache/dubbo/registry/RegistryFactory$Adaptive.java b/dubbo-native/src/main/java/org/apache/dubbo/registry/RegistryFactory$Adaptive.java index 85bb0b61d1..8b3ebc963e 100644 --- a/dubbo-native/src/main/java/org/apache/dubbo/registry/RegistryFactory$Adaptive.java +++ b/dubbo-native/src/main/java/org/apache/dubbo/registry/RegistryFactory$Adaptive.java @@ -21,7 +21,7 @@ public class RegistryFactory$Adaptive implements org.apache.dubbo.registry.Regis public org.apache.dubbo.registry.Registry getRegistry(org.apache.dubbo.common.URL arg0) { if (arg0 == null) throw new IllegalArgumentException("url == null"); org.apache.dubbo.common.URL url = arg0; -String extName = ( url.getProtocol() == null ? "dubbo" : url.getProtocol() ); +String extName = ( url.getProtocol() == null ? "adaptive" : url.getProtocol() ); if(extName == null) throw new IllegalStateException("Failed to get extension (org.apache.dubbo.registry.RegistryFactory) name from url (" + url.toString() + ") use keys([protocol])"); ScopeModel scopeModel = ScopeModelUtil.getOrDefault(url.getScopeModel(), org.apache.dubbo.registry.RegistryFactory.class); org.apache.dubbo.registry.RegistryFactory extension = (org.apache.dubbo.registry.RegistryFactory)scopeModel.getExtensionLoader(org.apache.dubbo.registry.RegistryFactory.class).getExtension(extName); diff --git a/dubbo-native/src/main/java/org/apache/dubbo/remoting/api/pu/PortUnificationTransporter$Adaptive.java b/dubbo-native/src/main/java/org/apache/dubbo/remoting/api/pu/PortUnificationTransporter$Adaptive.java new file mode 100644 index 0000000000..d5c1cc0a7a --- /dev/null +++ b/dubbo-native/src/main/java/org/apache/dubbo/remoting/api/pu/PortUnificationTransporter$Adaptive.java @@ -0,0 +1,39 @@ +/* + * 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.dubbo.remoting.api.pu; +import org.apache.dubbo.rpc.model.ScopeModel; +import org.apache.dubbo.rpc.model.ScopeModelUtil; +public class PortUnificationTransporter$Adaptive implements org.apache.dubbo.remoting.api.pu.PortUnificationTransporter { +public org.apache.dubbo.remoting.api.connection.AbstractConnectionClient connect(org.apache.dubbo.common.URL arg0, org.apache.dubbo.remoting.ChannelHandler arg1) throws org.apache.dubbo.remoting.RemotingException { +if (arg0 == null) throw new IllegalArgumentException("url == null"); +org.apache.dubbo.common.URL url = arg0; +String extName = url.getParameter("client", url.getParameter("transporter", "netty4")); +if(extName == null) throw new IllegalStateException("Failed to get extension (org.apache.dubbo.remoting.api.pu.PortUnificationTransporter) name from url (" + url.toString() + ") use keys([client, transporter])"); +ScopeModel scopeModel = ScopeModelUtil.getOrDefault(url.getScopeModel(), org.apache.dubbo.remoting.api.pu.PortUnificationTransporter.class); +org.apache.dubbo.remoting.api.pu.PortUnificationTransporter extension = (org.apache.dubbo.remoting.api.pu.PortUnificationTransporter)scopeModel.getExtensionLoader(org.apache.dubbo.remoting.api.pu.PortUnificationTransporter.class).getExtension(extName); +return extension.connect(arg0, arg1); +} +public org.apache.dubbo.remoting.api.pu.AbstractPortUnificationServer bind(org.apache.dubbo.common.URL arg0, org.apache.dubbo.remoting.ChannelHandler arg1) throws org.apache.dubbo.remoting.RemotingException { +if (arg0 == null) throw new IllegalArgumentException("url == null"); +org.apache.dubbo.common.URL url = arg0; +String extName = url.getParameter("server", url.getParameter("transporter", "netty4")); +if(extName == null) throw new IllegalStateException("Failed to get extension (org.apache.dubbo.remoting.api.pu.PortUnificationTransporter) name from url (" + url.toString() + ") use keys([server, transporter])"); +ScopeModel scopeModel = ScopeModelUtil.getOrDefault(url.getScopeModel(), org.apache.dubbo.remoting.api.pu.PortUnificationTransporter.class); +org.apache.dubbo.remoting.api.pu.PortUnificationTransporter extension = (org.apache.dubbo.remoting.api.pu.PortUnificationTransporter)scopeModel.getExtensionLoader(org.apache.dubbo.remoting.api.pu.PortUnificationTransporter.class).getExtension(extName); +return extension.bind(arg0, arg1); +} +} diff --git a/dubbo-native/src/main/java/org/apache/dubbo/rpc/cluster/router/state/StateRouterFactory$Adaptive.java b/dubbo-native/src/main/java/org/apache/dubbo/rpc/cluster/router/state/StateRouterFactory$Adaptive.java index 2dc6ccf2fc..c33747dc83 100644 --- a/dubbo-native/src/main/java/org/apache/dubbo/rpc/cluster/router/state/StateRouterFactory$Adaptive.java +++ b/dubbo-native/src/main/java/org/apache/dubbo/rpc/cluster/router/state/StateRouterFactory$Adaptive.java @@ -15,17 +15,16 @@ * limitations under the License. */ package org.apache.dubbo.rpc.cluster.router.state; -import org.apache.dubbo.common.URL; import org.apache.dubbo.rpc.model.ScopeModel; import org.apache.dubbo.rpc.model.ScopeModelUtil; public class StateRouterFactory$Adaptive implements org.apache.dubbo.rpc.cluster.router.state.StateRouterFactory { -public org.apache.dubbo.rpc.cluster.router.state.StateRouter getRouter(Class arg0, URL arg1) { -if (arg0 == null) throw new IllegalArgumentException("url == null"); +public org.apache.dubbo.rpc.cluster.router.state.StateRouter getRouter(java.lang.Class arg0, org.apache.dubbo.common.URL arg1) { +if (arg1 == null) throw new IllegalArgumentException("url == null"); org.apache.dubbo.common.URL url = arg1; String extName = ( url.getProtocol() == null ? "adaptive" : url.getProtocol() ); if(extName == null) throw new IllegalStateException("Failed to get extension (org.apache.dubbo.rpc.cluster.router.state.StateRouterFactory) name from url (" + url.toString() + ") use keys([protocol])"); ScopeModel scopeModel = ScopeModelUtil.getOrDefault(url.getScopeModel(), org.apache.dubbo.rpc.cluster.router.state.StateRouterFactory.class); org.apache.dubbo.rpc.cluster.router.state.StateRouterFactory extension = (org.apache.dubbo.rpc.cluster.router.state.StateRouterFactory)scopeModel.getExtensionLoader(org.apache.dubbo.rpc.cluster.router.state.StateRouterFactory.class).getExtension(extName); -return extension.getRouter(arg0,arg1); +return extension.getRouter(arg0, arg1); } } diff --git a/dubbo-native/src/main/java/org/apache/dubbo/rpc/executor/IsolationExecutorSupportFactory$Adaptive.java b/dubbo-native/src/main/java/org/apache/dubbo/rpc/executor/IsolationExecutorSupportFactory$Adaptive.java new file mode 100644 index 0000000000..fbf3bcf235 --- /dev/null +++ b/dubbo-native/src/main/java/org/apache/dubbo/rpc/executor/IsolationExecutorSupportFactory$Adaptive.java @@ -0,0 +1,33 @@ +/* + * 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.dubbo.rpc.executor; +import org.apache.dubbo.rpc.model.ScopeModel; +import org.apache.dubbo.rpc.model.ScopeModelUtil; +public class IsolationExecutorSupportFactory$Adaptive implements org.apache.dubbo.rpc.executor.IsolationExecutorSupportFactory { +public org.apache.dubbo.rpc.executor.ExecutorSupport createIsolationExecutorSupport(org.apache.dubbo.common.URL arg0) { +if (arg0 == null) throw new IllegalArgumentException("url == null"); +org.apache.dubbo.common.URL url = arg0; +String extName = ( url.getProtocol() == null ? "adaptive" : url.getProtocol() ); +if(extName == null) throw new IllegalStateException("Failed to get extension (org.apache.dubbo.rpc.executor.IsolationExecutorSupportFactory) name from url (" + url.toString() + ") use keys([protocol])"); +ScopeModel scopeModel = ScopeModelUtil.getOrDefault(url.getScopeModel(), org.apache.dubbo.rpc.executor.IsolationExecutorSupportFactory.class); +org.apache.dubbo.rpc.executor.IsolationExecutorSupportFactory extension = (org.apache.dubbo.rpc.executor.IsolationExecutorSupportFactory)scopeModel.getExtensionLoader(org.apache.dubbo.rpc.executor.IsolationExecutorSupportFactory.class).getExtension(extName); +return extension.createIsolationExecutorSupport(arg0); +} +public org.apache.dubbo.rpc.executor.ExecutorSupport getIsolationExecutorSupport(org.apache.dubbo.common.URL arg0) { +throw new UnsupportedOperationException("The method public static org.apache.dubbo.rpc.executor.ExecutorSupport org.apache.dubbo.rpc.executor.IsolationExecutorSupportFactory.getIsolationExecutorSupport(org.apache.dubbo.common.URL) of interface org.apache.dubbo.rpc.executor.IsolationExecutorSupportFactory is not adaptive method!"); +} +}