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


Java NotSerializableException.initCause方法代码示例

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


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

示例1: fromData

import java.io.NotSerializableException; //导入方法依赖的package包/类
@Override
public void fromData(DataInput in) throws IOException, ClassNotFoundException {
  super.fromData(in);
  this.msgNum = in.readInt();
  this.lastMsg = in.readBoolean();
  this.processorId = in.readInt();
  try {
    this.result = DataSerializer.readObject(in);
  } catch (Exception e) { // bug fix 40670
    // Seems odd to throw a NonSerializableEx when it has already been
    // serialized and we are failing because we can't deserialize.
    NotSerializableException ioEx = new NotSerializableException();
    ioEx.initCause(e);
    throw ioEx;
  }
}
 
开发者ID:ampool,项目名称:monarch,代码行数:17,代码来源:FunctionStreamingReplyMessage.java

示例2: toData

import java.io.NotSerializableException; //导入方法依赖的package包/类
@Override
public void toData(DataOutput out) throws IOException {
  super.toData(out);
  out.writeInt(this.msgNum);
  out.writeBoolean(this.lastMsg);
  out.writeInt(this.processorId);

  // soubhik. fix for ticket 40670
  try {
    DataSerializer.writeObject(this.result, out);
  } catch (Exception ex) {
    if (ex instanceof CancelException) {
      throw new DistributedSystemDisconnectedException(ex);
    }
    NotSerializableException ioEx =
        new NotSerializableException(this.result.getClass().getName());
    ioEx.initCause(ex);
    throw ioEx;
  }
}
 
开发者ID:ampool,项目名称:monarch,代码行数:21,代码来源:FunctionStreamingReplyMessage.java

示例3: writeReplace

import java.io.NotSerializableException; //导入方法依赖的package包/类
/**
 * Replaces the {@code CertPath} to be serialized with a
 * {@code CertPathRep} object.
 *
 * @return the {@code CertPathRep} to be serialized
 *
 * @throws ObjectStreamException if a {@code CertPathRep} object
 * representing this certification path could not be created
 */
protected Object writeReplace() throws ObjectStreamException {
    try {
        return new CertPathRep(type, getEncoded());
    } catch (CertificateException ce) {
        NotSerializableException nse =
            new NotSerializableException
                ("java.security.cert.CertPath: " + type);
        nse.initCause(ce);
        throw nse;
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:21,代码来源:CertPath.java

示例4: readResolve

import java.io.NotSerializableException; //导入方法依赖的package包/类
/**
 * Returns a {@code CertPath} constructed from the type and data.
 *
 * @return the resolved {@code CertPath} object
 *
 * @throws ObjectStreamException if a {@code CertPath} could not
 * be constructed
 */
protected Object readResolve() throws ObjectStreamException {
    try {
        CertificateFactory cf = CertificateFactory.getInstance(type);
        return cf.generateCertPath(new ByteArrayInputStream(data));
    } catch (CertificateException ce) {
        NotSerializableException nse =
            new NotSerializableException
                ("java.security.cert.CertPath: " + type);
        nse.initCause(ce);
        throw nse;
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:21,代码来源:CertPath.java

示例5: rethrowDeserializationException

import java.io.NotSerializableException; //导入方法依赖的package包/类
private void rethrowDeserializationException(IOException ioe)
        throws ClassNotFoundException, IOException {
    // specially treating for an UnmarshalException
    if (ioe instanceof UnmarshalException) {
        NotSerializableException nse = new NotSerializableException();
        nse.initCause(ioe);
        throw nse; // the fix of 6937053 made ClientNotifForwarder.fetchNotifs
                   // fetch one by one with UnmarshalException
    }

    // Not serialization problem, return.
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:13,代码来源:RMIConnector.java


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