// Path: mappingrpc-connector/src/main/java/github/mappingrpc/core/rpc/CallResultFuture.java
// public class CallResultFuture {
// 	private Object result;
// 	private JSONObject detail;
// 	Object lock = new Object();
// 
// 	private Class<?> returnType;
// 
// 	public CallResultFuture(Class<?> returnType) {
// 		this.returnType = returnType;
// 	}
// 
// 	public void waitReturn(long timeoutInMs) {
// 		synchronized (lock) {
// 			try {
// 				lock.wait(timeoutInMs);
// 			} catch (InterruptedException e) {
// 				e.printStackTrace();
// 				throw new RuntimeException(e);
// 			}
// 		}
// 
// 		if (result == null && returnType != null) {
// 			throw new TimeoutException("{timeoutInMs:" + timeoutInMs + "}");
// 		}
// 		if (result instanceof Throwable) {
// 			Throwable e = (Throwable) result;
// 			throw new RuntimeException(e);
// 		}
// 	}
// 
// 	public void putResultAndReturn(Object result) {
// 		this.result = result;
// 		synchronized (lock) {
// 			lock.notifyAll();
// 		}
// 	}
// 	
// 	public void returnWithVoid(){
// 		synchronized (lock) {
// 			lock.notifyAll();
// 		}
// 	}
// 	
// 	@Deprecated
// 	/**
// 	 * Deprecated: not in use
// 	 * @param detail
// 	 * @return
// 	 */
// 	public CallResultFuture putDetail(JSONObject detail){
// 		this.detail = detail;
// 		return this;
// 	}
// 
// 	public Object getResult(){
// 		return result;
// 	}
// 
// 	public JSONObject getDetail() {
// 		return detail;
// 	}
// 
// 	public void setDetail(JSONObject detail) {
// 		this.detail = detail;
// 	}
// 
// 	public Class<?> getReturnType() {
// 		return returnType;
// 	}
// 
// 	public void setReturnType(Class<?> returnType) {
// 		this.returnType = returnType;
// 	}
// 
// }
// 
// Path: mappingrpc-connector/src/main/java/github/mappingrpc/core/rpc/ServiceInvocationHandler.java
// public class ServiceInvocationHandler implements InvocationHandler {
// 	Logger log = LoggerFactory.getLogger(ServiceInvocationHandler.class);
// 
// 	private MappingPackageClient rpcClient;
// 	Map<Method, ApiProxyMeta> apiHolder = new HashMap<>();
// 
// 	public ServiceInvocationHandler(MappingPackageClient rpcClient) {
// 		this.rpcClient = rpcClient;
// 	}
// 
// 	public Object generateProxy(String serviceInterface) {
// 		Class<?> clazz;
// 		try {
// 			clazz = Class.forName(serviceInterface);// FIXME
// 		} catch (ClassNotFoundException e) {
// 			throw new RuntimeException(e);
// 		}
// 
// 		for (Method method : clazz.getMethods()) {
// 			RequestMapping requestMapping = method.getAnnotation(RequestMapping.class);
// 			if (requestMapping != null) {
// 				ApiProxyMeta apiMeta = new ApiProxyMeta();
// 				apiMeta.setRequestUrl(requestMapping.value());
// 				apiMeta.setParameterTypes(method.getParameterTypes());
// 				apiMeta.setReturnType(method.getReturnType());
// 				apiHolder.put(method, apiMeta);
// 			}
// 		}
// 
// 		Object proxy = Proxy.newProxyInstance(clazz.getClassLoader(), new Class[] { clazz }, this);
// 		return proxy;
// 	}
// 
// 	@Override
// 	public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
// 		// TODO 过滤掉hashCode()/toString()/equals等本地方法
// 
// 		ApiProxyMeta meta = apiHolder.get(method);
// 		return rpcClient.sendRpc(meta.getRequestUrl(), args, meta.getReturnType(), 300000);
// 	}
// 
// }


import github.mappingrpc.core.rpc.CallResultFuture;
import github.mappingrpc.core.rpc.ServiceInvocationHandler;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ExecutorService;
package github.mappingrpc.core.metadata;




public class MetaHolder {
	private Map<String, ProviderMeta> providerHolder = new HashMap<>();
	private Map<String, ServiceInvocationHandler> clientProxyHolder = new HashMap<>();
	private Map<Long, CallResultFuture> requestPool = new ConcurrentHashMap<>();
	private long feature1;
	private ExecutorService threadPool;
	private ExecutorService sysThreadPool;// for QOS

	public Map<String, ProviderMeta> getProviderHolder() {
		return providerHolder;
	}

	public Map<String, ServiceInvocationHandler> getClientProxyHolder() {
		return clientProxyHolder;
	}

	public Map<Long, CallResultFuture> getRequestPool() {
		return requestPool;
	}

// Path: mappingrpc-connector/src/main/java/github/mappingrpc/core/rpc/CallResultFuture.java
// public class CallResultFuture {
// 	private Object result;
// 	private JSONObject detail;
// 	Object lock = new Object();
// 
// 	private Class<?> returnType;
// 
// 	public CallResultFuture(Class<?> returnType) {
// 		this.returnType = returnType;
// 	}
// 
// 	public void waitReturn(long timeoutInMs) {
// 		synchronized (lock) {
// 			try {
// 				lock.wait(timeoutInMs);
// 			} catch (InterruptedException e) {
// 				e.printStackTrace();
// 				throw new RuntimeException(e);
// 			}
// 		}
// 
// 		if (result == null && returnType != null) {
// 			throw new TimeoutException("{timeoutInMs:" + timeoutInMs + "}");
// 		}
// 		if (result instanceof Throwable) {
// 			Throwable e = (Throwable) result;
// 			throw new RuntimeException(e);
// 		}
// 	}
// 
// 	public void putResultAndReturn(Object result) {
// 		this.result = result;
// 		synchronized (lock) {
// 			lock.notifyAll();
// 		}
// 	}
// 	
// 	public void returnWithVoid(){
// 		synchronized (lock) {
// 			lock.notifyAll();
// 		}
// 	}
// 	
// 	@Deprecated
// 	/**
// 	 * Deprecated: not in use
// 	 * @param detail
// 	 * @return
// 	 */
// 	public CallResultFuture putDetail(JSONObject detail){
// 		this.detail = detail;
// 		return this;
// 	}
// 
// 	public Object getResult(){
// 		return result;
// 	}
// 
// 	public JSONObject getDetail() {
// 		return detail;
// 	}
// 
// 	public void setDetail(JSONObject detail) {
// 		this.detail = detail;
// 	}
// 
// 	public Class<?> getReturnType() {
// 		return returnType;
// 	}
// 
// 	public void setReturnType(Class<?> returnType) {
// 		this.returnType = returnType;
// 	}
// 
// }
// 
// Path: mappingrpc-connector/src/main/java/github/mappingrpc/core/rpc/ServiceInvocationHandler.java
// public class ServiceInvocationHandler implements InvocationHandler {
// 	Logger log = LoggerFactory.getLogger(ServiceInvocationHandler.class);
// 
// 	private MappingPackageClient rpcClient;
// 	Map<Method, ApiProxyMeta> apiHolder = new HashMap<>();
// 
// 	public ServiceInvocationHandler(MappingPackageClient rpcClient) {
// 		this.rpcClient = rpcClient;
// 	}
// 
// 	public Object generateProxy(String serviceInterface) {
// 		Class<?> clazz;
// 		try {
// 			clazz = Class.forName(serviceInterface);// FIXME
// 		} catch (ClassNotFoundException e) {
// 			throw new RuntimeException(e);
// 		}
// 
// 		for (Method method : clazz.getMethods()) {
// 			RequestMapping requestMapping = method.getAnnotation(RequestMapping.class);
// 			if (requestMapping != null) {
// 				ApiProxyMeta apiMeta = new ApiProxyMeta();
// 				apiMeta.setRequestUrl(requestMapping.value());
// 				apiMeta.setParameterTypes(method.getParameterTypes());
// 				apiMeta.setReturnType(method.getReturnType());
// 				apiHolder.put(method, apiMeta);
// 			}
// 		}
// 
// 		Object proxy = Proxy.newProxyInstance(clazz.getClassLoader(), new Class[] { clazz }, this);
// 		return proxy;
// 	}
// 
// 	@Override
// 	public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
// 		// TODO 过滤掉hashCode()/toString()/equals等本地方法
// 
// 		ApiProxyMeta meta = apiHolder.get(method);
// 		return rpcClient.sendRpc(meta.getRequestUrl(), args, meta.getReturnType(), 300000);
// 	}
// 
// }


// Path: mappingrpc-connector/src/main/java/github/mappingrpc/core/metadata/MetaHolder.java
import github.mappingrpc.core.rpc.CallResultFuture;
import github.mappingrpc.core.rpc.ServiceInvocationHandler;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ExecutorService;

package github.mappingrpc.core.metadata;




public class MetaHolder {
	private Map<String, ProviderMeta> providerHolder = new HashMap<>();
	private Map<String, ServiceInvocationHandler> clientProxyHolder = new HashMap<>();
	private Map<Long, CallResultFuture> requestPool = new ConcurrentHashMap<>();
	private long feature1;
	private ExecutorService threadPool;
	private ExecutorService sysThreadPool;// for QOS

	public Map<String, ProviderMeta> getProviderHolder() {
		return providerHolder;
	}

	public Map<String, ServiceInvocationHandler> getClientProxyHolder() {
		return clientProxyHolder;
	}

	public Map<Long, CallResultFuture> getRequestPool() {
		return requestPool;
	}

	public void setRequestPool(Map<Long, CallResultFuture> requestPool) {