// Path: mappingrpc-connector/src/main/java/github/mappingrpc/api/exception/TimeoutException.java
// public class TimeoutException extends RuntimeException {
// 
// 	private static final long serialVersionUID = 1L;
// 
// 	public TimeoutException(String msg){
// 		super(msg);
// 	}
// }


import github.mappingrpc.api.exception.TimeoutException;
import com.alibaba.fastjson.JSONObject;
package github.mappingrpc.core.rpc;



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) {
// Path: mappingrpc-connector/src/main/java/github/mappingrpc/api/exception/TimeoutException.java
// public class TimeoutException extends RuntimeException {
// 
// 	private static final long serialVersionUID = 1L;
// 
// 	public TimeoutException(String msg){
// 		super(msg);
// 	}
// }


// Path: mappingrpc-connector/src/main/java/github/mappingrpc/core/rpc/CallResultFuture.java
import github.mappingrpc.api.exception.TimeoutException;
import com.alibaba.fastjson.JSONObject;

package github.mappingrpc.core.rpc;



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 + "}");