本文整理汇总了Java中sun.rmi.transport.tcp.TCPEndpoint.readHostPortFormat方法的典型用法代码示例。如果您正苦于以下问题:Java TCPEndpoint.readHostPortFormat方法的具体用法?Java TCPEndpoint.readHostPortFormat怎么用?Java TCPEndpoint.readHostPortFormat使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sun.rmi.transport.tcp.TCPEndpoint
的用法示例。
在下文中一共展示了TCPEndpoint.readHostPortFormat方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: read
import sun.rmi.transport.tcp.TCPEndpoint; //导入方法依赖的package包/类
public static LiveRef read(ObjectInput in, boolean useNewFormat)
throws IOException, ClassNotFoundException
{
Endpoint ep;
ObjID id;
// Now read in the endpoint, id, and result flag
// (need to choose whether or not to read old JDK1.1 endpoint format)
if (useNewFormat) {
ep = TCPEndpoint.read(in);
} else {
ep = TCPEndpoint.readHostPortFormat(in);
}
id = ObjID.read(in);
boolean isResultStream = in.readBoolean();
LiveRef ref = new LiveRef(id, ep, false);
if (in instanceof ConnectionInputStream) {
ConnectionInputStream stream = (ConnectionInputStream)in;
// save ref to send "dirty" call after all args/returns
// have been unmarshaled.
stream.saveRef(ref);
if (isResultStream) {
// set flag in stream indicating that remote objects were
// unmarshaled. A DGC ack should be sent by the transport.
stream.setAckNeeded();
}
} else {
DGCClient.registerRefs(ep, Arrays.asList(new LiveRef[] { ref }));
}
return ref;
}