📄 naming.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:50 EDT 2002 --><TITLE>J2ME RMI Optional Package Specification v1.0: Class Naming</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"> <A HREF="../../java/rmi/MarshalledObject.html"><B>PREV CLASS</B></A> <A HREF="../../java/rmi/RMISecurityManager.html"><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../index.html" TARGET="_top"><B>FRAMES</B></A> <A HREF="Naming.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</FONT><BR>Class Naming</H2><PRE>java.lang.Object | +--<B>java.rmi.Naming</B></PRE><HR><DL><DT>public final class <B>Naming</B><DT>extends java.lang.Object</DL><P>The <code>Naming</code> class provides methods for storing and obtaining references to remote objects in a remote object registry. Each method of the <code>Naming</code> class takes as one of its arguments a name that is a <code>java.lang.String</code> in URL format (without the scheme component) of the form: <PRE> //host:port/name </PRE> <P>where <code>host</code> is the host (remote or local) where the registry is located, <code>port</code> is the port number on which the registry accepts calls, and where <code>name</code> is a simple string uninterpreted by the registry. Both <code>host</code> and <code>port</code> are optional. If <code>host</code> is omitted, the host defaults to the local host. If <code>port</code> is omitted, then the port defaults to 1099, the "well-known" port that RMI's registry, <code>rmiregistry</code>, uses. <P><em>Binding</em> a name for a remote object is associating or registering a name for a remote object that can be used at a later time to look up that remote object. A remote object can be associated with a name using the <code>Naming</code> class's <code>bind</code> or <code>rebind</code> methods. <P>Once a remote object is registered (bound) with the RMI registry on the local host, callers on a remote (or local) host can lookup the remote object by name, obtain its reference, and then invoke remote methods on the object. A registry may be shared by all servers running on a host or an individual server process may create and use its own registry if desired (see <code>java.rmi.registry.LocateRegistry.createRegistry</code> method for details).<P><DL><DT><B>Since: </B><DD>JDK1.1</DD><DT><B>See Also: </B><DD><A HREF="../../java/rmi/registry/Registry.html"><CODE>Registry</CODE></A>, <A HREF="../../java/rmi/registry/LocateRegistry.html"><CODE>LocateRegistry</CODE></A>, <A HREF="../../java/rmi/registry/LocateRegistry.html#createRegistry(int)"><CODE>LocateRegistry.createRegistry(int)</CODE></A></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>static void</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/rmi/Naming.html#bind(java.lang.String, java.rmi.Remote)">bind</A></B>(java.lang.String name, <A HREF="../../java/rmi/Remote.html">Remote</A> obj)</CODE><BR> Binds the specified <code>name</code> to a remote object.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static java.lang.String[]</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/rmi/Naming.html#list(java.lang.String)">list</A></B>(java.lang.String name)</CODE><BR> Returns an array of the names bound in the registry.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static <A HREF="../../java/rmi/Remote.html">Remote</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../java/rmi/Naming.html#lookup(java.lang.String)">lookup</A></B>(java.lang.String name)</CODE><BR> Returns a reference, a stub, for the remote object associated with the specified <code>name</code>.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static void</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/rmi/Naming.html#rebind(java.lang.String, java.rmi.Remote)">rebind</A></B>(java.lang.String name, <A HREF="../../java/rmi/Remote.html">Remote</A> obj)</CODE><BR> Rebinds the specified name to a new remote object.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static void</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/rmi/Naming.html#unbind(java.lang.String)">unbind</A></B>(java.lang.String name)</CODE><BR> Destroys the binding for the specified name that is associated
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -