public boolean isAvailable() {
return true;
}
public Result invoke(Invocation invocation) throws RpcException {
try {
return new RpcResult(remoteObject.getClass().getMethod(invocation.getMethodName(), invocation.getParameterTypes()).invoke(remoteObject, invocation.getArguments()));
} catch (InvocationTargetException e) {
Throwable t = e.getTargetException();
if (t instanceof RemoteAccessException) {
t = ((RemoteAccessException)t).getCause();
}
if (t instanceof RemoteException) {
throw RmiInvoker.setRpcExceptionCode(t, new RpcException("Failed to invoke remote service: " + serviceType + ", method: "
+ invocation.getMethodName() + ", url: " + url + ", cause: " + t.getMessage(), t));
} else {
return new RpcResult(t);
}
} catch (Throwable e) {
if (e instanceof RemoteAccessException) {
e = ((RemoteAccessException)e).getCause();
}