Merge branch 'apache-3.2' into apache-3.3
# Conflicts: # dubbo-config/dubbo-config-api/pom.xml # dubbo-distribution/dubbo-all/pom.xml # dubbo-metrics/dubbo-metrics-default/src/main/resources/META-INF/dubbo/internal/org.apache.dubbo.metrics.collector.MetricsCollector # pom.xml
This commit is contained in:
commit
992abd2d34
|
|
@ -61,6 +61,7 @@ dubbo-metrics-default
|
|||
dubbo-metrics-metadata
|
||||
dubbo-metrics-prometheus
|
||||
dubbo-metrics-registry
|
||||
dubbo-metrics-config-center
|
||||
dubbo-monitor
|
||||
dubbo-monitor-api
|
||||
dubbo-monitor-default
|
||||
|
|
@ -102,6 +103,10 @@ dubbo-spring-boot-actuator-compatible
|
|||
dubbo-spring-boot-autoconfigure
|
||||
dubbo-spring-boot-autoconfigure-compatible
|
||||
dubbo-spring-boot-compatible
|
||||
dubbo-spring-boot-observability-starters
|
||||
dubbo-spring-boot-observability-autoconfigure
|
||||
dubbo-spring-boot-tracing-brave-zipkin-starter
|
||||
dubbo-spring-boot-tracing-otel-zipkin-starter
|
||||
dubbo-spring-boot-observability-starter
|
||||
dubbo-spring-boot-starter
|
||||
dubbo-spring-security
|
||||
|
|
|
|||
|
|
@ -68,6 +68,7 @@ header:
|
|||
- 'Jenkinsfile'
|
||||
- '**/vendor/**'
|
||||
- '**/src/test/resources/certs/**'
|
||||
- '**/src/test/resources/definition/**'
|
||||
- 'dubbo-common/src/main/java/org/apache/dubbo/common/threadlocal/InternalThreadLocal.java'
|
||||
- 'dubbo-common/src/main/java/org/apache/dubbo/common/threadlocal/InternalThreadLocalMap.java'
|
||||
- 'dubbo-common/src/main/java/org/apache/dubbo/common/timer/HashedWheelTimer.java'
|
||||
|
|
|
|||
|
|
@ -20,7 +20,8 @@ package org.apache.dubbo.rpc.cluster.filter.support;
|
|||
|
||||
import org.apache.dubbo.common.extension.Activate;
|
||||
import org.apache.dubbo.metrics.collector.DefaultMetricsCollector;
|
||||
import org.apache.dubbo.metrics.event.MetricsEvent;
|
||||
import org.apache.dubbo.metrics.event.MetricsEventBus;
|
||||
import org.apache.dubbo.metrics.event.RequestBeforeEvent;
|
||||
import org.apache.dubbo.rpc.BaseFilter;
|
||||
import org.apache.dubbo.rpc.Invocation;
|
||||
import org.apache.dubbo.rpc.Invoker;
|
||||
|
|
@ -30,19 +31,17 @@ import org.apache.dubbo.rpc.cluster.filter.ClusterFilter;
|
|||
import org.apache.dubbo.rpc.model.ApplicationModel;
|
||||
import org.apache.dubbo.rpc.model.ScopeModelAware;
|
||||
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
import static org.apache.dubbo.common.constants.CommonConstants.CONSUMER;
|
||||
import static org.apache.dubbo.common.constants.CommonConstants.PROVIDER_SIDE;
|
||||
|
||||
@Activate(group = CONSUMER,onClass = "org.apache.dubbo.metrics.collector.DefaultMetricsCollector")
|
||||
@Activate(group = CONSUMER, onClass = "org.apache.dubbo.metrics.collector.DefaultMetricsCollector")
|
||||
public class MetricsClusterFilter implements ClusterFilter, BaseFilter.Listener, ScopeModelAware {
|
||||
|
||||
private ApplicationModel applicationModel;
|
||||
private DefaultMetricsCollector collector;
|
||||
|
||||
@Override
|
||||
public void setApplicationModel(ApplicationModel applicationModel) {
|
||||
this.applicationModel = applicationModel;
|
||||
this.collector = applicationModel.getBeanFactory().getBean(DefaultMetricsCollector.class);
|
||||
}
|
||||
|
||||
|
|
@ -65,18 +64,12 @@ public class MetricsClusterFilter implements ClusterFilter, BaseFilter.Listener,
|
|||
if (collector == null || !collector.isCollectEnabled()) {
|
||||
return;
|
||||
}
|
||||
if (t != null && t instanceof RpcException) {
|
||||
if (t instanceof RpcException) {
|
||||
RpcException e = (RpcException) t;
|
||||
if (e.isForbidden()) {
|
||||
collector.getMethodSampler().incOnEvent(invocation,
|
||||
MetricsEvent.Type.SERVICE_UNAVAILABLE.getNameByType(getSide(invocation)));
|
||||
MetricsEventBus.publish(RequestBeforeEvent.toEvent(applicationModel, invocation));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private String getSide(Invocation invocation) {
|
||||
Optional<? extends Invoker<?>> invoker = Optional.ofNullable(invocation.getInvoker());
|
||||
String side = invoker.isPresent() ? invoker.get().getUrl().getSide() : PROVIDER_SIDE;
|
||||
return side;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -333,6 +333,8 @@ public abstract class AbstractClusterInvoker<T> implements ClusterInvoker<T> {
|
|||
List<Invoker<T>> invokers = list(invocation);
|
||||
InvocationProfilerUtils.releaseDetailProfiler(invocation);
|
||||
|
||||
checkInvokers(invokers, invocation);
|
||||
|
||||
LoadBalance loadbalance = initLoadBalance(invokers, invocation);
|
||||
RpcUtils.attachInvocationIdIfAsync(getUrl(), invocation);
|
||||
|
||||
|
|
|
|||
|
|
@ -51,7 +51,6 @@ public class BroadcastClusterInvoker<T> extends AbstractClusterInvoker<T> {
|
|||
@Override
|
||||
@SuppressWarnings({"unchecked", "rawtypes"})
|
||||
public Result doInvoke(final Invocation invocation, List<Invoker<T>> invokers, LoadBalance loadbalance) throws RpcException {
|
||||
checkInvokers(invokers, invocation);
|
||||
RpcContext.getServiceContext().setInvokers((List) invokers);
|
||||
RpcException exception = null;
|
||||
Result result = null;
|
||||
|
|
|
|||
|
|
@ -104,7 +104,6 @@ public class FailbackClusterInvoker<T> extends AbstractClusterInvoker<T> {
|
|||
Invoker<T> invoker = null;
|
||||
URL consumerUrl = RpcContext.getServiceContext().getConsumerUrl();
|
||||
try {
|
||||
checkInvokers(invokers, invocation);
|
||||
invoker = select(loadbalance, invocation, invokers, null);
|
||||
// Asynchronous call method must be used here, because failback will retry in the background.
|
||||
// Then the serviceContext will be cleared after the call is completed.
|
||||
|
|
|
|||
|
|
@ -41,7 +41,6 @@ public class FailfastClusterInvoker<T> extends AbstractClusterInvoker<T> {
|
|||
|
||||
@Override
|
||||
public Result doInvoke(Invocation invocation, List<Invoker<T>> invokers, LoadBalance loadbalance) throws RpcException {
|
||||
checkInvokers(invokers, invocation);
|
||||
Invoker<T> invoker = select(loadbalance, invocation, invokers, null);
|
||||
try {
|
||||
return invokeWithContext(invoker, invocation);
|
||||
|
|
|
|||
|
|
@ -57,7 +57,6 @@ public class FailoverClusterInvoker<T> extends AbstractClusterInvoker<T> {
|
|||
@SuppressWarnings({"unchecked", "rawtypes"})
|
||||
public Result doInvoke(Invocation invocation, final List<Invoker<T>> invokers, LoadBalance loadbalance) throws RpcException {
|
||||
List<Invoker<T>> copyInvokers = invokers;
|
||||
checkInvokers(copyInvokers, invocation);
|
||||
String methodName = RpcUtils.getMethodName(invocation);
|
||||
int len = calculateInvokeTimes(methodName);
|
||||
// retry loop.
|
||||
|
|
|
|||
|
|
@ -47,7 +47,6 @@ public class FailsafeClusterInvoker<T> extends AbstractClusterInvoker<T> {
|
|||
@Override
|
||||
public Result doInvoke(Invocation invocation, List<Invoker<T>> invokers, LoadBalance loadbalance) throws RpcException {
|
||||
try {
|
||||
checkInvokers(invokers, invocation);
|
||||
Invoker<T> invoker = select(loadbalance, invocation, invokers, null);
|
||||
return invokeWithContext(invoker, invocation);
|
||||
} catch (Throwable e) {
|
||||
|
|
|
|||
|
|
@ -67,7 +67,6 @@ public class ForkingClusterInvoker<T> extends AbstractClusterInvoker<T> {
|
|||
@SuppressWarnings({"unchecked", "rawtypes"})
|
||||
public Result doInvoke(final Invocation invocation, List<Invoker<T>> invokers, LoadBalance loadbalance) throws RpcException {
|
||||
try {
|
||||
checkInvokers(invokers, invocation);
|
||||
final List<Invoker<T>> selected;
|
||||
final int forks = getUrl().getParameter(FORKS_KEY, DEFAULT_FORKS);
|
||||
final int timeout = getUrl().getParameter(TIMEOUT_KEY, DEFAULT_TIMEOUT);
|
||||
|
|
|
|||
|
|
@ -59,7 +59,6 @@ public class MergeableClusterInvoker<T> extends AbstractClusterInvoker<T> {
|
|||
|
||||
@Override
|
||||
protected Result doInvoke(Invocation invocation, List<Invoker<T>> invokers, LoadBalance loadbalance) throws RpcException {
|
||||
checkInvokers(invokers, invocation);
|
||||
String merger = getUrl().getMethodParameter(invocation.getMethodName(), MERGER_KEY);
|
||||
if (ConfigUtils.isEmpty(merger)) { // If a method doesn't have a merger, only invoke one Group
|
||||
for (final Invoker<T> invoker : invokers) {
|
||||
|
|
|
|||
|
|
@ -107,7 +107,7 @@ class AvailableClusterInvokerTest {
|
|||
invoker.invoke(invocation);
|
||||
fail();
|
||||
} catch (RpcException e) {
|
||||
Assertions.assertTrue(e.getMessage().contains("No provider available in"));
|
||||
Assertions.assertTrue(e.getMessage().contains("No provider available"));
|
||||
assertFalse(e.getCause() instanceof RpcException);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,7 +17,6 @@
|
|||
package org.apache.dubbo.rpc.cluster.support;
|
||||
|
||||
import org.apache.dubbo.common.URL;
|
||||
import org.apache.dubbo.common.utils.LogUtil;
|
||||
import org.apache.dubbo.rpc.AppResponse;
|
||||
import org.apache.dubbo.rpc.Invoker;
|
||||
import org.apache.dubbo.rpc.Result;
|
||||
|
|
@ -25,6 +24,7 @@ import org.apache.dubbo.rpc.RpcContext;
|
|||
import org.apache.dubbo.rpc.RpcInvocation;
|
||||
import org.apache.dubbo.rpc.cluster.Directory;
|
||||
import org.apache.dubbo.rpc.cluster.filter.DemoService;
|
||||
import org.apache.dubbo.rpc.RpcException;
|
||||
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
|
|
@ -33,7 +33,7 @@ import org.junit.jupiter.api.Test;
|
|||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
import static org.junit.jupiter.api.Assertions.assertFalse;
|
||||
import static org.mockito.BDDMockito.given;
|
||||
import static org.mockito.Mockito.mock;
|
||||
|
||||
|
|
@ -113,10 +113,13 @@ class FailSafeClusterInvokerTest {
|
|||
resetInvokerToNoException();
|
||||
|
||||
FailsafeClusterInvoker<DemoService> invoker = new FailsafeClusterInvoker<DemoService>(dic);
|
||||
LogUtil.start();
|
||||
invoker.invoke(invocation);
|
||||
assertTrue(LogUtil.findMessage("No provider") > 0);
|
||||
LogUtil.stop();
|
||||
|
||||
try{
|
||||
invoker.invoke(invocation);
|
||||
} catch (RpcException e){
|
||||
Assertions.assertTrue(e.getMessage().contains("No provider available"));
|
||||
assertFalse(e.getCause() instanceof RpcException);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,9 +24,10 @@ import org.apache.dubbo.common.utils.LogUtil;
|
|||
import org.apache.dubbo.rpc.AppResponse;
|
||||
import org.apache.dubbo.rpc.Invoker;
|
||||
import org.apache.dubbo.rpc.Result;
|
||||
import org.apache.dubbo.rpc.RpcContext;
|
||||
import org.apache.dubbo.rpc.RpcInvocation;
|
||||
import org.apache.dubbo.rpc.RpcContext;
|
||||
import org.apache.dubbo.rpc.cluster.Directory;
|
||||
import org.apache.dubbo.rpc.RpcException;
|
||||
|
||||
import org.apache.log4j.Level;
|
||||
import org.junit.jupiter.api.AfterEach;
|
||||
|
|
@ -37,6 +38,7 @@ import org.junit.jupiter.api.MethodOrderer;
|
|||
import org.junit.jupiter.api.Order;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.TestMethodOrder;
|
||||
import org.junit.jupiter.api.function.Executable;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.ArrayList;
|
||||
|
|
@ -45,7 +47,7 @@ import java.util.concurrent.CountDownLatch;
|
|||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import static org.apache.dubbo.common.constants.CommonConstants.RETRIES_KEY;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
import static org.mockito.BDDMockito.given;
|
||||
import static org.mockito.Mockito.mock;
|
||||
|
||||
|
|
@ -110,6 +112,9 @@ class FailbackClusterInvokerTest {
|
|||
given(dic.getUrl()).willReturn(url);
|
||||
given(dic.getConsumerUrl()).willReturn(url);
|
||||
given(dic.getInterface()).willReturn(FailbackClusterInvokerTest.class);
|
||||
given(dic.list(invocation)).willReturn(invokers);
|
||||
given(invoker.getUrl()).willReturn(url);
|
||||
|
||||
FailbackClusterInvoker<FailbackClusterInvokerTest> invoker = new FailbackClusterInvoker<>(dic);
|
||||
invoker.invoke(invocation);
|
||||
Assertions.assertNull(RpcContext.getServiceContext().getInvoker());
|
||||
|
|
@ -123,6 +128,9 @@ class FailbackClusterInvokerTest {
|
|||
given(dic.getUrl()).willReturn(url);
|
||||
given(dic.getConsumerUrl()).willReturn(url);
|
||||
given(dic.getInterface()).willReturn(FailbackClusterInvokerTest.class);
|
||||
given(dic.list(invocation)).willReturn(invokers);
|
||||
given(invoker.getUrl()).willReturn(url);
|
||||
|
||||
FailbackClusterInvoker<FailbackClusterInvokerTest> invoker = new FailbackClusterInvoker<>(dic);
|
||||
invoker.invoke(invocation);
|
||||
Assertions.assertNull(RpcContext.getServiceContext().getInvoker());
|
||||
|
|
@ -161,17 +169,15 @@ class FailbackClusterInvokerTest {
|
|||
given(dic.getInterface()).willReturn(FailbackClusterInvokerTest.class);
|
||||
|
||||
invocation.setMethodName("method1");
|
||||
|
||||
invokers.add(invoker);
|
||||
|
||||
resetInvokerToNoException();
|
||||
|
||||
FailbackClusterInvoker<FailbackClusterInvokerTest> invoker = new FailbackClusterInvoker<>(dic);
|
||||
LogUtil.start();
|
||||
DubboAppender.clear();
|
||||
invoker.invoke(invocation);
|
||||
assertEquals(1, LogUtil.findMessage("Failback to invoke"));
|
||||
LogUtil.stop();
|
||||
try{
|
||||
invoker.invoke(invocation);
|
||||
} catch (RpcException e){
|
||||
Assertions.assertTrue(e.getMessage().contains("No provider available"));
|
||||
assertFalse(e.getCause() instanceof RpcException);
|
||||
}
|
||||
}
|
||||
|
||||
@Disabled
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ import org.apache.dubbo.rpc.RpcException;
|
|||
import org.apache.dubbo.rpc.cluster.ClusterInvoker;
|
||||
import org.apache.dubbo.rpc.cluster.Directory;
|
||||
|
||||
import org.apache.dubbo.rpc.cluster.support.AbstractClusterInvoker;
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
|
|
@ -174,6 +175,7 @@ class ZoneAwareClusterInvokerTest {
|
|||
given(directory.getUrl()).willReturn(url);
|
||||
given(directory.getConsumerUrl()).willReturn(url);
|
||||
given(directory.list(invocation)).willReturn(new ArrayList<>(0));
|
||||
given(directory.getInterface()).willReturn(ZoneAwareClusterInvokerTest.class);
|
||||
|
||||
zoneAwareClusterInvoker = new ZoneAwareClusterInvoker<>(directory);
|
||||
|
||||
|
|
|
|||
|
|
@ -275,6 +275,7 @@ public interface CommonConstants {
|
|||
int MAX_PROXY_COUNT = 65535;
|
||||
|
||||
String MONITOR_KEY = "monitor";
|
||||
String BACKGROUND_KEY = "background";
|
||||
String CLUSTER_KEY = "cluster";
|
||||
String USERNAME_KEY = "username";
|
||||
String PASSWORD_KEY = "password";
|
||||
|
|
@ -313,6 +314,7 @@ public interface CommonConstants {
|
|||
String HEARTBEAT_EVENT = null;
|
||||
String MOCK_HEARTBEAT_EVENT = "H";
|
||||
String READONLY_EVENT = "R";
|
||||
String WRITEABLE_EVENT = "W";
|
||||
|
||||
String REFERENCE_FILTER_KEY = "reference.filter";
|
||||
|
||||
|
|
@ -628,4 +630,9 @@ public interface CommonConstants {
|
|||
String DUBBO_METRICS_CONFIGCENTER_ENABLE = "dubbo.metrics.configcenter.enable";
|
||||
|
||||
Integer TRI_EXCEPTION_CODE_NOT_EXISTS = 0;
|
||||
|
||||
String PACKABLE_METHOD_FACTORY_KEY = "serialize.packable.factory";
|
||||
|
||||
String DUBBO_PACKABLE_METHOD_FACTORY = "dubbo.application.parameters." + PACKABLE_METHOD_FACTORY_KEY;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -34,6 +34,8 @@ public interface QosConstants {
|
|||
|
||||
String ANONYMOUS_ACCESS_PERMISSION_LEVEL = "qos.anonymous.access.permission.level";
|
||||
|
||||
String ANONYMOUS_ACCESS_ALLOW_COMMANDS = "qos.anonymous.access.allow.commands";
|
||||
|
||||
String QOS_ENABLE_COMPATIBLE = "qos-enable";
|
||||
|
||||
String QOS_HOST_COMPATIBLE = "qos-host";
|
||||
|
|
|
|||
|
|
@ -14,21 +14,18 @@
|
|||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.apache.dubbo.spring.boot.observability.annotation;
|
||||
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
package org.apache.dubbo.common.lang;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Inherited;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Target({ElementType.TYPE,ElementType.METHOD})
|
||||
|
||||
@Target({ElementType.METHOD, ElementType.PARAMETER, ElementType.FIELD})
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Inherited
|
||||
@Documented
|
||||
@ConditionalOnProperty(prefix = "dubbo.tracing", name = "enabled", matchIfMissing = true)
|
||||
public @interface ConditionalOnDubboTracingEnable {
|
||||
public @interface Nullable {
|
||||
}
|
||||
|
|
@ -0,0 +1,150 @@
|
|||
/*
|
||||
* 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.utils;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.Method;
|
||||
import java.lang.reflect.ParameterizedType;
|
||||
import java.lang.reflect.Type;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* A utility class that provides methods for accessing and manipulating private fields and methods of an object.
|
||||
* This is useful for white-box testing, where the internal workings of a class need to be tested directly.
|
||||
* <p>
|
||||
* Note: Usage of this class should be limited to testing purposes only, as it violates the encapsulation principle.
|
||||
*/
|
||||
public class ReflectionUtils {
|
||||
|
||||
private ReflectionUtils() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the value of the specified field from the given object.
|
||||
*
|
||||
* @param source The object from which to retrieve the field value.
|
||||
* @param fieldName The name of the field to retrieve.
|
||||
* @return The value of the specified field in the given object.
|
||||
* @throws RuntimeException If the specified field does not exist.
|
||||
*/
|
||||
public static Object getField(Object source, String fieldName) {
|
||||
try {
|
||||
Field f = source.getClass().getDeclaredField(fieldName);
|
||||
f.setAccessible(true);
|
||||
return f.get(source);
|
||||
} catch (Exception e) {
|
||||
throw new ReflectionException(e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the specified method on the given object with the provided parameters.
|
||||
*
|
||||
* @param source The object on which to invoke the method.
|
||||
* @param methodName The name of the method to invoke.
|
||||
* @param params The parameters to pass to the method.
|
||||
* @return The result of invoking the specified method on the given object.
|
||||
*/
|
||||
public static Object invoke(Object source, String methodName, Object... params) {
|
||||
try {
|
||||
Class<?>[] classes = Arrays.stream(params)
|
||||
.map(param -> param != null ? param.getClass() : null)
|
||||
.toArray(Class<?>[]::new);
|
||||
|
||||
for (Method method : source.getClass().getDeclaredMethods()) {
|
||||
if (method.getName().equals(methodName) && matchParameters(method.getParameterTypes(), classes)) {
|
||||
method.setAccessible(true);
|
||||
return method.invoke(source, params);
|
||||
}
|
||||
}
|
||||
throw new NoSuchMethodException("No method found with the specified name and parameter types");
|
||||
} catch (Exception e) {
|
||||
throw new ReflectionException(e);
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean matchParameters(Class<?>[] methodParamTypes, Class<?>[] givenParamTypes) {
|
||||
if (methodParamTypes.length != givenParamTypes.length) {
|
||||
return false;
|
||||
}
|
||||
|
||||
for (int i = 0; i < methodParamTypes.length; i++) {
|
||||
if (givenParamTypes[i] == null) {
|
||||
if (methodParamTypes[i].isPrimitive()) {
|
||||
return false;
|
||||
}
|
||||
} else if (!methodParamTypes[i].isAssignableFrom(givenParamTypes[i])) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a list of distinct {@link Class} objects representing the generics of the given class that implement the
|
||||
* given interface.
|
||||
*
|
||||
* @param clazz the class to retrieve the generics for
|
||||
* @param interfaceClass the interface to retrieve the generics for
|
||||
* @return a list of distinct {@link Class} objects representing the generics of the given class that implement the
|
||||
* given interface
|
||||
*/
|
||||
public static List<Class<?>> getClassGenerics(Class<?> clazz, Class<?> interfaceClass) {
|
||||
List<Class<?>> generics = new ArrayList<>();
|
||||
Type[] genericInterfaces = clazz.getGenericInterfaces();
|
||||
for (Type genericInterface : genericInterfaces) {
|
||||
if (genericInterface instanceof ParameterizedType) {
|
||||
ParameterizedType parameterizedType = (ParameterizedType) genericInterface;
|
||||
Type rawType = parameterizedType.getRawType();
|
||||
if (rawType instanceof Class && interfaceClass.isAssignableFrom((Class<?>) rawType)) {
|
||||
Type[] actualTypeArguments = parameterizedType.getActualTypeArguments();
|
||||
for (Type actualTypeArgument : actualTypeArguments) {
|
||||
if (actualTypeArgument instanceof Class) {
|
||||
generics.add((Class<?>) actualTypeArgument);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Type genericSuperclass = clazz.getGenericSuperclass();
|
||||
if (genericSuperclass instanceof ParameterizedType) {
|
||||
ParameterizedType parameterizedType = (ParameterizedType) genericSuperclass;
|
||||
Type[] actualTypeArguments = parameterizedType.getActualTypeArguments();
|
||||
for (Type actualTypeArgument : actualTypeArguments) {
|
||||
if (actualTypeArgument instanceof Class) {
|
||||
generics.add((Class<?>) actualTypeArgument);
|
||||
}
|
||||
}
|
||||
}
|
||||
Class<?> superclass = clazz.getSuperclass();
|
||||
if (superclass != null) {
|
||||
generics.addAll(getClassGenerics(superclass, interfaceClass));
|
||||
}
|
||||
return generics.stream().distinct().collect(Collectors.toList());
|
||||
}
|
||||
|
||||
public static class ReflectionException extends RuntimeException {
|
||||
public ReflectionException(Throwable cause) {
|
||||
super(cause);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -313,7 +313,8 @@ public abstract class AbstractInterfaceConfig extends AbstractMethodConfig {
|
|||
// There may be no interface class when generic call
|
||||
return;
|
||||
}
|
||||
if (!interfaceClass.isInterface()) {
|
||||
|
||||
if (!interfaceClass.isInterface() && !canSkipInterfaceCheck()) {
|
||||
throw new IllegalStateException(interfaceName + " is not an interface");
|
||||
}
|
||||
|
||||
|
|
@ -373,6 +374,15 @@ public abstract class AbstractInterfaceConfig extends AbstractMethodConfig {
|
|||
|
||||
}
|
||||
|
||||
/**
|
||||
* it is used for skipping the check of interface since dubbo 3.2
|
||||
* rest protocol allow the service is implement class
|
||||
* @return
|
||||
*/
|
||||
protected boolean canSkipInterfaceCheck() {
|
||||
return false;
|
||||
}
|
||||
|
||||
protected boolean verifyMethodConfig(MethodConfig methodConfig, Class<?> interfaceClass, boolean ignoreInvalidMethodConfig) {
|
||||
String methodName = methodConfig.getName();
|
||||
if (StringUtils.isEmpty(methodName)) {
|
||||
|
|
@ -687,7 +697,7 @@ public abstract class AbstractInterfaceConfig extends AbstractMethodConfig {
|
|||
}
|
||||
|
||||
public void setRegistry(RegistryConfig registry) {
|
||||
List<RegistryConfig> registries = new ArrayList<RegistryConfig>(1);
|
||||
List<RegistryConfig> registries = new ArrayList<>(1);
|
||||
registries.add(registry);
|
||||
setRegistries(registries);
|
||||
}
|
||||
|
|
@ -715,7 +725,6 @@ public abstract class AbstractInterfaceConfig extends AbstractMethodConfig {
|
|||
return methods;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public void setMethods(List<? extends MethodConfig> methods) {
|
||||
this.methods = (methods != null) ? new ArrayList<>(methods) : null;
|
||||
}
|
||||
|
|
@ -922,4 +931,5 @@ public abstract class AbstractInterfaceConfig extends AbstractMethodConfig {
|
|||
public void setInterfaceClassLoader(ClassLoader interfaceClassLoader) {
|
||||
this.interfaceClassLoader = interfaceClassLoader;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -55,6 +55,7 @@ import static org.apache.dubbo.common.constants.QosConstants.ACCEPT_FOREIGN_IP;
|
|||
import static org.apache.dubbo.common.constants.QosConstants.ACCEPT_FOREIGN_IP_COMPATIBLE;
|
||||
import static org.apache.dubbo.common.constants.QosConstants.ACCEPT_FOREIGN_IP_WHITELIST;
|
||||
import static org.apache.dubbo.common.constants.QosConstants.ACCEPT_FOREIGN_IP_WHITELIST_COMPATIBLE;
|
||||
import static org.apache.dubbo.common.constants.QosConstants.ANONYMOUS_ACCESS_ALLOW_COMMANDS;
|
||||
import static org.apache.dubbo.common.constants.QosConstants.ANONYMOUS_ACCESS_PERMISSION_LEVEL;
|
||||
import static org.apache.dubbo.common.constants.QosConstants.ANONYMOUS_ACCESS_PERMISSION_LEVEL_COMPATIBLE;
|
||||
import static org.apache.dubbo.common.constants.QosConstants.QOS_ENABLE;
|
||||
|
|
@ -170,6 +171,11 @@ public class ApplicationConfig extends AbstractConfig {
|
|||
*/
|
||||
private String qosAnonymousAccessPermissionLevel;
|
||||
|
||||
/**
|
||||
* the anonymous(any foreign ip) allow commands, default is empty, can not access any cmd
|
||||
*/
|
||||
private String qosAnonymousAllowCommands;
|
||||
|
||||
/**
|
||||
* Customized parameters
|
||||
*/
|
||||
|
|
@ -472,6 +478,15 @@ public class ApplicationConfig extends AbstractConfig {
|
|||
this.qosAnonymousAccessPermissionLevel = qosAnonymousAccessPermissionLevel;
|
||||
}
|
||||
|
||||
@Parameter(key = ANONYMOUS_ACCESS_ALLOW_COMMANDS)
|
||||
public String getQosAnonymousAllowCommands() {
|
||||
return qosAnonymousAllowCommands;
|
||||
}
|
||||
|
||||
public void setQosAnonymousAllowCommands(String qosAnonymousAllowCommands) {
|
||||
this.qosAnonymousAllowCommands = qosAnonymousAllowCommands;
|
||||
}
|
||||
|
||||
/**
|
||||
* The format is the same as the springboot, including: getQosEnableCompatible(), getQosPortCompatible(), getQosAcceptForeignIpCompatible().
|
||||
*
|
||||
|
|
|
|||
|
|
@ -150,4 +150,6 @@ public interface Constants {
|
|||
String SERVER_THREAD_POOL_NAME = "DubboServerHandler";
|
||||
|
||||
String CLIENT_THREAD_POOL_NAME = "DubboClientHandler";
|
||||
|
||||
String REST_PROTOCOL="rest";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -273,7 +273,7 @@ public class ProtocolConfig extends AbstractConfig {
|
|||
return name;
|
||||
}
|
||||
|
||||
public final void setName(String name) {
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
|
|
@ -291,7 +291,7 @@ public class ProtocolConfig extends AbstractConfig {
|
|||
return port;
|
||||
}
|
||||
|
||||
public final void setPort(Integer port) {
|
||||
public void setPort(Integer port) {
|
||||
this.port = port;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -51,7 +51,6 @@ public abstract class ServiceConfigBase<T> extends AbstractServiceConfig {
|
|||
private static final long serialVersionUID = 3033787999037024738L;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* The interface class of the exported service
|
||||
*/
|
||||
|
|
@ -173,8 +172,8 @@ public abstract class ServiceConfigBase<T> extends AbstractServiceConfig {
|
|||
convertProviderIdToProvider();
|
||||
if (provider == null) {
|
||||
provider = getModuleConfigManager()
|
||||
.getDefaultProvider()
|
||||
.orElseThrow(() -> new IllegalStateException("Default provider is not initialized"));
|
||||
.getDefaultProvider()
|
||||
.orElseThrow(() -> new IllegalStateException("Default provider is not initialized"));
|
||||
}
|
||||
// try set properties from `dubbo.service` if not set in current config
|
||||
refreshWithPrefixes(super.getPrefixes(), ConfigMode.OVERRIDE_IF_ABSENT);
|
||||
|
|
@ -228,7 +227,7 @@ public abstract class ServiceConfigBase<T> extends AbstractServiceConfig {
|
|||
protected void convertProviderIdToProvider() {
|
||||
if (provider == null && StringUtils.hasText(providerIds)) {
|
||||
provider = getModuleConfigManager().getProvider(providerIds)
|
||||
.orElseThrow(() -> new IllegalStateException("Provider config not found: " + providerIds));
|
||||
.orElseThrow(() -> new IllegalStateException("Provider config not found: " + providerIds));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -250,7 +249,7 @@ public abstract class ServiceConfigBase<T> extends AbstractServiceConfig {
|
|||
if (globalProtocol.isPresent()) {
|
||||
tmpProtocols.add(globalProtocol.get());
|
||||
} else {
|
||||
throw new IllegalStateException("Protocol not found: "+id);
|
||||
throw new IllegalStateException("Protocol not found: " + id);
|
||||
}
|
||||
}
|
||||
setProtocols(tmpProtocols);
|
||||
|
|
@ -267,7 +266,7 @@ public abstract class ServiceConfigBase<T> extends AbstractServiceConfig {
|
|||
try {
|
||||
if (StringUtils.isNotEmpty(interfaceName)) {
|
||||
this.interfaceClass = Class.forName(interfaceName, true, Thread.currentThread()
|
||||
.getContextClassLoader());
|
||||
.getContextClassLoader());
|
||||
}
|
||||
} catch (ClassNotFoundException t) {
|
||||
throw new IllegalStateException(t.getMessage(), t);
|
||||
|
|
@ -285,9 +284,9 @@ public abstract class ServiceConfigBase<T> extends AbstractServiceConfig {
|
|||
}
|
||||
|
||||
|
||||
|
||||
public void setInterface(Class<?> interfaceClass) {
|
||||
if (interfaceClass != null && !interfaceClass.isInterface()) {
|
||||
// rest protocol allow set impl class
|
||||
if (interfaceClass != null && !interfaceClass.isInterface() && !canSkipInterfaceCheck()) {
|
||||
throw new IllegalStateException("The interface class " + interfaceClass + " is not a interface!");
|
||||
}
|
||||
this.interfaceClass = interfaceClass;
|
||||
|
|
@ -297,6 +296,23 @@ public abstract class ServiceConfigBase<T> extends AbstractServiceConfig {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canSkipInterfaceCheck() {
|
||||
// for multipart protocol so for each contain
|
||||
List<ProtocolConfig> protocols = getProtocols();
|
||||
|
||||
if (protocols == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
for (ProtocolConfig protocol : protocols) {
|
||||
if (Constants.REST_PROTOCOL.equals(protocol.getName())) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Transient
|
||||
public T getRef() {
|
||||
return ref;
|
||||
|
|
|
|||
|
|
@ -14,9 +14,11 @@
|
|||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.apache.dubbo.config;
|
||||
|
||||
import org.apache.dubbo.config.nested.BaggageConfig;
|
||||
import org.apache.dubbo.config.nested.ExporterConfig;
|
||||
import org.apache.dubbo.config.nested.PropagationConfig;
|
||||
import org.apache.dubbo.config.nested.SamplingConfig;
|
||||
import org.apache.dubbo.config.support.Nested;
|
||||
|
|
@ -49,6 +51,12 @@ public class TracingConfig extends AbstractConfig {
|
|||
@Nested
|
||||
private PropagationConfig propagation = new PropagationConfig();
|
||||
|
||||
/**
|
||||
* Exporter configuration.
|
||||
*/
|
||||
@Nested
|
||||
private ExporterConfig tracingExporter = new ExporterConfig();
|
||||
|
||||
public TracingConfig() {
|
||||
}
|
||||
|
||||
|
|
@ -87,4 +95,12 @@ public class TracingConfig extends AbstractConfig {
|
|||
public void setPropagation(PropagationConfig propagation) {
|
||||
this.propagation = propagation;
|
||||
}
|
||||
|
||||
public ExporterConfig getTracingExporter() {
|
||||
return tracingExporter;
|
||||
}
|
||||
|
||||
public void setTracingExporter(ExporterConfig tracingExporter) {
|
||||
this.tracingExporter = tracingExporter;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,79 @@
|
|||
/*
|
||||
* 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.config.nested;
|
||||
|
||||
import org.apache.dubbo.config.support.Nested;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.Duration;
|
||||
|
||||
public class ExporterConfig implements Serializable {
|
||||
|
||||
@Nested
|
||||
private ZipkinConfig zipkinConfig;
|
||||
|
||||
public ZipkinConfig getZipkinConfig() {
|
||||
return zipkinConfig;
|
||||
}
|
||||
|
||||
public void setZipkinConfig(ZipkinConfig zipkinConfig) {
|
||||
this.zipkinConfig = zipkinConfig;
|
||||
}
|
||||
|
||||
public static class ZipkinConfig implements Serializable {
|
||||
|
||||
/**
|
||||
* URL to the Zipkin API.
|
||||
*/
|
||||
private String endpoint;
|
||||
|
||||
/**
|
||||
* Connection timeout for requests to Zipkin.
|
||||
*/
|
||||
private Duration connectTimeout = Duration.ofSeconds(1);
|
||||
|
||||
/**
|
||||
* Read timeout for requests to Zipkin.
|
||||
*/
|
||||
private Duration readTimeout = Duration.ofSeconds(10);
|
||||
|
||||
public String getEndpoint() {
|
||||
return endpoint;
|
||||
}
|
||||
|
||||
public void setEndpoint(String endpoint) {
|
||||
this.endpoint = endpoint;
|
||||
}
|
||||
|
||||
public Duration getConnectTimeout() {
|
||||
return connectTimeout;
|
||||
}
|
||||
|
||||
public void setConnectTimeout(Duration connectTimeout) {
|
||||
this.connectTimeout = connectTimeout;
|
||||
}
|
||||
|
||||
public Duration getReadTimeout() {
|
||||
return readTimeout;
|
||||
}
|
||||
|
||||
public void setReadTimeout(Duration readTimeout) {
|
||||
this.readTimeout = readTimeout;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
/*
|
||||
* 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.model;
|
||||
|
||||
public interface Pack {
|
||||
|
||||
/**
|
||||
* @param obj instance
|
||||
* @return byte array
|
||||
* @throws Exception when error occurs
|
||||
*/
|
||||
byte[] pack(Object obj) throws Exception;
|
||||
|
||||
}
|
||||
|
|
@ -17,56 +17,21 @@
|
|||
|
||||
package org.apache.dubbo.rpc.model;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* A packable method is used to customize serialization for methods. It can provide a common wrapper
|
||||
* for RESP / Protobuf.
|
||||
*/
|
||||
public interface PackableMethod {
|
||||
|
||||
interface Pack {
|
||||
|
||||
/**
|
||||
* @param obj instance
|
||||
* @return byte array
|
||||
* @throws IOException when error occurs
|
||||
*/
|
||||
byte[] pack(Object obj) throws IOException;
|
||||
}
|
||||
|
||||
interface WrapperUnPack extends UnPack {
|
||||
|
||||
default Object unpack(byte[] data) throws IOException, ClassNotFoundException {
|
||||
return unpack(data, false);
|
||||
}
|
||||
|
||||
Object unpack(byte[] data, boolean isReturnTriException) throws IOException, ClassNotFoundException;
|
||||
|
||||
|
||||
}
|
||||
|
||||
interface UnPack {
|
||||
|
||||
/**
|
||||
* @param data byte array
|
||||
* @return object instance
|
||||
* @throws IOException IOException
|
||||
* @throws ClassNotFoundException when no class found
|
||||
*/
|
||||
Object unpack(byte[] data) throws IOException, ClassNotFoundException;
|
||||
|
||||
}
|
||||
|
||||
default Object parseRequest(byte[] data) throws IOException, ClassNotFoundException {
|
||||
default Object parseRequest(byte[] data) throws Exception {
|
||||
return getRequestUnpack().unpack(data);
|
||||
}
|
||||
|
||||
default Object parseResponse(byte[] data) throws IOException, ClassNotFoundException {
|
||||
default Object parseResponse(byte[] data) throws Exception {
|
||||
return parseResponse(data, false);
|
||||
}
|
||||
|
||||
default Object parseResponse(byte[] data, boolean isReturnTriException) throws IOException, ClassNotFoundException {
|
||||
default Object parseResponse(byte[] data, boolean isReturnTriException) throws Exception {
|
||||
UnPack unPack = getResponseUnpack();
|
||||
if (unPack instanceof WrapperUnPack) {
|
||||
return ((WrapperUnPack) unPack).unpack(data, isReturnTriException);
|
||||
|
|
@ -74,11 +39,11 @@ public interface PackableMethod {
|
|||
return unPack.unpack(data);
|
||||
}
|
||||
|
||||
default byte[] packRequest(Object request) throws IOException {
|
||||
default byte[] packRequest(Object request) throws Exception {
|
||||
return getRequestPack().pack(request);
|
||||
}
|
||||
|
||||
default byte[] packResponse(Object response) throws IOException {
|
||||
default byte[] packResponse(Object response) throws Exception {
|
||||
return getResponsePack().pack(response);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,29 @@
|
|||
/*
|
||||
* 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.model;
|
||||
|
||||
import org.apache.dubbo.common.URL;
|
||||
import org.apache.dubbo.common.extension.ExtensionScope;
|
||||
import org.apache.dubbo.common.extension.SPI;
|
||||
|
||||
@SPI(scope = ExtensionScope.FRAMEWORK)
|
||||
public interface PackableMethodFactory {
|
||||
|
||||
PackableMethod create(MethodDescriptor methodDescriptor, URL url, String contentType);
|
||||
|
||||
}
|
||||
|
|
@ -40,6 +40,8 @@ public class ProviderModel extends ServiceModel {
|
|||
*/
|
||||
private List<URL> serviceUrls = new ArrayList<>();
|
||||
|
||||
private volatile long lastInvokeTime = 0;
|
||||
|
||||
public ProviderModel(String serviceKey,
|
||||
Object serviceInstance,
|
||||
ServiceDescriptor serviceDescriptor,
|
||||
|
|
@ -176,6 +178,14 @@ public class ProviderModel extends ServiceModel {
|
|||
}
|
||||
|
||||
|
||||
public long getLastInvokeTime() {
|
||||
return lastInvokeTime;
|
||||
}
|
||||
|
||||
public void updateLastInvokeTime() {
|
||||
this.lastInvokeTime = System.currentTimeMillis();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,29 @@
|
|||
/*
|
||||
* 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.model;
|
||||
|
||||
public interface UnPack {
|
||||
|
||||
/**
|
||||
* @param data byte array
|
||||
* @return object instance
|
||||
* @throws Exception exception
|
||||
*/
|
||||
Object unpack(byte[] data) throws Exception;
|
||||
|
||||
}
|
||||
|
|
@ -15,23 +15,14 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.apache.dubbo.metrics.metrics.event;
|
||||
package org.apache.dubbo.rpc.model;
|
||||
|
||||
import org.apache.dubbo.metrics.event.RTEvent;
|
||||
import org.apache.dubbo.metrics.model.MethodMetric;
|
||||
import org.apache.dubbo.rpc.model.ApplicationModel;
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
import org.junit.jupiter.api.Test;
|
||||
public interface WrapperUnPack extends UnPack {
|
||||
|
||||
class RTEventTest {
|
||||
|
||||
@Test
|
||||
void testNewEvent() {
|
||||
MethodMetric metric = new MethodMetric();
|
||||
Long rt = 5L;
|
||||
RTEvent event = new RTEvent(ApplicationModel.defaultModel(), metric, rt);
|
||||
|
||||
Assertions.assertEquals(event.getSource(), ApplicationModel.defaultModel());
|
||||
Assertions.assertEquals(event.getRt(), rt);
|
||||
default Object unpack(byte[] data) throws Exception {
|
||||
return unpack(data, false);
|
||||
}
|
||||
|
||||
Object unpack(byte[] data, boolean isReturnTriException) throws Exception;
|
||||
|
||||
}
|
||||
|
|
@ -27,4 +27,17 @@ public class ApplicationConfig extends org.apache.dubbo.config.ApplicationConfig
|
|||
public ApplicationConfig(String name) {
|
||||
super(name);
|
||||
}
|
||||
|
||||
public void setRegistry(com.alibaba.dubbo.config.RegistryConfig registry) {
|
||||
super.setRegistry(registry);
|
||||
}
|
||||
|
||||
public void setMonitor(com.alibaba.dubbo.config.MonitorConfig monitor) {
|
||||
super.setMonitor(monitor);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setMonitor(String monitor) {
|
||||
setMonitor(new com.alibaba.dubbo.config.MonitorConfig(monitor));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,4 +19,32 @@ package com.alibaba.dubbo.config;
|
|||
|
||||
@Deprecated
|
||||
public class ConsumerConfig extends org.apache.dubbo.config.ConsumerConfig {
|
||||
|
||||
public void setApplication(com.alibaba.dubbo.config.ApplicationConfig application) {
|
||||
super.setApplication(application);
|
||||
}
|
||||
|
||||
public void setModule(com.alibaba.dubbo.config.ModuleConfig module) {
|
||||
super.setModule(module);
|
||||
}
|
||||
|
||||
public void setRegistry(com.alibaba.dubbo.config.RegistryConfig registry) {
|
||||
super.setRegistry(registry);
|
||||
}
|
||||
|
||||
public void addMethod(com.alibaba.dubbo.config.MethodConfig methodConfig) {
|
||||
super.addMethod(methodConfig);
|
||||
}
|
||||
|
||||
public void setMonitor(com.alibaba.dubbo.config.MonitorConfig monitor) {
|
||||
super.setMonitor(monitor);
|
||||
}
|
||||
|
||||
public void setMock(Boolean mock) {
|
||||
if (mock == null) {
|
||||
setMock((String) null);
|
||||
} else {
|
||||
setMock(String.valueOf(mock));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,5 +19,15 @@ package com.alibaba.dubbo.config;
|
|||
|
||||
@Deprecated
|
||||
public class MethodConfig extends org.apache.dubbo.config.MethodConfig {
|
||||
public void addArgument(com.alibaba.dubbo.config.ArgumentConfig argumentConfig) {
|
||||
super.addArgument(argumentConfig);
|
||||
}
|
||||
|
||||
public void setMock(Boolean mock) {
|
||||
if (mock == null) {
|
||||
setMock((String) null);
|
||||
} else {
|
||||
setMock(String.valueOf(mock));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,4 +26,17 @@ public class ModuleConfig extends org.apache.dubbo.config.ModuleConfig {
|
|||
public ModuleConfig(String name) {
|
||||
super(name);
|
||||
}
|
||||
|
||||
public void setRegistry(com.alibaba.dubbo.config.RegistryConfig registry) {
|
||||
super.setRegistry(registry);
|
||||
}
|
||||
|
||||
public void setMonitor(com.alibaba.dubbo.config.MonitorConfig monitor) {
|
||||
super.setMonitor(monitor);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setMonitor(String monitor) {
|
||||
setMonitor(new com.alibaba.dubbo.config.MonitorConfig(monitor));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,4 +30,10 @@ public class ProtocolConfig extends org.apache.dubbo.config.ProtocolConfig {
|
|||
public ProtocolConfig(String name, int port) {
|
||||
super(name, port);
|
||||
}
|
||||
|
||||
public void mergeProtocol(ProtocolConfig sourceConfig) {
|
||||
super.mergeProtocol(sourceConfig);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,4 +19,40 @@ package com.alibaba.dubbo.config;
|
|||
|
||||
@Deprecated
|
||||
public class ProviderConfig extends org.apache.dubbo.config.ProviderConfig {
|
||||
public void setApplication(com.alibaba.dubbo.config.ApplicationConfig application) {
|
||||
super.setApplication(application);
|
||||
}
|
||||
|
||||
public void setModule(com.alibaba.dubbo.config.ModuleConfig module) {
|
||||
super.setModule(module);
|
||||
}
|
||||
|
||||
public void setRegistry(com.alibaba.dubbo.config.RegistryConfig registry) {
|
||||
super.setRegistry(registry);
|
||||
}
|
||||
|
||||
public void addMethod(com.alibaba.dubbo.config.MethodConfig methodConfig) {
|
||||
super.addMethod(methodConfig);
|
||||
}
|
||||
|
||||
public void setMonitor(com.alibaba.dubbo.config.MonitorConfig monitor) {
|
||||
super.setMonitor(monitor);
|
||||
}
|
||||
|
||||
public void setProtocol(com.alibaba.dubbo.config.ProtocolConfig protocol) {
|
||||
super.setProtocol(protocol);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setProtocol(String protocol) {
|
||||
setProtocol(new com.alibaba.dubbo.config.ProtocolConfig(protocol));
|
||||
}
|
||||
|
||||
public void setMock(Boolean mock) {
|
||||
if (mock == null) {
|
||||
setMock((String) null);
|
||||
} else {
|
||||
setMock(String.valueOf(mock));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,5 +29,39 @@ public class ReferenceConfig<T> extends org.apache.dubbo.config.ReferenceConfig<
|
|||
super(reference);
|
||||
}
|
||||
|
||||
public void setConsumer(com.alibaba.dubbo.config.ConsumerConfig consumer) {
|
||||
super.setConsumer(consumer);
|
||||
}
|
||||
|
||||
public void setApplication(com.alibaba.dubbo.config.ApplicationConfig application) {
|
||||
super.setApplication(application);
|
||||
}
|
||||
|
||||
public void setModule(com.alibaba.dubbo.config.ModuleConfig module) {
|
||||
super.setModule(module);
|
||||
}
|
||||
|
||||
public void setRegistry(com.alibaba.dubbo.config.RegistryConfig registry) {
|
||||
super.setRegistry(registry);
|
||||
}
|
||||
|
||||
public void addMethod(com.alibaba.dubbo.config.MethodConfig methodConfig) {
|
||||
super.addMethod(methodConfig);
|
||||
}
|
||||
|
||||
public void setMonitor(com.alibaba.dubbo.config.MonitorConfig monitor) {
|
||||
super.setMonitor(monitor);
|
||||
}
|
||||
|
||||
public void setMock(Boolean mock) {
|
||||
if (mock == null) {
|
||||
setMock((String) null);
|
||||
} else {
|
||||
setMock(String.valueOf(mock));
|
||||
}
|
||||
}
|
||||
|
||||
public void setInterfaceClass(Class<?> interfaceClass) {
|
||||
setInterface(interfaceClass);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,6 +19,9 @@ package com.alibaba.dubbo.config;
|
|||
|
||||
import org.apache.dubbo.config.annotation.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Deprecated
|
||||
public class ServiceConfig<T> extends org.apache.dubbo.config.ServiceConfig<T> {
|
||||
|
||||
|
|
@ -28,4 +31,97 @@ public class ServiceConfig<T> extends org.apache.dubbo.config.ServiceConfig<T> {
|
|||
public ServiceConfig(Service service) {
|
||||
super(service);
|
||||
}
|
||||
|
||||
public void setProvider(com.alibaba.dubbo.config.ProviderConfig provider) {
|
||||
super.setProvider(provider);
|
||||
}
|
||||
|
||||
public void setApplication(com.alibaba.dubbo.config.ApplicationConfig application) {
|
||||
super.setApplication(application);
|
||||
}
|
||||
|
||||
public void setModule(com.alibaba.dubbo.config.ModuleConfig module) {
|
||||
super.setModule(module);
|
||||
}
|
||||
|
||||
public void setRegistry(com.alibaba.dubbo.config.RegistryConfig registry) {
|
||||
super.setRegistry(registry);
|
||||
}
|
||||
|
||||
public void addMethod(com.alibaba.dubbo.config.MethodConfig methodConfig) {
|
||||
super.addMethod(methodConfig);
|
||||
}
|
||||
|
||||
public com.alibaba.dubbo.config.MonitorConfig getMonitor() {
|
||||
org.apache.dubbo.config.MonitorConfig monitorConfig = super.getMonitor();
|
||||
if (monitorConfig == null) {
|
||||
return null;
|
||||
}
|
||||
if (monitorConfig instanceof com.alibaba.dubbo.config.MonitorConfig) {
|
||||
return (com.alibaba.dubbo.config.MonitorConfig) monitorConfig;
|
||||
}
|
||||
throw new IllegalArgumentException("Monitor has not been set with type com.alibaba.dubbo.config.MonitorConfig. " +
|
||||
"Found " + monitorConfig.getClass().getName() + " instead.");
|
||||
}
|
||||
|
||||
public void setMonitor(com.alibaba.dubbo.config.MonitorConfig monitor) {
|
||||
super.setMonitor(monitor);
|
||||
}
|
||||
|
||||
public void setProtocol(com.alibaba.dubbo.config.ProtocolConfig protocol) {
|
||||
super.setProtocol(protocol);
|
||||
}
|
||||
|
||||
public void setMock(Boolean mock) {
|
||||
if (mock == null) {
|
||||
setMock((String) null);
|
||||
} else {
|
||||
setMock(String.valueOf(mock));
|
||||
}
|
||||
}
|
||||
|
||||
public void setProviders(List<ProviderConfig> providers) {
|
||||
setProtocols(convertProviderToProtocol(providers));
|
||||
}
|
||||
|
||||
private static List<ProtocolConfig> convertProviderToProtocol(List<ProviderConfig> providers) {
|
||||
if (providers == null || providers.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
List<ProtocolConfig> protocols = new ArrayList<ProtocolConfig>(providers.size());
|
||||
for (ProviderConfig provider : providers) {
|
||||
protocols.add(convertProviderToProtocol(provider));
|
||||
}
|
||||
return protocols;
|
||||
}
|
||||
|
||||
private static ProtocolConfig convertProviderToProtocol(ProviderConfig provider) {
|
||||
ProtocolConfig protocol = new ProtocolConfig();
|
||||
protocol.setName(provider.getProtocol().getName());
|
||||
protocol.setServer(provider.getServer());
|
||||
protocol.setClient(provider.getClient());
|
||||
protocol.setCodec(provider.getCodec());
|
||||
protocol.setHost(provider.getHost());
|
||||
protocol.setPort(provider.getPort());
|
||||
protocol.setPath(provider.getPath());
|
||||
protocol.setPayload(provider.getPayload());
|
||||
protocol.setThreads(provider.getThreads());
|
||||
protocol.setParameters(provider.getParameters());
|
||||
return protocol;
|
||||
}
|
||||
|
||||
private static ProviderConfig convertProtocolToProvider(ProtocolConfig protocol) {
|
||||
ProviderConfig provider = new ProviderConfig();
|
||||
provider.setProtocol(protocol);
|
||||
provider.setServer(protocol.getServer());
|
||||
provider.setClient(protocol.getClient());
|
||||
provider.setCodec(protocol.getCodec());
|
||||
provider.setHost(protocol.getHost());
|
||||
provider.setPort(protocol.getPort());
|
||||
provider.setPath(protocol.getPath());
|
||||
provider.setPayload(protocol.getPayload());
|
||||
provider.setThreads(protocol.getThreads());
|
||||
provider.setParameters(protocol.getParameters());
|
||||
return provider;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,6 +23,8 @@ public interface Exporter<T> extends org.apache.dubbo.rpc.Exporter<T> {
|
|||
@Override
|
||||
Invoker<T> getInvoker();
|
||||
|
||||
default void unregister() {}
|
||||
|
||||
class CompatibleExporter<T> implements Exporter<T> {
|
||||
|
||||
private org.apache.dubbo.rpc.Exporter<T> delegate;
|
||||
|
|
@ -40,5 +42,10 @@ public interface Exporter<T> extends org.apache.dubbo.rpc.Exporter<T> {
|
|||
public void unexport() {
|
||||
delegate.unexport();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unregister() {
|
||||
delegate.unregister();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@
|
|||
package org.apache.dubbo.config;
|
||||
|
||||
import com.alibaba.dubbo.config.ModuleConfig;
|
||||
import com.alibaba.dubbo.config.MonitorConfig;
|
||||
import com.alibaba.dubbo.config.RegistryConfig;
|
||||
import org.hamcrest.Matchers;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,67 @@
|
|||
/*
|
||||
* 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.config;
|
||||
|
||||
import org.apache.dubbo.common.utils.IOUtils;
|
||||
import org.apache.dubbo.common.utils.StringUtils;
|
||||
|
||||
import org.junit.jupiter.params.ParameterizedTest;
|
||||
import org.junit.jupiter.params.provider.ValueSource;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.Arrays;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static org.hamcrest.MatcherAssert.assertThat;
|
||||
import static org.hamcrest.collection.IsCollectionWithSize.hasSize;
|
||||
|
||||
public class SignatureTest {
|
||||
|
||||
@ParameterizedTest
|
||||
@ValueSource(classes = {
|
||||
com.alibaba.dubbo.config.ApplicationConfig.class,
|
||||
com.alibaba.dubbo.config.ArgumentConfig.class,
|
||||
com.alibaba.dubbo.config.ConsumerConfig.class,
|
||||
com.alibaba.dubbo.config.MethodConfig.class,
|
||||
com.alibaba.dubbo.config.ModuleConfig.class,
|
||||
com.alibaba.dubbo.config.MonitorConfig.class,
|
||||
com.alibaba.dubbo.config.ProtocolConfig.class,
|
||||
com.alibaba.dubbo.config.ProviderConfig.class,
|
||||
com.alibaba.dubbo.config.ReferenceConfig.class,
|
||||
com.alibaba.dubbo.config.RegistryConfig.class,
|
||||
com.alibaba.dubbo.config.ServiceConfig.class})
|
||||
void test(Class<?> targetClass) throws IOException {
|
||||
String[] lines = IOUtils.readLines(
|
||||
this.getClass().getClassLoader().getResourceAsStream("definition/" + targetClass.getName()));
|
||||
|
||||
// only compare setter now.
|
||||
// getter cannot make it compatible with the old version.
|
||||
Set<String> setters = Arrays.stream(lines)
|
||||
.filter(StringUtils::isNotEmpty)
|
||||
.filter(s -> !s.startsWith("//"))
|
||||
.filter(s -> s.contains("set"))
|
||||
.collect(Collectors.toSet());
|
||||
|
||||
for (Method method : targetClass.getMethods()) {
|
||||
setters.remove(method.toString().replace(method.getDeclaringClass().getName() + ".", targetClass.getName() + "."));
|
||||
}
|
||||
|
||||
assertThat(setters.toString(), setters, hasSize(0));
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,60 @@
|
|||
//
|
||||
// Licensed 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.
|
||||
//
|
||||
|
||||
public void com.alibaba.dubbo.config.ApplicationConfig.setVersion(java.lang.String)
|
||||
public java.lang.String com.alibaba.dubbo.config.ApplicationConfig.getOrganization()
|
||||
public void com.alibaba.dubbo.config.ApplicationConfig.setOrganization(java.lang.String)
|
||||
public java.lang.String com.alibaba.dubbo.config.ApplicationConfig.getArchitecture()
|
||||
public void com.alibaba.dubbo.config.ApplicationConfig.setArchitecture(java.lang.String)
|
||||
public java.lang.String com.alibaba.dubbo.config.ApplicationConfig.getEnvironment()
|
||||
public void com.alibaba.dubbo.config.ApplicationConfig.setEnvironment(java.lang.String)
|
||||
public com.alibaba.dubbo.config.RegistryConfig com.alibaba.dubbo.config.ApplicationConfig.getRegistry()
|
||||
public void com.alibaba.dubbo.config.ApplicationConfig.setRegistry(com.alibaba.dubbo.config.RegistryConfig)
|
||||
public java.util.List com.alibaba.dubbo.config.ApplicationConfig.getRegistries()
|
||||
public void com.alibaba.dubbo.config.ApplicationConfig.setRegistries(java.util.List)
|
||||
public com.alibaba.dubbo.config.MonitorConfig com.alibaba.dubbo.config.ApplicationConfig.getMonitor()
|
||||
public void com.alibaba.dubbo.config.ApplicationConfig.setMonitor(java.lang.String)
|
||||
public void com.alibaba.dubbo.config.ApplicationConfig.setMonitor(com.alibaba.dubbo.config.MonitorConfig)
|
||||
public java.lang.String com.alibaba.dubbo.config.ApplicationConfig.getCompiler()
|
||||
public void com.alibaba.dubbo.config.ApplicationConfig.setCompiler(java.lang.String)
|
||||
public void com.alibaba.dubbo.config.ApplicationConfig.setLogger(java.lang.String)
|
||||
public java.lang.String com.alibaba.dubbo.config.ApplicationConfig.getDumpDirectory()
|
||||
public void com.alibaba.dubbo.config.ApplicationConfig.setDumpDirectory(java.lang.String)
|
||||
public java.lang.Boolean com.alibaba.dubbo.config.ApplicationConfig.getQosEnable()
|
||||
public void com.alibaba.dubbo.config.ApplicationConfig.setQosEnable(java.lang.Boolean)
|
||||
public java.lang.Integer com.alibaba.dubbo.config.ApplicationConfig.getQosPort()
|
||||
public void com.alibaba.dubbo.config.ApplicationConfig.setQosPort(java.lang.Integer)
|
||||
public java.lang.Boolean com.alibaba.dubbo.config.ApplicationConfig.getQosAcceptForeignIp()
|
||||
public void com.alibaba.dubbo.config.ApplicationConfig.setQosAcceptForeignIp(java.lang.Boolean)
|
||||
public java.lang.String com.alibaba.dubbo.config.ApplicationConfig.getName()
|
||||
public java.lang.Boolean com.alibaba.dubbo.config.ApplicationConfig.isDefault()
|
||||
public void com.alibaba.dubbo.config.ApplicationConfig.setName(java.lang.String)
|
||||
public java.util.Map com.alibaba.dubbo.config.ApplicationConfig.getParameters()
|
||||
public void com.alibaba.dubbo.config.ApplicationConfig.setDefault(java.lang.Boolean)
|
||||
public java.lang.String com.alibaba.dubbo.config.ApplicationConfig.getLogger()
|
||||
public java.lang.String com.alibaba.dubbo.config.ApplicationConfig.getOwner()
|
||||
public void com.alibaba.dubbo.config.ApplicationConfig.setOwner(java.lang.String)
|
||||
public java.lang.String com.alibaba.dubbo.config.ApplicationConfig.getVersion()
|
||||
public void com.alibaba.dubbo.config.ApplicationConfig.setParameters(java.util.Map)
|
||||
public void com.alibaba.dubbo.config.ApplicationConfig.setId(java.lang.String)
|
||||
public java.lang.String com.alibaba.dubbo.config.ApplicationConfig.toString()
|
||||
public java.lang.String com.alibaba.dubbo.config.ApplicationConfig.getId()
|
||||
public final void com.alibaba.dubbo.config.ApplicationConfig.wait(long,int) throws java.lang.InterruptedException
|
||||
public final native void com.alibaba.dubbo.config.ApplicationConfig.wait(long) throws java.lang.InterruptedException
|
||||
public final void com.alibaba.dubbo.config.ApplicationConfig.wait() throws java.lang.InterruptedException
|
||||
public boolean com.alibaba.dubbo.config.ApplicationConfig.equals(java.lang.Object)
|
||||
public native int com.alibaba.dubbo.config.ApplicationConfig.hashCode()
|
||||
public final native java.lang.Class com.alibaba.dubbo.config.ApplicationConfig.getClass()
|
||||
public final native void com.alibaba.dubbo.config.ApplicationConfig.notify()
|
||||
public final native void com.alibaba.dubbo.config.ApplicationConfig.notifyAll()
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
//
|
||||
// Licensed 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.
|
||||
//
|
||||
|
||||
public void com.alibaba.dubbo.config.ArgumentConfig.setCallback(java.lang.Boolean)
|
||||
public java.lang.Boolean com.alibaba.dubbo.config.ArgumentConfig.isCallback()
|
||||
public void com.alibaba.dubbo.config.ArgumentConfig.setIndex(java.lang.Integer)
|
||||
public java.lang.String com.alibaba.dubbo.config.ArgumentConfig.getType()
|
||||
public java.lang.Integer com.alibaba.dubbo.config.ArgumentConfig.getIndex()
|
||||
public void com.alibaba.dubbo.config.ArgumentConfig.setType(java.lang.String)
|
||||
public final void com.alibaba.dubbo.config.ArgumentConfig.wait(long,int) throws java.lang.InterruptedException
|
||||
public final native void com.alibaba.dubbo.config.ArgumentConfig.wait(long) throws java.lang.InterruptedException
|
||||
public final void com.alibaba.dubbo.config.ArgumentConfig.wait() throws java.lang.InterruptedException
|
||||
public boolean com.alibaba.dubbo.config.ArgumentConfig.equals(java.lang.Object)
|
||||
public java.lang.String com.alibaba.dubbo.config.ArgumentConfig.toString()
|
||||
public native int com.alibaba.dubbo.config.ArgumentConfig.hashCode()
|
||||
public final native java.lang.Class com.alibaba.dubbo.config.ArgumentConfig.getClass()
|
||||
public final native void com.alibaba.dubbo.config.ArgumentConfig.notify()
|
||||
public final native void com.alibaba.dubbo.config.ArgumentConfig.notifyAll()
|
||||
|
|
@ -0,0 +1,123 @@
|
|||
//
|
||||
// Licensed 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.
|
||||
//
|
||||
|
||||
public void com.alibaba.dubbo.config.ConsumerConfig.setTimeout(java.lang.Integer)
|
||||
public java.lang.String com.alibaba.dubbo.config.ConsumerConfig.getClient()
|
||||
public void com.alibaba.dubbo.config.ConsumerConfig.setClient(java.lang.String)
|
||||
public java.lang.String com.alibaba.dubbo.config.ConsumerConfig.getThreadpool()
|
||||
public void com.alibaba.dubbo.config.ConsumerConfig.setThreadpool(java.lang.String)
|
||||
public java.lang.Integer com.alibaba.dubbo.config.ConsumerConfig.getCorethreads()
|
||||
public void com.alibaba.dubbo.config.ConsumerConfig.setCorethreads(java.lang.Integer)
|
||||
public void com.alibaba.dubbo.config.ConsumerConfig.setThreads(java.lang.Integer)
|
||||
public java.lang.Integer com.alibaba.dubbo.config.ConsumerConfig.getQueues()
|
||||
public void com.alibaba.dubbo.config.ConsumerConfig.setQueues(java.lang.Integer)
|
||||
public java.lang.Boolean com.alibaba.dubbo.config.ConsumerConfig.getDefault()
|
||||
public java.lang.Boolean com.alibaba.dubbo.config.ConsumerConfig.isDefault()
|
||||
public java.lang.Integer com.alibaba.dubbo.config.ConsumerConfig.getThreads()
|
||||
public void com.alibaba.dubbo.config.ConsumerConfig.setDefault(java.lang.Boolean)
|
||||
public void com.alibaba.dubbo.config.ConsumerConfig.setVersion(java.lang.String)
|
||||
public void com.alibaba.dubbo.config.ConsumerConfig.setGeneric(java.lang.Boolean)
|
||||
public void com.alibaba.dubbo.config.ConsumerConfig.setGeneric(java.lang.String)
|
||||
public java.lang.String com.alibaba.dubbo.config.ConsumerConfig.getGeneric()
|
||||
public void com.alibaba.dubbo.config.ConsumerConfig.setListener(java.lang.String)
|
||||
public void com.alibaba.dubbo.config.ConsumerConfig.setOnconnect(java.lang.String)
|
||||
public void com.alibaba.dubbo.config.ConsumerConfig.setOndisconnect(java.lang.String)
|
||||
public java.lang.Boolean com.alibaba.dubbo.config.ConsumerConfig.getStubevent()
|
||||
public java.lang.String com.alibaba.dubbo.config.ConsumerConfig.getReconnect()
|
||||
public void com.alibaba.dubbo.config.ConsumerConfig.setReconnect(java.lang.String)
|
||||
public java.lang.Boolean com.alibaba.dubbo.config.ConsumerConfig.getSticky()
|
||||
public void com.alibaba.dubbo.config.ConsumerConfig.setSticky(java.lang.Boolean)
|
||||
public java.lang.Boolean com.alibaba.dubbo.config.ConsumerConfig.getLazy()
|
||||
public void com.alibaba.dubbo.config.ConsumerConfig.setInit(java.lang.Boolean)
|
||||
public void com.alibaba.dubbo.config.ConsumerConfig.setInjvm(java.lang.Boolean)
|
||||
public void com.alibaba.dubbo.config.ConsumerConfig.setLazy(java.lang.Boolean)
|
||||
public java.lang.Boolean com.alibaba.dubbo.config.ConsumerConfig.isInjvm()
|
||||
public void com.alibaba.dubbo.config.ConsumerConfig.setCheck(java.lang.Boolean)
|
||||
public java.lang.Boolean com.alibaba.dubbo.config.ConsumerConfig.isCheck()
|
||||
public void com.alibaba.dubbo.config.ConsumerConfig.setGroup(java.lang.String)
|
||||
public java.lang.String com.alibaba.dubbo.config.ConsumerConfig.getGroup()
|
||||
public java.lang.Boolean com.alibaba.dubbo.config.ConsumerConfig.isInit()
|
||||
public java.lang.Boolean com.alibaba.dubbo.config.ConsumerConfig.isGeneric()
|
||||
public java.lang.String com.alibaba.dubbo.config.ConsumerConfig.getFilter()
|
||||
public java.lang.String com.alibaba.dubbo.config.ConsumerConfig.getListener()
|
||||
public java.lang.String com.alibaba.dubbo.config.ConsumerConfig.getVersion()
|
||||
public com.alibaba.dubbo.config.RegistryConfig com.alibaba.dubbo.config.ConsumerConfig.getRegistry()
|
||||
public void com.alibaba.dubbo.config.ConsumerConfig.setRegistry(com.alibaba.dubbo.config.RegistryConfig)
|
||||
public java.util.List com.alibaba.dubbo.config.ConsumerConfig.getRegistries()
|
||||
public void com.alibaba.dubbo.config.ConsumerConfig.setRegistries(java.util.List)
|
||||
public com.alibaba.dubbo.config.MonitorConfig com.alibaba.dubbo.config.ConsumerConfig.getMonitor()
|
||||
public void com.alibaba.dubbo.config.ConsumerConfig.setMonitor(com.alibaba.dubbo.config.MonitorConfig)
|
||||
public void com.alibaba.dubbo.config.ConsumerConfig.setMonitor(java.lang.String)
|
||||
public java.lang.String com.alibaba.dubbo.config.ConsumerConfig.getCluster()
|
||||
public void com.alibaba.dubbo.config.ConsumerConfig.setCluster(java.lang.String)
|
||||
public java.lang.Integer com.alibaba.dubbo.config.ConsumerConfig.getConnections()
|
||||
public void com.alibaba.dubbo.config.ConsumerConfig.setConnections(java.lang.Integer)
|
||||
public com.alibaba.dubbo.config.ApplicationConfig com.alibaba.dubbo.config.ConsumerConfig.getApplication()
|
||||
public void com.alibaba.dubbo.config.ConsumerConfig.setApplication(com.alibaba.dubbo.config.ApplicationConfig)
|
||||
public com.alibaba.dubbo.config.ModuleConfig com.alibaba.dubbo.config.ConsumerConfig.getModule()
|
||||
public void com.alibaba.dubbo.config.ConsumerConfig.setModule(com.alibaba.dubbo.config.ModuleConfig)
|
||||
public java.lang.Integer com.alibaba.dubbo.config.ConsumerConfig.getCallbacks()
|
||||
public void com.alibaba.dubbo.config.ConsumerConfig.setCallbacks(java.lang.Integer)
|
||||
public java.lang.String com.alibaba.dubbo.config.ConsumerConfig.getOnconnect()
|
||||
public java.lang.String com.alibaba.dubbo.config.ConsumerConfig.getOndisconnect()
|
||||
public java.lang.String com.alibaba.dubbo.config.ConsumerConfig.getLocal()
|
||||
public void com.alibaba.dubbo.config.ConsumerConfig.setLocal(java.lang.String)
|
||||
public void com.alibaba.dubbo.config.ConsumerConfig.setLocal(java.lang.Boolean)
|
||||
public void com.alibaba.dubbo.config.ConsumerConfig.setStub(java.lang.Boolean)
|
||||
public void com.alibaba.dubbo.config.ConsumerConfig.setStub(java.lang.String)
|
||||
public java.lang.String com.alibaba.dubbo.config.ConsumerConfig.getProxy()
|
||||
public void com.alibaba.dubbo.config.ConsumerConfig.setProxy(java.lang.String)
|
||||
public java.lang.String com.alibaba.dubbo.config.ConsumerConfig.getLayer()
|
||||
public void com.alibaba.dubbo.config.ConsumerConfig.setLayer(java.lang.String)
|
||||
public void com.alibaba.dubbo.config.ConsumerConfig.setScope(java.lang.String)
|
||||
public void com.alibaba.dubbo.config.ConsumerConfig.setFilter(java.lang.String)
|
||||
public java.lang.String com.alibaba.dubbo.config.ConsumerConfig.getOwner()
|
||||
public java.lang.String com.alibaba.dubbo.config.ConsumerConfig.getScope()
|
||||
public void com.alibaba.dubbo.config.ConsumerConfig.setOwner(java.lang.String)
|
||||
public java.lang.String com.alibaba.dubbo.config.ConsumerConfig.getStub()
|
||||
public java.lang.Integer com.alibaba.dubbo.config.ConsumerConfig.getRetries()
|
||||
public void com.alibaba.dubbo.config.ConsumerConfig.setRetries(java.lang.Integer)
|
||||
public java.lang.String com.alibaba.dubbo.config.ConsumerConfig.getLoadbalance()
|
||||
public void com.alibaba.dubbo.config.ConsumerConfig.setLoadbalance(java.lang.String)
|
||||
public java.lang.Integer com.alibaba.dubbo.config.ConsumerConfig.getActives()
|
||||
public void com.alibaba.dubbo.config.ConsumerConfig.setActives(java.lang.Integer)
|
||||
public java.lang.String com.alibaba.dubbo.config.ConsumerConfig.getMerger()
|
||||
public void com.alibaba.dubbo.config.ConsumerConfig.setMerger(java.lang.String)
|
||||
public java.lang.String com.alibaba.dubbo.config.ConsumerConfig.getValidation()
|
||||
public void com.alibaba.dubbo.config.ConsumerConfig.setValidation(java.lang.String)
|
||||
public java.lang.Boolean com.alibaba.dubbo.config.ConsumerConfig.isAsync()
|
||||
public void com.alibaba.dubbo.config.ConsumerConfig.setForks(java.lang.Integer)
|
||||
public java.lang.Integer com.alibaba.dubbo.config.ConsumerConfig.getForks()
|
||||
public void com.alibaba.dubbo.config.ConsumerConfig.setAsync(java.lang.Boolean)
|
||||
public java.lang.Boolean com.alibaba.dubbo.config.ConsumerConfig.getSent()
|
||||
public void com.alibaba.dubbo.config.ConsumerConfig.setSent(java.lang.Boolean)
|
||||
public java.lang.String com.alibaba.dubbo.config.ConsumerConfig.getMock()
|
||||
public void com.alibaba.dubbo.config.ConsumerConfig.setMock(java.lang.String)
|
||||
public void com.alibaba.dubbo.config.ConsumerConfig.setMock(java.lang.Boolean)
|
||||
public void com.alibaba.dubbo.config.ConsumerConfig.setCache(java.lang.String)
|
||||
public java.util.Map com.alibaba.dubbo.config.ConsumerConfig.getParameters()
|
||||
public java.lang.String com.alibaba.dubbo.config.ConsumerConfig.getCache()
|
||||
public void com.alibaba.dubbo.config.ConsumerConfig.setParameters(java.util.Map)
|
||||
public java.lang.Integer com.alibaba.dubbo.config.ConsumerConfig.getTimeout()
|
||||
public void com.alibaba.dubbo.config.ConsumerConfig.setId(java.lang.String)
|
||||
public java.lang.String com.alibaba.dubbo.config.ConsumerConfig.toString()
|
||||
public java.lang.String com.alibaba.dubbo.config.ConsumerConfig.getId()
|
||||
public final void com.alibaba.dubbo.config.ConsumerConfig.wait(long,int) throws java.lang.InterruptedException
|
||||
public final native void com.alibaba.dubbo.config.ConsumerConfig.wait(long) throws java.lang.InterruptedException
|
||||
public final void com.alibaba.dubbo.config.ConsumerConfig.wait() throws java.lang.InterruptedException
|
||||
public boolean com.alibaba.dubbo.config.ConsumerConfig.equals(java.lang.Object)
|
||||
public native int com.alibaba.dubbo.config.ConsumerConfig.hashCode()
|
||||
public final native java.lang.Class com.alibaba.dubbo.config.ConsumerConfig.getClass()
|
||||
public final native void com.alibaba.dubbo.config.ConsumerConfig.notify()
|
||||
public final native void com.alibaba.dubbo.config.ConsumerConfig.notifyAll()
|
||||
|
|
@ -0,0 +1,81 @@
|
|||
//
|
||||
// Licensed 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.
|
||||
//
|
||||
|
||||
public java.lang.Boolean com.alibaba.dubbo.config.MethodConfig.getSticky()
|
||||
public void com.alibaba.dubbo.config.MethodConfig.setSticky(java.lang.Boolean)
|
||||
public static java.util.List com.alibaba.dubbo.config.MethodConfig.constructMethodConfig(com.alibaba.dubbo.config.annotation.Method[])
|
||||
public java.lang.Boolean com.alibaba.dubbo.config.MethodConfig.isReliable()
|
||||
public void com.alibaba.dubbo.config.MethodConfig.setReliable(java.lang.Boolean)
|
||||
public java.lang.Integer com.alibaba.dubbo.config.MethodConfig.getExecutes()
|
||||
public void com.alibaba.dubbo.config.MethodConfig.setExecutes(java.lang.Integer)
|
||||
public java.lang.Boolean com.alibaba.dubbo.config.MethodConfig.getDeprecated()
|
||||
public void com.alibaba.dubbo.config.MethodConfig.setDeprecated(java.lang.Boolean)
|
||||
public java.util.List com.alibaba.dubbo.config.MethodConfig.getArguments()
|
||||
public void com.alibaba.dubbo.config.MethodConfig.setArguments(java.util.List)
|
||||
public java.lang.Object com.alibaba.dubbo.config.MethodConfig.getOnreturn()
|
||||
public void com.alibaba.dubbo.config.MethodConfig.setOnreturn(java.lang.Object)
|
||||
public java.lang.String com.alibaba.dubbo.config.MethodConfig.getOnreturnMethod()
|
||||
public void com.alibaba.dubbo.config.MethodConfig.setOnreturnMethod(java.lang.String)
|
||||
public java.lang.Object com.alibaba.dubbo.config.MethodConfig.getOnthrow()
|
||||
public void com.alibaba.dubbo.config.MethodConfig.setOnthrow(java.lang.Object)
|
||||
public java.lang.String com.alibaba.dubbo.config.MethodConfig.getOnthrowMethod()
|
||||
public void com.alibaba.dubbo.config.MethodConfig.setOnthrowMethod(java.lang.String)
|
||||
public java.lang.Object com.alibaba.dubbo.config.MethodConfig.getOninvoke()
|
||||
public void com.alibaba.dubbo.config.MethodConfig.setOninvoke(java.lang.Object)
|
||||
public java.lang.String com.alibaba.dubbo.config.MethodConfig.getOninvokeMethod()
|
||||
public void com.alibaba.dubbo.config.MethodConfig.setOninvokeMethod(java.lang.String)
|
||||
public void com.alibaba.dubbo.config.MethodConfig.setReturn(java.lang.Boolean)
|
||||
public java.lang.Boolean com.alibaba.dubbo.config.MethodConfig.isReturn()
|
||||
public java.lang.Integer com.alibaba.dubbo.config.MethodConfig.getStat()
|
||||
public void com.alibaba.dubbo.config.MethodConfig.setStat(java.lang.Integer)
|
||||
public java.lang.Boolean com.alibaba.dubbo.config.MethodConfig.isRetry()
|
||||
public void com.alibaba.dubbo.config.MethodConfig.setRetry(java.lang.Boolean)
|
||||
public java.lang.String com.alibaba.dubbo.config.MethodConfig.getName()
|
||||
public void com.alibaba.dubbo.config.MethodConfig.setName(java.lang.String)
|
||||
public void com.alibaba.dubbo.config.MethodConfig.setTimeout(java.lang.Integer)
|
||||
public java.lang.Integer com.alibaba.dubbo.config.MethodConfig.getRetries()
|
||||
public void com.alibaba.dubbo.config.MethodConfig.setRetries(java.lang.Integer)
|
||||
public java.lang.String com.alibaba.dubbo.config.MethodConfig.getLoadbalance()
|
||||
public void com.alibaba.dubbo.config.MethodConfig.setLoadbalance(java.lang.String)
|
||||
public java.lang.Integer com.alibaba.dubbo.config.MethodConfig.getActives()
|
||||
public void com.alibaba.dubbo.config.MethodConfig.setActives(java.lang.Integer)
|
||||
public java.lang.String com.alibaba.dubbo.config.MethodConfig.getMerger()
|
||||
public void com.alibaba.dubbo.config.MethodConfig.setMerger(java.lang.String)
|
||||
public java.lang.String com.alibaba.dubbo.config.MethodConfig.getValidation()
|
||||
public void com.alibaba.dubbo.config.MethodConfig.setValidation(java.lang.String)
|
||||
public java.lang.Boolean com.alibaba.dubbo.config.MethodConfig.isAsync()
|
||||
public void com.alibaba.dubbo.config.MethodConfig.setForks(java.lang.Integer)
|
||||
public java.lang.Integer com.alibaba.dubbo.config.MethodConfig.getForks()
|
||||
public void com.alibaba.dubbo.config.MethodConfig.setAsync(java.lang.Boolean)
|
||||
public java.lang.Boolean com.alibaba.dubbo.config.MethodConfig.getSent()
|
||||
public void com.alibaba.dubbo.config.MethodConfig.setSent(java.lang.Boolean)
|
||||
public java.lang.String com.alibaba.dubbo.config.MethodConfig.getMock()
|
||||
public void com.alibaba.dubbo.config.MethodConfig.setMock(java.lang.String)
|
||||
public void com.alibaba.dubbo.config.MethodConfig.setMock(java.lang.Boolean)
|
||||
public void com.alibaba.dubbo.config.MethodConfig.setCache(java.lang.String)
|
||||
public java.util.Map com.alibaba.dubbo.config.MethodConfig.getParameters()
|
||||
public java.lang.String com.alibaba.dubbo.config.MethodConfig.getCache()
|
||||
public void com.alibaba.dubbo.config.MethodConfig.setParameters(java.util.Map)
|
||||
public java.lang.Integer com.alibaba.dubbo.config.MethodConfig.getTimeout()
|
||||
public void com.alibaba.dubbo.config.MethodConfig.setId(java.lang.String)
|
||||
public java.lang.String com.alibaba.dubbo.config.MethodConfig.toString()
|
||||
public java.lang.String com.alibaba.dubbo.config.MethodConfig.getId()
|
||||
public final void com.alibaba.dubbo.config.MethodConfig.wait(long,int) throws java.lang.InterruptedException
|
||||
public final native void com.alibaba.dubbo.config.MethodConfig.wait(long) throws java.lang.InterruptedException
|
||||
public final void com.alibaba.dubbo.config.MethodConfig.wait() throws java.lang.InterruptedException
|
||||
public boolean com.alibaba.dubbo.config.MethodConfig.equals(java.lang.Object)
|
||||
public native int com.alibaba.dubbo.config.MethodConfig.hashCode()
|
||||
public final native java.lang.Class com.alibaba.dubbo.config.MethodConfig.getClass()
|
||||
public final native void com.alibaba.dubbo.config.MethodConfig.notify()
|
||||
public final native void com.alibaba.dubbo.config.MethodConfig.notifyAll()
|
||||
|
|
@ -0,0 +1,42 @@
|
|||
//
|
||||
// Licensed 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.
|
||||
//
|
||||
|
||||
public void com.alibaba.dubbo.config.ModuleConfig.setVersion(java.lang.String)
|
||||
public java.lang.String com.alibaba.dubbo.config.ModuleConfig.getOrganization()
|
||||
public void com.alibaba.dubbo.config.ModuleConfig.setOrganization(java.lang.String)
|
||||
public com.alibaba.dubbo.config.RegistryConfig com.alibaba.dubbo.config.ModuleConfig.getRegistry()
|
||||
public void com.alibaba.dubbo.config.ModuleConfig.setRegistry(com.alibaba.dubbo.config.RegistryConfig)
|
||||
public java.util.List com.alibaba.dubbo.config.ModuleConfig.getRegistries()
|
||||
public void com.alibaba.dubbo.config.ModuleConfig.setRegistries(java.util.List)
|
||||
public com.alibaba.dubbo.config.MonitorConfig com.alibaba.dubbo.config.ModuleConfig.getMonitor()
|
||||
public void com.alibaba.dubbo.config.ModuleConfig.setMonitor(java.lang.String)
|
||||
public void com.alibaba.dubbo.config.ModuleConfig.setMonitor(com.alibaba.dubbo.config.MonitorConfig)
|
||||
public java.lang.String com.alibaba.dubbo.config.ModuleConfig.getName()
|
||||
public java.lang.Boolean com.alibaba.dubbo.config.ModuleConfig.isDefault()
|
||||
public void com.alibaba.dubbo.config.ModuleConfig.setName(java.lang.String)
|
||||
public void com.alibaba.dubbo.config.ModuleConfig.setDefault(java.lang.Boolean)
|
||||
public java.lang.String com.alibaba.dubbo.config.ModuleConfig.getOwner()
|
||||
public void com.alibaba.dubbo.config.ModuleConfig.setOwner(java.lang.String)
|
||||
public java.lang.String com.alibaba.dubbo.config.ModuleConfig.getVersion()
|
||||
public void com.alibaba.dubbo.config.ModuleConfig.setId(java.lang.String)
|
||||
public java.lang.String com.alibaba.dubbo.config.ModuleConfig.toString()
|
||||
public java.lang.String com.alibaba.dubbo.config.ModuleConfig.getId()
|
||||
public final void com.alibaba.dubbo.config.ModuleConfig.wait(long,int) throws java.lang.InterruptedException
|
||||
public final native void com.alibaba.dubbo.config.ModuleConfig.wait(long) throws java.lang.InterruptedException
|
||||
public final void com.alibaba.dubbo.config.ModuleConfig.wait() throws java.lang.InterruptedException
|
||||
public boolean com.alibaba.dubbo.config.ModuleConfig.equals(java.lang.Object)
|
||||
public native int com.alibaba.dubbo.config.ModuleConfig.hashCode()
|
||||
public final native java.lang.Class com.alibaba.dubbo.config.ModuleConfig.getClass()
|
||||
public final native void com.alibaba.dubbo.config.ModuleConfig.notify()
|
||||
public final native void com.alibaba.dubbo.config.ModuleConfig.notifyAll()
|
||||
|
|
@ -0,0 +1,43 @@
|
|||
//
|
||||
// Licensed 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.
|
||||
//
|
||||
|
||||
public void com.alibaba.dubbo.config.MonitorConfig.setVersion(java.lang.String)
|
||||
public void com.alibaba.dubbo.config.MonitorConfig.setProtocol(java.lang.String)
|
||||
public java.lang.String com.alibaba.dubbo.config.MonitorConfig.getUsername()
|
||||
public void com.alibaba.dubbo.config.MonitorConfig.setUsername(java.lang.String)
|
||||
public void com.alibaba.dubbo.config.MonitorConfig.setPassword(java.lang.String)
|
||||
public void com.alibaba.dubbo.config.MonitorConfig.setInterval(java.lang.String)
|
||||
public java.lang.String com.alibaba.dubbo.config.MonitorConfig.getInterval()
|
||||
public void com.alibaba.dubbo.config.MonitorConfig.setGroup(java.lang.String)
|
||||
public java.lang.String com.alibaba.dubbo.config.MonitorConfig.getGroup()
|
||||
public java.lang.String com.alibaba.dubbo.config.MonitorConfig.getAddress()
|
||||
public java.lang.Boolean com.alibaba.dubbo.config.MonitorConfig.isDefault()
|
||||
public java.util.Map com.alibaba.dubbo.config.MonitorConfig.getParameters()
|
||||
public java.lang.String com.alibaba.dubbo.config.MonitorConfig.getProtocol()
|
||||
public void com.alibaba.dubbo.config.MonitorConfig.setDefault(java.lang.Boolean)
|
||||
public java.lang.String com.alibaba.dubbo.config.MonitorConfig.getPassword()
|
||||
public void com.alibaba.dubbo.config.MonitorConfig.setAddress(java.lang.String)
|
||||
public java.lang.String com.alibaba.dubbo.config.MonitorConfig.getVersion()
|
||||
public void com.alibaba.dubbo.config.MonitorConfig.setParameters(java.util.Map)
|
||||
public void com.alibaba.dubbo.config.MonitorConfig.setId(java.lang.String)
|
||||
public java.lang.String com.alibaba.dubbo.config.MonitorConfig.toString()
|
||||
public java.lang.String com.alibaba.dubbo.config.MonitorConfig.getId()
|
||||
public final void com.alibaba.dubbo.config.MonitorConfig.wait(long,int) throws java.lang.InterruptedException
|
||||
public final native void com.alibaba.dubbo.config.MonitorConfig.wait(long) throws java.lang.InterruptedException
|
||||
public final void com.alibaba.dubbo.config.MonitorConfig.wait() throws java.lang.InterruptedException
|
||||
public boolean com.alibaba.dubbo.config.MonitorConfig.equals(java.lang.Object)
|
||||
public native int com.alibaba.dubbo.config.MonitorConfig.hashCode()
|
||||
public final native java.lang.Class com.alibaba.dubbo.config.MonitorConfig.getClass()
|
||||
public final native void com.alibaba.dubbo.config.MonitorConfig.notify()
|
||||
public final native void com.alibaba.dubbo.config.MonitorConfig.notifyAll()
|
||||
|
|
@ -0,0 +1,92 @@
|
|||
//
|
||||
// Licensed 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.
|
||||
//
|
||||
|
||||
public java.lang.String com.alibaba.dubbo.config.ProtocolConfig.getClient()
|
||||
public void com.alibaba.dubbo.config.ProtocolConfig.setClient(java.lang.String)
|
||||
public java.lang.String com.alibaba.dubbo.config.ProtocolConfig.getThreadpool()
|
||||
public void com.alibaba.dubbo.config.ProtocolConfig.setThreadpool(java.lang.String)
|
||||
public void com.alibaba.dubbo.config.ProtocolConfig.setThreads(java.lang.Integer)
|
||||
public java.lang.Integer com.alibaba.dubbo.config.ProtocolConfig.getQueues()
|
||||
public void com.alibaba.dubbo.config.ProtocolConfig.setQueues(java.lang.Integer)
|
||||
public java.lang.String com.alibaba.dubbo.config.ProtocolConfig.getContextpath()
|
||||
public void com.alibaba.dubbo.config.ProtocolConfig.setContextpath(java.lang.String)
|
||||
public java.lang.Integer com.alibaba.dubbo.config.ProtocolConfig.getIothreads()
|
||||
public void com.alibaba.dubbo.config.ProtocolConfig.setIothreads(java.lang.Integer)
|
||||
public java.lang.Integer com.alibaba.dubbo.config.ProtocolConfig.getAccepts()
|
||||
public void com.alibaba.dubbo.config.ProtocolConfig.setAccepts(java.lang.Integer)
|
||||
public java.lang.String com.alibaba.dubbo.config.ProtocolConfig.getSerialization()
|
||||
public void com.alibaba.dubbo.config.ProtocolConfig.setSerialization(java.lang.String)
|
||||
public java.lang.String com.alibaba.dubbo.config.ProtocolConfig.getCharset()
|
||||
public void com.alibaba.dubbo.config.ProtocolConfig.setCharset(java.lang.String)
|
||||
public java.lang.Integer com.alibaba.dubbo.config.ProtocolConfig.getPayload()
|
||||
public void com.alibaba.dubbo.config.ProtocolConfig.setPayload(java.lang.Integer)
|
||||
public java.lang.Integer com.alibaba.dubbo.config.ProtocolConfig.getHeartbeat()
|
||||
public void com.alibaba.dubbo.config.ProtocolConfig.setHeartbeat(java.lang.Integer)
|
||||
public java.lang.String com.alibaba.dubbo.config.ProtocolConfig.getServer()
|
||||
public void com.alibaba.dubbo.config.ProtocolConfig.setServer(java.lang.String)
|
||||
public java.lang.String com.alibaba.dubbo.config.ProtocolConfig.getAccesslog()
|
||||
public void com.alibaba.dubbo.config.ProtocolConfig.setAccesslog(java.lang.String)
|
||||
public java.lang.String com.alibaba.dubbo.config.ProtocolConfig.getTelnet()
|
||||
public void com.alibaba.dubbo.config.ProtocolConfig.setTelnet(java.lang.String)
|
||||
public java.lang.String com.alibaba.dubbo.config.ProtocolConfig.getPrompt()
|
||||
public void com.alibaba.dubbo.config.ProtocolConfig.setPrompt(java.lang.String)
|
||||
public java.lang.String com.alibaba.dubbo.config.ProtocolConfig.getStatus()
|
||||
public void com.alibaba.dubbo.config.ProtocolConfig.setStatus(java.lang.String)
|
||||
public java.lang.Boolean com.alibaba.dubbo.config.ProtocolConfig.isRegister()
|
||||
public void com.alibaba.dubbo.config.ProtocolConfig.setRegister(java.lang.Boolean)
|
||||
public java.lang.String com.alibaba.dubbo.config.ProtocolConfig.getTransporter()
|
||||
public void com.alibaba.dubbo.config.ProtocolConfig.setTransporter(java.lang.String)
|
||||
public java.lang.String com.alibaba.dubbo.config.ProtocolConfig.getExchanger()
|
||||
public void com.alibaba.dubbo.config.ProtocolConfig.setExchanger(java.lang.String)
|
||||
public java.lang.String com.alibaba.dubbo.config.ProtocolConfig.getDispather()
|
||||
public void com.alibaba.dubbo.config.ProtocolConfig.setDispather(java.lang.String)
|
||||
public void com.alibaba.dubbo.config.ProtocolConfig.setDispatcher(java.lang.String)
|
||||
public java.lang.String com.alibaba.dubbo.config.ProtocolConfig.getNetworker()
|
||||
public void com.alibaba.dubbo.config.ProtocolConfig.setNetworker(java.lang.String)
|
||||
public java.lang.String com.alibaba.dubbo.config.ProtocolConfig.getOptimizer()
|
||||
public void com.alibaba.dubbo.config.ProtocolConfig.setOptimizer(java.lang.String)
|
||||
public void com.alibaba.dubbo.config.ProtocolConfig.setExtension(java.lang.String)
|
||||
public void com.alibaba.dubbo.config.ProtocolConfig.setHost(java.lang.String)
|
||||
public java.lang.String com.alibaba.dubbo.config.ProtocolConfig.getCodec()
|
||||
public void com.alibaba.dubbo.config.ProtocolConfig.setCodec(java.lang.String)
|
||||
public java.lang.String com.alibaba.dubbo.config.ProtocolConfig.getName()
|
||||
public java.lang.Boolean com.alibaba.dubbo.config.ProtocolConfig.isDefault()
|
||||
public void com.alibaba.dubbo.config.ProtocolConfig.destroy()
|
||||
public void com.alibaba.dubbo.config.ProtocolConfig.setName(java.lang.String)
|
||||
public java.lang.Integer com.alibaba.dubbo.config.ProtocolConfig.getThreads()
|
||||
public java.util.Map com.alibaba.dubbo.config.ProtocolConfig.getParameters()
|
||||
public java.lang.String com.alibaba.dubbo.config.ProtocolConfig.getPath()
|
||||
public java.lang.String com.alibaba.dubbo.config.ProtocolConfig.getHost()
|
||||
public java.lang.Integer com.alibaba.dubbo.config.ProtocolConfig.getPort()
|
||||
public void com.alibaba.dubbo.config.ProtocolConfig.setDefault(java.lang.Boolean)
|
||||
public java.lang.String com.alibaba.dubbo.config.ProtocolConfig.getExtension()
|
||||
public void com.alibaba.dubbo.config.ProtocolConfig.setPort(java.lang.Integer)
|
||||
public void com.alibaba.dubbo.config.ProtocolConfig.setKeepAlive(java.lang.Boolean)
|
||||
public java.lang.Boolean com.alibaba.dubbo.config.ProtocolConfig.getKeepAlive()
|
||||
public void com.alibaba.dubbo.config.ProtocolConfig.setPath(java.lang.String)
|
||||
public java.lang.String com.alibaba.dubbo.config.ProtocolConfig.getDispatcher()
|
||||
public void com.alibaba.dubbo.config.ProtocolConfig.setBuffer(java.lang.Integer)
|
||||
public java.lang.Integer com.alibaba.dubbo.config.ProtocolConfig.getBuffer()
|
||||
public void com.alibaba.dubbo.config.ProtocolConfig.setParameters(java.util.Map)
|
||||
public void com.alibaba.dubbo.config.ProtocolConfig.setId(java.lang.String)
|
||||
public java.lang.String com.alibaba.dubbo.config.ProtocolConfig.toString()
|
||||
public java.lang.String com.alibaba.dubbo.config.ProtocolConfig.getId()
|
||||
public final void com.alibaba.dubbo.config.ProtocolConfig.wait(long,int) throws java.lang.InterruptedException
|
||||
public final native void com.alibaba.dubbo.config.ProtocolConfig.wait(long) throws java.lang.InterruptedException
|
||||
public final void com.alibaba.dubbo.config.ProtocolConfig.wait() throws java.lang.InterruptedException
|
||||
public boolean com.alibaba.dubbo.config.ProtocolConfig.equals(java.lang.Object)
|
||||
public native int com.alibaba.dubbo.config.ProtocolConfig.hashCode()
|
||||
public final native java.lang.Class com.alibaba.dubbo.config.ProtocolConfig.getClass()
|
||||
public final native void com.alibaba.dubbo.config.ProtocolConfig.notify()
|
||||
public final native void com.alibaba.dubbo.config.ProtocolConfig.notifyAll()
|
||||
|
|
@ -0,0 +1,176 @@
|
|||
//
|
||||
// Licensed 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.
|
||||
//
|
||||
|
||||
public java.lang.String com.alibaba.dubbo.config.ProviderConfig.getClient()
|
||||
public void com.alibaba.dubbo.config.ProviderConfig.setClient(java.lang.String)
|
||||
public java.lang.String com.alibaba.dubbo.config.ProviderConfig.getThreadpool()
|
||||
public void com.alibaba.dubbo.config.ProviderConfig.setThreadpool(java.lang.String)
|
||||
public void com.alibaba.dubbo.config.ProviderConfig.setThreads(java.lang.Integer)
|
||||
public java.lang.Integer com.alibaba.dubbo.config.ProviderConfig.getQueues()
|
||||
public void com.alibaba.dubbo.config.ProviderConfig.setQueues(java.lang.Integer)
|
||||
public java.lang.String com.alibaba.dubbo.config.ProviderConfig.getCluster()
|
||||
public java.lang.Integer com.alibaba.dubbo.config.ProviderConfig.getConnections()
|
||||
public void com.alibaba.dubbo.config.ProviderConfig.setProtocol(java.lang.String)
|
||||
public java.lang.Integer com.alibaba.dubbo.config.ProviderConfig.getRetries()
|
||||
public java.lang.String com.alibaba.dubbo.config.ProviderConfig.getLoadbalance()
|
||||
public java.lang.Integer com.alibaba.dubbo.config.ProviderConfig.getActives()
|
||||
public java.lang.String com.alibaba.dubbo.config.ProviderConfig.getContextpath()
|
||||
public void com.alibaba.dubbo.config.ProviderConfig.setContextpath(java.lang.String)
|
||||
public java.lang.Integer com.alibaba.dubbo.config.ProviderConfig.getIothreads()
|
||||
public void com.alibaba.dubbo.config.ProviderConfig.setIothreads(java.lang.Integer)
|
||||
public java.lang.Integer com.alibaba.dubbo.config.ProviderConfig.getAccepts()
|
||||
public void com.alibaba.dubbo.config.ProviderConfig.setAccepts(java.lang.Integer)
|
||||
public java.lang.String com.alibaba.dubbo.config.ProviderConfig.getCharset()
|
||||
public void com.alibaba.dubbo.config.ProviderConfig.setCharset(java.lang.String)
|
||||
public java.lang.Integer com.alibaba.dubbo.config.ProviderConfig.getPayload()
|
||||
public void com.alibaba.dubbo.config.ProviderConfig.setPayload(java.lang.Integer)
|
||||
public java.lang.String com.alibaba.dubbo.config.ProviderConfig.getServer()
|
||||
public void com.alibaba.dubbo.config.ProviderConfig.setServer(java.lang.String)
|
||||
public java.lang.String com.alibaba.dubbo.config.ProviderConfig.getTelnet()
|
||||
public void com.alibaba.dubbo.config.ProviderConfig.setTelnet(java.lang.String)
|
||||
public java.lang.String com.alibaba.dubbo.config.ProviderConfig.getPrompt()
|
||||
public void com.alibaba.dubbo.config.ProviderConfig.setPrompt(java.lang.String)
|
||||
public java.lang.String com.alibaba.dubbo.config.ProviderConfig.getStatus()
|
||||
public void com.alibaba.dubbo.config.ProviderConfig.setStatus(java.lang.String)
|
||||
public java.lang.String com.alibaba.dubbo.config.ProviderConfig.getTransporter()
|
||||
public void com.alibaba.dubbo.config.ProviderConfig.setTransporter(java.lang.String)
|
||||
public java.lang.String com.alibaba.dubbo.config.ProviderConfig.getExchanger()
|
||||
public void com.alibaba.dubbo.config.ProviderConfig.setExchanger(java.lang.String)
|
||||
public java.lang.String com.alibaba.dubbo.config.ProviderConfig.getDispather()
|
||||
public void com.alibaba.dubbo.config.ProviderConfig.setDispather(java.lang.String)
|
||||
public void com.alibaba.dubbo.config.ProviderConfig.setDispatcher(java.lang.String)
|
||||
public java.lang.String com.alibaba.dubbo.config.ProviderConfig.getNetworker()
|
||||
public void com.alibaba.dubbo.config.ProviderConfig.setNetworker(java.lang.String)
|
||||
public java.lang.Boolean com.alibaba.dubbo.config.ProviderConfig.isAsync()
|
||||
public void com.alibaba.dubbo.config.ProviderConfig.setHost(java.lang.String)
|
||||
public java.lang.String com.alibaba.dubbo.config.ProviderConfig.getCodec()
|
||||
public void com.alibaba.dubbo.config.ProviderConfig.setCodec(java.lang.String)
|
||||
public java.lang.Integer com.alibaba.dubbo.config.ProviderConfig.getWait()
|
||||
public void com.alibaba.dubbo.config.ProviderConfig.setWait(java.lang.Integer)
|
||||
public java.lang.Boolean com.alibaba.dubbo.config.ProviderConfig.isDefault()
|
||||
public java.lang.Integer com.alibaba.dubbo.config.ProviderConfig.getThreads()
|
||||
public java.lang.String com.alibaba.dubbo.config.ProviderConfig.getPath()
|
||||
public java.lang.String com.alibaba.dubbo.config.ProviderConfig.getHost()
|
||||
public java.lang.Integer com.alibaba.dubbo.config.ProviderConfig.getPort()
|
||||
public void com.alibaba.dubbo.config.ProviderConfig.setDefault(java.lang.Boolean)
|
||||
public void com.alibaba.dubbo.config.ProviderConfig.setPort(java.lang.Integer)
|
||||
public void com.alibaba.dubbo.config.ProviderConfig.setPath(java.lang.String)
|
||||
public java.lang.String com.alibaba.dubbo.config.ProviderConfig.getDispatcher()
|
||||
public void com.alibaba.dubbo.config.ProviderConfig.setBuffer(java.lang.Integer)
|
||||
public java.lang.Integer com.alibaba.dubbo.config.ProviderConfig.getBuffer()
|
||||
public java.lang.Integer com.alibaba.dubbo.config.ProviderConfig.getTimeout()
|
||||
public void com.alibaba.dubbo.config.ProviderConfig.setVersion(java.lang.String)
|
||||
public void com.alibaba.dubbo.config.ProviderConfig.setListener(java.lang.String)
|
||||
public void com.alibaba.dubbo.config.ProviderConfig.setProtocol(com.alibaba.dubbo.config.ProtocolConfig)
|
||||
public java.lang.Integer com.alibaba.dubbo.config.ProviderConfig.getExecutes()
|
||||
public void com.alibaba.dubbo.config.ProviderConfig.setExecutes(java.lang.Integer)
|
||||
public void com.alibaba.dubbo.config.ProviderConfig.setDeprecated(java.lang.Boolean)
|
||||
public java.lang.String com.alibaba.dubbo.config.ProviderConfig.getSerialization()
|
||||
public void com.alibaba.dubbo.config.ProviderConfig.setSerialization(java.lang.String)
|
||||
public java.lang.String com.alibaba.dubbo.config.ProviderConfig.getAccesslog()
|
||||
public void com.alibaba.dubbo.config.ProviderConfig.setAccesslog(java.lang.String)
|
||||
public void com.alibaba.dubbo.config.ProviderConfig.setAccesslog(java.lang.Boolean)
|
||||
public java.lang.Boolean com.alibaba.dubbo.config.ProviderConfig.isRegister()
|
||||
public void com.alibaba.dubbo.config.ProviderConfig.setRegister(java.lang.Boolean)
|
||||
public java.lang.Boolean com.alibaba.dubbo.config.ProviderConfig.getExport()
|
||||
public void com.alibaba.dubbo.config.ProviderConfig.setExport(java.lang.Boolean)
|
||||
public java.lang.Integer com.alibaba.dubbo.config.ProviderConfig.getWeight()
|
||||
public void com.alibaba.dubbo.config.ProviderConfig.setWeight(java.lang.Integer)
|
||||
public java.lang.String com.alibaba.dubbo.config.ProviderConfig.getDocument()
|
||||
public void com.alibaba.dubbo.config.ProviderConfig.setDocument(java.lang.String)
|
||||
public java.lang.Boolean com.alibaba.dubbo.config.ProviderConfig.isDeprecated()
|
||||
public void com.alibaba.dubbo.config.ProviderConfig.setDynamic(java.lang.Boolean)
|
||||
public java.util.List com.alibaba.dubbo.config.ProviderConfig.getProtocols()
|
||||
public void com.alibaba.dubbo.config.ProviderConfig.setProtocols(java.util.List)
|
||||
public java.lang.Integer com.alibaba.dubbo.config.ProviderConfig.getWarmup()
|
||||
public void com.alibaba.dubbo.config.ProviderConfig.setWarmup(java.lang.Integer)
|
||||
public void com.alibaba.dubbo.config.ProviderConfig.setGroup(java.lang.String)
|
||||
public java.lang.String com.alibaba.dubbo.config.ProviderConfig.getGroup()
|
||||
public void com.alibaba.dubbo.config.ProviderConfig.setDelay(java.lang.Integer)
|
||||
public java.lang.String com.alibaba.dubbo.config.ProviderConfig.getToken()
|
||||
public void com.alibaba.dubbo.config.ProviderConfig.setToken(java.lang.String)
|
||||
public void com.alibaba.dubbo.config.ProviderConfig.setToken(java.lang.Boolean)
|
||||
public java.lang.String com.alibaba.dubbo.config.ProviderConfig.getTag()
|
||||
public void com.alibaba.dubbo.config.ProviderConfig.setTag(java.lang.String)
|
||||
public com.alibaba.dubbo.config.ProtocolConfig com.alibaba.dubbo.config.ProviderConfig.getProtocol()
|
||||
public java.lang.String com.alibaba.dubbo.config.ProviderConfig.getFilter()
|
||||
public java.lang.String com.alibaba.dubbo.config.ProviderConfig.getListener()
|
||||
public java.lang.Boolean com.alibaba.dubbo.config.ProviderConfig.isDynamic()
|
||||
public java.lang.Integer com.alibaba.dubbo.config.ProviderConfig.getDelay()
|
||||
public java.lang.String com.alibaba.dubbo.config.ProviderConfig.getVersion()
|
||||
public com.alibaba.dubbo.config.RegistryConfig com.alibaba.dubbo.config.ProviderConfig.getRegistry()
|
||||
public void com.alibaba.dubbo.config.ProviderConfig.setRegistry(com.alibaba.dubbo.config.RegistryConfig)
|
||||
public java.util.List com.alibaba.dubbo.config.ProviderConfig.getRegistries()
|
||||
public void com.alibaba.dubbo.config.ProviderConfig.setRegistries(java.util.List)
|
||||
public com.alibaba.dubbo.config.MonitorConfig com.alibaba.dubbo.config.ProviderConfig.getMonitor()
|
||||
public void com.alibaba.dubbo.config.ProviderConfig.setMonitor(com.alibaba.dubbo.config.MonitorConfig)
|
||||
public void com.alibaba.dubbo.config.ProviderConfig.setMonitor(java.lang.String)
|
||||
public void com.alibaba.dubbo.config.ProviderConfig.setOnconnect(java.lang.String)
|
||||
public void com.alibaba.dubbo.config.ProviderConfig.setOndisconnect(java.lang.String)
|
||||
public void com.alibaba.dubbo.config.ProviderConfig.setCluster(java.lang.String)
|
||||
public void com.alibaba.dubbo.config.ProviderConfig.setConnections(java.lang.Integer)
|
||||
public com.alibaba.dubbo.config.ApplicationConfig com.alibaba.dubbo.config.ProviderConfig.getApplication()
|
||||
public void com.alibaba.dubbo.config.ProviderConfig.setApplication(com.alibaba.dubbo.config.ApplicationConfig)
|
||||
public com.alibaba.dubbo.config.ModuleConfig com.alibaba.dubbo.config.ProviderConfig.getModule()
|
||||
public void com.alibaba.dubbo.config.ProviderConfig.setModule(com.alibaba.dubbo.config.ModuleConfig)
|
||||
public java.lang.Integer com.alibaba.dubbo.config.ProviderConfig.getCallbacks()
|
||||
public void com.alibaba.dubbo.config.ProviderConfig.setCallbacks(java.lang.Integer)
|
||||
public java.lang.String com.alibaba.dubbo.config.ProviderConfig.getOnconnect()
|
||||
public java.lang.String com.alibaba.dubbo.config.ProviderConfig.getOndisconnect()
|
||||
public java.lang.String com.alibaba.dubbo.config.ProviderConfig.getLocal()
|
||||
public void com.alibaba.dubbo.config.ProviderConfig.setLocal(java.lang.String)
|
||||
public void com.alibaba.dubbo.config.ProviderConfig.setLocal(java.lang.Boolean)
|
||||
public void com.alibaba.dubbo.config.ProviderConfig.setStub(java.lang.Boolean)
|
||||
public void com.alibaba.dubbo.config.ProviderConfig.setStub(java.lang.String)
|
||||
public java.lang.String com.alibaba.dubbo.config.ProviderConfig.getProxy()
|
||||
public void com.alibaba.dubbo.config.ProviderConfig.setProxy(java.lang.String)
|
||||
public java.lang.String com.alibaba.dubbo.config.ProviderConfig.getLayer()
|
||||
public void com.alibaba.dubbo.config.ProviderConfig.setLayer(java.lang.String)
|
||||
public void com.alibaba.dubbo.config.ProviderConfig.setScope(java.lang.String)
|
||||
public void com.alibaba.dubbo.config.ProviderConfig.setFilter(java.lang.String)
|
||||
public java.lang.String com.alibaba.dubbo.config.ProviderConfig.getOwner()
|
||||
public java.lang.String com.alibaba.dubbo.config.ProviderConfig.getScope()
|
||||
public void com.alibaba.dubbo.config.ProviderConfig.setOwner(java.lang.String)
|
||||
public java.lang.String com.alibaba.dubbo.config.ProviderConfig.getStub()
|
||||
public void com.alibaba.dubbo.config.ProviderConfig.setTimeout(java.lang.Integer)
|
||||
public void com.alibaba.dubbo.config.ProviderConfig.setRetries(java.lang.Integer)
|
||||
public void com.alibaba.dubbo.config.ProviderConfig.setLoadbalance(java.lang.String)
|
||||
public void com.alibaba.dubbo.config.ProviderConfig.setActives(java.lang.Integer)
|
||||
public java.lang.String com.alibaba.dubbo.config.ProviderConfig.getMerger()
|
||||
public void com.alibaba.dubbo.config.ProviderConfig.setMerger(java.lang.String)
|
||||
public java.lang.String com.alibaba.dubbo.config.ProviderConfig.getValidation()
|
||||
public void com.alibaba.dubbo.config.ProviderConfig.setValidation(java.lang.String)
|
||||
public void com.alibaba.dubbo.config.ProviderConfig.setForks(java.lang.Integer)
|
||||
public java.lang.Integer com.alibaba.dubbo.config.ProviderConfig.getForks()
|
||||
public void com.alibaba.dubbo.config.ProviderConfig.setAsync(java.lang.Boolean)
|
||||
public java.lang.Boolean com.alibaba.dubbo.config.ProviderConfig.getSent()
|
||||
public void com.alibaba.dubbo.config.ProviderConfig.setSent(java.lang.Boolean)
|
||||
public java.lang.String com.alibaba.dubbo.config.ProviderConfig.getMock()
|
||||
public void com.alibaba.dubbo.config.ProviderConfig.setMock(java.lang.String)
|
||||
public void com.alibaba.dubbo.config.ProviderConfig.setMock(java.lang.Boolean)
|
||||
public void com.alibaba.dubbo.config.ProviderConfig.setCache(java.lang.String)
|
||||
public java.util.Map com.alibaba.dubbo.config.ProviderConfig.getParameters()
|
||||
public java.lang.String com.alibaba.dubbo.config.ProviderConfig.getCache()
|
||||
public void com.alibaba.dubbo.config.ProviderConfig.setParameters(java.util.Map)
|
||||
public void com.alibaba.dubbo.config.ProviderConfig.setId(java.lang.String)
|
||||
public java.lang.String com.alibaba.dubbo.config.ProviderConfig.toString()
|
||||
public java.lang.String com.alibaba.dubbo.config.ProviderConfig.getId()
|
||||
public final void com.alibaba.dubbo.config.ProviderConfig.wait(long,int) throws java.lang.InterruptedException
|
||||
public final native void com.alibaba.dubbo.config.ProviderConfig.wait(long) throws java.lang.InterruptedException
|
||||
public final void com.alibaba.dubbo.config.ProviderConfig.wait() throws java.lang.InterruptedException
|
||||
public boolean com.alibaba.dubbo.config.ProviderConfig.equals(java.lang.Object)
|
||||
public native int com.alibaba.dubbo.config.ProviderConfig.hashCode()
|
||||
public final native java.lang.Class com.alibaba.dubbo.config.ProviderConfig.getClass()
|
||||
public final native void com.alibaba.dubbo.config.ProviderConfig.notify()
|
||||
public final native void com.alibaba.dubbo.config.ProviderConfig.notifyAll()
|
||||
|
|
@ -0,0 +1,130 @@
|
|||
//
|
||||
// Licensed 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.
|
||||
//
|
||||
|
||||
public java.lang.String com.alibaba.dubbo.config.ReferenceConfig.getClient()
|
||||
public void com.alibaba.dubbo.config.ReferenceConfig.setClient(java.lang.String)
|
||||
public void com.alibaba.dubbo.config.ReferenceConfig.setProtocol(java.lang.String)
|
||||
public java.lang.Class com.alibaba.dubbo.config.ReferenceConfig.getInterfaceClass()
|
||||
public void com.alibaba.dubbo.config.ReferenceConfig.setInterfaceClass(java.lang.Class)
|
||||
public java.lang.String com.alibaba.dubbo.config.ReferenceConfig.getInterface()
|
||||
public void com.alibaba.dubbo.config.ReferenceConfig.setInterface(java.lang.Class)
|
||||
public void com.alibaba.dubbo.config.ReferenceConfig.setInterface(java.lang.String)
|
||||
public void com.alibaba.dubbo.config.ReferenceConfig.setMethods(java.util.List)
|
||||
public com.alibaba.dubbo.config.ConsumerConfig com.alibaba.dubbo.config.ReferenceConfig.getConsumer()
|
||||
public void com.alibaba.dubbo.config.ReferenceConfig.setConsumer(com.alibaba.dubbo.config.ConsumerConfig)
|
||||
public java.lang.String com.alibaba.dubbo.config.ReferenceConfig.getUniqueServiceName()
|
||||
public java.lang.String com.alibaba.dubbo.config.ReferenceConfig.getGroup()
|
||||
public com.alibaba.dubbo.common.URL com.alibaba.dubbo.config.ReferenceConfig.toUrl()
|
||||
public java.util.List com.alibaba.dubbo.config.ReferenceConfig.toUrls()
|
||||
public java.lang.String com.alibaba.dubbo.config.ReferenceConfig.getUrl()
|
||||
public void com.alibaba.dubbo.config.ReferenceConfig.setUrl(java.lang.String)
|
||||
public synchronized java.lang.Object com.alibaba.dubbo.config.ReferenceConfig.get()
|
||||
public java.util.List com.alibaba.dubbo.config.ReferenceConfig.getMethods()
|
||||
public synchronized void com.alibaba.dubbo.config.ReferenceConfig.destroy()
|
||||
public java.lang.String com.alibaba.dubbo.config.ReferenceConfig.getProtocol()
|
||||
public java.lang.String com.alibaba.dubbo.config.ReferenceConfig.getVersion()
|
||||
public void com.alibaba.dubbo.config.ReferenceConfig.setVersion(java.lang.String)
|
||||
public void com.alibaba.dubbo.config.ReferenceConfig.setGeneric(java.lang.Boolean)
|
||||
public void com.alibaba.dubbo.config.ReferenceConfig.setGeneric(java.lang.String)
|
||||
public java.lang.String com.alibaba.dubbo.config.ReferenceConfig.getGeneric()
|
||||
public void com.alibaba.dubbo.config.ReferenceConfig.setListener(java.lang.String)
|
||||
public void com.alibaba.dubbo.config.ReferenceConfig.setOnconnect(java.lang.String)
|
||||
public void com.alibaba.dubbo.config.ReferenceConfig.setOndisconnect(java.lang.String)
|
||||
public java.lang.Boolean com.alibaba.dubbo.config.ReferenceConfig.getStubevent()
|
||||
public java.lang.String com.alibaba.dubbo.config.ReferenceConfig.getReconnect()
|
||||
public void com.alibaba.dubbo.config.ReferenceConfig.setReconnect(java.lang.String)
|
||||
public java.lang.Boolean com.alibaba.dubbo.config.ReferenceConfig.getSticky()
|
||||
public void com.alibaba.dubbo.config.ReferenceConfig.setSticky(java.lang.Boolean)
|
||||
public java.lang.Boolean com.alibaba.dubbo.config.ReferenceConfig.getLazy()
|
||||
public void com.alibaba.dubbo.config.ReferenceConfig.setInit(java.lang.Boolean)
|
||||
public void com.alibaba.dubbo.config.ReferenceConfig.setInjvm(java.lang.Boolean)
|
||||
public void com.alibaba.dubbo.config.ReferenceConfig.setLazy(java.lang.Boolean)
|
||||
public java.lang.Boolean com.alibaba.dubbo.config.ReferenceConfig.isInjvm()
|
||||
public void com.alibaba.dubbo.config.ReferenceConfig.setCheck(java.lang.Boolean)
|
||||
public java.lang.Boolean com.alibaba.dubbo.config.ReferenceConfig.isCheck()
|
||||
public void com.alibaba.dubbo.config.ReferenceConfig.setGroup(java.lang.String)
|
||||
public java.lang.Boolean com.alibaba.dubbo.config.ReferenceConfig.isInit()
|
||||
public java.lang.Boolean com.alibaba.dubbo.config.ReferenceConfig.isGeneric()
|
||||
public java.lang.String com.alibaba.dubbo.config.ReferenceConfig.getFilter()
|
||||
public java.lang.String com.alibaba.dubbo.config.ReferenceConfig.getListener()
|
||||
public com.alibaba.dubbo.config.RegistryConfig com.alibaba.dubbo.config.ReferenceConfig.getRegistry()
|
||||
public void com.alibaba.dubbo.config.ReferenceConfig.setRegistry(com.alibaba.dubbo.config.RegistryConfig)
|
||||
public java.util.List com.alibaba.dubbo.config.ReferenceConfig.getRegistries()
|
||||
public void com.alibaba.dubbo.config.ReferenceConfig.setRegistries(java.util.List)
|
||||
public com.alibaba.dubbo.config.MonitorConfig com.alibaba.dubbo.config.ReferenceConfig.getMonitor()
|
||||
public void com.alibaba.dubbo.config.ReferenceConfig.setMonitor(com.alibaba.dubbo.config.MonitorConfig)
|
||||
public void com.alibaba.dubbo.config.ReferenceConfig.setMonitor(java.lang.String)
|
||||
public java.lang.String com.alibaba.dubbo.config.ReferenceConfig.getCluster()
|
||||
public void com.alibaba.dubbo.config.ReferenceConfig.setCluster(java.lang.String)
|
||||
public java.lang.Integer com.alibaba.dubbo.config.ReferenceConfig.getConnections()
|
||||
public void com.alibaba.dubbo.config.ReferenceConfig.setConnections(java.lang.Integer)
|
||||
public com.alibaba.dubbo.config.ApplicationConfig com.alibaba.dubbo.config.ReferenceConfig.getApplication()
|
||||
public void com.alibaba.dubbo.config.ReferenceConfig.setApplication(com.alibaba.dubbo.config.ApplicationConfig)
|
||||
public com.alibaba.dubbo.config.ModuleConfig com.alibaba.dubbo.config.ReferenceConfig.getModule()
|
||||
public void com.alibaba.dubbo.config.ReferenceConfig.setModule(com.alibaba.dubbo.config.ModuleConfig)
|
||||
public java.lang.Integer com.alibaba.dubbo.config.ReferenceConfig.getCallbacks()
|
||||
public void com.alibaba.dubbo.config.ReferenceConfig.setCallbacks(java.lang.Integer)
|
||||
public java.lang.String com.alibaba.dubbo.config.ReferenceConfig.getOnconnect()
|
||||
public java.lang.String com.alibaba.dubbo.config.ReferenceConfig.getOndisconnect()
|
||||
public java.lang.String com.alibaba.dubbo.config.ReferenceConfig.getLocal()
|
||||
public void com.alibaba.dubbo.config.ReferenceConfig.setLocal(java.lang.String)
|
||||
public void com.alibaba.dubbo.config.ReferenceConfig.setLocal(java.lang.Boolean)
|
||||
public void com.alibaba.dubbo.config.ReferenceConfig.setStub(java.lang.Boolean)
|
||||
public void com.alibaba.dubbo.config.ReferenceConfig.setStub(java.lang.String)
|
||||
public java.lang.String com.alibaba.dubbo.config.ReferenceConfig.getProxy()
|
||||
public void com.alibaba.dubbo.config.ReferenceConfig.setProxy(java.lang.String)
|
||||
public java.lang.String com.alibaba.dubbo.config.ReferenceConfig.getLayer()
|
||||
public void com.alibaba.dubbo.config.ReferenceConfig.setLayer(java.lang.String)
|
||||
public void com.alibaba.dubbo.config.ReferenceConfig.setScope(java.lang.String)
|
||||
public void com.alibaba.dubbo.config.ReferenceConfig.setFilter(java.lang.String)
|
||||
public java.lang.String com.alibaba.dubbo.config.ReferenceConfig.getOwner()
|
||||
public java.lang.String com.alibaba.dubbo.config.ReferenceConfig.getScope()
|
||||
public void com.alibaba.dubbo.config.ReferenceConfig.setOwner(java.lang.String)
|
||||
public java.lang.String com.alibaba.dubbo.config.ReferenceConfig.getStub()
|
||||
public void com.alibaba.dubbo.config.ReferenceConfig.setTimeout(java.lang.Integer)
|
||||
public java.lang.Integer com.alibaba.dubbo.config.ReferenceConfig.getRetries()
|
||||
public void com.alibaba.dubbo.config.ReferenceConfig.setRetries(java.lang.Integer)
|
||||
public java.lang.String com.alibaba.dubbo.config.ReferenceConfig.getLoadbalance()
|
||||
public void com.alibaba.dubbo.config.ReferenceConfig.setLoadbalance(java.lang.String)
|
||||
public java.lang.Integer com.alibaba.dubbo.config.ReferenceConfig.getActives()
|
||||
public void com.alibaba.dubbo.config.ReferenceConfig.setActives(java.lang.Integer)
|
||||
public java.lang.String com.alibaba.dubbo.config.ReferenceConfig.getMerger()
|
||||
public void com.alibaba.dubbo.config.ReferenceConfig.setMerger(java.lang.String)
|
||||
public java.lang.String com.alibaba.dubbo.config.ReferenceConfig.getValidation()
|
||||
public void com.alibaba.dubbo.config.ReferenceConfig.setValidation(java.lang.String)
|
||||
public java.lang.Boolean com.alibaba.dubbo.config.ReferenceConfig.isAsync()
|
||||
public void com.alibaba.dubbo.config.ReferenceConfig.setForks(java.lang.Integer)
|
||||
public java.lang.Integer com.alibaba.dubbo.config.ReferenceConfig.getForks()
|
||||
public void com.alibaba.dubbo.config.ReferenceConfig.setAsync(java.lang.Boolean)
|
||||
public java.lang.Boolean com.alibaba.dubbo.config.ReferenceConfig.getSent()
|
||||
public void com.alibaba.dubbo.config.ReferenceConfig.setSent(java.lang.Boolean)
|
||||
public java.lang.String com.alibaba.dubbo.config.ReferenceConfig.getMock()
|
||||
public void com.alibaba.dubbo.config.ReferenceConfig.setMock(java.lang.String)
|
||||
public void com.alibaba.dubbo.config.ReferenceConfig.setMock(java.lang.Boolean)
|
||||
public void com.alibaba.dubbo.config.ReferenceConfig.setCache(java.lang.String)
|
||||
public java.util.Map com.alibaba.dubbo.config.ReferenceConfig.getParameters()
|
||||
public java.lang.String com.alibaba.dubbo.config.ReferenceConfig.getCache()
|
||||
public void com.alibaba.dubbo.config.ReferenceConfig.setParameters(java.util.Map)
|
||||
public java.lang.Integer com.alibaba.dubbo.config.ReferenceConfig.getTimeout()
|
||||
public void com.alibaba.dubbo.config.ReferenceConfig.setId(java.lang.String)
|
||||
public java.lang.String com.alibaba.dubbo.config.ReferenceConfig.toString()
|
||||
public java.lang.String com.alibaba.dubbo.config.ReferenceConfig.getId()
|
||||
public final void com.alibaba.dubbo.config.ReferenceConfig.wait(long,int) throws java.lang.InterruptedException
|
||||
public final native void com.alibaba.dubbo.config.ReferenceConfig.wait(long) throws java.lang.InterruptedException
|
||||
public final void com.alibaba.dubbo.config.ReferenceConfig.wait() throws java.lang.InterruptedException
|
||||
public boolean com.alibaba.dubbo.config.ReferenceConfig.equals(java.lang.Object)
|
||||
public native int com.alibaba.dubbo.config.ReferenceConfig.hashCode()
|
||||
public final native java.lang.Class com.alibaba.dubbo.config.ReferenceConfig.getClass()
|
||||
public final native void com.alibaba.dubbo.config.ReferenceConfig.notify()
|
||||
public final native void com.alibaba.dubbo.config.ReferenceConfig.notifyAll()
|
||||
|
|
@ -0,0 +1,69 @@
|
|||
//
|
||||
// Licensed 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.
|
||||
//
|
||||
|
||||
public void com.alibaba.dubbo.config.RegistryConfig.setVersion(java.lang.String)
|
||||
public void com.alibaba.dubbo.config.RegistryConfig.setTimeout(java.lang.Integer)
|
||||
public java.lang.String com.alibaba.dubbo.config.RegistryConfig.getClient()
|
||||
public void com.alibaba.dubbo.config.RegistryConfig.setClient(java.lang.String)
|
||||
public java.lang.String com.alibaba.dubbo.config.RegistryConfig.getCluster()
|
||||
public void com.alibaba.dubbo.config.RegistryConfig.setCluster(java.lang.String)
|
||||
public void com.alibaba.dubbo.config.RegistryConfig.setProtocol(java.lang.String)
|
||||
public java.lang.String com.alibaba.dubbo.config.RegistryConfig.getUsername()
|
||||
public void com.alibaba.dubbo.config.RegistryConfig.setUsername(java.lang.String)
|
||||
public void com.alibaba.dubbo.config.RegistryConfig.setPassword(java.lang.String)
|
||||
public java.lang.String com.alibaba.dubbo.config.RegistryConfig.getServer()
|
||||
public void com.alibaba.dubbo.config.RegistryConfig.setServer(java.lang.String)
|
||||
public java.lang.Boolean com.alibaba.dubbo.config.RegistryConfig.isRegister()
|
||||
public void com.alibaba.dubbo.config.RegistryConfig.setRegister(java.lang.Boolean)
|
||||
public java.lang.String com.alibaba.dubbo.config.RegistryConfig.getTransporter()
|
||||
public void com.alibaba.dubbo.config.RegistryConfig.setTransporter(java.lang.String)
|
||||
public void com.alibaba.dubbo.config.RegistryConfig.setDynamic(java.lang.Boolean)
|
||||
public java.lang.String com.alibaba.dubbo.config.RegistryConfig.getTransport()
|
||||
public void com.alibaba.dubbo.config.RegistryConfig.setTransport(java.lang.String)
|
||||
public java.lang.Integer com.alibaba.dubbo.config.RegistryConfig.getSession()
|
||||
public void com.alibaba.dubbo.config.RegistryConfig.setSession(java.lang.Integer)
|
||||
public java.lang.Boolean com.alibaba.dubbo.config.RegistryConfig.isSubscribe()
|
||||
public void com.alibaba.dubbo.config.RegistryConfig.setSubscribe(java.lang.Boolean)
|
||||
public void com.alibaba.dubbo.config.RegistryConfig.setCheck(java.lang.Boolean)
|
||||
public java.lang.Boolean com.alibaba.dubbo.config.RegistryConfig.isCheck()
|
||||
public void com.alibaba.dubbo.config.RegistryConfig.setGroup(java.lang.String)
|
||||
public java.lang.String com.alibaba.dubbo.config.RegistryConfig.getGroup()
|
||||
public java.lang.Integer com.alibaba.dubbo.config.RegistryConfig.getWait()
|
||||
public void com.alibaba.dubbo.config.RegistryConfig.setWait(java.lang.Integer)
|
||||
public void com.alibaba.dubbo.config.RegistryConfig.setFile(java.lang.String)
|
||||
public java.lang.String com.alibaba.dubbo.config.RegistryConfig.getAddress()
|
||||
public java.lang.Boolean com.alibaba.dubbo.config.RegistryConfig.isDefault()
|
||||
public java.util.Map com.alibaba.dubbo.config.RegistryConfig.getParameters()
|
||||
public java.lang.String com.alibaba.dubbo.config.RegistryConfig.getProtocol()
|
||||
public java.lang.String com.alibaba.dubbo.config.RegistryConfig.getFile()
|
||||
public java.lang.Integer com.alibaba.dubbo.config.RegistryConfig.getPort()
|
||||
public void com.alibaba.dubbo.config.RegistryConfig.setDefault(java.lang.Boolean)
|
||||
public java.lang.String com.alibaba.dubbo.config.RegistryConfig.getPassword()
|
||||
public void com.alibaba.dubbo.config.RegistryConfig.setAddress(java.lang.String)
|
||||
public void com.alibaba.dubbo.config.RegistryConfig.setPort(java.lang.Integer)
|
||||
public java.lang.Boolean com.alibaba.dubbo.config.RegistryConfig.isDynamic()
|
||||
public java.lang.String com.alibaba.dubbo.config.RegistryConfig.getVersion()
|
||||
public void com.alibaba.dubbo.config.RegistryConfig.setParameters(java.util.Map)
|
||||
public java.lang.Integer com.alibaba.dubbo.config.RegistryConfig.getTimeout()
|
||||
public void com.alibaba.dubbo.config.RegistryConfig.setId(java.lang.String)
|
||||
public java.lang.String com.alibaba.dubbo.config.RegistryConfig.toString()
|
||||
public java.lang.String com.alibaba.dubbo.config.RegistryConfig.getId()
|
||||
public final void com.alibaba.dubbo.config.RegistryConfig.wait(long,int) throws java.lang.InterruptedException
|
||||
public final native void com.alibaba.dubbo.config.RegistryConfig.wait(long) throws java.lang.InterruptedException
|
||||
public final void com.alibaba.dubbo.config.RegistryConfig.wait() throws java.lang.InterruptedException
|
||||
public boolean com.alibaba.dubbo.config.RegistryConfig.equals(java.lang.Object)
|
||||
public native int com.alibaba.dubbo.config.RegistryConfig.hashCode()
|
||||
public final native java.lang.Class com.alibaba.dubbo.config.RegistryConfig.getClass()
|
||||
public final native void com.alibaba.dubbo.config.RegistryConfig.notify()
|
||||
public final native void com.alibaba.dubbo.config.RegistryConfig.notifyAll()
|
||||
|
|
@ -0,0 +1,150 @@
|
|||
//
|
||||
// Licensed 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.
|
||||
//
|
||||
|
||||
public void com.alibaba.dubbo.config.ServiceConfig.setGeneric(java.lang.String)
|
||||
public java.lang.String com.alibaba.dubbo.config.ServiceConfig.getGeneric()
|
||||
public boolean com.alibaba.dubbo.config.ServiceConfig.isExported()
|
||||
public boolean com.alibaba.dubbo.config.ServiceConfig.isUnexported()
|
||||
public void com.alibaba.dubbo.config.ServiceConfig.setProvider(com.alibaba.dubbo.config.ProviderConfig)
|
||||
public java.util.List com.alibaba.dubbo.config.ServiceConfig.getExportedUrls()
|
||||
public void com.alibaba.dubbo.config.ServiceConfig.setProviders(java.util.List)
|
||||
public java.lang.Class com.alibaba.dubbo.config.ServiceConfig.getInterfaceClass()
|
||||
public void com.alibaba.dubbo.config.ServiceConfig.setInterfaceClass(java.lang.Class)
|
||||
public java.lang.String com.alibaba.dubbo.config.ServiceConfig.getInterface()
|
||||
public void com.alibaba.dubbo.config.ServiceConfig.setInterface(java.lang.String)
|
||||
public void com.alibaba.dubbo.config.ServiceConfig.setInterface(java.lang.Class)
|
||||
public void com.alibaba.dubbo.config.ServiceConfig.setMethods(java.util.List)
|
||||
public java.lang.String com.alibaba.dubbo.config.ServiceConfig.getUniqueServiceName()
|
||||
public java.lang.String com.alibaba.dubbo.config.ServiceConfig.getGroup()
|
||||
public void com.alibaba.dubbo.config.ServiceConfig.setMock(java.lang.Boolean)
|
||||
public void com.alibaba.dubbo.config.ServiceConfig.setMock(java.lang.String)
|
||||
public com.alibaba.dubbo.common.URL com.alibaba.dubbo.config.ServiceConfig.toUrl()
|
||||
public java.util.List com.alibaba.dubbo.config.ServiceConfig.toUrls()
|
||||
public synchronized void com.alibaba.dubbo.config.ServiceConfig.unexport()
|
||||
public java.util.List com.alibaba.dubbo.config.ServiceConfig.getMethods()
|
||||
public java.lang.String com.alibaba.dubbo.config.ServiceConfig.getPath()
|
||||
public java.lang.Object com.alibaba.dubbo.config.ServiceConfig.getRef()
|
||||
public synchronized void com.alibaba.dubbo.config.ServiceConfig.export()
|
||||
public java.util.List com.alibaba.dubbo.config.ServiceConfig.getProviders()
|
||||
public com.alibaba.dubbo.config.ProviderConfig com.alibaba.dubbo.config.ServiceConfig.getProvider()
|
||||
public java.lang.String com.alibaba.dubbo.config.ServiceConfig.getVersion()
|
||||
public void com.alibaba.dubbo.config.ServiceConfig.setPath(java.lang.String)
|
||||
public void com.alibaba.dubbo.config.ServiceConfig.setRef(java.lang.Object)
|
||||
public void com.alibaba.dubbo.config.ServiceConfig.setVersion(java.lang.String)
|
||||
public void com.alibaba.dubbo.config.ServiceConfig.setListener(java.lang.String)
|
||||
public void com.alibaba.dubbo.config.ServiceConfig.setProtocol(com.alibaba.dubbo.config.ProtocolConfig)
|
||||
public java.lang.Integer com.alibaba.dubbo.config.ServiceConfig.getExecutes()
|
||||
public void com.alibaba.dubbo.config.ServiceConfig.setExecutes(java.lang.Integer)
|
||||
public void com.alibaba.dubbo.config.ServiceConfig.setDeprecated(java.lang.Boolean)
|
||||
public java.lang.String com.alibaba.dubbo.config.ServiceConfig.getSerialization()
|
||||
public void com.alibaba.dubbo.config.ServiceConfig.setSerialization(java.lang.String)
|
||||
public java.lang.String com.alibaba.dubbo.config.ServiceConfig.getAccesslog()
|
||||
public void com.alibaba.dubbo.config.ServiceConfig.setAccesslog(java.lang.String)
|
||||
public void com.alibaba.dubbo.config.ServiceConfig.setAccesslog(java.lang.Boolean)
|
||||
public java.lang.Boolean com.alibaba.dubbo.config.ServiceConfig.isRegister()
|
||||
public void com.alibaba.dubbo.config.ServiceConfig.setRegister(java.lang.Boolean)
|
||||
public java.lang.Boolean com.alibaba.dubbo.config.ServiceConfig.getExport()
|
||||
public void com.alibaba.dubbo.config.ServiceConfig.setExport(java.lang.Boolean)
|
||||
public java.lang.Integer com.alibaba.dubbo.config.ServiceConfig.getWeight()
|
||||
public void com.alibaba.dubbo.config.ServiceConfig.setWeight(java.lang.Integer)
|
||||
public java.lang.String com.alibaba.dubbo.config.ServiceConfig.getDocument()
|
||||
public void com.alibaba.dubbo.config.ServiceConfig.setDocument(java.lang.String)
|
||||
public java.lang.Boolean com.alibaba.dubbo.config.ServiceConfig.isDeprecated()
|
||||
public void com.alibaba.dubbo.config.ServiceConfig.setDynamic(java.lang.Boolean)
|
||||
public java.util.List com.alibaba.dubbo.config.ServiceConfig.getProtocols()
|
||||
public void com.alibaba.dubbo.config.ServiceConfig.setProtocols(java.util.List)
|
||||
public java.lang.Integer com.alibaba.dubbo.config.ServiceConfig.getWarmup()
|
||||
public void com.alibaba.dubbo.config.ServiceConfig.setWarmup(java.lang.Integer)
|
||||
public void com.alibaba.dubbo.config.ServiceConfig.setGroup(java.lang.String)
|
||||
public void com.alibaba.dubbo.config.ServiceConfig.setDelay(java.lang.Integer)
|
||||
public java.lang.String com.alibaba.dubbo.config.ServiceConfig.getToken()
|
||||
public void com.alibaba.dubbo.config.ServiceConfig.setToken(java.lang.String)
|
||||
public void com.alibaba.dubbo.config.ServiceConfig.setToken(java.lang.Boolean)
|
||||
public java.lang.String com.alibaba.dubbo.config.ServiceConfig.getTag()
|
||||
public void com.alibaba.dubbo.config.ServiceConfig.setTag(java.lang.String)
|
||||
public com.alibaba.dubbo.config.ProtocolConfig com.alibaba.dubbo.config.ServiceConfig.getProtocol()
|
||||
public java.lang.String com.alibaba.dubbo.config.ServiceConfig.getFilter()
|
||||
public java.lang.String com.alibaba.dubbo.config.ServiceConfig.getListener()
|
||||
public java.lang.Boolean com.alibaba.dubbo.config.ServiceConfig.isDynamic()
|
||||
public java.lang.Integer com.alibaba.dubbo.config.ServiceConfig.getDelay()
|
||||
public com.alibaba.dubbo.config.RegistryConfig com.alibaba.dubbo.config.ServiceConfig.getRegistry()
|
||||
public void com.alibaba.dubbo.config.ServiceConfig.setRegistry(com.alibaba.dubbo.config.RegistryConfig)
|
||||
public java.util.List com.alibaba.dubbo.config.ServiceConfig.getRegistries()
|
||||
public void com.alibaba.dubbo.config.ServiceConfig.setRegistries(java.util.List)
|
||||
public com.alibaba.dubbo.config.MonitorConfig com.alibaba.dubbo.config.ServiceConfig.getMonitor()
|
||||
public void com.alibaba.dubbo.config.ServiceConfig.setMonitor(com.alibaba.dubbo.config.MonitorConfig)
|
||||
public void com.alibaba.dubbo.config.ServiceConfig.setMonitor(java.lang.String)
|
||||
public void com.alibaba.dubbo.config.ServiceConfig.setOnconnect(java.lang.String)
|
||||
public void com.alibaba.dubbo.config.ServiceConfig.setOndisconnect(java.lang.String)
|
||||
public java.lang.String com.alibaba.dubbo.config.ServiceConfig.getCluster()
|
||||
public void com.alibaba.dubbo.config.ServiceConfig.setCluster(java.lang.String)
|
||||
public java.lang.Integer com.alibaba.dubbo.config.ServiceConfig.getConnections()
|
||||
public void com.alibaba.dubbo.config.ServiceConfig.setConnections(java.lang.Integer)
|
||||
public com.alibaba.dubbo.config.ApplicationConfig com.alibaba.dubbo.config.ServiceConfig.getApplication()
|
||||
public void com.alibaba.dubbo.config.ServiceConfig.setApplication(com.alibaba.dubbo.config.ApplicationConfig)
|
||||
public com.alibaba.dubbo.config.ModuleConfig com.alibaba.dubbo.config.ServiceConfig.getModule()
|
||||
public void com.alibaba.dubbo.config.ServiceConfig.setModule(com.alibaba.dubbo.config.ModuleConfig)
|
||||
public java.lang.Integer com.alibaba.dubbo.config.ServiceConfig.getCallbacks()
|
||||
public void com.alibaba.dubbo.config.ServiceConfig.setCallbacks(java.lang.Integer)
|
||||
public java.lang.String com.alibaba.dubbo.config.ServiceConfig.getOnconnect()
|
||||
public java.lang.String com.alibaba.dubbo.config.ServiceConfig.getOndisconnect()
|
||||
public java.lang.String com.alibaba.dubbo.config.ServiceConfig.getLocal()
|
||||
public void com.alibaba.dubbo.config.ServiceConfig.setLocal(java.lang.String)
|
||||
public void com.alibaba.dubbo.config.ServiceConfig.setLocal(java.lang.Boolean)
|
||||
public void com.alibaba.dubbo.config.ServiceConfig.setStub(java.lang.Boolean)
|
||||
public void com.alibaba.dubbo.config.ServiceConfig.setStub(java.lang.String)
|
||||
public java.lang.String com.alibaba.dubbo.config.ServiceConfig.getProxy()
|
||||
public void com.alibaba.dubbo.config.ServiceConfig.setProxy(java.lang.String)
|
||||
public java.lang.String com.alibaba.dubbo.config.ServiceConfig.getLayer()
|
||||
public void com.alibaba.dubbo.config.ServiceConfig.setLayer(java.lang.String)
|
||||
public void com.alibaba.dubbo.config.ServiceConfig.setScope(java.lang.String)
|
||||
public void com.alibaba.dubbo.config.ServiceConfig.setFilter(java.lang.String)
|
||||
public java.lang.String com.alibaba.dubbo.config.ServiceConfig.getOwner()
|
||||
public java.lang.String com.alibaba.dubbo.config.ServiceConfig.getScope()
|
||||
public void com.alibaba.dubbo.config.ServiceConfig.setOwner(java.lang.String)
|
||||
public java.lang.String com.alibaba.dubbo.config.ServiceConfig.getStub()
|
||||
public void com.alibaba.dubbo.config.ServiceConfig.setTimeout(java.lang.Integer)
|
||||
public java.lang.Integer com.alibaba.dubbo.config.ServiceConfig.getRetries()
|
||||
public void com.alibaba.dubbo.config.ServiceConfig.setRetries(java.lang.Integer)
|
||||
public java.lang.String com.alibaba.dubbo.config.ServiceConfig.getLoadbalance()
|
||||
public void com.alibaba.dubbo.config.ServiceConfig.setLoadbalance(java.lang.String)
|
||||
public java.lang.Integer com.alibaba.dubbo.config.ServiceConfig.getActives()
|
||||
public void com.alibaba.dubbo.config.ServiceConfig.setActives(java.lang.Integer)
|
||||
public java.lang.String com.alibaba.dubbo.config.ServiceConfig.getMerger()
|
||||
public void com.alibaba.dubbo.config.ServiceConfig.setMerger(java.lang.String)
|
||||
public java.lang.String com.alibaba.dubbo.config.ServiceConfig.getValidation()
|
||||
public void com.alibaba.dubbo.config.ServiceConfig.setValidation(java.lang.String)
|
||||
public java.lang.Boolean com.alibaba.dubbo.config.ServiceConfig.isAsync()
|
||||
public void com.alibaba.dubbo.config.ServiceConfig.setForks(java.lang.Integer)
|
||||
public java.lang.Integer com.alibaba.dubbo.config.ServiceConfig.getForks()
|
||||
public void com.alibaba.dubbo.config.ServiceConfig.setAsync(java.lang.Boolean)
|
||||
public java.lang.Boolean com.alibaba.dubbo.config.ServiceConfig.getSent()
|
||||
public void com.alibaba.dubbo.config.ServiceConfig.setSent(java.lang.Boolean)
|
||||
public java.lang.String com.alibaba.dubbo.config.ServiceConfig.getMock()
|
||||
public void com.alibaba.dubbo.config.ServiceConfig.setCache(java.lang.String)
|
||||
public java.util.Map com.alibaba.dubbo.config.ServiceConfig.getParameters()
|
||||
public java.lang.String com.alibaba.dubbo.config.ServiceConfig.getCache()
|
||||
public void com.alibaba.dubbo.config.ServiceConfig.setParameters(java.util.Map)
|
||||
public java.lang.Integer com.alibaba.dubbo.config.ServiceConfig.getTimeout()
|
||||
public void com.alibaba.dubbo.config.ServiceConfig.setId(java.lang.String)
|
||||
public java.lang.String com.alibaba.dubbo.config.ServiceConfig.toString()
|
||||
public java.lang.String com.alibaba.dubbo.config.ServiceConfig.getId()
|
||||
public final void com.alibaba.dubbo.config.ServiceConfig.wait(long,int) throws java.lang.InterruptedException
|
||||
public final native void com.alibaba.dubbo.config.ServiceConfig.wait(long) throws java.lang.InterruptedException
|
||||
public final void com.alibaba.dubbo.config.ServiceConfig.wait() throws java.lang.InterruptedException
|
||||
public boolean com.alibaba.dubbo.config.ServiceConfig.equals(java.lang.Object)
|
||||
public native int com.alibaba.dubbo.config.ServiceConfig.hashCode()
|
||||
public final native java.lang.Class com.alibaba.dubbo.config.ServiceConfig.getClass()
|
||||
public final native void com.alibaba.dubbo.config.ServiceConfig.notify()
|
||||
public final native void com.alibaba.dubbo.config.ServiceConfig.notifyAll()
|
||||
|
|
@ -66,6 +66,12 @@
|
|||
<version>${project.parent.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.dubbo</groupId>
|
||||
<artifactId>dubbo-metrics-config-center</artifactId>
|
||||
<version>${project.parent.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.dubbo</groupId>
|
||||
<artifactId>dubbo-monitor-api</artifactId>
|
||||
|
|
|
|||
|
|
@ -22,9 +22,11 @@ import org.apache.dubbo.common.constants.LoggerCodeConstants;
|
|||
import org.apache.dubbo.common.logger.ErrorTypeAwareLogger;
|
||||
import org.apache.dubbo.common.logger.LoggerFactory;
|
||||
import org.apache.dubbo.common.utils.Assert;
|
||||
import org.apache.dubbo.rpc.GracefulShutdown;
|
||||
import org.apache.dubbo.rpc.model.ApplicationModel;
|
||||
import org.apache.dubbo.rpc.model.ModuleModel;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
|
||||
|
|
@ -80,6 +82,12 @@ public class DubboShutdownHook extends Thread {
|
|||
}
|
||||
|
||||
private void doDestroy() {
|
||||
// send readonly for shutdown hook
|
||||
List<GracefulShutdown> gracefulShutdowns = GracefulShutdown.getGracefulShutdowns(applicationModel.getFrameworkModel());
|
||||
for (GracefulShutdown gracefulShutdown : gracefulShutdowns) {
|
||||
gracefulShutdown.readonly();
|
||||
}
|
||||
|
||||
boolean hasModuleBindSpring = false;
|
||||
// check if any modules are bound to Spring
|
||||
for (ModuleModel module: applicationModel.getModuleModels()) {
|
||||
|
|
@ -92,11 +100,11 @@ public class DubboShutdownHook extends Thread {
|
|||
int timeout = ConfigurationUtils.getServerShutdownTimeout(applicationModel);
|
||||
if (timeout > 0) {
|
||||
long start = System.currentTimeMillis();
|
||||
/**
|
||||
* To avoid shutdown conflicts between Dubbo and Spring,
|
||||
* wait for the modules bound to Spring to be handled by Spring util timeout.
|
||||
/*
|
||||
To avoid shutdown conflicts between Dubbo and Spring,
|
||||
wait for the modules bound to Spring to be handled by Spring until timeout.
|
||||
*/
|
||||
logger.info("Waiting for modules managed by Spring to be shut down.");
|
||||
logger.info("Waiting for modules managed by Spring to be shutdown.");
|
||||
while (!applicationModel.isDestroyed() && hasModuleBindSpring
|
||||
&& (System.currentTimeMillis() - start) < timeout) {
|
||||
try {
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ package org.apache.dubbo.config;
|
|||
import org.apache.dubbo.common.URL;
|
||||
import org.apache.dubbo.common.URLBuilder;
|
||||
import org.apache.dubbo.common.Version;
|
||||
import org.apache.dubbo.common.config.ConfigurationUtils;
|
||||
import org.apache.dubbo.common.constants.CommonConstants;
|
||||
import org.apache.dubbo.common.extension.ExtensionLoader;
|
||||
import org.apache.dubbo.common.logger.ErrorTypeAwareLogger;
|
||||
|
|
@ -86,6 +87,7 @@ import static org.apache.dubbo.common.constants.LoggerCodeConstants.CONFIG_NO_ME
|
|||
import static org.apache.dubbo.common.constants.LoggerCodeConstants.CONFIG_SERVER_DISCONNECTED;
|
||||
import static org.apache.dubbo.common.constants.LoggerCodeConstants.CONFIG_UNEXPORT_ERROR;
|
||||
import static org.apache.dubbo.common.constants.LoggerCodeConstants.CONFIG_USE_RANDOM_PORT;
|
||||
import static org.apache.dubbo.common.constants.LoggerCodeConstants.INTERNAL_ERROR;
|
||||
import static org.apache.dubbo.common.constants.RegistryConstants.DYNAMIC_KEY;
|
||||
import static org.apache.dubbo.common.constants.RegistryConstants.SERVICE_REGISTRY_PROTOCOL;
|
||||
import static org.apache.dubbo.common.utils.NetUtils.getAvailablePort;
|
||||
|
|
@ -194,6 +196,14 @@ public class ServiceConfig<T> extends ServiceConfigBase<T> {
|
|||
return;
|
||||
}
|
||||
if (!exporters.isEmpty()) {
|
||||
for (Exporter<?> exporter : exporters) {
|
||||
try {
|
||||
exporter.unregister();
|
||||
} catch (Throwable t) {
|
||||
logger.warn(CONFIG_UNEXPORT_ERROR, "", "", "Unexpected error occurred when unexport " + exporter, t);
|
||||
}
|
||||
}
|
||||
waitForIdle();
|
||||
for (Exporter<?> exporter : exporters) {
|
||||
try {
|
||||
exporter.unexport();
|
||||
|
|
@ -209,6 +219,51 @@ public class ServiceConfig<T> extends ServiceConfigBase<T> {
|
|||
repository.unregisterProvider(providerModel);
|
||||
}
|
||||
|
||||
private void waitForIdle() {
|
||||
int timeout = ConfigurationUtils.getServerShutdownTimeout(getScopeModel());
|
||||
|
||||
long idleTime = System.currentTimeMillis() - providerModel.getLastInvokeTime();
|
||||
|
||||
// 1. if service has idle for 10s(shutdown time), un-export directly
|
||||
if (idleTime > timeout) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 2. if service has idle for more than 6.7s(2/3 of shutdown time), wait for the rest time, then un-export directly
|
||||
int tick = timeout / 3;
|
||||
if (timeout - idleTime < tick) {
|
||||
logger.info("Service " + getUniqueServiceName() + " has idle for " + idleTime + " ms, wait for " + (timeout - idleTime) + " ms to un-export");
|
||||
try {
|
||||
Thread.sleep(timeout - idleTime);
|
||||
} catch (InterruptedException e) {
|
||||
logger.warn(INTERNAL_ERROR, "unknown error in registry module", "", e.getMessage(), e);
|
||||
Thread.currentThread().interrupt();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// 3. Wait for 3.33s(1/3 of shutdown time), if service has idle for 3.33s(1/3 of shutdown time), un-export directly,
|
||||
// otherwise wait for the rest time until idle for 3.33s(1/3 of shutdown time). The max wait time is 10s(shutdown time).
|
||||
idleTime = 0;
|
||||
long startTime = System.currentTimeMillis();
|
||||
while (idleTime < tick) {
|
||||
// service idle time.
|
||||
idleTime = System.currentTimeMillis() - Math.max(providerModel.getLastInvokeTime(), startTime);
|
||||
if (idleTime >= tick || System.currentTimeMillis() - startTime > timeout) {
|
||||
return;
|
||||
}
|
||||
// idle rest time or timeout rest time
|
||||
long waitTime = Math.min(tick - idleTime, timeout + startTime - System.currentTimeMillis());
|
||||
logger.info("Service " + getUniqueServiceName() + " has idle for " + idleTime + " ms, wait for " + waitTime + " ms to un-export");
|
||||
try {
|
||||
Thread.sleep(waitTime);
|
||||
} catch (InterruptedException e) {
|
||||
logger.warn(INTERNAL_ERROR, "unknown error in registry module", "", e.getMessage(), e);
|
||||
Thread.currentThread().interrupt();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* for early init serviceMetadata
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ import org.apache.dubbo.common.URL;
|
|||
import org.apache.dubbo.common.config.ConfigurationUtils;
|
||||
import org.apache.dubbo.common.config.Environment;
|
||||
import org.apache.dubbo.common.config.ReferenceCache;
|
||||
import org.apache.dubbo.common.config.configcenter.ConfigChangeType;
|
||||
import org.apache.dubbo.common.config.configcenter.DynamicConfiguration;
|
||||
import org.apache.dubbo.common.config.configcenter.DynamicConfigurationFactory;
|
||||
import org.apache.dubbo.common.config.configcenter.wrapper.CompositeDynamicConfiguration;
|
||||
|
|
@ -50,17 +51,21 @@ import org.apache.dubbo.config.utils.CompositeReferenceCache;
|
|||
import org.apache.dubbo.config.utils.ConfigValidationUtils;
|
||||
import org.apache.dubbo.metadata.report.MetadataReportFactory;
|
||||
import org.apache.dubbo.metadata.report.MetadataReportInstance;
|
||||
import org.apache.dubbo.metrics.collector.ConfigCenterMetricsCollector;
|
||||
import org.apache.dubbo.metrics.collector.DefaultMetricsCollector;
|
||||
import org.apache.dubbo.metrics.config.event.ConfigCenterEvent;
|
||||
import org.apache.dubbo.metrics.event.MetricsEventBus;
|
||||
import org.apache.dubbo.metrics.registry.event.RegistryEvent;
|
||||
import org.apache.dubbo.metrics.report.MetricsReporter;
|
||||
import org.apache.dubbo.metrics.report.MetricsReporterFactory;
|
||||
import org.apache.dubbo.metrics.service.MetricsServiceExporter;
|
||||
import org.apache.dubbo.registry.Registry;
|
||||
import org.apache.dubbo.registry.RegistryFactory;
|
||||
import org.apache.dubbo.registry.client.metadata.ServiceInstanceMetadataUtils;
|
||||
import org.apache.dubbo.registry.support.RegistryManager;
|
||||
import org.apache.dubbo.rpc.model.ApplicationModel;
|
||||
import org.apache.dubbo.rpc.model.ModuleModel;
|
||||
import org.apache.dubbo.rpc.model.ModuleServiceRepository;
|
||||
import org.apache.dubbo.rpc.model.ProviderModel;
|
||||
import org.apache.dubbo.rpc.model.ScopeModel;
|
||||
import org.apache.dubbo.rpc.model.ScopeModelUtil;
|
||||
|
||||
|
|
@ -799,8 +804,6 @@ public class DefaultApplicationDeployer extends AbstractDeployer<ApplicationMode
|
|||
}
|
||||
}
|
||||
ApplicationModel applicationModel = getApplicationModel();
|
||||
ConfigCenterMetricsCollector collector =
|
||||
applicationModel.getBeanFactory().getOrRegisterBean(ConfigCenterMetricsCollector.class);
|
||||
|
||||
if (StringUtils.isNotEmpty(configCenter.getConfigFile())) {
|
||||
String configContent = dynamicConfiguration.getProperties(configCenter.getConfigFile(), configCenter.getGroup());
|
||||
|
|
@ -819,11 +822,11 @@ public class DefaultApplicationDeployer extends AbstractDeployer<ApplicationMode
|
|||
environment.updateAppExternalConfigMap(appConfigMap);
|
||||
|
||||
// Add metrics
|
||||
collector.increase4Initialized(configCenter.getConfigFile(), configCenter.getGroup(),
|
||||
configCenter.getProtocol(), applicationModel.getApplicationName(), configMap.size());
|
||||
MetricsEventBus.publish(ConfigCenterEvent.toChangeEvent(applicationModel, configCenter.getConfigFile(), configCenter.getGroup(),
|
||||
configCenter.getProtocol(), ConfigChangeType.ADDED.name(), configMap.size()));
|
||||
if (isNotEmpty(appGroup)) {
|
||||
collector.increase4Initialized(appConfigFile, appGroup,
|
||||
configCenter.getProtocol(), applicationModel.getApplicationName(), appConfigMap.size());
|
||||
MetricsEventBus.publish(ConfigCenterEvent.toChangeEvent(applicationModel, appConfigFile, appGroup,
|
||||
configCenter.getProtocol(), ConfigChangeType.ADDED.name(), appConfigMap.size()));
|
||||
}
|
||||
} catch (IOException e) {
|
||||
throw new IllegalStateException("Failed to parse configurations from Config Center.", e);
|
||||
|
|
@ -932,10 +935,12 @@ public class DefaultApplicationDeployer extends AbstractDeployer<ApplicationMode
|
|||
}
|
||||
onStopping();
|
||||
|
||||
unexportMetricsService();
|
||||
offline();
|
||||
|
||||
unregisterServiceInstance();
|
||||
|
||||
unexportMetricsService();
|
||||
|
||||
unRegisterShutdownHook();
|
||||
if (asyncMetadataFuture != null) {
|
||||
asyncMetadataFuture.cancel(true);
|
||||
|
|
@ -944,6 +949,33 @@ public class DefaultApplicationDeployer extends AbstractDeployer<ApplicationMode
|
|||
}
|
||||
}
|
||||
|
||||
private void offline() {
|
||||
try {
|
||||
for (ModuleModel moduleModel : applicationModel.getModuleModels()) {
|
||||
ModuleServiceRepository serviceRepository = moduleModel.getServiceRepository();
|
||||
List<ProviderModel> exportedServices = serviceRepository.getExportedServices();
|
||||
for (ProviderModel exportedService : exportedServices) {
|
||||
List<ProviderModel.RegisterStatedURL> statedUrls = exportedService.getStatedUrl();
|
||||
for (ProviderModel.RegisterStatedURL statedURL : statedUrls) {
|
||||
if (statedURL.isRegistered()) {
|
||||
doOffline(statedURL);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Throwable t) {
|
||||
logger.error(LoggerCodeConstants.INTERNAL_ERROR, "", "", "Exceptions occurred when unregister services.", t);
|
||||
}
|
||||
}
|
||||
|
||||
private void doOffline(ProviderModel.RegisterStatedURL statedURL) {
|
||||
RegistryFactory registryFactory =
|
||||
statedURL.getRegistryUrl().getOrDefaultApplicationModel().getExtensionLoader(RegistryFactory.class).getAdaptiveExtension();
|
||||
Registry registry = registryFactory.getRegistry(statedURL.getRegistryUrl());
|
||||
registry.unregister(statedURL.getProviderUrl());
|
||||
statedURL.setRegistered(false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postDestroy() {
|
||||
synchronized (destroyLock) {
|
||||
|
|
@ -1153,6 +1185,7 @@ public class DefaultApplicationDeployer extends AbstractDeployer<ApplicationMode
|
|||
collector.registryDefaultSample();
|
||||
}
|
||||
}
|
||||
|
||||
private void completeStartFuture(boolean success) {
|
||||
if (startFuture != null) {
|
||||
startFuture.complete(success);
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@
|
|||
package org.apache.dubbo.config.deploy;
|
||||
|
||||
import org.apache.dubbo.common.config.ReferenceCache;
|
||||
import org.apache.dubbo.common.constants.LoggerCodeConstants;
|
||||
import org.apache.dubbo.common.deploy.AbstractDeployer;
|
||||
import org.apache.dubbo.common.deploy.ApplicationDeployer;
|
||||
import org.apache.dubbo.common.deploy.DeployListener;
|
||||
|
|
@ -35,6 +36,8 @@ import org.apache.dubbo.config.ServiceConfig;
|
|||
import org.apache.dubbo.config.ServiceConfigBase;
|
||||
import org.apache.dubbo.config.context.ModuleConfigManager;
|
||||
import org.apache.dubbo.config.utils.SimpleReferenceCache;
|
||||
import org.apache.dubbo.registry.Registry;
|
||||
import org.apache.dubbo.registry.RegistryFactory;
|
||||
import org.apache.dubbo.rpc.model.ConsumerModel;
|
||||
import org.apache.dubbo.rpc.model.ModuleModel;
|
||||
import org.apache.dubbo.rpc.model.ModuleServiceRepository;
|
||||
|
|
@ -213,6 +216,33 @@ public class DefaultModuleDeployer extends AbstractDeployer<ModuleModel> impleme
|
|||
return;
|
||||
}
|
||||
onModuleStopping();
|
||||
|
||||
offline();
|
||||
}
|
||||
|
||||
private void offline() {
|
||||
try {
|
||||
ModuleServiceRepository serviceRepository = moduleModel.getServiceRepository();
|
||||
List<ProviderModel> exportedServices = serviceRepository.getExportedServices();
|
||||
for (ProviderModel exportedService : exportedServices) {
|
||||
List<ProviderModel.RegisterStatedURL> statedUrls = exportedService.getStatedUrl();
|
||||
for (ProviderModel.RegisterStatedURL statedURL : statedUrls) {
|
||||
if (statedURL.isRegistered()) {
|
||||
doOffline(statedURL);
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Throwable t) {
|
||||
logger.error(LoggerCodeConstants.INTERNAL_ERROR, "", "", "Exceptions occurred when unregister services.", t);
|
||||
}
|
||||
}
|
||||
|
||||
private void doOffline(ProviderModel.RegisterStatedURL statedURL) {
|
||||
RegistryFactory registryFactory =
|
||||
statedURL.getRegistryUrl().getOrDefaultApplicationModel().getExtensionLoader(RegistryFactory.class).getAdaptiveExtension();
|
||||
Registry registry = registryFactory.getRegistry(statedURL.getRegistryUrl());
|
||||
registry.unregister(statedURL.getProviderUrl());
|
||||
statedURL.setRegistered(false);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -436,7 +466,7 @@ public class DefaultModuleDeployer extends AbstractDeployer<ModuleModel> impleme
|
|||
exportFuture = CompletableFuture.allOf(asyncExportingFutures.toArray(new CompletableFuture[0]));
|
||||
exportFuture.get();
|
||||
} catch (Throwable e) {
|
||||
logger.warn(CONFIG_FAILED_EXPORT_SERVICE, "","",getIdentifier() + " export services occurred an exception: " + e.toString());
|
||||
logger.warn(CONFIG_FAILED_EXPORT_SERVICE, "", "", getIdentifier() + " export services occurred an exception: " + e.toString());
|
||||
} finally {
|
||||
logger.info(getIdentifier() + " export services finished.");
|
||||
asyncExportingFutures.clear();
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@
|
|||
<description>The spring config module of dubbo project</description>
|
||||
<properties>
|
||||
<skip_maven_deploy>false</skip_maven_deploy>
|
||||
<spring-boot.version>2.7.10</spring-boot.version>
|
||||
<spring-boot.version>2.7.11</spring-boot.version>
|
||||
<!-- Uncomment spring_version property to check Spring 4.x compatibility -->
|
||||
<!-- <spring_version>4.3.30.RELEASE</spring_version> -->
|
||||
</properties>
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ import static org.apache.dubbo.common.utils.StringUtils.join;
|
|||
|
||||
public class ReferenceBeanSupport {
|
||||
|
||||
private static List<String> IGNORED_ATTRS = Arrays.asList(ReferenceAttributes.ID, ReferenceAttributes.GROUP,
|
||||
private static final List<String> IGNORED_ATTRS = Arrays.asList(ReferenceAttributes.ID, ReferenceAttributes.GROUP,
|
||||
ReferenceAttributes.VERSION, ReferenceAttributes.INTERFACE, ReferenceAttributes.INTERFACE_NAME,
|
||||
ReferenceAttributes.INTERFACE_CLASS);
|
||||
|
||||
|
|
@ -66,7 +66,7 @@ public class ReferenceBeanSupport {
|
|||
if (interfaceName == null) {
|
||||
Object interfaceClassValue = attributes.get(ReferenceAttributes.INTERFACE_CLASS);
|
||||
if (interfaceClassValue instanceof Class) {
|
||||
interfaceName = ((Class) interfaceClassValue).getName();
|
||||
interfaceName = ((Class<?>) interfaceClassValue).getName();
|
||||
} else if (interfaceClassValue instanceof String) {
|
||||
if (interfaceClassValue.equals("void")) {
|
||||
attributes.remove(ReferenceAttributes.INTERFACE_CLASS);
|
||||
|
|
|
|||
|
|
@ -175,7 +175,10 @@ public class DubboBeanDefinitionParser implements BeanDefinitionParser {
|
|||
if ("registry".equals(property) && RegistryConfig.NO_AVAILABLE.equalsIgnoreCase(value)) {
|
||||
RegistryConfig registryConfig = new RegistryConfig();
|
||||
registryConfig.setAddress(RegistryConfig.NO_AVAILABLE);
|
||||
beanDefinition.getPropertyValues().addPropertyValue(beanProperty, registryConfig);
|
||||
// see AbstractInterfaceConfig#registries, It will be invoker setRegistries method when BeanDefinition is registered,
|
||||
beanDefinition.getPropertyValues().addPropertyValue("registries", registryConfig);
|
||||
// If registry is N/A, don't init it until the reference is invoked
|
||||
beanDefinition.setLazyInit(true);
|
||||
} else if ("provider".equals(property) || "registry".equals(property) || ("protocol".equals(property) && AbstractServiceConfig.class.isAssignableFrom(beanClass))) {
|
||||
/**
|
||||
* For 'provider' 'protocol' 'registry', keep literal value (should be id/name) and set the value to 'registryIds' 'providerIds' protocolIds'
|
||||
|
|
|
|||
|
|
@ -547,6 +547,12 @@
|
|||
<![CDATA[ Anonymous (any foreign ip) access level, the default is NONE, can not access any cmd. ]]></xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
<xsd:attribute name="qos-anonymous-allow-commands" type="xsd:string">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
<![CDATA[ Anonymous(any foreign ip) allow commands, default is empty, can not access any cmd. ]]></xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
</xsd:complexType>
|
||||
|
||||
<xsd:complexType name="moduleType">
|
||||
|
|
@ -1210,6 +1216,7 @@
|
|||
<xsd:complexType name="baggageType">
|
||||
<xsd:all>
|
||||
<xsd:element ref="remoteFields" minOccurs="0"/>
|
||||
<xsd:element ref="correlation" minOccurs="0"/>
|
||||
</xsd:all>
|
||||
<xsd:attribute name="enabled" type="xsd:boolean">
|
||||
<xsd:annotation>
|
||||
|
|
@ -1238,6 +1245,33 @@
|
|||
</xsd:simpleContent>
|
||||
</xsd:complexType>
|
||||
|
||||
<xsd:complexType name="tracingExporterType">
|
||||
<xsd:all>
|
||||
<xsd:element ref="zipkin-config" minOccurs="0"/>
|
||||
</xsd:all>
|
||||
</xsd:complexType>
|
||||
|
||||
<xsd:complexType name="zipkinConfigType">
|
||||
<xsd:attribute name="endpoint" type="xsd:string">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
<![CDATA[ The url of zipkin server. ]]></xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
<xsd:attribute name="connectTimeout" type="xsd:duration">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
<![CDATA[ Connection timeout for requests to Zipkin. ]]></xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
<xsd:attribute name="readTimeout" type="xsd:duration">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
<![CDATA[ Read timeout for requests to Zipkin. ]]></xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
</xsd:complexType>
|
||||
|
||||
<xsd:complexType name="methodType">
|
||||
<xsd:complexContent>
|
||||
<xsd:extension base="abstractMethodType">
|
||||
|
|
@ -2187,4 +2221,18 @@
|
|||
means that these fields would end up as key-value pairs in e.g. MDC. ]]></xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:element>
|
||||
|
||||
<xsd:element name="tracing-exporter" type="tracingExporterType">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
<![CDATA[ Exporter of tracing. ]]></xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:element>
|
||||
|
||||
<xsd:element name="zipkin-config" type="zipkinConfigType">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
<![CDATA[ Config of zipkin exporter. ]]></xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,42 @@
|
|||
/*
|
||||
* 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.config.spring;
|
||||
|
||||
import org.apache.dubbo.config.ApplicationConfig;
|
||||
import org.apache.dubbo.config.ProtocolConfig;
|
||||
import org.apache.dubbo.config.ServiceConfig;
|
||||
import org.apache.dubbo.config.spring.api.SpringControllerService;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
public class ControllerServiceConfigTest {
|
||||
|
||||
@Test
|
||||
void testServiceConfig() {
|
||||
|
||||
ServiceConfig<SpringControllerService> serviceServiceConfig = new ServiceConfig<>();
|
||||
ApplicationConfig applicationConfig = new ApplicationConfig();
|
||||
applicationConfig.setName("dubbo");
|
||||
serviceServiceConfig.setApplication(applicationConfig);
|
||||
serviceServiceConfig.setProtocol(new ProtocolConfig("rest",8080));
|
||||
serviceServiceConfig.setRef(new SpringControllerService());
|
||||
serviceServiceConfig.setInterface(SpringControllerService.class.getName());
|
||||
serviceServiceConfig.export();
|
||||
serviceServiceConfig.unexport();
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
/*
|
||||
* 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.config.spring.api;
|
||||
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
@RequestMapping("/controller")
|
||||
public class SpringControllerService {
|
||||
|
||||
@GetMapping("/sayHello")
|
||||
public String sayHello(String say) {
|
||||
return say;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
/*
|
||||
* 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.config.spring.reference.registryNA.consumer;
|
||||
|
||||
import org.apache.dubbo.config.spring.api.HelloService;
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.context.support.ClassPathXmlApplicationContext;
|
||||
|
||||
class DubboXmlConsumerTest {
|
||||
|
||||
|
||||
@Test
|
||||
void testConsumer() {
|
||||
ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("classpath:/org/apache/dubbo/config/spring/reference/registryNA/consumer/dubbo-registryNA-consumer.xml");
|
||||
context.start();
|
||||
HelloService helloService = context.getBean("helloService", HelloService.class);
|
||||
IllegalStateException exception = Assertions.assertThrows(IllegalStateException.class, () -> helloService.sayHello("dubbo"));
|
||||
Assertions.assertTrue(exception.getMessage().contains("No such any registry to reference org.apache.dubbo.config.spring.api.HelloService"));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
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.
|
||||
-->
|
||||
<beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:dubbo="http://dubbo.apache.org/schema/dubbo"
|
||||
xmlns="http://www.springframework.org/schema/beans"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.3.xsd
|
||||
http://dubbo.apache.org/schema/dubbo http://dubbo.apache.org/schema/dubbo/dubbo.xsd">
|
||||
|
||||
<dubbo:application name="demo-consumer">
|
||||
</dubbo:application>
|
||||
|
||||
<dubbo:metadata-report address="zookeeper://127.0.0.1:2181"/>
|
||||
|
||||
<dubbo:registry id="demo1" address="zookeeper://127.0.0.1:2181?registry-type=service"/>
|
||||
|
||||
<dubbo:reference id="helloService" check="false" interface="org.apache.dubbo.config.spring.api.HelloService" />
|
||||
|
||||
</beans>
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
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.
|
||||
-->
|
||||
<beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:dubbo="http://dubbo.apache.org/schema/dubbo"
|
||||
xmlns="http://www.springframework.org/schema/beans"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.3.xsd
|
||||
http://dubbo.apache.org/schema/dubbo http://dubbo.apache.org/schema/dubbo/dubbo.xsd">
|
||||
|
||||
<dubbo:application name="demo-consumer">
|
||||
</dubbo:application>
|
||||
|
||||
<dubbo:metadata-report address="zookeeper://127.0.0.1:2181"/>
|
||||
|
||||
<dubbo:registry id="demo1" address="zookeeper://127.0.0.1:2181?registry-type=service"/>
|
||||
|
||||
<dubbo:reference id="helloService" check="false" interface="org.apache.dubbo.config.spring.api.HelloService" registry="N/A" />
|
||||
|
||||
</beans>
|
||||
|
|
@ -0,0 +1,51 @@
|
|||
/*
|
||||
* 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.config.spring.reference.registryNA.provider;
|
||||
|
||||
import org.apache.dubbo.config.spring.api.HelloService;
|
||||
import org.apache.dubbo.rpc.RpcException;
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.context.support.ClassPathXmlApplicationContext;
|
||||
|
||||
/**
|
||||
* @author <a href = "mailto:kamtohung@gmail.com">KamTo Hung</a>
|
||||
*/
|
||||
public class DubboXmlProviderTest {
|
||||
|
||||
@Test
|
||||
void testProvider() {
|
||||
ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("classpath:/org/apache/dubbo/config/spring/reference/registryNA/provider/dubbo-provider.xml");
|
||||
context.start();
|
||||
Object bean = context.getBean("helloService");
|
||||
Assertions.assertNotNull(bean);
|
||||
}
|
||||
|
||||
@Test
|
||||
void testProvider2() {
|
||||
ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("classpath:/org/apache/dubbo/config/spring/reference/registryNA/provider/dubbo-provider.xml");
|
||||
context.start();
|
||||
Assertions.assertNotNull(context.getBean("helloService"));
|
||||
ClassPathXmlApplicationContext context2 = new ClassPathXmlApplicationContext("classpath:/org/apache/dubbo/config/spring/reference/registryNA/consumer/dubbo-consumer.xml");
|
||||
context2.start();
|
||||
HelloService helloService = context2.getBean("helloService", HelloService.class);
|
||||
Assertions.assertNotNull(helloService);
|
||||
RpcException exception = Assertions.assertThrows(RpcException.class, () -> helloService.sayHello("dubbo"));
|
||||
Assertions.assertTrue(exception.getMessage().contains("Failed to invoke the method sayHello in the service org.apache.dubbo.config.spring.api.HelloService. No provider available for the service org.apache.dubbo.config.spring.api.HelloService"));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
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.
|
||||
-->
|
||||
<beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:dubbo="http://dubbo.apache.org/schema/dubbo"
|
||||
xmlns="http://www.springframework.org/schema/beans"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.3.xsd
|
||||
http://dubbo.apache.org/schema/dubbo http://dubbo.apache.org/schema/dubbo/dubbo.xsd">
|
||||
|
||||
<dubbo:application name="demo-provider" >
|
||||
</dubbo:application>
|
||||
|
||||
<dubbo:config-center address="zookeeper://127.0.0.1:2181"/>
|
||||
<dubbo:metadata-report address="zookeeper://127.0.0.1:2181"/>
|
||||
<dubbo:registry id="registry1" address="zookeeper://127.0.0.1:2181?registry-type=service"/>
|
||||
|
||||
<dubbo:protocol name="dubbo" port="-1"/>
|
||||
<dubbo:protocol name="rest" port="-1"/>
|
||||
<dubbo:protocol name="tri" port="-1"/>
|
||||
|
||||
<bean id="helloService" class="org.apache.dubbo.config.spring.impl.HelloServiceImpl"/>
|
||||
|
||||
<dubbo:service delay="5000" interface="org.apache.dubbo.config.spring.api.HelloService" timeout="3000" ref="helloService" registry="N/A" protocol="dubbo"/>
|
||||
|
||||
</beans>
|
||||
|
|
@ -63,5 +63,10 @@
|
|||
<version>${apollo_mock_server_version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.dubbo</groupId>
|
||||
<artifactId>dubbo-metrics-config-center</artifactId>
|
||||
<version>${project.parent.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
|
|
|
|||
|
|
@ -16,15 +16,6 @@
|
|||
*/
|
||||
package org.apache.dubbo.configcenter.support.apollo;
|
||||
|
||||
import org.apache.dubbo.common.URL;
|
||||
import org.apache.dubbo.common.config.configcenter.ConfigChangeType;
|
||||
import org.apache.dubbo.common.config.configcenter.ConfigChangedEvent;
|
||||
import org.apache.dubbo.common.config.configcenter.ConfigurationListener;
|
||||
import org.apache.dubbo.common.config.configcenter.DynamicConfiguration;
|
||||
import org.apache.dubbo.common.logger.ErrorTypeAwareLogger;
|
||||
import org.apache.dubbo.common.logger.LoggerFactory;
|
||||
import org.apache.dubbo.common.utils.StringUtils;
|
||||
|
||||
import com.ctrip.framework.apollo.Config;
|
||||
import com.ctrip.framework.apollo.ConfigChangeListener;
|
||||
import com.ctrip.framework.apollo.ConfigFile;
|
||||
|
|
@ -33,7 +24,16 @@ import com.ctrip.framework.apollo.core.enums.ConfigFileFormat;
|
|||
import com.ctrip.framework.apollo.enums.ConfigSourceType;
|
||||
import com.ctrip.framework.apollo.enums.PropertyChangeType;
|
||||
import com.ctrip.framework.apollo.model.ConfigChange;
|
||||
import org.apache.dubbo.metrics.collector.ConfigCenterMetricsCollector;
|
||||
import org.apache.dubbo.common.URL;
|
||||
import org.apache.dubbo.common.config.configcenter.ConfigChangeType;
|
||||
import org.apache.dubbo.common.config.configcenter.ConfigChangedEvent;
|
||||
import org.apache.dubbo.common.config.configcenter.ConfigurationListener;
|
||||
import org.apache.dubbo.common.config.configcenter.DynamicConfiguration;
|
||||
import org.apache.dubbo.common.logger.ErrorTypeAwareLogger;
|
||||
import org.apache.dubbo.common.logger.LoggerFactory;
|
||||
import org.apache.dubbo.common.utils.StringUtils;
|
||||
import org.apache.dubbo.metrics.config.event.ConfigCenterEvent;
|
||||
import org.apache.dubbo.metrics.event.MetricsEventBus;
|
||||
import org.apache.dubbo.rpc.model.ApplicationModel;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
|
@ -52,6 +52,7 @@ import static org.apache.dubbo.common.constants.CommonConstants.CONFIG_NAMESPACE
|
|||
import static org.apache.dubbo.common.constants.LoggerCodeConstants.CONFIG_FAILED_CLOSE_CONNECT_APOLLO;
|
||||
import static org.apache.dubbo.common.constants.LoggerCodeConstants.CONFIG_FAILED_CONNECT_REGISTRY;
|
||||
import static org.apache.dubbo.common.constants.LoggerCodeConstants.CONFIG_NOT_EFFECT_EMPTY_RULE_APOLLO;
|
||||
import static org.apache.dubbo.metrics.MetricsConstants.SELF_INCREMENT_SIZE;
|
||||
|
||||
/**
|
||||
* Apollo implementation, https://github.com/ctripcorp/apollo
|
||||
|
|
@ -250,9 +251,8 @@ public class ApolloDynamicConfiguration implements DynamicConfiguration {
|
|||
ConfigChangedEvent event = new ConfigChangedEvent(key, change.getNamespace(), change.getNewValue(), getChangeType(change));
|
||||
listeners.forEach(listener -> listener.process(event));
|
||||
|
||||
ConfigCenterMetricsCollector collector =
|
||||
applicationModel.getBeanFactory().getBean(ConfigCenterMetricsCollector.class);
|
||||
collector.increaseUpdated("apollo", applicationModel.getApplicationName(), event);
|
||||
MetricsEventBus.publish(ConfigCenterEvent.toChangeEvent(applicationModel, event.getKey(), event.getGroup(),
|
||||
ConfigCenterEvent.APOLLO_PROTOCOL, ConfigChangeType.ADDED.name(), SELF_INCREMENT_SIZE));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -56,5 +56,10 @@
|
|||
<artifactId>dubbo-metrics-prometheus</artifactId>
|
||||
<version>${project.parent.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.dubbo</groupId>
|
||||
<artifactId>dubbo-metrics-config-center</artifactId>
|
||||
<version>${project.parent.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
|
|
|
|||
|
|
@ -17,14 +17,11 @@
|
|||
|
||||
package org.apache.dubbo.configcenter.support.nacos;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.Properties;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.ConcurrentMap;
|
||||
import java.util.concurrent.CopyOnWriteArraySet;
|
||||
import java.util.concurrent.Executor;
|
||||
|
||||
import com.alibaba.nacos.api.NacosFactory;
|
||||
import com.alibaba.nacos.api.PropertyKeyConst;
|
||||
import com.alibaba.nacos.api.config.ConfigService;
|
||||
import com.alibaba.nacos.api.config.listener.AbstractSharedListener;
|
||||
import com.alibaba.nacos.api.exception.NacosException;
|
||||
import org.apache.dubbo.common.URL;
|
||||
import org.apache.dubbo.common.config.configcenter.ConfigChangeType;
|
||||
import org.apache.dubbo.common.config.configcenter.ConfigChangedEvent;
|
||||
|
|
@ -37,15 +34,18 @@ import org.apache.dubbo.common.logger.LoggerFactory;
|
|||
import org.apache.dubbo.common.utils.ConcurrentHashMapUtils;
|
||||
import org.apache.dubbo.common.utils.MD5Utils;
|
||||
import org.apache.dubbo.common.utils.StringUtils;
|
||||
|
||||
import com.alibaba.nacos.api.NacosFactory;
|
||||
import com.alibaba.nacos.api.PropertyKeyConst;
|
||||
import com.alibaba.nacos.api.config.ConfigService;
|
||||
import com.alibaba.nacos.api.config.listener.AbstractSharedListener;
|
||||
import com.alibaba.nacos.api.exception.NacosException;
|
||||
import org.apache.dubbo.metrics.collector.ConfigCenterMetricsCollector;
|
||||
import org.apache.dubbo.metrics.config.event.ConfigCenterEvent;
|
||||
import org.apache.dubbo.metrics.event.MetricsEventBus;
|
||||
import org.apache.dubbo.rpc.model.ApplicationModel;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.Properties;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.ConcurrentMap;
|
||||
import java.util.concurrent.CopyOnWriteArraySet;
|
||||
import java.util.concurrent.Executor;
|
||||
|
||||
import static com.alibaba.nacos.api.PropertyKeyConst.PASSWORD;
|
||||
import static com.alibaba.nacos.api.PropertyKeyConst.SERVER_ADDR;
|
||||
import static com.alibaba.nacos.api.PropertyKeyConst.USERNAME;
|
||||
|
|
@ -55,6 +55,7 @@ import static org.apache.dubbo.common.constants.LoggerCodeConstants.INTERNAL_INT
|
|||
import static org.apache.dubbo.common.constants.RemotingConstants.BACKUP_KEY;
|
||||
import static org.apache.dubbo.common.utils.StringConstantFieldValuePredicate.of;
|
||||
import static org.apache.dubbo.common.utils.StringUtils.HYPHEN_CHAR;
|
||||
import static org.apache.dubbo.metrics.MetricsConstants.SELF_INCREMENT_SIZE;
|
||||
|
||||
/**
|
||||
* The nacos implementation of {@link DynamicConfiguration}
|
||||
|
|
@ -345,9 +346,8 @@ public class NacosDynamicConfiguration implements DynamicConfiguration {
|
|||
}
|
||||
listeners.forEach(listener -> listener.process(event));
|
||||
|
||||
ConfigCenterMetricsCollector collector =
|
||||
applicationModel.getBeanFactory().getOrRegisterBean(ConfigCenterMetricsCollector.class);
|
||||
collector.increaseUpdated("nacos", applicationModel.getApplicationName(), event);
|
||||
MetricsEventBus.publish(ConfigCenterEvent.toChangeEvent(applicationModel, event.getKey(), event.getGroup(),
|
||||
ConfigCenterEvent.NACOS_PROTOCOL, ConfigChangeType.ADDED.name(), SELF_INCREMENT_SIZE));
|
||||
}
|
||||
|
||||
void addListener(ConfigurationListener configurationListener) {
|
||||
|
|
|
|||
|
|
@ -75,6 +75,11 @@
|
|||
<artifactId>dubbo-metrics-prometheus</artifactId>
|
||||
<version>${project.parent.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.dubbo</groupId>
|
||||
<artifactId>dubbo-metrics-config-center</artifactId>
|
||||
<version>${project.parent.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<profiles>
|
||||
|
|
|
|||
|
|
@ -20,7 +20,8 @@ import org.apache.dubbo.common.config.configcenter.ConfigChangeType;
|
|||
import org.apache.dubbo.common.config.configcenter.ConfigChangedEvent;
|
||||
import org.apache.dubbo.common.config.configcenter.ConfigurationListener;
|
||||
import org.apache.dubbo.common.utils.CollectionUtils;
|
||||
import org.apache.dubbo.metrics.collector.ConfigCenterMetricsCollector;
|
||||
import org.apache.dubbo.metrics.config.event.ConfigCenterEvent;
|
||||
import org.apache.dubbo.metrics.event.MetricsEventBus;
|
||||
import org.apache.dubbo.remoting.zookeeper.DataListener;
|
||||
import org.apache.dubbo.remoting.zookeeper.EventType;
|
||||
import org.apache.dubbo.rpc.model.ApplicationModel;
|
||||
|
|
@ -28,6 +29,8 @@ import org.apache.dubbo.rpc.model.ApplicationModel;
|
|||
import java.util.Set;
|
||||
import java.util.concurrent.CopyOnWriteArraySet;
|
||||
|
||||
import static org.apache.dubbo.metrics.MetricsConstants.SELF_INCREMENT_SIZE;
|
||||
|
||||
/**
|
||||
* one path has multi configurationListeners
|
||||
*/
|
||||
|
|
@ -77,9 +80,8 @@ public class ZookeeperDataListener implements DataListener {
|
|||
listeners.forEach(listener -> listener.process(configChangeEvent));
|
||||
}
|
||||
|
||||
ConfigCenterMetricsCollector collector =
|
||||
applicationModel.getBeanFactory().getBean(ConfigCenterMetricsCollector.class);
|
||||
collector.increaseUpdated("zookeeper", applicationModel.getApplicationName(), configChangeEvent);
|
||||
MetricsEventBus.publish(ConfigCenterEvent.toChangeEvent(applicationModel, configChangeEvent.getKey(), configChangeEvent.getGroup(),
|
||||
ConfigCenterEvent.ZK_PROTOCOL, ConfigChangeType.ADDED.name(), SELF_INCREMENT_SIZE));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@
|
|||
|
||||
<properties>
|
||||
<skip_maven_deploy>true</skip_maven_deploy>
|
||||
<spring-boot-maven-plugin.version>2.7.10</spring-boot-maven-plugin.version>
|
||||
<spring-boot-maven-plugin.version>2.7.11</spring-boot-maven-plugin.version>
|
||||
</properties>
|
||||
|
||||
<modules>
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@
|
|||
|
||||
<properties>
|
||||
<skip_maven_deploy>true</skip_maven_deploy>
|
||||
<spring-boot-maven-plugin.version>2.7.10</spring-boot-maven-plugin.version>
|
||||
<spring-boot-maven-plugin.version>2.7.11</spring-boot-maven-plugin.version>
|
||||
</properties>
|
||||
|
||||
<artifactId>dubbo-demo-api</artifactId>
|
||||
|
|
|
|||
|
|
@ -36,18 +36,17 @@
|
|||
<artifactId>dubbo-rpc-rest</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Spring Web MVC -->
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-web</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- Spring Web MVC -->
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-context</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-web</artifactId>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
</project>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,34 @@
|
|||
/*
|
||||
* 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.demo.rest.api;
|
||||
|
||||
|
||||
|
||||
import javax.ws.rs.Consumes;
|
||||
import javax.ws.rs.GET;
|
||||
import javax.ws.rs.Path;
|
||||
|
||||
@Path("/curl")
|
||||
public interface CurlService {
|
||||
// curl -X GET http://localhost:8888/services/curl
|
||||
// http://localhost:8888/services/curl
|
||||
@GET
|
||||
@Consumes({javax.ws.rs.core.MediaType.TEXT_PLAIN})
|
||||
String curl();
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
/*
|
||||
* 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.demo.rest.api;
|
||||
|
||||
|
||||
|
||||
import javax.ws.rs.Consumes;
|
||||
import javax.ws.rs.GET;
|
||||
import javax.ws.rs.Path;
|
||||
|
||||
@Path("/annotation")
|
||||
public interface DubboServiceAnnotationService {
|
||||
@GET
|
||||
@Consumes({javax.ws.rs.core.MediaType.TEXT_PLAIN})
|
||||
String annotation();
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
/*
|
||||
* 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.demo.rest.api;
|
||||
|
||||
|
||||
|
||||
import javax.ws.rs.POST;
|
||||
import javax.ws.rs.Path;
|
||||
|
||||
@Path("/exception/mapper")
|
||||
public interface ExceptionMapperService {
|
||||
|
||||
@POST
|
||||
@Path("/exception")
|
||||
String exception(String message);
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,71 @@
|
|||
/*
|
||||
* 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.demo.rest.api;
|
||||
|
||||
|
||||
import io.swagger.jaxrs.PATCH;
|
||||
|
||||
import javax.ws.rs.Consumes;
|
||||
import javax.ws.rs.DELETE;
|
||||
import javax.ws.rs.GET;
|
||||
import javax.ws.rs.HEAD;
|
||||
import javax.ws.rs.OPTIONS;
|
||||
import javax.ws.rs.POST;
|
||||
import javax.ws.rs.PUT;
|
||||
import javax.ws.rs.Path;
|
||||
import javax.ws.rs.QueryParam;
|
||||
|
||||
@Path("/demoService")
|
||||
public interface HttpMethodService {
|
||||
|
||||
@POST
|
||||
@Path("/sayPost")
|
||||
@Consumes({javax.ws.rs.core.MediaType.TEXT_PLAIN})
|
||||
String sayHelloPost(String hello);
|
||||
|
||||
@DELETE
|
||||
@Path("/sayDelete")
|
||||
@Consumes({javax.ws.rs.core.MediaType.TEXT_PLAIN})
|
||||
String sayHelloDelete(@QueryParam("name") String hello);
|
||||
|
||||
@HEAD
|
||||
@Path("/sayHead")
|
||||
@Consumes({javax.ws.rs.core.MediaType.TEXT_PLAIN})
|
||||
String sayHelloHead(@QueryParam("name") String hello);
|
||||
|
||||
@GET
|
||||
@Path("/sayGet")
|
||||
@Consumes({javax.ws.rs.core.MediaType.TEXT_PLAIN})
|
||||
String sayHelloGet(@QueryParam("name") String hello);
|
||||
|
||||
@PUT
|
||||
@Path("/sayPut")
|
||||
@Consumes({javax.ws.rs.core.MediaType.TEXT_PLAIN})
|
||||
String sayHelloPut(@QueryParam("name") String hello);
|
||||
|
||||
@PATCH
|
||||
@Path("/sayPatch")
|
||||
@Consumes({javax.ws.rs.core.MediaType.TEXT_PLAIN})
|
||||
String sayHelloPatch(@QueryParam("name") String hello);
|
||||
|
||||
@OPTIONS
|
||||
@Path("/sayOptions")
|
||||
@Consumes({javax.ws.rs.core.MediaType.TEXT_PLAIN})
|
||||
String sayHelloOptions(@QueryParam("name") String hello);
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,47 @@
|
|||
/*
|
||||
* 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.demo.rest.api;
|
||||
|
||||
|
||||
import javax.ws.rs.Consumes;
|
||||
import javax.ws.rs.HeaderParam;
|
||||
import javax.ws.rs.POST;
|
||||
import javax.ws.rs.Path;
|
||||
import javax.ws.rs.QueryParam;
|
||||
import java.util.List;
|
||||
|
||||
@Path("/demoService")
|
||||
public interface HttpRequestAndResponseRPCContextService {
|
||||
|
||||
@POST
|
||||
@Path("/httpRequestParam")
|
||||
@Consumes({javax.ws.rs.core.MediaType.TEXT_PLAIN})
|
||||
String httpRequestParam(@QueryParam("name") String hello);
|
||||
|
||||
@POST
|
||||
@Path("/httpRequestHeader")
|
||||
@Consumes({javax.ws.rs.core.MediaType.TEXT_PLAIN})
|
||||
String httpRequestHeader(@HeaderParam("header") String hello);
|
||||
|
||||
@POST
|
||||
@Path("/httpResponseHeader")
|
||||
@Consumes({javax.ws.rs.core.MediaType.TEXT_PLAIN})
|
||||
List<String> httpResponseHeader(@HeaderParam("response") String hello);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,120 @@
|
|||
/*
|
||||
* 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.demo.rest.api;
|
||||
|
||||
|
||||
import po.User;
|
||||
|
||||
import javax.ws.rs.Consumes;
|
||||
import javax.ws.rs.FormParam;
|
||||
import javax.ws.rs.GET;
|
||||
import javax.ws.rs.HeaderParam;
|
||||
import javax.ws.rs.POST;
|
||||
import javax.ws.rs.Path;
|
||||
import javax.ws.rs.Produces;
|
||||
import javax.ws.rs.QueryParam;
|
||||
import javax.ws.rs.core.MediaType;
|
||||
import javax.ws.rs.core.MultivaluedMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
*
|
||||
* @Consumers & @Produces can be not used ,we will make sure the content-type of request by arg type
|
||||
* but the Request method is forbidden disappear
|
||||
* parameters which annotation are not present , it is from the body (jaxrs anntation is diffrent from spring web from param(only request param can ignore anntation))
|
||||
*
|
||||
* Every method only one param from body
|
||||
*
|
||||
* the path annotation must present in class & method
|
||||
*/
|
||||
|
||||
@Path("/jaxrs/demo/service")
|
||||
public interface JaxRsRestDemoService {
|
||||
@GET
|
||||
@Path("/hello")
|
||||
Integer hello(@QueryParam("a") Integer a, @QueryParam("b") Integer b);
|
||||
|
||||
@GET
|
||||
@Path("/error")
|
||||
String error();
|
||||
|
||||
@POST
|
||||
@Path("/say")
|
||||
String sayHello(String name);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@POST
|
||||
@Path("/testFormBody")
|
||||
Long testFormBody(@FormParam("number") Long number);
|
||||
|
||||
@POST
|
||||
@Path("/testJavaBeanBody")
|
||||
@Consumes({MediaType.APPLICATION_JSON})
|
||||
User testJavaBeanBody(User user);
|
||||
|
||||
|
||||
|
||||
@GET
|
||||
@Path("/primitive")
|
||||
int primitiveInt(@QueryParam("a") int a, @QueryParam("b") int b);
|
||||
|
||||
@GET
|
||||
@Path("/primitiveLong")
|
||||
long primitiveLong(@QueryParam("a") long a, @QueryParam("b") Long b);
|
||||
|
||||
@GET
|
||||
@Path("/primitiveByte")
|
||||
long primitiveByte(@QueryParam("a") byte a, @QueryParam("b") Long b);
|
||||
|
||||
@POST
|
||||
@Path("/primitiveShort")
|
||||
long primitiveShort(@QueryParam("a") short a, @QueryParam("b") Long b, int c);
|
||||
|
||||
@GET
|
||||
@Path("testMapParam")
|
||||
@Produces({MediaType.TEXT_PLAIN})
|
||||
@Consumes({MediaType.TEXT_PLAIN})
|
||||
String testMapParam(@QueryParam("test") Map<String, String> params);
|
||||
|
||||
@GET
|
||||
@Path("testMapHeader")
|
||||
@Produces({MediaType.TEXT_PLAIN})
|
||||
@Consumes({MediaType.TEXT_PLAIN})
|
||||
String testMapHeader(@HeaderParam("test") Map<String, String> headers);
|
||||
|
||||
@POST
|
||||
@Path("testMapForm")
|
||||
@Produces({MediaType.APPLICATION_JSON})
|
||||
@Consumes({MediaType.APPLICATION_FORM_URLENCODED})
|
||||
List<String> testMapForm(MultivaluedMap<String, String> params);
|
||||
|
||||
@POST
|
||||
@Path("/header")
|
||||
@Consumes({MediaType.TEXT_PLAIN})
|
||||
String header(@HeaderParam("header") String header);
|
||||
|
||||
@POST
|
||||
@Path("/headerInt")
|
||||
@Consumes({MediaType.TEXT_PLAIN})
|
||||
int headerInt(@HeaderParam("header") int header);
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,79 @@
|
|||
/*
|
||||
* 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.demo.rest.api;
|
||||
|
||||
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.util.MultiValueMap;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestHeader;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import po.User;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@RequestMapping("/spring/demo/service")
|
||||
public interface SpringRestDemoService {
|
||||
|
||||
@RequestMapping(method = RequestMethod.GET, value = "/hello")
|
||||
Integer hello(@RequestParam("a") Integer a, @RequestParam("b") Integer b);
|
||||
|
||||
@RequestMapping(method = RequestMethod.GET, value = "/error")
|
||||
String error();
|
||||
|
||||
@RequestMapping(method = RequestMethod.POST, value = "/say")
|
||||
String sayHello(@RequestBody String name);
|
||||
|
||||
@RequestMapping(method = RequestMethod.POST, value = "/testFormBody", consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE)
|
||||
Long testFormBody(@RequestBody Long number);
|
||||
|
||||
@RequestMapping(method = RequestMethod.POST, value = "/testJavaBeanBody", consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE)
|
||||
User testJavaBeanBody(@RequestBody User user);
|
||||
|
||||
|
||||
@RequestMapping(method = RequestMethod.GET, value = "/primitive")
|
||||
int primitiveInt(@RequestParam("a") int a, @RequestParam("b") int b);
|
||||
|
||||
@RequestMapping(method = RequestMethod.GET, value = "/primitiveLong")
|
||||
long primitiveLong(@RequestParam("a") long a, @RequestParam("b") Long b);
|
||||
|
||||
@RequestMapping(method = RequestMethod.GET, value = "/primitiveByte")
|
||||
long primitiveByte(@RequestParam("a") byte a, @RequestParam("b") Long b);
|
||||
|
||||
|
||||
@RequestMapping(method = RequestMethod.POST, value = "/primitiveShort")
|
||||
long primitiveShort(@RequestParam("a") short a, @RequestParam("b") Long b, @RequestBody int c);
|
||||
|
||||
|
||||
@RequestMapping(method = RequestMethod.GET, value = "/testMapParam")
|
||||
String testMapParam(@RequestParam Map<String, String> params);
|
||||
|
||||
@RequestMapping(method = RequestMethod.GET, value = "/testMapHeader")
|
||||
String testMapHeader(@RequestHeader Map<String, String> headers);
|
||||
|
||||
@RequestMapping(method = RequestMethod.POST, value = "/testMapForm", consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE)
|
||||
List<String> testMapForm(MultiValueMap<String, String> params);
|
||||
|
||||
|
||||
@RequestMapping(method = RequestMethod.GET, value = "/headerInt")
|
||||
int headerInt(@RequestHeader("header") int header);
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,78 @@
|
|||
/*
|
||||
* 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 po;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Objects;
|
||||
|
||||
|
||||
public class User implements Serializable {
|
||||
|
||||
|
||||
private Long id;
|
||||
|
||||
private String name;
|
||||
|
||||
public User() {
|
||||
}
|
||||
|
||||
public User(Long id, String name) {
|
||||
this.id = id;
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public static User getInstance() {
|
||||
return new User(1l, "dubbo-rest");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
User user = (User) o;
|
||||
return Objects.equals(id, user.id) && Objects.equals(name, user.name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(id, name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "User (" +
|
||||
"id=" + id +
|
||||
", name='" + name + '\'' +
|
||||
')';
|
||||
}
|
||||
}
|
||||
|
|
@ -133,7 +133,7 @@
|
|||
<plugin>
|
||||
<groupId>org.graalvm.buildtools</groupId>
|
||||
<artifactId>native-maven-plugin</artifactId>
|
||||
<version>0.9.20</version>
|
||||
<version>0.9.21</version>
|
||||
<configuration>
|
||||
<classesDirectory>${project.build.outputDirectory}</classesDirectory>
|
||||
<metadataRepository>
|
||||
|
|
|
|||
|
|
@ -130,7 +130,7 @@
|
|||
<plugin>
|
||||
<groupId>org.graalvm.buildtools</groupId>
|
||||
<artifactId>native-maven-plugin</artifactId>
|
||||
<version>0.9.20</version>
|
||||
<version>0.9.21</version>
|
||||
<configuration>
|
||||
<classesDirectory>${project.build.outputDirectory}</classesDirectory>
|
||||
<metadataRepository>
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@
|
|||
<maven.compiler.source>8</maven.compiler.source>
|
||||
<maven.compiler.target>8</maven.compiler.target>
|
||||
<slf4j-log4j12.version>1.7.33</slf4j-log4j12.version>
|
||||
<spring-boot.version>2.7.10</spring-boot.version>
|
||||
<spring-boot.version>2.7.11</spring-boot.version>
|
||||
<skip_maven_deploy>true</skip_maven_deploy>
|
||||
</properties>
|
||||
|
||||
|
|
@ -125,7 +125,7 @@
|
|||
|
||||
<dependency>
|
||||
<groupId>org.apache.dubbo</groupId>
|
||||
<artifactId>dubbo-spring-boot-observability-starter</artifactId>
|
||||
<artifactId>dubbo-spring-boot-tracing-otel-zipkin-starter</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@
|
|||
<maven.compiler.source>8</maven.compiler.source>
|
||||
<maven.compiler.target>8</maven.compiler.target>
|
||||
<slf4j-log4j12.version>1.7.33</slf4j-log4j12.version>
|
||||
<spring-boot.version>2.7.10</spring-boot.version>
|
||||
<spring-boot.version>2.7.11</spring-boot.version>
|
||||
<skip_maven_deploy>true</skip_maven_deploy>
|
||||
</properties>
|
||||
|
||||
|
|
@ -120,7 +120,7 @@
|
|||
<!-- Observability -->
|
||||
<dependency>
|
||||
<groupId>org.apache.dubbo</groupId>
|
||||
<artifactId>dubbo-spring-boot-observability-starter</artifactId>
|
||||
<artifactId>dubbo-spring-boot-tracing-otel-zipkin-starter</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
|
|
|
|||
|
|
@ -36,8 +36,8 @@
|
|||
<maven.compiler.source>8</maven.compiler.source>
|
||||
<maven.compiler.target>8</maven.compiler.target>
|
||||
<skip_maven_deploy>true</skip_maven_deploy>
|
||||
<spring-boot.version>2.7.10</spring-boot.version>
|
||||
<spring-boot-maven-plugin.version>2.7.10</spring-boot-maven-plugin.version>
|
||||
<spring-boot.version>2.7.11</spring-boot.version>
|
||||
<spring-boot-maven-plugin.version>2.7.11</spring-boot-maven-plugin.version>
|
||||
<micrometer-core.version>1.10.6</micrometer-core.version>
|
||||
</properties>
|
||||
<dependencyManagement>
|
||||
|
|
|
|||
|
|
@ -34,7 +34,6 @@
|
|||
<skip_maven_deploy>true</skip_maven_deploy>
|
||||
<source.level>1.8</source.level>
|
||||
<target.level>1.8</target.level>
|
||||
<protobuf-java.version>3.22.2</protobuf-java.version>
|
||||
<maven-compiler-plugin.version>3.11.0</maven-compiler-plugin.version>
|
||||
</properties>
|
||||
|
||||
|
|
@ -115,7 +114,6 @@
|
|||
<dependency>
|
||||
<groupId>com.google.protobuf</groupId>
|
||||
<artifactId>protobuf-java</artifactId>
|
||||
<version>${protobuf-java.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
|
|
@ -124,7 +122,7 @@
|
|||
<plugin>
|
||||
<groupId>kr.motd.maven</groupId>
|
||||
<artifactId>os-maven-plugin</artifactId>
|
||||
<version>1.7.1</version>
|
||||
<version>${maven_os_plugin_version}</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>initialize</phase>
|
||||
|
|
@ -137,9 +135,9 @@
|
|||
<plugin>
|
||||
<groupId>org.xolstice.maven.plugins</groupId>
|
||||
<artifactId>protobuf-maven-plugin</artifactId>
|
||||
<version>0.6.1</version>
|
||||
<version>${maven_protobuf_plugin_version}</version>
|
||||
<configuration>
|
||||
<protocArtifact>com.google.protobuf:protoc:${protobuf-java.version}:exe:${os.detected.classifier}</protocArtifact>
|
||||
<protocArtifact>com.google.protobuf:protoc:${protobuf-java_version}:exe:${os.detected.classifier}</protocArtifact>
|
||||
<pluginId>triple-java</pluginId>
|
||||
<outputDirectory>build/generated/source/proto/main/java</outputDirectory>
|
||||
</configuration>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,153 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
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.
|
||||
-->
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>org.apache.dubbo</groupId>
|
||||
<artifactId>dubbo-demo-xml</artifactId>
|
||||
<version>${revision}</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
<artifactId>dubbo-demo-jaxrs-rest-consumer</artifactId>
|
||||
|
||||
<packaging>jar</packaging>
|
||||
<description>Dubbo JAXRS Rest Consumer Demo</description>
|
||||
<name>${project.artifactId}</name>
|
||||
|
||||
<properties>
|
||||
<skip_maven_deploy>true</skip_maven_deploy>
|
||||
<slf4j-log4j12.version>1.7.33</slf4j-log4j12.version>
|
||||
</properties>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-context</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-web</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.dubbo</groupId>
|
||||
<artifactId>dubbo-registry-multicast</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.dubbo</groupId>
|
||||
<artifactId>dubbo-registry-zookeeper</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.dubbo</groupId>
|
||||
<artifactId>dubbo-registry-nacos</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba.nacos</groupId>
|
||||
<artifactId>nacos-client</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.dubbo</groupId>
|
||||
<artifactId>dubbo-configcenter-zookeeper</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.dubbo</groupId>
|
||||
<artifactId>dubbo-configcenter-nacos</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.dubbo</groupId>
|
||||
<artifactId>dubbo-metadata-report-zookeeper</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.dubbo</groupId>
|
||||
<artifactId>dubbo-metadata-report-nacos</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.dubbo</groupId>
|
||||
<artifactId>dubbo-rpc-dubbo</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.dubbo</groupId>
|
||||
<artifactId>dubbo-rpc-rest</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.dubbo</groupId>
|
||||
<artifactId>dubbo-config-spring</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.dubbo</groupId>
|
||||
<artifactId>dubbo-remoting-netty4</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.dubbo</groupId>
|
||||
<artifactId>dubbo-serialization-hessian2</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.dubbo</groupId>
|
||||
<artifactId>dubbo-serialization-fastjson2</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.dubbo</groupId>
|
||||
<artifactId>dubbo-serialization-jdk</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-api</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-log4j12</artifactId>
|
||||
<version>${slf4j-log4j12.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>log4j</groupId>
|
||||
<artifactId>log4j</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-test</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.dubbo</groupId>
|
||||
<artifactId>dubbo-demo-interface</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<profiles>
|
||||
<!-- For jdk 11 above JavaEE annotation -->
|
||||
<profile>
|
||||
<id>javax.annotation</id>
|
||||
<activation>
|
||||
<jdk>[1.11,)</jdk>
|
||||
</activation>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>javax.annotation</groupId>
|
||||
<artifactId>javax.annotation-api</artifactId>
|
||||
<version>1.3.2</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</profile>
|
||||
</profiles>
|
||||
|
||||
</project>
|
||||
|
|
@ -0,0 +1,114 @@
|
|||
/*
|
||||
* 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.demo.rest.api;
|
||||
|
||||
import org.apache.dubbo.demo.rest.api.annotation.DubboServiceAnnotationServiceConsumer;
|
||||
import org.jboss.resteasy.specimpl.MultivaluedMapImpl;
|
||||
import org.springframework.context.support.ClassPathXmlApplicationContext;
|
||||
import po.User;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
public class RestConsumer {
|
||||
|
||||
public static void main(String[] args) {
|
||||
consumerService();
|
||||
}
|
||||
|
||||
public static void consumerService() {
|
||||
ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(new String[]{"spring/rest-consumer.xml"});
|
||||
context.start();
|
||||
System.out.println("rest consumer start");
|
||||
testExceptionMapperService(context);
|
||||
testHttpMethodService(context);
|
||||
httpRPCContextTest(context);
|
||||
jaxRsRestDemoServiceTest(context);
|
||||
annotationTest(context);
|
||||
System.out.println("rest consumer test success");
|
||||
}
|
||||
|
||||
private static void annotationTest(ClassPathXmlApplicationContext context) {
|
||||
DubboServiceAnnotationServiceConsumer bean = context.getBean(DubboServiceAnnotationServiceConsumer.class);
|
||||
bean.invokeAnnotationService();
|
||||
}
|
||||
|
||||
private static void jaxRsRestDemoServiceTest(ClassPathXmlApplicationContext context) {
|
||||
JaxRsRestDemoService jaxRsRestDemoService = context.getBean("jaxRsRestDemoService", JaxRsRestDemoService.class);
|
||||
String hello = jaxRsRestDemoService.sayHello("hello");
|
||||
assertEquals("Hello, hello", hello);
|
||||
Integer result = jaxRsRestDemoService.primitiveInt(1, 2);
|
||||
Long resultLong = jaxRsRestDemoService.primitiveLong(1, 2l);
|
||||
long resultByte = jaxRsRestDemoService.primitiveByte((byte) 1, 2l);
|
||||
long resultShort = jaxRsRestDemoService.primitiveShort((short) 1, 2l, 1);
|
||||
|
||||
assertEquals(result, 3);
|
||||
assertEquals(resultShort, 3l);
|
||||
assertEquals(resultLong, 3l);
|
||||
assertEquals(resultByte, 3l);
|
||||
|
||||
assertEquals(Long.valueOf(1l), jaxRsRestDemoService.testFormBody(1l));
|
||||
|
||||
MultivaluedMapImpl<String, String> forms = new MultivaluedMapImpl<>();
|
||||
forms.put("form", Arrays.asList("F1"));
|
||||
|
||||
assertEquals(Arrays.asList("F1"), jaxRsRestDemoService.testMapForm(forms));
|
||||
assertEquals(User.getInstance(), jaxRsRestDemoService.testJavaBeanBody(User.getInstance()));
|
||||
}
|
||||
|
||||
|
||||
private static void testExceptionMapperService(ClassPathXmlApplicationContext context) {
|
||||
String returnStr = "exception";
|
||||
String paramStr = "exception";
|
||||
ExceptionMapperService exceptionMapperService = context.getBean("exceptionMapperService", ExceptionMapperService.class);
|
||||
assertEquals(returnStr, exceptionMapperService.exception(paramStr));
|
||||
}
|
||||
|
||||
private static void httpRPCContextTest(ClassPathXmlApplicationContext context) {
|
||||
|
||||
HttpRequestAndResponseRPCContextService requestAndResponseRPCContextService = context.getBean("httpRequestAndResponseRPCContextService", HttpRequestAndResponseRPCContextService.class);
|
||||
String returnStr = "hello";
|
||||
String paramStr = "hello";
|
||||
assertEquals(returnStr, requestAndResponseRPCContextService.httpRequestHeader(paramStr));
|
||||
assertEquals(returnStr, requestAndResponseRPCContextService.httpRequestParam(paramStr));
|
||||
assertEquals(returnStr, requestAndResponseRPCContextService.httpResponseHeader(paramStr).get(0));
|
||||
}
|
||||
|
||||
|
||||
private static void testHttpMethodService(ClassPathXmlApplicationContext context) {
|
||||
HttpMethodService httpMethodService = context.getBean("httpMethodService", HttpMethodService.class);
|
||||
String returnStr = "hello";
|
||||
String paramStr = "hello";
|
||||
// assertEquals(null, httpMethodService.sayHelloHead(paramStr));
|
||||
assertEquals(returnStr, httpMethodService.sayHelloGet(paramStr));
|
||||
assertEquals(returnStr, httpMethodService.sayHelloDelete(paramStr));
|
||||
assertEquals(returnStr, httpMethodService.sayHelloPut(paramStr));
|
||||
assertEquals(returnStr, httpMethodService.sayHelloOptions(paramStr));
|
||||
// Assert.assertEquals(returnStr, httpMethodService.sayHelloPatch(paramStr));
|
||||
assertEquals(returnStr, httpMethodService.sayHelloPost(paramStr));
|
||||
}
|
||||
|
||||
private static void assertEquals(Object returnStr, Object exception) {
|
||||
boolean equal = returnStr != null && returnStr.equals(exception);
|
||||
|
||||
if (equal) {
|
||||
return;
|
||||
} else {
|
||||
throw new RuntimeException();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -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.demo.rest.api.annotation;
|
||||
|
||||
import org.apache.dubbo.config.annotation.DubboReference;
|
||||
import org.apache.dubbo.demo.rest.api.DubboServiceAnnotationService;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
public class DubboServiceAnnotationServiceConsumer {
|
||||
|
||||
@DubboReference(interfaceClass = DubboServiceAnnotationService.class)
|
||||
DubboServiceAnnotationService dubboServiceAnnotationService;
|
||||
|
||||
public void invokeAnnotationService() {
|
||||
String annotation = dubboServiceAnnotationService.annotation();
|
||||
System.out.println(annotation);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
/*
|
||||
* 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.demo.rest.api.config;
|
||||
|
||||
import org.apache.dubbo.config.spring.context.annotation.DubboComponentScan;
|
||||
|
||||
@DubboComponentScan("org.apache.dubbo.demo.rest")
|
||||
public class DubboConfig {
|
||||
}
|
||||
|
|
@ -0,0 +1,48 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
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.
|
||||
-->
|
||||
|
||||
<beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:dubbo="http://dubbo.apache.org/schema/dubbo"
|
||||
xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:context="http://www.springframework.org/schema/context"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.3.xsd
|
||||
http://dubbo.apache.org/schema/dubbo http://dubbo.apache.org/schema/dubbo/dubbo.xsd http://www.springframework.org/schema/context
|
||||
http://www.springframework.org/schema/context/spring-context.xsd">
|
||||
|
||||
<context:component-scan base-package="org.apache.dubbo.demo.rest"/>
|
||||
|
||||
<dubbo:application name="rest-consumer" owner="programmer" organization="dubbo"/>
|
||||
|
||||
<bean name="dubboConfig" class="org.apache.dubbo.demo.rest.api.config.DubboConfig"></bean>
|
||||
|
||||
<dubbo:registry address="zookeeper://${zookeeper.address:127.0.0.1}:2181"/>
|
||||
|
||||
<dubbo:reference id="jaxRsRestDemoService"
|
||||
interface="org.apache.dubbo.demo.rest.api.JaxRsRestDemoService" protocol="rest"/>
|
||||
|
||||
<dubbo:reference id="httpMethodService"
|
||||
interface="org.apache.dubbo.demo.rest.api.HttpMethodService" protocol="rest"/>
|
||||
|
||||
<dubbo:reference id="httpRequestAndResponseRPCContextService"
|
||||
interface="org.apache.dubbo.demo.rest.api.HttpRequestAndResponseRPCContextService" protocol="rest"/>
|
||||
|
||||
<dubbo:reference id="exceptionMapperService"
|
||||
interface="org.apache.dubbo.demo.rest.api.ExceptionMapperService" protocol="rest"/>
|
||||
|
||||
|
||||
</beans>
|
||||
|
|
@ -0,0 +1,153 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
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.
|
||||
-->
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>org.apache.dubbo</groupId>
|
||||
<artifactId>dubbo-demo-xml</artifactId>
|
||||
<version>${revision}</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
<artifactId>dubbo-demo-jaxrs-rest-provider</artifactId>
|
||||
|
||||
<packaging>jar</packaging>
|
||||
<description>Dubbo JAXRS Rest Provider Demo</description>
|
||||
<name>${project.artifactId}</name>
|
||||
|
||||
<properties>
|
||||
<skip_maven_deploy>true</skip_maven_deploy>
|
||||
<slf4j-log4j12.version>1.7.33</slf4j-log4j12.version>
|
||||
</properties>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-context</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-web</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.dubbo</groupId>
|
||||
<artifactId>dubbo-registry-multicast</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.dubbo</groupId>
|
||||
<artifactId>dubbo-registry-zookeeper</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.dubbo</groupId>
|
||||
<artifactId>dubbo-registry-nacos</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba.nacos</groupId>
|
||||
<artifactId>nacos-client</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.dubbo</groupId>
|
||||
<artifactId>dubbo-configcenter-zookeeper</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.dubbo</groupId>
|
||||
<artifactId>dubbo-configcenter-nacos</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.dubbo</groupId>
|
||||
<artifactId>dubbo-metadata-report-zookeeper</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.dubbo</groupId>
|
||||
<artifactId>dubbo-metadata-report-nacos</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.dubbo</groupId>
|
||||
<artifactId>dubbo-rpc-dubbo</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.dubbo</groupId>
|
||||
<artifactId>dubbo-rpc-rest</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.dubbo</groupId>
|
||||
<artifactId>dubbo-config-spring</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.dubbo</groupId>
|
||||
<artifactId>dubbo-remoting-netty4</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.dubbo</groupId>
|
||||
<artifactId>dubbo-serialization-hessian2</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.dubbo</groupId>
|
||||
<artifactId>dubbo-serialization-fastjson2</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.dubbo</groupId>
|
||||
<artifactId>dubbo-serialization-jdk</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-api</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-log4j12</artifactId>
|
||||
<version>${slf4j-log4j12.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>log4j</groupId>
|
||||
<artifactId>log4j</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-test</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.dubbo</groupId>
|
||||
<artifactId>dubbo-demo-interface</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<profiles>
|
||||
<!-- For jdk 11 above JavaEE annotation -->
|
||||
<profile>
|
||||
<id>javax.annotation</id>
|
||||
<activation>
|
||||
<jdk>[1.11,)</jdk>
|
||||
</activation>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>javax.annotation</groupId>
|
||||
<artifactId>javax.annotation-api</artifactId>
|
||||
<version>1.3.2</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</profile>
|
||||
</profiles>
|
||||
|
||||
</project>
|
||||
|
|
@ -0,0 +1,43 @@
|
|||
/*
|
||||
* 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.demo.rest.api;
|
||||
|
||||
import org.springframework.context.support.ClassPathXmlApplicationContext;
|
||||
|
||||
|
||||
public class RestProvider {
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(new String[]{"spring/rest-provider.xml"});
|
||||
|
||||
context.refresh();
|
||||
|
||||
// SpringControllerService springControllerService = context.getBean(SpringControllerService.class);
|
||||
// ServiceConfig<SpringControllerService> serviceConfig = new ServiceConfig<>();
|
||||
// serviceConfig.setInterface(SpringControllerService.class);
|
||||
// serviceConfig.setProtocol(new ProtocolConfig("rest", 8888));
|
||||
// serviceConfig.setRef(springControllerService);
|
||||
// serviceConfig.export();
|
||||
|
||||
|
||||
System.out.println("dubbo service started");
|
||||
|
||||
System.in.read();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue