📄 serialized-form.html
字号:
<DL><DD><code>readObject</code> for custom serialization. <p>This method reads this object's serialized form for this class as follows: <p>The <code>readObject</code> method is invoked on <code>in</code> to read this object's unique identifier (a <A HREF="java/rmi/server/UID.html"><CODE>UID</CODE></A> instance). <p>Next, the <code>readUTF</code> method is invoked on <code>in</code> to read the external ref type name of the <code>RemoteRef</code> instance for this object's activator. Next, the <code>RemoteRef</code> instance is created of an implementation-specific class corresponding to the external ref type name (returned by <code>readUTF</code>), and the <code>readExternal</code> method is invoked on that <code>RemoteRef</code> instance to read the external form corresponding to the external ref type name. <p>Note: If the external ref type name is <code>"UnicastRef"</code>, <code>"UnicastServerRef"</code>, <code>"UnicastRef2"</code>, <code>"UnicastServerRef2"</code>, <code>"ActivatableRef"</code>, or <code>"ActivatableServerRef"</code>, a corresponding implementation-specific class must be found, and its <code>readExternal</code> method must read the serial data for that external ref type name as specified to be written in the <b>serialData</b> documentation for this class. If the external ref type name is any other string (of non-zero length), a <code>ClassNotFoundException</code> will be thrown, unless the implementation provides an implementation-specific class corresponding to that external ref type name, in which case the <code>RemoteRef</code> will be an instance of that implementation-specific class.</DL><HR><A NAME="writeObject(java.io.ObjectOutputStream)"><!-- --></A><H3>writeObject</H3><PRE>private void <B>writeObject</B>(java.io.ObjectOutputStream out) throws java.io.IOException, java.lang.ClassNotFoundException</PRE><DL><DD><code>writeObject</code> for custom serialization. <p>This method writes this object's serialized form for this class as follows: <p>The <code>writeObject</code> method is invoked on <code>out</code> passing this object's unique identifier (a <A HREF="java/rmi/server/UID.html"><CODE>UID</CODE></A> instance) as the argument. <p>Next, the <A HREF="java/rmi/server/RemoteRef.html#getRefClass(java.io.ObjectOutput)"><CODE>getRefClass</CODE></A> method is invoked on the activator's <code>RemoteRef</code> instance to obtain its external ref type name. Next, the <code>writeUTF</code> method is invoked on <code>out</code> with the value returned by <code>getRefClass</code>, and then the <code>writeExternal</code> method is invoked on the <code>RemoteRef</code> instance passing <code>out</code> as the argument.<DD><DL><DT><B>Serial Data:</B><DD>The serialized data for this class comprises a <code>java.rmi.server.UID</code> (written with <code>ObjectOutput.writeObject</code>) followed by the external ref type name of the activator's <code>RemoteRef</code> instance (a string written with <code>ObjectOutput.writeUTF</code>), followed by the external form of the <code>RemoteRef</code> instance as written by its <code>writeExternal</code> method. <p>The external ref type name of the <code>RemoteRef</Code> instance is determined using the definitions of external ref type names specified in the <A HREF="java/rmi/server/RemoteObject.html"><CODE>RemoteObject</CODE></A> <code>writeObject</code> method <b>serialData</b> specification. Similarly, the data written by the <code>writeExternal</code> method and read by the <code>readExternal</code> method of <code>RemoteRef</code> implementation classes corresponding to each of the defined external ref type names is specified in the <A HREF="java/rmi/server/RemoteObject.html"><CODE>RemoteObject</CODE></A> <code>writeObject</code> method <b>serialData</b> specification.</DL></DD></DL><P><A NAME="java.rmi.activation.UnknownObjectException"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor"><TD COLSPAN=2><FONT SIZE="+2"><B>Class <A HREF="java/rmi/activation/UnknownObjectException.html">java.rmi.activation.UnknownObjectException</A> implements Serializable</B></FONT></TD></TR></TABLE><P><P><HR SIZE="4" NOSHADE><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor"><TD ALIGN="center"><FONT SIZE="+2"><B>Package</B> <B>java.rmi.dgc</B></FONT></TD></TR></TABLE><P><A NAME="java.rmi.dgc.Lease"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor"><TD COLSPAN=2><FONT SIZE="+2"><B>Class <A HREF="java/rmi/dgc/Lease.html">java.rmi.dgc.Lease</A> implements Serializable</B></FONT></TD></TR></TABLE><P><A NAME="serializedForm"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Serialized Fields</B></FONT></TD></TR></TABLE><H3>vmid</H3><PRE><A HREF="java/rmi/dgc/VMID.html">VMID</A> <B>vmid</B></PRE><DL><DT><DD>Virtual Machine ID with which this Lease is associated.<DD><DL><DT><B>See Also: </B><DD><A HREF="java/rmi/dgc/Lease.html#getVMID()"><CODE>Lease.getVMID()</CODE></A></DL></DD></DL><HR><H3>value</H3><PRE>long <B>value</B></PRE><DL><DT><DD>Duration of this lease.<DD><DL><DT><B>See Also: </B><DD><A HREF="java/rmi/dgc/Lease.html#getValue()"><CODE>Lease.getValue()</CODE></A></DL></DD></DL><P><A NAME="java.rmi.dgc.VMID"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor"><TD COLSPAN=2><FONT SIZE="+2"><B>Class <A HREF="java/rmi/dgc/VMID.html">java.rmi.dgc.VMID</A> implements Serializable</B></FONT></TD></TR></TABLE><P><A NAME="serializedForm"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Serialized Fields</B></FONT></TD></TR></TABLE><H3>addr</H3><PRE>byte[] <B>addr</B></PRE><DL><DT><DD>array of bytes uniquely identifying host created on</DL><HR><H3>uid</H3><PRE><A HREF="java/rmi/server/UID.html">UID</A> <B>uid</B></PRE><DL><DT><DD>unique identifier with respect to host created on</DL><P><HR SIZE="4" NOSHADE><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor"><TD ALIGN="center"><FONT SIZE="+2"><B>Package</B> <B>java.rmi.server</B></FONT></TD></TR></TABLE><P><A NAME="java.rmi.server.ExportException"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor"><TD COLSPAN=2><FONT SIZE="+2"><B>Class <A HREF="java/rmi/server/ExportException.html">java.rmi.server.ExportException</A> implements Serializable</B></FONT></TD></TR></TABLE><P><P><A NAME="java.rmi.server.ObjID"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor"><TD COLSPAN=2><FONT SIZE="+2"><B>Class <A HREF="java/rmi/server/ObjID.html">java.rmi.server.ObjID</A> implements Serializable</B></FONT></TD></TR></TABLE><P><A NAME="serializedForm"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Serialized Fields</B></FONT></TD></TR></TABLE><H3>objNum</H3><PRE>long <B>objNum</B></PRE><DL><DT><DD>object number<DD><DL><DT><B>See Also: </B><DD><A HREF="java/rmi/server/ObjID.html#hashCode()"><CODE>ObjID.hashCode()</CODE></A></DL></DD></DL><HR><H3>space</H3><PRE><A HREF="java/rmi/server/UID.html">UID</A> <B>space</B></PRE><DL><DT><DD>address space identifier (unique to host)</DL><P><A NAME="java.rmi.server.RemoteObject"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor"><TD COLSPAN=2><FONT SIZE="+2"><B>Class <A HREF="java/rmi/server/RemoteObject.html">java.rmi.server.RemoteObject</A> implements Serializable</B></FONT></TD></TR></TABLE><P><A NAME="serialized_methods"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Serialization Methods</B></FONT></TD></TR></TABLE><P><A NAME="readObject(java.io.ObjectInputStream)"><!-- --></A><H3>readObject</H3><PRE>private void <B>readObject</B>(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException</PRE><DL><DD><code>readObject</code> for custom serialization. <p>This method reads this object's serialized form for this class as follows: <p>The <code>readUTF</code> method is invoked on <code>in</code> to read the external ref type name for the <code>RemoteRef</code> instance to be filled in to this object's <code>ref</code> field. If the string returned by <code>readUTF</code> has length zero, the <code>readObject</code> method is invoked on <code>in</code>, and than the value returned by <code>readObject</code> is cast to <code>RemoteRef</code> and this object's <code>ref</code> field is set to that value. Otherwise, this object's <code>ref</code> field is set to a <code>RemoteRef</code> instance that is created of an implementation-specific class corresponding to the external ref type name returned by <code>readUTF</code>, and then the <code>readExternal</code> method is invoked on this object's <code>ref</code> field. <p>If the external ref type name is <code>"UnicastRef"</code>, <code>"UnicastServerRef"</code>, <code>"UnicastRef2"</code>, <code>"UnicastServerRef2"</code>, or <code>"ActivatableRef"</code>, a corresponding implementation-specific class must be found, and its <code>readExternal</code> method must read the serial data for that external ref type name as specified to be written in the <b>serialData</b> documentation for this class. If the external ref type name is any other string (of non-zero length), a <code>ClassNotFoundException</code> will be thrown, unless the implementation provides an implementation-specific class corresponding to that external ref type name, in which case this object's <code>ref</code> field will be set to an instance of that implementation-specific class.</DL><HR><A NAME="writeObject(java.io.ObjectOutputStream)"><!-- --></A><H3>writeObject</H3><PRE>private void <B>writeObject</B>(java.io.ObjectOutputStream out) throws java.io.IOException, java.lang.ClassNotFoundException</PRE><DL><DD><code>writeObject</code> for custom serialization. <p>This method writes this object's serialized form for this class as follows: <p>The <A HREF="java/rmi/server/RemoteRef.html#getRefClass(java.io.ObjectOutput)"><CODE>getRefClass</CODE></A> method is invoked on this object's <code>ref</code> field to obtain its external ref type name. If the value returned by <code>getRefClass</code> was a non-<code>null</code> string of length greater than zero, the <code>writeUTF</code> method is invoked on <code>out</code> with the value returned by <code>getRefClass</code>, and then the <code>writeExternal</code> method is invoked on this object's <code>ref</code> field passing <code>out</code> as the argument; otherwise, the <code>writeUTF</code> method is invoked on <code>out</code> with a zero-length string (<code>""</code>), and then the <code>writeObject</code> method is invoked on <code>out</code> passing this object's <code>ref</code> field as the argument.<DD><DL><DT><B>Serial Data:</B><DD>The serialized data for this class comprises a string (written with <code>ObjectOutput.writeUTF</code>) that is either the external ref type name of the contained <code>RemoteRef</code> instance (the <code>ref</code> field) or a zero-length string, followed by either the external form of the <code>ref</code> field as written by its <code>writeExternal</code> method if the string was of non-zero length, or the serialized form of the <code>ref</code> field as written by passing it to the serialization stream's <code>writeObject</code> if the string was of zero length. <p>If this object is an instance of <code>java.rmi.server.UnicastRemoteObject</code> that does not use custom socket factories, the external ref type name is <code>"UnicastServerRef"</code>. If this object is an instance of <code>UnicastRemoteObject</code> that does use custom socket factories, the external ref type name is <code>"UnicastServerRef2"</code>. <p>If this object is an instance of <code>java.rmi.server.RemoteStub</code> that was returned from any of the <code>UnicastRemoteObject.exportObject</code> methods and custom socket factories are not used, the external ref type name is <code>"UnicastRef"</code>. If this object is an instance of
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -