Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
touzizhuo03
Dubbo
提交
89a27ce1
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,发现更多精彩内容 >>
提交
89a27ce1
编写于
7月 05, 2012
作者:
L
liangfei0201
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
DUBBO-469 调整Filter链顺序
上级
40984fd0
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
39 addition
and
18 deletion
+39
-18
dubbo-monitor/dubbo-monitor-api/src/main/java/com/alibaba/dubbo/monitor/support/MonitorFilter.java
...java/com/alibaba/dubbo/monitor/support/MonitorFilter.java
+3
-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
+1
-1
dubbo-rpc/dubbo-rpc-api/src/main/java/com/alibaba/dubbo/rpc/filter/EchoFilter.java
...rc/main/java/com/alibaba/dubbo/rpc/filter/EchoFilter.java
+1
-1
dubbo-rpc/dubbo-rpc-api/src/main/java/com/alibaba/dubbo/rpc/filter/GenericFilter.java
...main/java/com/alibaba/dubbo/rpc/filter/GenericFilter.java
+1
-1
dubbo-rpc/dubbo-rpc-api/src/main/java/com/alibaba/dubbo/rpc/filter/GenericImplFilter.java
.../java/com/alibaba/dubbo/rpc/filter/GenericImplFilter.java
+1
-1
dubbo-rpc/dubbo-rpc-api/src/main/java/com/alibaba/dubbo/rpc/support/RpcUtils.java
...src/main/java/com/alibaba/dubbo/rpc/support/RpcUtils.java
+32
-8
未找到文件。
dubbo-monitor/dubbo-monitor-api/src/main/java/com/alibaba/dubbo/monitor/support/MonitorFilter.java
浏览文件 @
89a27ce1
...
...
@@ -34,6 +34,8 @@ import com.alibaba.dubbo.rpc.Invoker;
import
com.alibaba.dubbo.rpc.Result
;
import
com.alibaba.dubbo.rpc.RpcContext
;
import
com.alibaba.dubbo.rpc.RpcException
;
import
com.alibaba.dubbo.rpc.RpcInvocation
;
import
com.alibaba.dubbo.rpc.support.RpcUtils
;
/**
* MonitorFilter. (SPI, Singleton, ThreadSafe)
...
...
@@ -82,12 +84,7 @@ public class MonitorFilter implements Filter {
int
concurrent
=
getConcurrent
(
invoker
,
invocation
).
get
();
// 当前并发数
String
application
=
invoker
.
getUrl
().
getParameter
(
Constants
.
APPLICATION_KEY
);
String
service
=
invoker
.
getInterface
().
getName
();
// 获取服务名称
String
method
=
invocation
.
getMethodName
();
// 获取方法名
if
(
Constants
.
$INVOKE
.
equals
(
method
)
&&
invocation
.
getArguments
().
length
>
0
&&
invocation
.
getArguments
()[
0
]
instanceof
String
)
{
method
=
(
String
)
invocation
.
getArguments
()[
0
];
}
String
method
=
RpcUtils
.
getMethodName
(
invocation
);
// 获取方法名
URL
url
=
invoker
.
getUrl
().
getUrlParameter
(
Constants
.
MONITOR_KEY
);
Monitor
monitor
=
monitorFactory
.
getMonitor
(
url
);
int
localPort
;
...
...
dubbo-rpc/dubbo-rpc-api/src/main/java/com/alibaba/dubbo/rpc/RpcInvocation.java
浏览文件 @
89a27ce1
...
...
@@ -111,7 +111,7 @@ public class RpcInvocation implements Invocation, Serializable {
public
void
setInvoker
(
Invoker
<?>
invoker
)
{
this
.
invoker
=
invoker
;
}
public
String
getMethodName
()
{
return
methodName
;
}
...
...
dubbo-rpc/dubbo-rpc-api/src/main/java/com/alibaba/dubbo/rpc/filter/EchoFilter.java
浏览文件 @
89a27ce1
...
...
@@ -29,7 +29,7 @@ import com.alibaba.dubbo.rpc.RpcResult;
*
* @author william.liangf
*/
@Activate
(
group
=
Constants
.
PROVIDER
)
@Activate
(
group
=
Constants
.
PROVIDER
,
order
=
-
110000
)
public
class
EchoFilter
implements
Filter
{
public
Result
invoke
(
Invoker
<?>
invoker
,
Invocation
inv
)
throws
RpcException
{
...
...
dubbo-rpc/dubbo-rpc-api/src/main/java/com/alibaba/dubbo/rpc/filter/GenericFilter.java
浏览文件 @
89a27ce1
...
...
@@ -35,7 +35,7 @@ import com.alibaba.dubbo.rpc.service.GenericException;
*
* @author william.liangf
*/
@Activate
(
group
=
Constants
.
PROVIDER
)
@Activate
(
group
=
Constants
.
PROVIDER
,
order
=
-
100000
)
public
class
GenericFilter
implements
Filter
{
public
Result
invoke
(
Invoker
<?>
invoker
,
Invocation
inv
)
throws
RpcException
{
...
...
dubbo-rpc/dubbo-rpc-api/src/main/java/com/alibaba/dubbo/rpc/filter/GenericImplFilter.java
浏览文件 @
89a27ce1
...
...
@@ -39,7 +39,7 @@ import com.alibaba.dubbo.rpc.service.GenericException;
*
* @author william.liangf
*/
@Activate
(
group
=
Constants
.
CONSUMER
,
value
=
Constants
.
GENERIC_KEY
)
@Activate
(
group
=
Constants
.
CONSUMER
,
value
=
Constants
.
GENERIC_KEY
,
order
=
100000
)
public
class
GenericImplFilter
implements
Filter
{
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
GenericImplFilter
.
class
);
...
...
dubbo-rpc/dubbo-rpc-api/src/main/java/com/alibaba/dubbo/rpc/support/RpcUtils.java
浏览文件 @
89a27ce1
...
...
@@ -112,17 +112,41 @@ public class RpcUtils {
}
public
static
String
getMethodName
(
Invocation
invocation
){
String
methodName
;
if
(
Constants
.
$INVOKE
.
equals
(
invocation
.
getMethodName
())
&&
invocation
.
getArguments
()
!=
null
&&
invocation
.
getArguments
().
length
>
0
&&
invocation
.
getArguments
()[
0
]
!=
null
){
//the frist argument must be real method name;
methodName
=
invocation
.
getArguments
()[
0
].
toString
();
}
else
{
methodName
=
invocation
.
getMethodName
();
&&
invocation
.
getArguments
().
length
>
0
&&
invocation
.
getArguments
()[
0
]
instanceof
String
){
return
(
String
)
invocation
.
getArguments
()[
0
];
}
return
methodName
;
return
invocation
.
getMethodName
();
}
public
static
Object
[]
getArguments
(
Invocation
invocation
){
if
(
Constants
.
$INVOKE
.
equals
(
invocation
.
getMethodName
())
&&
invocation
.
getArguments
()
!=
null
&&
invocation
.
getArguments
().
length
>
2
&&
invocation
.
getArguments
()[
2
]
instanceof
Object
[]){
return
(
Object
[])
invocation
.
getArguments
()[
2
];
}
return
invocation
.
getArguments
();
}
public
static
Class
<?>[]
getParameterTypes
(
Invocation
invocation
){
if
(
Constants
.
$INVOKE
.
equals
(
invocation
.
getMethodName
())
&&
invocation
.
getArguments
()
!=
null
&&
invocation
.
getArguments
().
length
>
1
&&
invocation
.
getArguments
()[
1
]
instanceof
String
[]){
String
[]
types
=
(
String
[])
invocation
.
getArguments
()[
1
];
if
(
types
==
null
)
{
return
new
Class
<?>[
0
];
}
Class
<?>[]
parameterTypes
=
new
Class
<?>[
types
.
length
];
for
(
int
i
=
0
;
i
<
types
.
length
;
i
++)
{
parameterTypes
[
i
]
=
ReflectUtils
.
forName
(
types
[
0
]);
}
return
parameterTypes
;
}
return
invocation
.
getParameterTypes
();
}
public
static
boolean
isAsync
(
URL
url
,
Invocation
inv
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录