Skip to content

Commit 33fae5c

Browse files
committed
fix AutoJsonRpcClientProxyCreator can't not override the json-rpc method
1 parent d438415 commit 33fae5c

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/main/java/com/googlecode/jsonrpc4j/ProxyUtil.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ private static boolean isDeclaringClassAnObject(Method method) {
163163
return method.getDeclaringClass() == Object.class;
164164
}
165165

166-
private static String getMethodName(Method method) {
166+
public static String getMethodName(Method method) {
167167
final JsonRpcMethod jsonRpcMethod = ReflectionUtil.getAnnotation(method, JsonRpcMethod.class);
168168
if (jsonRpcMethod == null) {
169169
return method.getName();

src/main/java/com/googlecode/jsonrpc4j/spring/JsonProxyFactoryBean.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import com.googlecode.jsonrpc4j.JsonRpcClient.RequestListener;
55
import com.googlecode.jsonrpc4j.ExceptionResolver;
66
import com.googlecode.jsonrpc4j.JsonRpcHttpClient;
7+
import com.googlecode.jsonrpc4j.ProxyUtil;
78
import com.googlecode.jsonrpc4j.ReflectionUtil;
89
import org.aopalliance.intercept.MethodInterceptor;
910
import org.aopalliance.intercept.MethodInvocation;
@@ -104,7 +105,7 @@ public Object invoke(MethodInvocation invocation)
104105
Type retType = (invocation.getMethod().getGenericReturnType() != null) ? invocation.getMethod().getGenericReturnType() : invocation.getMethod().getReturnType();
105106
Object arguments = ReflectionUtil.parseArguments(invocation.getMethod(), invocation.getArguments());
106107

107-
return jsonRpcHttpClient.invoke(invocation.getMethod().getName(), arguments, retType, extraHttpHeaders);
108+
return jsonRpcHttpClient.invoke(ProxyUtil.getMethodName(method), arguments, retType, extraHttpHeaders);
108109
}
109110

110111
/**

0 commit comments

Comments
 (0)