Search in sources :

Example 1 with NoSuchMethodException

use of org.apache.dubbo.common.bytecode.NoSuchMethodException in project dubbo by alibaba.

the class RpcMessageHandler method reply.

public Object reply(ExchangeChannel channel, RpcMessage msg) throws RemotingException {
    String desc = msg.getMethodDesc();
    Object[] args = msg.getArguments();
    Object impl = mProvider.getImplementation(msg.getClassName());
    Wrapper wrap = Wrapper.getWrapper(impl.getClass());
    try {
        return new MockResult(wrap.invokeMethod(impl, desc, msg.getParameterTypes(), args));
    } catch (NoSuchMethodException e) {
        throw new RemotingException(channel, "Service method not found.");
    } catch (InvocationTargetException e) {
        return new MockResult(e.getTargetException());
    }
}
Also used : Wrapper(org.apache.dubbo.common.bytecode.Wrapper) RemotingException(org.apache.dubbo.remoting.RemotingException) InvocationTargetException(java.lang.reflect.InvocationTargetException) NoSuchMethodException(org.apache.dubbo.common.bytecode.NoSuchMethodException)

Aggregations

InvocationTargetException (java.lang.reflect.InvocationTargetException)1 NoSuchMethodException (org.apache.dubbo.common.bytecode.NoSuchMethodException)1 Wrapper (org.apache.dubbo.common.bytecode.Wrapper)1 RemotingException (org.apache.dubbo.remoting.RemotingException)1