📄 activator.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Frameset//EN""http://www.w3.org/TR/REC-html40/frameset.dtd"><!--NewPage--><HTML><HEAD><!-- Generated by javadoc on Thu May 30 13:46:51 EDT 2002 --><TITLE>J2ME RMI Optional Package Specification v1.0: Interface Activator</TITLE><LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style"></HEAD><BODY BGCOLOR="white"><!-- ========== START OF NAVBAR ========== --><A NAME="navbar_top"><!-- --></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0"><TR><TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_top_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3"> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>J2ME RMI Optional Package</EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> PREV CLASS NEXT CLASS</FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../index.html" TARGET="_top"><B>FRAMES</B></A> <A HREF="Activator.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: INNER | FIELD | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: FIELD | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><!-- =========== END OF NAVBAR =========== --><HR><!-- ======== START OF CLASS DATA ======== --><H2><FONT SIZE="-1">java.rmi.activation</FONT><BR>Interface Activator</H2><DL><DT><B>All Superinterfaces:</B> <DD><A HREF="../../../java/rmi/Remote.html">Remote</A></DD></DL><HR><DL><DT>public interface <B>Activator</B><DT>extends <A HREF="../../../java/rmi/Remote.html">Remote</A></DL><P>The <code>Activator</code> facilitates remote object activation. A "faulting" remote reference calls the activator's <code>activate</code> method to obtain a "live" reference to a "activatable" remote object. Upon receiving a request for activation, the activator looks up the activation descriptor for the activation identifier, <code>id</code>; determines the group in which the object should be activated; initiates object re-creation via the group's J2SE API <code>ActivationInstantiator</code> (via a call to the <code>newInstance</code> method). The activator initiates the execution of activation groups as necessary. For example, if an activation group for a specific group identifier is not already executing, the activator initiates the execution of a VM for the group.<p> The activator is responsible for monitoring and detecting when activation groups fail so that it can remove stale remote references to groups and active objects within those groups.<p> The <code>Activator</code> works closely with <code>ActivationSystem</code>, which provides a means for registering groups and objects within those groups, and <code>ActivationMonitor</code>, which receives information about active and inactive objects and inactive groups. <p> A server side implementation of the Activator is not required for the RMI Optional Package. Additionally, the <code>ActivationSystem</code> and <code>ActivationInstantiator</code> interfaces (and dependent classes) referenced in this document are only part of the J2SE RMI API. <p> <b>See the following J2SE APIs:</b><p> <pre> java.rmi.activation.ActivationInstantiator<p> java.rmi.activation.ActivationGroupDesc<p> java.rmi.activation.ActivationGroupID </pre><P><DL><DT><B>Since: </B><DD>1.2</DD></DL><HR><P><!-- ======== INNER CLASS SUMMARY ======== --><!-- =========== FIELD SUMMARY =========== --><!-- ======== CONSTRUCTOR SUMMARY ======== --><!-- ========== METHOD SUMMARY =========== --><A NAME="method_summary"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=2><FONT SIZE="+2"><B>Method Summary</B></FONT></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../../java/rmi/MarshalledObject.html">MarshalledObject</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../java/rmi/activation/Activator.html#activate(java.rmi.activation.ActivationID, boolean)">activate</A></B>(<A HREF="../../../java/rmi/activation/ActivationID.html">ActivationID</A> id, boolean force)</CODE><BR> Activate the object associated with the activation identifier, <code>id</code>.</TD></TR></TABLE> <P><!-- ============ FIELD DETAIL =========== --><!-- ========= CONSTRUCTOR DETAIL ======== --><!-- ============ 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="activate(java.rmi.activation.ActivationID, boolean)"><!-- --></A><H3>activate</H3><PRE>public <A HREF="../../../java/rmi/MarshalledObject.html">MarshalledObject</A> <B>activate</B>(<A HREF="../../../java/rmi/activation/ActivationID.html">ActivationID</A> id, boolean force) throws <A HREF="../../../java/rmi/activation/ActivationException.html">ActivationException</A>, <A HREF="../../../java/rmi/activation/UnknownObjectException.html">UnknownObjectException</A>, <A HREF="../../../java/rmi/RemoteException.html">RemoteException</A></PRE><DL><DD>Activate the object associated with the activation identifier, <code>id</code>. If the activator knows the object to be active already, and <code>force</code> is false , the stub with a "live" reference is returned immediately to the caller; otherwise, if the activator does not know that corresponding the remote object is active, the activator uses the activation descriptor information (previously registered) to determine the group (VM) in which the object should be activated. If an <code>ActivationInstantiator</code> (part of the J2SE API) corresponding to the object's group descriptor already exists, the activator invokes the activation group's <code>newInstance</code>, method passing it the object's id and descriptor. <p> If the activation group for the object's group descriptor does not yet exist, the activator starts an <code>ActivationInstantiator</code> executing (by spawning a child process, for example). When the activator receives the activation group's call back (via the J2SE <code>ActivationSystem</code>'s <code>activeGroup</code> method) specifying the activation group's reference, the activator can then invoke that activation instantiator's <code>newInstance</code> method to forward each pending activation request to the activation group and return the result (a marshalled remote object reference, a stub) to the caller running on the RMI Optional Package.<p> Note that the activator receives a "marshalled" object instead of a Remote object so that the activator does not need to load the code for that object, or participate in distributed garbage collection for that object. If the activator kept a strong reference to the remote object, the activator would then prevent the object from being garbage collected under the normal distributed garbage collection mechanism. <p><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>id</CODE> - the activation identifier for the object being activated<DD><CODE>force</CODE> - if true, the activator contacts the group to obtain the remote object's reference; if false, returning the cached value is allowed.<DT><B>Returns:</B><DD>the remote object (a stub) in a marshalled form<DT><B>Throws:</B><DD><CODE><A HREF="../../../java/rmi/activation/ActivationException.html">ActivationException</A></CODE> - if object activation fails<DD><CODE><A HREF="../../../java/rmi/activation/UnknownObjectException.html">UnknownObjectException</A></CODE> - if object is unknown (not registered)<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><!-- ========= END OF CLASS DATA ========= --><HR><!-- ========== START OF NAVBAR ========== --><A NAME="navbar_bottom"><!-- --></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0"><TR><TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_bottom_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3"> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>J2ME RMI Optional Package</EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> PREV CLASS NEXT CLASS</FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../index.html" TARGET="_top"><B>FRAMES</B></A> <A HREF="Activator.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: INNER | FIELD | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: FIELD | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><!-- =========== END OF NAVBAR =========== --><HR><font size="-1">Copyright 1994-2002 Sun Microsystems, Inc. All Rights Reserved.</font> </BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -