activatable.html

来自「API資料大全」· HTML 代码 · 共 735 行 · 第 1/4 页

HTML
735 行
字号
 A concrete subclass of this class must call this constructor to register and export the object during <i>initial</i> construction.  As a side-effect of activatable object construction, the remote object is both "registered" with the activation system and "exported" (on an anonymous port if port=0) to the RMI runtime so that it is available to accept incoming calls from clients.<DD><DL><DT><B>Parameters:</B><DD><CODE>location</CODE> - the location for classes for this object<DD><CODE>data</CODE> - the object's initialization data<DD><CODE>restart</CODE> - if true, the object is restarted (reactivated) when either the activator is restarted or the object's activation group is restarted after an unexpected crash; if false, the object is only activated on demand.  Specifying <code>restart</code> to be <code>true</code> does not force an initial immediate activation of a newly registered object;  initial activation is lazy.<DD><CODE>port</CODE> - the port on which the object is exported (an anonymous port is used if port=0)<DD><CODE>csf</CODE> - the client-side socket factory for making calls to the remote object<DD><CODE>ssf</CODE> - the server-side socket factory for receiving remote calls<DT><B>Throws:</B><DD><CODE><A HREF="../../../java/rmi/activation/ActivationException.html">ActivationException</A></CODE> - if object registration fails.<DD><CODE><A HREF="../../../java/rmi/RemoteException.html">RemoteException</A></CODE> - if either of the following fails: a) registering the object with the activation system or b) exporting the object to the RMI runtime.<DT><B>Since: </B><DD>1.2</DD></DL></DD></DL><HR><A NAME="Activatable(java.rmi.activation.ActivationID, int)"><!-- --></A><H3>Activatable</H3><PRE>protected <B>Activatable</B>(<A HREF="../../../java/rmi/activation/ActivationID.html">ActivationID</A>&nbsp;id,                      int&nbsp;port)               throws <A HREF="../../../java/rmi/RemoteException.html">RemoteException</A></PRE><DL><DD>Constructor used to activate/export the object on a specified port. An "activatable" remote object must have a constructor that takes two arguments: <ul> <li>the object's activation identifier (<code>ActivationID</code>), and <li>the object's initialization data (a <code>MarshalledObject</code>). </ul><p> A concrete subclass of this class must call this constructor when it is <i>activated</i> via the two parameter constructor described above. As a side-effect of construction, the remote object is "exported" to the RMI runtime (on the specified <code>port</code>) and is available to accept incoming calls from clients.<DD><DL><DT><B>Parameters:</B><DD><CODE>id</CODE> - activation identifier for the object<DD><CODE>port</CODE> - the port number on which the object is exported<DT><B>Throws:</B><DD><CODE><A HREF="../../../java/rmi/RemoteException.html">RemoteException</A></CODE> - if exporting the object to the RMI runtime fails<DT><B>Since: </B><DD>1.2</DD></DL></DD></DL><HR><A NAME="Activatable(java.rmi.activation.ActivationID, int, java.rmi.server.RMIClientSocketFactory, java.rmi.server.RMIServerSocketFactory)"><!-- --></A><H3>Activatable</H3><PRE>protected <B>Activatable</B>(<A HREF="../../../java/rmi/activation/ActivationID.html">ActivationID</A>&nbsp;id,                      int&nbsp;port,                      <A HREF="../../../java/rmi/server/RMIClientSocketFactory.html">RMIClientSocketFactory</A>&nbsp;csf,                      <A HREF="../../../java/rmi/server/RMIServerSocketFactory.html">RMIServerSocketFactory</A>&nbsp;ssf)               throws <A HREF="../../../java/rmi/RemoteException.html">RemoteException</A></PRE><DL><DD>Constructor used to activate/export the object on a specified port. An "activatable" remote object must have a constructor that takes two arguments: <ul> <li>the object's activation identifier (<code>ActivationID</code>), and <li>the object's initialization data (a <code>MarshalledObject</code>). </ul><p> A concrete subclass of this class must call this constructor when it is <i>activated</i> via the two parameter constructor described above. As a side-effect of construction, the remote object is "exported" to the RMI runtime (on the specified <code>port</code>) and is available to accept incoming calls from clients.<DD><DL><DT><B>Parameters:</B><DD><CODE>id</CODE> - activation identifier for the object<DD><CODE>port</CODE> - the port number on which the object is exported<DD><CODE>csf</CODE> - the client-side socket factory for making calls to the remote object<DD><CODE>ssf</CODE> - the server-side socket factory for receiving remote calls<DT><B>Throws:</B><DD><CODE><A HREF="../../../java/rmi/RemoteException.html">RemoteException</A></CODE> - if exporting the object to the RMI runtime fails<DT><B>Since: </B><DD>1.2</DD></DL></DD></DL><!-- ============ METHOD DETAIL ========== --><A NAME="method_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Method Detail</B></FONT></TD></TR></TABLE><A NAME="getID()"><!-- --></A><H3>getID</H3><PRE>protected <A HREF="../../../java/rmi/activation/ActivationID.html">ActivationID</A> <B>getID</B>()</PRE><DL><DD>Returns the object's activation identifier.  The method is protected so that only subclasses can obtain an object's identifier.<DD><DL><DT><B>Returns:</B><DD>the object's activation identifier<DT><B>Since: </B><DD>1.2</DD></DL></DD></DL><HR><A NAME="register(java.rmi.activation.ActivationDesc)"><!-- --></A><H3>register</H3><PRE>public static <A HREF="../../../java/rmi/Remote.html">Remote</A> <B>register</B>(<A HREF="../../../java/rmi/activation/ActivationDesc.html">ActivationDesc</A>&nbsp;desc)                       throws <A HREF="../../../java/rmi/activation/UnknownGroupException.html">UnknownGroupException</A>,                              <A HREF="../../../java/rmi/activation/ActivationException.html">ActivationException</A>,                              <A HREF="../../../java/rmi/RemoteException.html">RemoteException</A></PRE><DL><DD>Register an object descriptor for an activatable remote object so that is can be activated on demand.<DD><DL><DT><B>Parameters:</B><DD><CODE>desc</CODE> - the object's descriptor<DT><B>Returns:</B><DD>the stub for the activatable remote object<DT><B>Throws:</B><DD><CODE><A HREF="../../../java/rmi/activation/UnknownGroupException.html">UnknownGroupException</A></CODE> - if group id in <code>desc</code> is not registered with the activation system<DD><CODE><A HREF="../../../java/rmi/activation/ActivationException.html">ActivationException</A></CODE> - if activation system is not running<DD><CODE><A HREF="../../../java/rmi/RemoteException.html">RemoteException</A></CODE> - if remote call fails<DT><B>Since: </B><DD>1.2</DD></DL></DD></DL><HR><A NAME="inactive(java.rmi.activation.ActivationID)"><!-- --></A><H3>inactive</H3><PRE>public static boolean <B>inactive</B>(<A HREF="../../../java/rmi/activation/ActivationID.html">ActivationID</A>&nbsp;id)                        throws <A HREF="../../../java/rmi/activation/UnknownObjectException.html">UnknownObjectException</A>,                               <A HREF="../../../java/rmi/activation/ActivationException.html">ActivationException</A>,                               <A HREF="../../../java/rmi/RemoteException.html">RemoteException</A></PRE><DL><DD>Informs the system that the object with the corresponding activation <code>id</code> is currently inactive. If the object is currently active, the object is "unexported" from the RMI runtime (only if there are no pending or in-progress calls) so the that it can no longer receive incoming calls. This call informs this VM's ActivationGroup that the object is inactive, that, in turn, informs its ActivationMonitor. If this call completes successfully, a subsequent activate request to the activator will cause the object to reactivate. The operation may still succeed if the object is considered active but has already unexported itself.<DD><DL><DT><B>Parameters:</B><DD><CODE>id</CODE> - the object's activation identifier<DT><B>Returns:</B><DD>true if the operation succeeds (the operation will succeed if the object in currently known to be active and is either already unexported or is currently exported and has no pending/executing calls); false is returned if the object has pending/executing calls in which case it cannot be deactivated<DT><B>Throws:</B><DD><CODE><A HREF="../../../java/rmi/activation/UnknownObjectException.html">UnknownObjectException</A></CODE> - if object is not known (it may already be inactive)<DD><CODE><A HREF="../../../java/rmi/activation/ActivationException.html">ActivationException</A></CODE> - if group is not active<DD><CODE><A HREF="../../../java/rmi/RemoteException.html">RemoteException</A></CODE> - if call informing monitor fails<DT><B>Since: </B><DD>1.2</DD></DL></DD></DL><HR><A NAME="unregister(java.rmi.activation.ActivationID)"><!-- --></A><H3>unregister</H3><PRE>public static void <B>unregister</B>(<A HREF="../../../java/rmi/activation/ActivationID.html">ActivationID</A>&nbsp;id)                       throws <A HREF="../../../java/rmi/activation/UnknownObjectException.html">UnknownObjectException</A>,                              <A HREF="../../../java/rmi/activation/ActivationException.html">ActivationException</A>,                              <A HREF="../../../java/rmi/RemoteException.html">RemoteException</A></PRE><DL><DD>Revokes previous registration for the activation descriptor associated with <code>id</code>. An object can no longer be activated via that <code>id</code>.<DD><DL><DT><B>Parameters:</B><DD><CODE>id</CODE> - the object's activation identifier<DT><B>Throws:</B><DD><CODE><A HREF="../../../java/rmi/activation/UnknownObjectException.html">UnknownObjectException</A></CODE> - if object (<code>id</code>) is unknown<DD><CODE><A HREF="../../../java/rmi/activation/ActivationException.html">ActivationException</A></CODE> - if activation system is not running<DD><CODE><A HREF="../../../java/rmi/RemoteException.html">RemoteException</A></CODE> - if remote call to activation system fails<DT><B>Since: </B><DD>1.2</DD></DL></DD></DL><HR><A NAME="exportObject(java.rmi.Remote, java.lang.String, java.rmi.MarshalledObject, boolean, int)"><!-- --></A><H3>exportObject</H3><PRE>public static <A HREF="../../../java/rmi/activation/ActivationID.html">ActivationID</A> <B>exportObject</B>(<A HREF="../../../java/rmi/Remote.html">Remote</A>&nbsp;obj,                                        <A HREF="../../../java/lang/String.html">String</A>&nbsp;location,                                        <A HREF="../../../java/rmi/MarshalledObject.html">MarshalledObject</A>&nbsp;data,                                        boolean&nbsp;restart,                                        int&nbsp;port)                                 throws <A HREF="../../../java/rmi/activation/ActivationException.html">ActivationException</A>,                                        <A HREF="../../../java/rmi/RemoteException.html">RemoteException</A></PRE><DL><DD>This <code>exportObject</code> method may be invoked explicitly by an "activatable" object, that does not extend the <code>Activatable</code> class, in order to both a) register the object's activation descriptor, constructed from the supplied <code>location</code>, and <code>data</code>, with the activation system (so the object can be activated), and b) export the remote object, <code>obj</code>, on a specific port (if port=0, then an anonymous port is chosen). Once the object is exported, it can receive incoming RMI calls.<p>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?