public static <InterfaceType> InterfaceType getClient(
			Class<InterfaceType> interfaceType, String serverAddr) {
		try {
			String className = "Impl" + interfaceType.getSimpleName();
			CtClass proxy = classPool.getOrNull(className);
			if (proxy == null) {
				proxy = classPool.makeClass(className);
				CtClass interfaceCtClass = classPool.get(interfaceType
						.getName());
				proxy.setInterfaces(new CtClass[] { interfaceCtClass });
				proxy.setSuperclass(iClientCtClass);
				HashMap<String, Method> methods = new HashMap<String, Method>();
				for (Method method : interfaceType.getDeclaredMethods()) {
					methods.put(method.getName(), method);
				}
				for (CtMethod method : interfaceCtClass.getMethods()) {
					Method oMethod = methods.get(method.getName());
					if (null != oMethod) {
						CtMethod proxyMethod = CtNewMethod.copy(method, proxy,
								null);
						String methodBody = "_niven_rpc_invoke(\""
								+ Common.methodFullName(oMethod) + "\"";
						if (method.getParameterTypes().length >= 0) {
							String params = "";
							for (int i = 0; i < method.getParameterTypes().length; i++) {
								params += ","
										+ wrapPrimitiveToObjectCast(
												oMethod.getParameterTypes()[i],
												"$" + (i + 1));
							}
							methodBody += ", new Object[]{"
									+ params.substring(1) + "}";
						}
						methodBody += ")";
						Class<?> returnType = oMethod.getReturnType();
						if (!Void.TYPE.equals(returnType)) {
							methodBody = "Object ret = "
									+ methodBody
									+ "; return "
									+ wrapObjectToPrimitiveCast(returnType,
											"ret");
						}
						methodBody = "{" + methodBody + ";}";
						System.out.println(methodBody);
						proxyMethod.setBody(methodBody);
						proxy.addMethod(proxyMethod);
					}
				}
			}
			IClient iClient = (IClient) proxy.toClass().newInstance();
			iClient.serverAddr = serverAddr;
			iClient.interfaceTypeName = interfaceType.getName();
			return interfaceType.cast(iClient);
		} catch (Exception e) {
			e.printStackTrace();
			throw new RPCException(
					"Failed to make client proxy from interface", e);
		}
	}