Skip to content

Commit

Permalink
improve:ProviderMethodModel add parameterClasses (#3693)
Browse files Browse the repository at this point in the history
  • Loading branch information
qinliujie authored and Jeff-Lv committed Mar 20, 2019
1 parent 6272691 commit b9bf4a2
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,24 @@
package org.apache.dubbo.rpc.model;

import java.lang.reflect.Method;
import java.lang.reflect.Type;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;

public class ProviderMethodModel {
private final Method method;
private final String methodName;
private final Class<?>[] parameterClasses;
private final String[] methodArgTypes;

private final Type[] genericParameterTypes;
private final ConcurrentMap<String, Object> attributeMap = new ConcurrentHashMap<>();

public ProviderMethodModel(Method method) {
this.method = method;
this.methodName = method.getName();
this.parameterClasses = method.getParameterTypes();
this.methodArgTypes = getArgTypes(method);
this.genericParameterTypes = method.getGenericParameterTypes();
}

public Method getMethod() {
Expand Down Expand Up @@ -61,4 +65,12 @@ private static String[] getArgTypes(Method method) {
}
return methodArgTypes;
}

public Class<?>[] getParameterClasses() {
return parameterClasses;
}

public Type[] getGenericParameterTypes() {
return genericParameterTypes;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,11 @@ public ProviderMethodModel getMethodModel(String methodName, String[] argTypes)
return null;
}

public List<ProviderMethodModel> getMethodModelList(String methodName) {
return methods.get(methodName);
}


private void initMethod(Class<?> serviceInterfaceClass) {
Method[] methodsToExport = null;
methodsToExport = serviceInterfaceClass.getMethods();
Expand Down

0 comments on commit b9bf4a2

Please sign in to comment.