public RemoteServiceMethod createRemoteServiceMethod(
Class<?> targetServiceType, Method proxiedMethod, Type targetReturnType) {
String methodSignature = ReflectionUtil.methodSignatureWithoutReturnType(proxiedMethod);
if (proxiedMethod.isAnnotationPresent(AstrixBroadcast.class)) {
Method targetServiceMethod = ReflectionUtil.getMethod(targetServiceType, proxiedMethod.getName(),proxiedMethod.getParameterTypes());
return new BroadcastedRemoteServiceMethod(methodSignature,
getRemoteResultReducerClass(targetServiceMethod),
remotingEngine, targetReturnType);
}
int partitionedByArgumentIndex = getPartitionedByAnnotation(proxiedMethod);
if (partitionedByArgumentIndex >= 0) {
Method targetServiceMethod = ReflectionUtil.getMethod(targetServiceType, proxiedMethod.getName(),proxiedMethod.getParameterTypes());
return new PartitionedRemoteServiceMethod(partitionedByArgumentIndex, proxiedMethod, methodSignature, remotingEngine, targetReturnType, targetServiceMethod);
}
if (proxiedMethod.isAnnotationPresent(AstrixRoutingStrategy.class)) {
RoutingStrategy routingStrategy = createRoutingStrategy(proxiedMethod);
return new RoutedRemoteServiceMethod(methodSignature, routingStrategy.create(proxiedMethod), remotingEngine, targetReturnType);
}
return new RoutedRemoteServiceMethod(methodSignature, defaultRoutingStrategy.create(proxiedMethod), remotingEngine, targetReturnType);
}