本文整理汇总了Java中sun.rmi.transport.proxy.RMIHttpToPortSocketFactory类的典型用法代码示例。如果您正苦于以下问题:Java RMIHttpToPortSocketFactory类的具体用法?Java RMIHttpToPortSocketFactory怎么用?Java RMIHttpToPortSocketFactory使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
RMIHttpToPortSocketFactory类属于sun.rmi.transport.proxy包,在下文中一共展示了RMIHttpToPortSocketFactory类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getSunSocketFactory
import sun.rmi.transport.proxy.RMIHttpToPortSocketFactory; //导入依赖的package包/类
public static RMISocketFactory getSunSocketFactory(String type) {
if (type.equalsIgnoreCase("default")) {
System.out.println("No forced SocketFactory, enabled DefaultSocketFactory supporting Fallback mode");
return new RMIDirectSocketFactory();
} else if (type.equalsIgnoreCase("cgi")) {
System.out.println("RMIToCGISocketFactory enabled...");
return new RMIHttpToCGISocketFactory();
} else if (type.equalsIgnoreCase("http")) {
System.out.println("RMIHttpToPortSocketFactory enabled...");
return new RMIHttpToPortSocketFactory();
} else if (type.equalsIgnoreCase("direct")) {
System.out.println("RMIDirectSocketFactory enabled...");
return new RMIDirectSocketFactory();
}
return new RMIDirectSocketFactory(); // if null returns default socket factory
}
示例2: createSocket
import sun.rmi.transport.proxy.RMIHttpToPortSocketFactory; //导入依赖的package包/类
public Socket createSocket(String h, int p)
throws IOException
{
return ((new RMIHttpToPortSocketFactory()).createSocket(h, p));
}