package com.lingbobu.flashdb.common.remote;
import java.net.MalformedURLException;
import com.caucho.hessian.client.HessianProxyFactory;
public class Hessian {
@SuppressWarnings("unchecked")
public static <T> T connect(String serviceUrl, Class<T> serviceInterface) {
HessianProxyFactory factory = new HessianProxyFactory();
try {
return (T) factory.create(serviceInterface, serviceUrl);
} catch (MalformedURLException e) {
throw new RuntimeException(e);
}
}
}