Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
touzizhuo03
Dubbo
提交
070b4ccd
D
Dubbo
项目概览
touzizhuo03
/
Dubbo
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
Dubbo
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
070b4ccd
编写于
12月 20, 2017
作者:
I
Ian Luo
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
#1067: I18N effort for dubbo code base - dubbo-rpc (part1)
上级
8e20d1ca
变更
16
隐藏空白更改
内联
并排
Showing
16 changed file
with
151 addition
and
158 deletion
+151
-158
dubbo-rpc/dubbo-rpc-api/src/main/java/com/alibaba/dubbo/rpc/Exporter.java
...rpc-api/src/main/java/com/alibaba/dubbo/rpc/Exporter.java
+9
-9
dubbo-rpc/dubbo-rpc-api/src/main/java/com/alibaba/dubbo/rpc/ExporterListener.java
...src/main/java/com/alibaba/dubbo/rpc/ExporterListener.java
+9
-10
dubbo-rpc/dubbo-rpc-api/src/main/java/com/alibaba/dubbo/rpc/Filter.java
...o-rpc-api/src/main/java/com/alibaba/dubbo/rpc/Filter.java
+9
-10
dubbo-rpc/dubbo-rpc-api/src/main/java/com/alibaba/dubbo/rpc/Invocation.java
...c-api/src/main/java/com/alibaba/dubbo/rpc/Invocation.java
+9
-10
dubbo-rpc/dubbo-rpc-api/src/main/java/com/alibaba/dubbo/rpc/Invoker.java
...-rpc-api/src/main/java/com/alibaba/dubbo/rpc/Invoker.java
+9
-9
dubbo-rpc/dubbo-rpc-api/src/main/java/com/alibaba/dubbo/rpc/InvokerListener.java
.../src/main/java/com/alibaba/dubbo/rpc/InvokerListener.java
+9
-10
dubbo-rpc/dubbo-rpc-api/src/main/java/com/alibaba/dubbo/rpc/Protocol.java
...rpc-api/src/main/java/com/alibaba/dubbo/rpc/Protocol.java
+37
-33
dubbo-rpc/dubbo-rpc-api/src/main/java/com/alibaba/dubbo/rpc/ProxyFactory.java
...api/src/main/java/com/alibaba/dubbo/rpc/ProxyFactory.java
+9
-10
dubbo-rpc/dubbo-rpc-api/src/main/java/com/alibaba/dubbo/rpc/Result.java
...o-rpc-api/src/main/java/com/alibaba/dubbo/rpc/Result.java
+9
-10
dubbo-rpc/dubbo-rpc-api/src/main/java/com/alibaba/dubbo/rpc/RpcConstants.java
...api/src/main/java/com/alibaba/dubbo/rpc/RpcConstants.java
+9
-9
dubbo-rpc/dubbo-rpc-api/src/main/java/com/alibaba/dubbo/rpc/RpcContext.java
...c-api/src/main/java/com/alibaba/dubbo/rpc/RpcContext.java
+10
-11
dubbo-rpc/dubbo-rpc-api/src/main/java/com/alibaba/dubbo/rpc/RpcException.java
...api/src/main/java/com/alibaba/dubbo/rpc/RpcException.java
+4
-6
dubbo-rpc/dubbo-rpc-api/src/main/java/com/alibaba/dubbo/rpc/RpcInvocation.java
...pi/src/main/java/com/alibaba/dubbo/rpc/RpcInvocation.java
+3
-4
dubbo-rpc/dubbo-rpc-api/src/main/java/com/alibaba/dubbo/rpc/RpcResult.java
...pc-api/src/main/java/com/alibaba/dubbo/rpc/RpcResult.java
+4
-5
dubbo-rpc/dubbo-rpc-api/src/main/java/com/alibaba/dubbo/rpc/RpcStatus.java
...pc-api/src/main/java/com/alibaba/dubbo/rpc/RpcStatus.java
+8
-8
dubbo-rpc/dubbo-rpc-api/src/main/java/com/alibaba/dubbo/rpc/StaticContext.java
...pi/src/main/java/com/alibaba/dubbo/rpc/StaticContext.java
+4
-4
未找到文件。
dubbo-rpc/dubbo-rpc-api/src/main/java/com/alibaba/dubbo/rpc/Exporter.java
浏览文件 @
070b4ccd
/*
* Copyright 1999-2011 Alibaba Group.
*
* 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
*
* 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.
...
...
@@ -18,7 +19,6 @@ package com.alibaba.dubbo.rpc;
/**
* Exporter. (API/SPI, Prototype, ThreadSafe)
*
* @author william.liangf
* @see com.alibaba.dubbo.rpc.Protocol#export(Invoker)
* @see com.alibaba.dubbo.rpc.ExporterListener
* @see com.alibaba.dubbo.rpc.protocol.AbstractExporter
...
...
dubbo-rpc/dubbo-rpc-api/src/main/java/com/alibaba/dubbo/rpc/ExporterListener.java
浏览文件 @
070b4ccd
/*
* Copyright 1999-2011 Alibaba Group.
*
* 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
*
* 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.
...
...
@@ -19,8 +20,6 @@ import com.alibaba.dubbo.common.extension.SPI;
/**
* ExporterListener. (SPI, Singleton, ThreadSafe)
*
* @author william.liangf
*/
@SPI
public
interface
ExporterListener
{
...
...
dubbo-rpc/dubbo-rpc-api/src/main/java/com/alibaba/dubbo/rpc/Filter.java
浏览文件 @
070b4ccd
/*
* Copyright 1999-2011 Alibaba Group.
*
* 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
*
* 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.
...
...
@@ -19,8 +20,6 @@ import com.alibaba.dubbo.common.extension.SPI;
/**
* Filter. (SPI, Singleton, ThreadSafe)
*
* @author william.liangf
*/
@SPI
public
interface
Filter
{
...
...
dubbo-rpc/dubbo-rpc-api/src/main/java/com/alibaba/dubbo/rpc/Invocation.java
浏览文件 @
070b4ccd
/*
* Copyright 1999-2011 Alibaba Group.
*
* 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
*
* 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.
...
...
@@ -20,8 +21,6 @@ import java.util.Map;
/**
* Invocation. (API, Prototype, NonThreadSafe)
*
* @author qian.lei
* @author william.liangf
* @serial Don't change the class name and package name.
* @see com.alibaba.dubbo.rpc.Invoker#invoke(Invocation)
* @see com.alibaba.dubbo.rpc.RpcInvocation
...
...
dubbo-rpc/dubbo-rpc-api/src/main/java/com/alibaba/dubbo/rpc/Invoker.java
浏览文件 @
070b4ccd
/*
* Copyright 1999-2011 Alibaba Group.
*
* 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
*
* 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.
...
...
@@ -20,7 +21,6 @@ import com.alibaba.dubbo.common.Node;
/**
* Invoker. (API/SPI, Prototype, ThreadSafe)
*
* @author william.liangf
* @see com.alibaba.dubbo.rpc.Protocol#refer(Class, com.alibaba.dubbo.common.URL)
* @see com.alibaba.dubbo.rpc.InvokerListener
* @see com.alibaba.dubbo.rpc.protocol.AbstractInvoker
...
...
dubbo-rpc/dubbo-rpc-api/src/main/java/com/alibaba/dubbo/rpc/InvokerListener.java
浏览文件 @
070b4ccd
/*
* Copyright 1999-2011 Alibaba Group.
*
* 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
*
* 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.
...
...
@@ -20,8 +21,6 @@ import com.alibaba.dubbo.common.extension.SPI;
/**
* InvokerListener. (SPI, Singleton, ThreadSafe)
*
* @author william.liangf
*/
@SPI
public
interface
InvokerListener
{
...
...
dubbo-rpc/dubbo-rpc-api/src/main/java/com/alibaba/dubbo/rpc/Protocol.java
浏览文件 @
070b4ccd
/*
* Copyright 1999-2011 Alibaba Group.
*
* 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
*
* 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.
...
...
@@ -21,53 +22,56 @@ import com.alibaba.dubbo.common.extension.SPI;
/**
* Protocol. (API/SPI, Singleton, ThreadSafe)
*
* @author william.liangf
*/
@SPI
(
"dubbo"
)
public
interface
Protocol
{
/**
*
获取缺省端口,当用户没有配置端口时使用。
*
Get default port when user doesn't config the port.
*
* @return
缺省端口
* @return
default port
*/
int
getDefaultPort
();
/**
* 暴露远程服务:<br>
* 1. 协议在接收请求时,应记录请求来源方地址信息:RpcContext.getContext().setRemoteAddress();<br>
* 2. export()必须是幂等的,也就是暴露同一个URL的Invoker两次,和暴露一次没有区别。<br>
* 3. export()传入的Invoker由框架实现并传入,协议不需要关心。<br>
* Export service for remote invocation: <br>
* 1. Protocol should record request source address after receive a request:
* RpcContext.getContext().setRemoteAddress();<br>
* 2. export() must be idempotent, that is, there's no difference between invoking once and invoking twice when
* export the same URL<br>
* 3. Invoker instance is passed in by the framework, protocol needs not to care <br>
*
* @param <T>
服务的类型
* @param invoker
服务的执行体
* @return exporter
暴露服务的引用,用于取消暴露
* @throws RpcException
当暴露服务出错时抛出,比如端口已占用
* @param <T>
Service type
* @param invoker
Service invoker
* @return exporter
reference for exported service, useful for unexport the service later
* @throws RpcException
thrown when error occurs during export the service, for example: port is occupied
*/
@Adaptive
<
T
>
Exporter
<
T
>
export
(
Invoker
<
T
>
invoker
)
throws
RpcException
;
/**
* 引用远程服务:<br>
* 1. 当用户调用refer()所返回的Invoker对象的invoke()方法时,协议需相应执行同URL远端export()传入的Invoker对象的invoke()方法。<br>
* 2. refer()返回的Invoker由协议实现,协议通常需要在此Invoker中发送远程请求。<br>
* 3. 当url中有设置check=false时,连接失败不能抛出异常,并内部自动恢复。<br>
* Refer a remote service: <br>
* 1. When user calls `invoke()` method of `Invoker` object which's returned from `refer()` call, the protocol
* needs to correspondingly execute `invoke()` method of `Invoker` object <br>
* 2. It's protocol's responsibility to implement `Invoker` which's returned from `refer()`. Generally speaking,
* protocol sends remote request in the `Invoker` implementation. <br>
* 3. When there's check=false set in URL, the implementation must not throw exception but try to recover when
* connection fails.
*
* @param <T>
服务的类型
* @param type
服务的类型
* @param url
远程服务的URL地址
* @return invoker
服务的本地代理
* @throws RpcException
当连接服务提供方失败时抛出
* @param <T>
Service type
* @param type
Service class
* @param url
URL address for the remote service
* @return invoker
service's local proxy
* @throws RpcException
when there's any error while connecting to the service provider
*/
@Adaptive
<
T
>
Invoker
<
T
>
refer
(
Class
<
T
>
type
,
URL
url
)
throws
RpcException
;
/**
*
释放协议:
<br>
* 1.
取消该协议所有已经暴露和引用的服务。
<br>
* 2.
释放协议所占用的所有资源,比如连接和端口。
<br>
* 3.
协议在释放后,依然能暴露和引用新的服务。<br>
*
Destroy protocol:
<br>
* 1.
Cancel all services this protocol exports and refers
<br>
* 2.
Release all occupied resources, for example: connection, port, etc.
<br>
* 3.
Protocol can continue to export and refer new service even after it's destroyed.
*/
void
destroy
();
...
...
dubbo-rpc/dubbo-rpc-api/src/main/java/com/alibaba/dubbo/rpc/ProxyFactory.java
浏览文件 @
070b4ccd
/*
* Copyright 1999-2011 Alibaba Group.
*
* 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
*
* 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.
...
...
@@ -22,8 +23,6 @@ import com.alibaba.dubbo.common.extension.SPI;
/**
* ProxyFactory. (API/SPI, Singleton, ThreadSafe)
*
* @author william.liangf
*/
@SPI
(
"javassist"
)
public
interface
ProxyFactory
{
...
...
dubbo-rpc/dubbo-rpc-api/src/main/java/com/alibaba/dubbo/rpc/Result.java
浏览文件 @
070b4ccd
/*
* Copyright 1999-2011 Alibaba Group.
*
* 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
*
* 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.
...
...
@@ -20,8 +21,6 @@ import java.util.Map;
/**
* RPC invoke result. (API, Prototype, NonThreadSafe)
*
* @author qianlei
* @author william.liangf
* @serial Don't change the class name and package name.
* @see com.alibaba.dubbo.rpc.Invoker#invoke(Invocation)
* @see com.alibaba.dubbo.rpc.RpcResult
...
...
dubbo-rpc/dubbo-rpc-api/src/main/java/com/alibaba/dubbo/rpc/RpcConstants.java
浏览文件 @
070b4ccd
/*
* Copyright 1999-2011 Alibaba Group.
*
* 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
*
* 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.
...
...
@@ -20,7 +21,6 @@ import com.alibaba.dubbo.common.Constants;
/**
* RpcConstants
*
* @author william.liangf
* @deprecated Replace to com.alibaba.dubbo.common.Constants
*/
@Deprecated
...
...
dubbo-rpc/dubbo-rpc-api/src/main/java/com/alibaba/dubbo/rpc/RpcContext.java
浏览文件 @
070b4ccd
...
...
@@ -35,11 +35,10 @@ import java.util.concurrent.TimeoutException;
/**
* Thread local context. (API, ThreadLocal, ThreadSafe)
* <p>
* 注意:RpcContext是一个临时状态记录器,当接收到RPC请求,或发起RPC请求时,RpcContext的状态都会变化。
* 比如:A调B,B再调C,则B机器上,在B调C之前,RpcContext记录的是A调B的信息,在B调C之后,RpcContext记录的是B调C的信息。
* Note: RpcContext is a temporary state holder. States in RpcContext changes every time when request is sent or received.
* For example: A invokes B, then B invokes C. On service B, RpcContext saves invocation info from A to B before B
* starts invoking C, and saves invocation info from B to C after B invokes C.
*
* @author qian.lei
* @author william.liangf
* @export
* @see com.alibaba.dubbo.rpc.filter.ContextFilter
*/
...
...
@@ -550,10 +549,10 @@ public class RpcContext {
}
/**
*
异步调用 ,需要返回值,即使步调用Future.get方法,也会处理调用超时问题
.
*
Async invocation. Timeout will be handled even if <code>Future.get()</code> is not called
.
*
* @param callable
* @return
通过future.get()获取返回结果.
* @return
get the return result from <code>future.get()</code>
*/
@SuppressWarnings
(
"unchecked"
)
public
<
T
>
Future
<
T
>
asyncCall
(
Callable
<
T
>
callable
)
{
...
...
@@ -607,16 +606,16 @@ public class RpcContext {
}
/**
* one
way调用,只发送请求,不接收返回结果.
* one
way async call, send request only, and result is not required
*
* @param
call
able
* @param
runn
able
*/
public
void
asyncCall
(
Runnable
runable
)
{
public
void
asyncCall
(
Runnable
run
n
able
)
{
try
{
setAttachment
(
Constants
.
RETURN_KEY
,
Boolean
.
FALSE
.
toString
());
runable
.
run
();
run
n
able
.
run
();
}
catch
(
Throwable
e
)
{
//
FIXME 异常是否应该放在future中?
//
FIXME should put exception in future?
throw
new
RpcException
(
"oneway call error ."
+
e
.
getMessage
(),
e
);
}
finally
{
removeAttachment
(
Constants
.
RETURN_KEY
);
...
...
dubbo-rpc/dubbo-rpc-api/src/main/java/com/alibaba/dubbo/rpc/RpcException.java
浏览文件 @
070b4ccd
/*
* Copyright 1999-2011 Alibaba Group.
*
*
* 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.
...
...
@@ -18,8 +18,6 @@ package com.alibaba.dubbo.rpc;
/**
* RPC Exception. (API, Prototype, ThreadSafe)
*
* @author shawn.qianx
* @author william.liangf
* @serial Don't change the class name and properties.
* @export
* @see com.alibaba.dubbo.rpc.Invoker#invoke(Invocation)
...
...
@@ -34,7 +32,7 @@ public final class RpcException extends RuntimeException {
public
static
final
int
FORBIDDEN_EXCEPTION
=
4
;
public
static
final
int
SERIALIZATION_EXCEPTION
=
5
;
private
static
final
long
serialVersionUID
=
7815426752583648734L
;
private
int
code
;
// RpcException
不能有子类,异常类型用ErrorCode表示,以便保持兼容。
private
int
code
;
// RpcException
cannot be extended, use error code for exception type to keep compatibility
public
RpcException
()
{
super
();
...
...
dubbo-rpc/dubbo-rpc-api/src/main/java/com/alibaba/dubbo/rpc/RpcInvocation.java
浏览文件 @
070b4ccd
/*
* Copyright 1999-2011 Alibaba Group.
*
*
* 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.
...
...
@@ -27,7 +27,6 @@ import java.util.Map;
/**
* RPC Invocation.
*
* @author qian.lei
* @serial Don't change the class name and properties.
*/
public
class
RpcInvocation
implements
Invocation
,
Serializable
{
...
...
dubbo-rpc/dubbo-rpc-api/src/main/java/com/alibaba/dubbo/rpc/RpcResult.java
浏览文件 @
070b4ccd
/*
* Copyright 1999-2011 Alibaba Group.
*
*
* 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.
...
...
@@ -22,7 +22,6 @@ import java.util.Map;
/**
* RPC Result.
*
* @author qianlei
* @serial Don't change the class name and properties.
*/
public
class
RpcResult
implements
Result
,
Serializable
{
...
...
@@ -63,7 +62,7 @@ public class RpcResult implements Result, Serializable {
}
/**
* @see com.alibaba.dubbo.rpc.RpcResult#setValue()
* @see com.alibaba.dubbo.rpc.RpcResult#setValue(
Object
)
* @deprecated Replace to setValue()
*/
@Deprecated
...
...
dubbo-rpc/dubbo-rpc-api/src/main/java/com/alibaba/dubbo/rpc/RpcStatus.java
浏览文件 @
070b4ccd
/*
* Copyright 1999-2011 Alibaba Group.
*
*
* 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.
...
...
@@ -15,6 +15,7 @@
*/
package
com.alibaba.dubbo.rpc
;
import
com.alibaba.dubbo.common.Constants
;
import
com.alibaba.dubbo.common.URL
;
import
java.util.concurrent.ConcurrentHashMap
;
...
...
@@ -26,7 +27,6 @@ import java.util.concurrent.atomic.AtomicLong;
/**
* URL statistics. (API, Cached, ThreadSafe)
*
* @author william.liangf
* @see com.alibaba.dubbo.rpc.filter.ActiveLimitFilter
* @see com.alibaba.dubbo.rpc.filter.ExecuteLimitFilter
* @see com.alibaba.dubbo.rpc.cluster.loadbalance.LeastActiveLoadBalance
...
...
@@ -313,10 +313,10 @@ public class RpcStatus {
}
/**
*
获取限制线程数的信号量,信号量的许可数就是executes设置的值
*
2017-08-21 yizhenqiang
* @param maxThreadNum
executes设置的值
* @return
*
Get the semaphore for thread number. Semaphore's permits is decided by {@link Constants#EXECUTES_KEY}
*
* @param maxThreadNum
value of {@link Constants#EXECUTES_KEY}
* @return
thread number semaphore
*/
public
Semaphore
getSemaphore
(
int
maxThreadNum
)
{
if
(
maxThreadNum
<=
0
)
{
...
...
dubbo-rpc/dubbo-rpc-api/src/main/java/com/alibaba/dubbo/rpc/StaticContext.java
浏览文件 @
070b4ccd
/*
* Copyright 1999-2011 Alibaba Group.
*
*
* 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.
...
...
@@ -23,7 +23,7 @@ import java.util.concurrent.ConcurrentHashMap;
import
java.util.concurrent.ConcurrentMap
;
/**
*
系统存储,内部类.
*
System context, for internal use only
*/
public
class
StaticContext
extends
ConcurrentHashMap
<
Object
,
Object
>
{
private
static
final
long
serialVersionUID
=
1L
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录