public class RMIUtil
extends java.lang.Object
public static <T> T getProxy(java.lang.String host,
int port,
java.lang.String serviceName,
java.lang.Class<T> serviceInterface)
throws java.lang.Exception
String host = "localhost";
int port = 1099;
String serviceName = "sampleService";
Class<SampleService> serviceInterface = com.seeyon.v3x.rmi.server.SampleService.class;
SampleService service = RMIUtil.getProxy(host, port, serviceName,
serviceInterface);
T - host - 服务的IPport - 服务的端口serviceName - 服务名称serviceInterface - 服务接口java.lang.Exceptionpublic static <T> T getProxy(java.lang.String serviceUrl,
java.lang.Class<T> serviceInterface)
throws java.lang.Exception
T - serviceUrl - RMI服务的的URL,形如rmi://ip:port/serviceserviceInterface - 服务接口java.lang.Exception