提交 510daffd 编写于 作者: I Ian Luo

#1067: I18N effort for dubbo code base - dubbo-rpc (part3)

上级 7ba9c2f0
/* /*
* Copyright 1999-2011 Alibaba Group. * Licensed to the Apache Software Foundation (ASF) under one or more
* * contributor license agreements. See the NOTICE file distributed with
* Licensed under the Apache License, Version 2.0 (the "License"); * this work for additional information regarding copyright ownership.
* you may not use this file except in compliance with the License. * The ASF licenses this file to You under the Apache License, Version 2.0
* You may obtain a copy of the License at * (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 * http://www.apache.org/licenses/LICENSE-2.0
* *
...@@ -24,8 +25,6 @@ import com.alibaba.dubbo.rpc.RpcException; ...@@ -24,8 +25,6 @@ import com.alibaba.dubbo.rpc.RpcException;
/** /**
* DeprecatedProtocolFilter * DeprecatedProtocolFilter
*
* @author william.liangf
*/ */
@Activate(Constants.DEPRECATED_KEY) @Activate(Constants.DEPRECATED_KEY)
public class DeprecatedInvokerListener extends InvokerListenerAdapter { public class DeprecatedInvokerListener extends InvokerListenerAdapter {
......
/* /*
* Copyright 1999-2011 Alibaba Group. * Licensed to the Apache Software Foundation (ASF) under one or more
* * contributor license agreements. See the NOTICE file distributed with
* Licensed under the Apache License, Version 2.0 (the "License"); * this work for additional information regarding copyright ownership.
* you may not use this file except in compliance with the License. * The ASF licenses this file to You under the Apache License, Version 2.0
* You may obtain a copy of the License at * (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 * http://www.apache.org/licenses/LICENSE-2.0
* *
...@@ -21,8 +22,6 @@ import com.alibaba.dubbo.rpc.RpcException; ...@@ -21,8 +22,6 @@ import com.alibaba.dubbo.rpc.RpcException;
/** /**
* ExporterListenerAdapter * ExporterListenerAdapter
*
* @author william.liangf
*/ */
public abstract class ExporterListenerAdapter implements ExporterListener { public abstract class ExporterListenerAdapter implements ExporterListener {
......
/* /*
* Copyright 1999-2011 Alibaba Group. * Licensed to the Apache Software Foundation (ASF) under one or more
* * contributor license agreements. See the NOTICE file distributed with
* Licensed under the Apache License, Version 2.0 (the "License"); * this work for additional information regarding copyright ownership.
* you may not use this file except in compliance with the License. * The ASF licenses this file to You under the Apache License, Version 2.0
* You may obtain a copy of the License at * (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 * http://www.apache.org/licenses/LICENSE-2.0
* *
...@@ -21,8 +22,6 @@ import com.alibaba.dubbo.rpc.RpcException; ...@@ -21,8 +22,6 @@ import com.alibaba.dubbo.rpc.RpcException;
/** /**
* InvokerListenerAdapter * InvokerListenerAdapter
*
* @author william.liangf
*/ */
public abstract class InvokerListenerAdapter implements InvokerListener { public abstract class InvokerListenerAdapter implements InvokerListener {
......
/* /*
* Copyright 1999-2011 Alibaba Group. * Licensed to the Apache Software Foundation (ASF) under one or more
* * contributor license agreements. See the NOTICE file distributed with
* Licensed under the Apache License, Version 2.0 (the "License"); * this work for additional information regarding copyright ownership.
* you may not use this file except in compliance with the License. * The ASF licenses this file to You under the Apache License, Version 2.0
* You may obtain a copy of the License at * (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 * http://www.apache.org/licenses/LICENSE-2.0
* *
...@@ -25,8 +26,6 @@ import java.util.List; ...@@ -25,8 +26,6 @@ import java.util.List;
/** /**
* ListenerExporter * ListenerExporter
*
* @author william.liangf
*/ */
public class ListenerExporterWrapper<T> implements Exporter<T> { public class ListenerExporterWrapper<T> implements Exporter<T> {
......
/* /*
* Copyright 1999-2011 Alibaba Group. * Licensed to the Apache Software Foundation (ASF) under one or more
* * contributor license agreements. See the NOTICE file distributed with
* Licensed under the Apache License, Version 2.0 (the "License"); * this work for additional information regarding copyright ownership.
* you may not use this file except in compliance with the License. * The ASF licenses this file to You under the Apache License, Version 2.0
* You may obtain a copy of the License at * (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 * http://www.apache.org/licenses/LICENSE-2.0
* *
...@@ -28,8 +29,6 @@ import java.util.List; ...@@ -28,8 +29,6 @@ import java.util.List;
/** /**
* ListenerInvoker * ListenerInvoker
*
* @author william.liangf
*/ */
public class ListenerInvokerWrapper<T> implements Invoker<T> { public class ListenerInvokerWrapper<T> implements Invoker<T> {
......
/* /*
* Copyright 1999-2011 Alibaba Group. * Licensed to the Apache Software Foundation (ASF) under one or more
* * contributor license agreements. See the NOTICE file distributed with
* Licensed under the Apache License, Version 2.0 (the "License"); * this work for additional information regarding copyright ownership.
* you may not use this file except in compliance with the License. * The ASF licenses this file to You under the Apache License, Version 2.0
* You may obtain a copy of the License at * (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 * http://www.apache.org/licenses/LICENSE-2.0
* *
...@@ -22,9 +23,6 @@ import com.alibaba.dubbo.rpc.Invoker; ...@@ -22,9 +23,6 @@ import com.alibaba.dubbo.rpc.Invoker;
/** /**
* AbstractExporter. * AbstractExporter.
*
* @author qianlei
* @author william.liangf
*/ */
public abstract class AbstractExporter<T> implements Exporter<T> { public abstract class AbstractExporter<T> implements Exporter<T> {
......
/* /*
* Copyright 1999-2011 Alibaba Group. * Licensed to the Apache Software Foundation (ASF) under one or more
* * contributor license agreements. See the NOTICE file distributed with
* Licensed under the Apache License, Version 2.0 (the "License"); * this work for additional information regarding copyright ownership.
* you may not use this file except in compliance with the License. * The ASF licenses this file to You under the Apache License, Version 2.0
* You may obtain a copy of the License at * (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 * http://www.apache.org/licenses/LICENSE-2.0
* *
...@@ -38,9 +39,6 @@ import java.util.concurrent.atomic.AtomicBoolean; ...@@ -38,9 +39,6 @@ import java.util.concurrent.atomic.AtomicBoolean;
/** /**
* AbstractInvoker. * AbstractInvoker.
*
* @author qian.lei
* @author william.liangf
*/ */
public abstract class AbstractInvoker<T> implements Invoker<T> { public abstract class AbstractInvoker<T> implements Invoker<T> {
......
/* /*
* Copyright 1999-2011 Alibaba Group. * Licensed to the Apache Software Foundation (ASF) under one or more
* * contributor license agreements. See the NOTICE file distributed with
* Licensed under the Apache License, Version 2.0 (the "License"); * this work for additional information regarding copyright ownership.
* you may not use this file except in compliance with the License. * The ASF licenses this file to You under the Apache License, Version 2.0
* You may obtain a copy of the License at * (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 * http://www.apache.org/licenses/LICENSE-2.0
* *
...@@ -33,9 +34,6 @@ import java.util.concurrent.ConcurrentHashMap; ...@@ -33,9 +34,6 @@ import java.util.concurrent.ConcurrentHashMap;
/** /**
* abstract ProtocolSupport. * abstract ProtocolSupport.
*
* @author qian.lei
* @author william.liangf
*/ */
public abstract class AbstractProtocol implements Protocol { public abstract class AbstractProtocol implements Protocol {
......
/* /*
* Copyright 1999-2012 Alibaba Group. * Licensed to the Apache Software Foundation (ASF) under one or more
* * contributor license agreements. See the NOTICE file distributed with
* Licensed under the Apache License, Version 2.0 (the "License"); * this work for additional information regarding copyright ownership.
* you may not use this file except in compliance with the License. * The ASF licenses this file to You under the Apache License, Version 2.0
* You may obtain a copy of the License at * (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 * http://www.apache.org/licenses/LICENSE-2.0
* *
...@@ -31,8 +32,6 @@ import java.util.concurrent.CopyOnWriteArrayList; ...@@ -31,8 +32,6 @@ import java.util.concurrent.CopyOnWriteArrayList;
/** /**
* AbstractProxyProtocol * AbstractProxyProtocol
*
* @author william.liangf
*/ */
public abstract class AbstractProxyProtocol extends AbstractProtocol { public abstract class AbstractProxyProtocol extends AbstractProtocol {
......
/* /*
* Copyright 1999-2011 Alibaba Group. * Licensed to the Apache Software Foundation (ASF) under one or more
* * contributor license agreements. See the NOTICE file distributed with
* Licensed under the Apache License, Version 2.0 (the "License"); * this work for additional information regarding copyright ownership.
* you may not use this file except in compliance with the License. * The ASF licenses this file to You under the Apache License, Version 2.0
* You may obtain a copy of the License at * (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 * http://www.apache.org/licenses/LICENSE-2.0
* *
...@@ -23,8 +24,6 @@ import com.alibaba.dubbo.rpc.RpcException; ...@@ -23,8 +24,6 @@ import com.alibaba.dubbo.rpc.RpcException;
/** /**
* InvokerWrapper * InvokerWrapper
*
* @author william.liangf
*/ */
public class InvokerWrapper<T> implements Invoker<T> { public class InvokerWrapper<T> implements Invoker<T> {
......
/* /*
* Copyright 1999-2011 Alibaba Group. * Licensed to the Apache Software Foundation (ASF) under one or more
* * contributor license agreements. See the NOTICE file distributed with
* Licensed under the Apache License, Version 2.0 (the "License"); * this work for additional information regarding copyright ownership.
* you may not use this file except in compliance with the License. * The ASF licenses this file to You under the Apache License, Version 2.0
* You may obtain a copy of the License at * (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 * http://www.apache.org/licenses/LICENSE-2.0
* *
...@@ -30,8 +31,6 @@ import java.util.List; ...@@ -30,8 +31,6 @@ import java.util.List;
/** /**
* ListenerProtocol * ListenerProtocol
*
* @author william.liangf
*/ */
public class ProtocolFilterWrapper implements Protocol { public class ProtocolFilterWrapper implements Protocol {
......
/* /*
* Copyright 1999-2011 Alibaba Group. * Licensed to the Apache Software Foundation (ASF) under one or more
* * contributor license agreements. See the NOTICE file distributed with
* Licensed under the Apache License, Version 2.0 (the "License"); * this work for additional information regarding copyright ownership.
* you may not use this file except in compliance with the License. * The ASF licenses this file to You under the Apache License, Version 2.0
* You may obtain a copy of the License at * (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 * http://www.apache.org/licenses/LICENSE-2.0
* *
...@@ -32,8 +33,6 @@ import java.util.Collections; ...@@ -32,8 +33,6 @@ import java.util.Collections;
/** /**
* ListenerProtocol * ListenerProtocol
*
* @author william.liangf
*/ */
public class ProtocolListenerWrapper implements Protocol { public class ProtocolListenerWrapper implements Protocol {
static { static {
......
/* /*
* Copyright 1999-2011 Alibaba Group. * Licensed to the Apache Software Foundation (ASF) under one or more
* * contributor license agreements. See the NOTICE file distributed with
* Licensed under the Apache License, Version 2.0 (the "License"); * this work for additional information regarding copyright ownership.
* you may not use this file except in compliance with the License. * The ASF licenses this file to You under the Apache License, Version 2.0
* You may obtain a copy of the License at * (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 * http://www.apache.org/licenses/LICENSE-2.0
* *
...@@ -24,8 +25,6 @@ import com.alibaba.dubbo.rpc.service.EchoService; ...@@ -24,8 +25,6 @@ import com.alibaba.dubbo.rpc.service.EchoService;
/** /**
* AbstractProxyFactory * AbstractProxyFactory
*
* @author william.liangf
*/ */
public abstract class AbstractProxyFactory implements ProxyFactory { public abstract class AbstractProxyFactory implements ProxyFactory {
......
/* /*
* Copyright 1999-2011 Alibaba Group. * Licensed to the Apache Software Foundation (ASF) under one or more
* * contributor license agreements. See the NOTICE file distributed with
* Licensed under the Apache License, Version 2.0 (the "License"); * this work for additional information regarding copyright ownership.
* you may not use this file except in compliance with the License. * The ASF licenses this file to You under the Apache License, Version 2.0
* You may obtain a copy of the License at * (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 * http://www.apache.org/licenses/LICENSE-2.0
* *
...@@ -26,8 +27,6 @@ import java.lang.reflect.InvocationTargetException; ...@@ -26,8 +27,6 @@ import java.lang.reflect.InvocationTargetException;
/** /**
* InvokerWrapper * InvokerWrapper
*
* @author william.liangf
*/ */
public abstract class AbstractProxyInvoker<T> implements Invoker<T> { public abstract class AbstractProxyInvoker<T> implements Invoker<T> {
......
/* /*
* Copyright 1999-2011 Alibaba Group. * Licensed to the Apache Software Foundation (ASF) under one or more
* * contributor license agreements. See the NOTICE file distributed with
* Licensed under the Apache License, Version 2.0 (the "License"); * this work for additional information regarding copyright ownership.
* you may not use this file except in compliance with the License. * The ASF licenses this file to You under the Apache License, Version 2.0
* You may obtain a copy of the License at * (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 * http://www.apache.org/licenses/LICENSE-2.0
* *
...@@ -23,8 +24,6 @@ import java.lang.reflect.Method; ...@@ -23,8 +24,6 @@ import java.lang.reflect.Method;
/** /**
* InvokerHandler * InvokerHandler
*
* @author william.liangf
*/ */
public class InvokerInvocationHandler implements InvocationHandler { public class InvokerInvocationHandler implements InvocationHandler {
......
/* /*
* Copyright 1999-2011 Alibaba Group. * Licensed to the Apache Software Foundation (ASF) under one or more
* * contributor license agreements. See the NOTICE file distributed with
* Licensed under the Apache License, Version 2.0 (the "License"); * this work for additional information regarding copyright ownership.
* you may not use this file except in compliance with the License. * The ASF licenses this file to You under the Apache License, Version 2.0
* You may obtain a copy of the License at * (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 * http://www.apache.org/licenses/LICENSE-2.0
* *
...@@ -25,8 +26,6 @@ import com.alibaba.dubbo.rpc.proxy.InvokerInvocationHandler; ...@@ -25,8 +26,6 @@ import com.alibaba.dubbo.rpc.proxy.InvokerInvocationHandler;
/** /**
* JavaassistRpcProxyFactory * JavaassistRpcProxyFactory
*
* @author william.liangf
*/ */
public class JavassistProxyFactory extends AbstractProxyFactory { public class JavassistProxyFactory extends AbstractProxyFactory {
...@@ -36,7 +35,7 @@ public class JavassistProxyFactory extends AbstractProxyFactory { ...@@ -36,7 +35,7 @@ public class JavassistProxyFactory extends AbstractProxyFactory {
} }
public <T> Invoker<T> getInvoker(T proxy, Class<T> type, URL url) { public <T> Invoker<T> getInvoker(T proxy, Class<T> type, URL url) {
// TODO Wrapper类不能正确处理带$的类名 // TODO Wrapper cannot handle this scenario correctly: the classname contains '$'
final Wrapper wrapper = Wrapper.getWrapper(proxy.getClass().getName().indexOf('$') < 0 ? proxy.getClass() : type); final Wrapper wrapper = Wrapper.getWrapper(proxy.getClass().getName().indexOf('$') < 0 ? proxy.getClass() : type);
return new AbstractProxyInvoker<T>(proxy, type, url) { return new AbstractProxyInvoker<T>(proxy, type, url) {
@Override @Override
......
/* /*
* Copyright 1999-2011 Alibaba Group. * Licensed to the Apache Software Foundation (ASF) under one or more
* * contributor license agreements. See the NOTICE file distributed with
* Licensed under the Apache License, Version 2.0 (the "License"); * this work for additional information regarding copyright ownership.
* you may not use this file except in compliance with the License. * The ASF licenses this file to You under the Apache License, Version 2.0
* You may obtain a copy of the License at * (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 * http://www.apache.org/licenses/LICENSE-2.0
* *
...@@ -26,8 +27,6 @@ import java.lang.reflect.Proxy; ...@@ -26,8 +27,6 @@ import java.lang.reflect.Proxy;
/** /**
* JavaassistRpcProxyFactory * JavaassistRpcProxyFactory
*
* @author william.liangf
*/ */
public class JdkProxyFactory extends AbstractProxyFactory { public class JdkProxyFactory extends AbstractProxyFactory {
......
/* /*
* Copyright 1999-2011 Alibaba Group. * Licensed to the Apache Software Foundation (ASF) under one or more
* * contributor license agreements. See the NOTICE file distributed with
* Licensed under the Apache License, Version 2.0 (the "License"); * this work for additional information regarding copyright ownership.
* you may not use this file except in compliance with the License. * The ASF licenses this file to You under the Apache License, Version 2.0
* You may obtain a copy of the License at * (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 * http://www.apache.org/licenses/LICENSE-2.0
* *
...@@ -36,8 +37,6 @@ import java.lang.reflect.Constructor; ...@@ -36,8 +37,6 @@ import java.lang.reflect.Constructor;
/** /**
* StubProxyFactoryWrapper * StubProxyFactoryWrapper
*
* @author william.liangf
*/ */
public class StubProxyFactoryWrapper implements ProxyFactory { public class StubProxyFactoryWrapper implements ProxyFactory {
......
/* /*
* Copyright 1999-2011 Alibaba Group. * Licensed to the Apache Software Foundation (ASF) under one or more
* * contributor license agreements. See the NOTICE file distributed with
* Licensed under the Apache License, Version 2.0 (the "License"); * this work for additional information regarding copyright ownership.
* you may not use this file except in compliance with the License. * The ASF licenses this file to You under the Apache License, Version 2.0
* You may obtain a copy of the License at * (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 * http://www.apache.org/licenses/LICENSE-2.0
* *
...@@ -17,8 +18,6 @@ package com.alibaba.dubbo.rpc.service; ...@@ -17,8 +18,6 @@ package com.alibaba.dubbo.rpc.service;
/** /**
* Echo service. * Echo service.
*
* @author qian.lei
* @export * @export
*/ */
public interface EchoService { public interface EchoService {
......
/* /*
* Copyright 1999-2011 Alibaba Group. * Licensed to the Apache Software Foundation (ASF) under one or more
* * contributor license agreements. See the NOTICE file distributed with
* Licensed under the Apache License, Version 2.0 (the "License"); * this work for additional information regarding copyright ownership.
* you may not use this file except in compliance with the License. * The ASF licenses this file to You under the Apache License, Version 2.0
* You may obtain a copy of the License at * (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 * http://www.apache.org/licenses/LICENSE-2.0
* *
...@@ -20,8 +21,6 @@ import com.alibaba.dubbo.common.utils.StringUtils; ...@@ -20,8 +21,6 @@ import com.alibaba.dubbo.common.utils.StringUtils;
/** /**
* GenericException * GenericException
* *
* @author william.liangf
* @serial Don't change the class name and properties.
* @export * @export
*/ */
public class GenericException extends RuntimeException { public class GenericException extends RuntimeException {
......
/* /*
* Copyright 1999-2011 Alibaba Group. * Licensed to the Apache Software Foundation (ASF) under one or more
* * contributor license agreements. See the NOTICE file distributed with
* Licensed under the Apache License, Version 2.0 (the "License"); * this work for additional information regarding copyright ownership.
* you may not use this file except in compliance with the License. * The ASF licenses this file to You under the Apache License, Version 2.0
* You may obtain a copy of the License at * (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 * http://www.apache.org/licenses/LICENSE-2.0
* *
...@@ -16,21 +17,21 @@ ...@@ -16,21 +17,21 @@
package com.alibaba.dubbo.rpc.service; package com.alibaba.dubbo.rpc.service;
/** /**
* 通用服务接口 * Generic service interface
* *
* @author william.liangf
* @export * @export
*/ */
public interface GenericService { public interface GenericService {
/** /**
* 泛化调用 * Generic invocation
* *
* @param method 方法名,如:findPerson,如果有重载方法,需带上参数列表,如:findPerson(java.lang.String) * @param method Method name, e.g. findPerson. If there are overridden methods, parameter info is
* @param parameterTypes 参数类型 * required, e.g. findPerson(java.lang.String)
* @param args 参数列表 * @param parameterTypes Parameter types
* @return 返回值 * @param args Arguments
* @throws Throwable 方法抛出的异常 * @return invocation return value
* @throws Throwable potential exception thrown from the invocation
*/ */
Object $invoke(String method, String[] parameterTypes, Object[] args) throws GenericException; Object $invoke(String method, String[] parameterTypes, Object[] args) throws GenericException;
......
/** /*
* Project: dubbo-rpc * Licensed to the Apache Software Foundation (ASF) under one or more
* <p> * contributor license agreements. See the NOTICE file distributed with
* File Created at 2012-2-24 * this work for additional information regarding copyright ownership.
* $Id$ * The ASF licenses this file to You under the Apache License, Version 2.0
* <p> * (the "License"); you may not use this file except in compliance with
* Copyright 1999-2100 Alibaba.com Corporation Limited. * the License. You may obtain a copy of the License at
* All rights reserved. *
* <p> * http://www.apache.org/licenses/LICENSE-2.0
* This software is the confidential and proprietary information of *
* Alibaba Company. ("Confidential Information"). You shall not * Unless required by applicable law or agreed to in writing, software
* disclose such Confidential Information and shall use it only in * distributed under the License is distributed on an "AS IS" BASIS,
* accordance with the terms of the license agreement you entered into * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* with Alibaba.com. * See the License for the specific language governing permissions and
* limitations under the License.
*/ */
package com.alibaba.dubbo.rpc.support; package com.alibaba.dubbo.rpc.support;
...@@ -20,8 +21,6 @@ import com.alibaba.dubbo.rpc.Invoker; ...@@ -20,8 +21,6 @@ import com.alibaba.dubbo.rpc.Invoker;
/** /**
* DelegateExporter * DelegateExporter
* @author chao.liuc
*
*/ */
public class DelegateExporter<T> implements Exporter<T> { public class DelegateExporter<T> implements Exporter<T> {
......
/* /*
* Copyright 1999-2012 Alibaba Group. * Licensed to the Apache Software Foundation (ASF) under one or more
* * contributor license agreements. See the NOTICE file distributed with
* Licensed under the Apache License, Version 2.0 (the "License"); * this work for additional information regarding copyright ownership.
* you may not use this file except in compliance with the License. * The ASF licenses this file to You under the Apache License, Version 2.0
* You may obtain a copy of the License at * (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 * http://www.apache.org/licenses/LICENSE-2.0
* *
...@@ -23,8 +24,6 @@ import com.alibaba.dubbo.rpc.RpcException; ...@@ -23,8 +24,6 @@ import com.alibaba.dubbo.rpc.RpcException;
/** /**
* DelegateInvoker * DelegateInvoker
*
* @author william.liangf
*/ */
public abstract class DelegateInvoker<T> implements Invoker<T> { public abstract class DelegateInvoker<T> implements Invoker<T> {
......
/* /*
* Copyright 1999-2011 Alibaba Group. * Licensed to the Apache Software Foundation (ASF) under one or more
* * contributor license agreements. See the NOTICE file distributed with
* Licensed under the Apache License, Version 2.0 (the "License"); * this work for additional information regarding copyright ownership.
* you may not use this file except in compliance with the License. * The ASF licenses this file to You under the Apache License, Version 2.0
* You may obtain a copy of the License at * (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 * http://www.apache.org/licenses/LICENSE-2.0
* *
...@@ -37,10 +38,6 @@ import java.util.List; ...@@ -37,10 +38,6 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentHashMap;
/**
* @author chao.liuc
* @author william.liangf
*/
final public class MockInvoker<T> implements Invoker<T> { final public class MockInvoker<T> implements Invoker<T> {
private final static ProxyFactory proxyFactory = ExtensionLoader.getExtensionLoader(ProxyFactory.class).getAdaptiveExtension(); private final static ProxyFactory proxyFactory = ExtensionLoader.getExtensionLoader(ProxyFactory.class).getAdaptiveExtension();
private final static Map<String, Invoker<?>> mocks = new ConcurrentHashMap<String, Invoker<?>>(); private final static Map<String, Invoker<?>> mocks = new ConcurrentHashMap<String, Invoker<?>>();
...@@ -118,7 +115,7 @@ final public class MockInvoker<T> implements Invoker<T> { ...@@ -118,7 +115,7 @@ final public class MockInvoker<T> implements Invoker<T> {
mock = mock.replace('`', '"'); mock = mock.replace('`', '"');
if (StringUtils.isBlank(mock)) { if (StringUtils.isBlank(mock)) {
throw new RpcException(" mocked exception for Service degradation. "); throw new RpcException(" mocked exception for Service degradation. ");
} else { //用户自定义类 } else { // user customized class
Throwable t = getThrowable(mock); Throwable t = getThrowable(mock);
throw new RpcException(RpcException.BIZ_EXCEPTION, t); throw new RpcException(RpcException.BIZ_EXCEPTION, t);
} }
......
/* /*
* Copyright 1999-2011 Alibaba Group. * Licensed to the Apache Software Foundation (ASF) under one or more
* * contributor license agreements. See the NOTICE file distributed with
* Licensed under the Apache License, Version 2.0 (the "License"); * this work for additional information regarding copyright ownership.
* you may not use this file except in compliance with the License. * The ASF licenses this file to You under the Apache License, Version 2.0
* You may obtain a copy of the License at * (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 * http://www.apache.org/licenses/LICENSE-2.0
* *
...@@ -22,9 +23,7 @@ import com.alibaba.dubbo.rpc.RpcException; ...@@ -22,9 +23,7 @@ import com.alibaba.dubbo.rpc.RpcException;
import com.alibaba.dubbo.rpc.protocol.AbstractProtocol; import com.alibaba.dubbo.rpc.protocol.AbstractProtocol;
/** /**
* MockProtocol 用于在consumer side 通过url及类型生成一个mockInvoker * MockProtocol is used for generating a mock invoker by URL and type on consumer side
*
* @author chao.liuc
*/ */
final public class MockProtocol extends AbstractProtocol { final public class MockProtocol extends AbstractProtocol {
......
/*
* 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 com.alibaba.dubbo.rpc.support; package com.alibaba.dubbo.rpc.support;
import com.alibaba.dubbo.common.Constants; import com.alibaba.dubbo.common.Constants;
import com.alibaba.dubbo.common.URL; import com.alibaba.dubbo.common.URL;
/**
* @author <a href="mailto:gang.lvg@alibaba-inc.com">kimi</a>
*/
public class ProtocolUtils { public class ProtocolUtils {
private ProtocolUtils() { private ProtocolUtils() {
......
/* /*
* Copyright 1999-2012 Alibaba Group. * Licensed to the Apache Software Foundation (ASF) under one or more
* * contributor license agreements. See the NOTICE file distributed with
* Licensed under the Apache License, Version 2.0 (the "License"); * this work for additional information regarding copyright ownership.
* you may not use this file except in compliance with the License. * The ASF licenses this file to You under the Apache License, Version 2.0
* You may obtain a copy of the License at * (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 * http://www.apache.org/licenses/LICENSE-2.0
* *
...@@ -29,9 +30,6 @@ import java.util.concurrent.atomic.AtomicLong; ...@@ -29,9 +30,6 @@ import java.util.concurrent.atomic.AtomicLong;
/** /**
* RpcUtils * RpcUtils
*
* @author william.liangf
* @author chao.liuc
*/ */
public class RpcUtils { public class RpcUtils {
...@@ -86,7 +84,7 @@ public class RpcUtils { ...@@ -86,7 +84,7 @@ public class RpcUtils {
} }
/** /**
* 幂等操作:异步操作默认添加invocation id * Idempotent operation: invocation id will be added in async operation by default
* *
* @param url * @param url
* @param inv * @param inv
...@@ -100,13 +98,11 @@ public class RpcUtils { ...@@ -100,13 +98,11 @@ public class RpcUtils {
private static boolean isAttachInvocationId(URL url, Invocation invocation) { private static boolean isAttachInvocationId(URL url, Invocation invocation) {
String value = url.getMethodParameter(invocation.getMethodName(), Constants.AUTO_ATTACH_INVOCATIONID_KEY); String value = url.getMethodParameter(invocation.getMethodName(), Constants.AUTO_ATTACH_INVOCATIONID_KEY);
if (value == null) { if (value == null) {
//异步操作默认添加invocationid // add invocationid in async operation by default
return isAsync(url, invocation); return isAsync(url, invocation);
} else if (Boolean.TRUE.toString().equalsIgnoreCase(value)) { } else if (Boolean.TRUE.toString().equalsIgnoreCase(value)) {
//设置为添加,则一定添加
return true; return true;
} else { } else {
//value为false时,不添加
return false; return false;
} }
} }
...@@ -151,7 +147,6 @@ public class RpcUtils { ...@@ -151,7 +147,6 @@ public class RpcUtils {
public static boolean isAsync(URL url, Invocation inv) { public static boolean isAsync(URL url, Invocation inv) {
boolean isAsync; boolean isAsync;
//如果Java代码中设置优先.
if (Boolean.TRUE.toString().equals(inv.getAttachment(Constants.ASYNC_KEY))) { if (Boolean.TRUE.toString().equals(inv.getAttachment(Constants.ASYNC_KEY))) {
isAsync = true; isAsync = true;
} else { } else {
...@@ -162,7 +157,6 @@ public class RpcUtils { ...@@ -162,7 +157,6 @@ public class RpcUtils {
public static boolean isOneway(URL url, Invocation inv) { public static boolean isOneway(URL url, Invocation inv) {
boolean isOneway; boolean isOneway;
//如果Java代码中设置优先.
if (Boolean.FALSE.toString().equals(inv.getAttachment(Constants.RETURN_KEY))) { if (Boolean.FALSE.toString().equals(inv.getAttachment(Constants.RETURN_KEY))) {
isOneway = true; isOneway = true;
} else { } else {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册