com.alibaba.dubbo.rpc.filter
Class ExceptionFilter

java.lang.Object
  extended by com.alibaba.dubbo.rpc.filter.ExceptionFilter
All Implemented Interfaces:
Filter

@Activate(group="provider")
public class ExceptionFilter
extends Object
implements Filter

ExceptionInvokerFilter

功能:

  1. 不期望的异常打ERROR日志(Provider端)
    不期望的日志即是,没有的接口上声明的Unchecked异常。
  2. 异常不在API包中,则Wrap一层RuntimeException。
    RPC对于第一层异常会直接序列化传输(Cause异常会String化),避免异常在Client出不能反序列化问题。

Author:
william.liangf, ding.lid

Constructor Summary
ExceptionFilter()
           
ExceptionFilter(Logger logger)
           
 
Method Summary
 Result invoke(Invoker<?> invoker, Invocation invocation)
          do invoke filter.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExceptionFilter

public ExceptionFilter()

ExceptionFilter

public ExceptionFilter(Logger logger)
Method Detail

invoke

public Result invoke(Invoker<?> invoker,
                     Invocation invocation)
              throws RpcException
Description copied from interface: Filter
do invoke filter.

// before filter Result result = invoker.invoke(invocation); // after filter return result;

Specified by:
invoke in interface Filter
Parameters:
invoker - service
invocation - invocation.
Returns:
invoke result.
Throws:
RpcException
See Also:
Invoker.invoke(Invocation)


Copyright © 2012–2017 Alibaba. All rights reserved.