本文整理汇总了Java中java.rmi.server.ObjID.write方法的典型用法代码示例。如果您正苦于以下问题:Java ObjID.write方法的具体用法?Java ObjID.write怎么用?Java ObjID.write使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.rmi.server.ObjID
的用法示例。
在下文中一共展示了ObjID.write方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: StreamRemoteCall
import java.rmi.server.ObjID; //导入方法依赖的package包/类
public StreamRemoteCall(Connection c, ObjID id, int op, long hash)
throws RemoteException
{
try {
conn = c;
Transport.transportLog.log(Log.VERBOSE,
"write remote call header...");
// write out remote call header info...
// call header, part 1 (read by Transport)
conn.getOutputStream().write(TransportConstants.Call);
getOutputStream(); // creates a MarshalOutputStream
id.write(out); // object id (target of call)
// call header, part 2 (read by Dispatcher)
out.writeInt(op); // method number (operation index)
out.writeLong(hash); // stub/skeleton hash
} catch (IOException e) {
throw new MarshalException("Error marshaling call header", e);
}
}
示例2: Reliable_RemoteCall
import java.rmi.server.ObjID; //导入方法依赖的package包/类
Reliable_RemoteCall(DataInputStream theis, DataOutputStream theos, ObjID objid,
int i, long j,FrameworkListener frameworkListener) throws Exception {
this.frameworkListener=frameworkListener;
debug = new Debug();
// DEBUG(System.out.println("NinjaRemoteCall client constructor
// called!"));
debug.print("NinjaRemoteCall client constructor called!");
datais = theis;
dataos = theos;
// Write call header
// DEBUG(System.out.println("NinjaRemoteCall: Getting
// DataOutputStream"));
debug.print("NinjaRemoteCall: Getting DataOutputStream");
// DataOutputStream dataos = new DataOutputStream(os);
// DEBUG(System.out.println("NinjaRemoteCall: Writing call msg 0x50"));
debug.print("NinjaRemoteCall: Writing call msg 0x50");
dataos.writeByte((byte)0x50);
// DEBUG(System.out.println("NinjaRemoteCall: Getting
// ObjectOutputStream"));
debug.print("NinjaRemoteCall: Getting ObjectOutputStream");
objout = new NinjaObjectOutputStream(frameworkListener);
// DEBUG(System.out.println("NinjaRemoteCall: Writing objid"));
debug.print("NinjaRemoteCall: Writing objid");
objid.write(objout);
// DEBUG(System.out.println("NinjaRemoteCall: Writing op: "+i));
debug.print("NinjaRemoteCall: Writing op: " + i);
objout.writeInt(i);
// DEBUG(System.out.println("NinjaRemoteCall: Writing hash: "+j));
debug.print("NinjaRemoteCall: Writing hash: " + j);
objout.writeLong(j);
// objout.flush();
}