当前位置: 首页>>代码示例>>Java>>正文


Java ObjID.write方法代码示例

本文整理汇总了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);
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:21,代码来源:StreamRemoteCall.java

示例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();
}
 
开发者ID:meisamhe,项目名称:GPLshared,代码行数:37,代码来源:Reiliable_RemoteCall.java


注:本文中的java.rmi.server.ObjID.write方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。