update spi for native code (#10951)
Signed-off-by: crazyhzm <crazyhzm@gmail.com> Signed-off-by: crazyhzm <crazyhzm@gmail.com>
This commit is contained in:
parent
a931777da6
commit
cce0bd81ec
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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!");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
@ -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 <T> org.apache.dubbo.rpc.cluster.router.state.StateRouter<T> getRouter(Class<T> 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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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!");
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue