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


Java RemoteRef.readExternal方法代码示例

本文整理汇总了Java中java.rmi.server.RemoteRef.readExternal方法的典型用法代码示例。如果您正苦于以下问题:Java RemoteRef.readExternal方法的具体用法?Java RemoteRef.readExternal怎么用?Java RemoteRef.readExternal使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在java.rmi.server.RemoteRef的用法示例。


在下文中一共展示了RemoteRef.readExternal方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: readExternal

import java.rmi.server.RemoteRef; //导入方法依赖的package包/类
/**
 * To obtain the description of the Serialization of this class see the Serialized form of
 * java.rmi.server.RemoteObject.
 */
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
    id = (ActivationID) in.readObject();

    String s = in.readUTF();

    if (s.equals("")) { //$NON-NLS-1$
        return;
    }
    Class extRefTypeClass = Class.forName(RemoteRef.packagePrefix +"."+ s); //$NON-NLS-1$

    try {
        ref = (RemoteRef)extRefTypeClass.newInstance();
    }
    catch(Throwable  t) {
        // rmi.73=Instantiation failed.
        throw new ClassNotFoundException(Messages.getString("rmi.73"), t); //$NON-NLS-1$
    }
    ref.readExternal(in);
}
 
开发者ID:shannah,项目名称:cn1,代码行数:24,代码来源:ActivatableRef.java

示例2: readObject

import java.rmi.server.RemoteRef; //导入方法依赖的package包/类
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
    // rmi.log.06=ActivationID.readObject:
    rlog.log(RMILog.VERBOSE, Messages.getString("rmi.log.06")); //$NON-NLS-1$
    try {
        uid = (UID) in.readObject();
        // rmi.log.07=UID={0}
        rlog.log(RMILog.VERBOSE, Messages.getString("rmi.log.07", uid)); //$NON-NLS-1$
        String refType = in.readUTF();
        // rmi.log.08=refType={0}
        rlog.log(RMILog.VERBOSE, Messages.getString("rmi.log.08", refType)); //$NON-NLS-1$
        Class<?> cl = Class.forName("org.apache.harmony.rmi.remoteref." //$NON-NLS-1$
                + refType);
        RemoteRef ref = (RemoteRef) cl.newInstance();
        // rmi.log.09=ref = {0}
        rlog.log(RMILog.VERBOSE, Messages.getString("rmi.log.09", ref)); //$NON-NLS-1$
        ref.readExternal(in);
        // rmi.log.0A=readExternal finished successfully.
        rlog.log(RMILog.VERBOSE, Messages.getString("rmi.log.0A")); //$NON-NLS-1$
        Class<?> activator_class = RMIClassLoader.loadClass((String) null,
                "org.apache.harmony.rmi.activation.Rmid_Stub"); //$NON-NLS-1$
        Class[] constructor_parameter_classes = { RemoteRef.class };
        Constructor<?> constructor = activator_class
                .getConstructor(constructor_parameter_classes);
        Object[] constructor_parameters = { ref };
        activator = (Activator) constructor.newInstance(constructor_parameters);
        // rmi.log.0B=ActivationID.readObject COMPLETED.
        rlog.log(RMILog.VERBOSE, Messages.getString("rmi.log.0B")); //$NON-NLS-1$
    } catch (Throwable t) {
        // rmi.09=Unable to deserialize ActivationID: {0}
        throw new IOException(Messages.getString("rmi.09", t)); //$NON-NLS-1$
    }
}
 
开发者ID:shannah,项目名称:cn1,代码行数:33,代码来源:ActivationID.java


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