📄 context.html
字号:
the behaviour is determined by the service provider. <p> The value of this constant is "java.naming.security.authentication".<DD><DL><DT><B>See Also: </B><DD><A HREF="../../javax/naming/Context.html#addToEnvironment(java.lang.String, java.lang.Object)"><CODE>addToEnvironment(String, Object)</CODE></A>, <A HREF="../../javax/naming/Context.html#removeFromEnvironment(java.lang.String)"><CODE>removeFromEnvironment(String)</CODE></A></DL></DD></DL><HR><A NAME="SECURITY_PRINCIPAL"><!-- --></A><H3>SECURITY_PRINCIPAL</H3><PRE>public static final <A HREF="../../java/lang/String.html">String</A> <B>SECURITY_PRINCIPAL</B></PRE><DL><DD>Constant that holds the name of the environment property for specifying the identity of the principal for authenticating the caller to the service. The format of the principal depends on the authentication scheme. If this property is unspecified, the behaviour is determined by the service provider. <p> The value of this constant is "java.naming.security.principal".<DD><DL><DT><B>See Also: </B><DD><A HREF="../../javax/naming/Context.html#addToEnvironment(java.lang.String, java.lang.Object)"><CODE>addToEnvironment(String, Object)</CODE></A>, <A HREF="../../javax/naming/Context.html#removeFromEnvironment(java.lang.String)"><CODE>removeFromEnvironment(String)</CODE></A></DL></DD></DL><HR><A NAME="SECURITY_CREDENTIALS"><!-- --></A><H3>SECURITY_CREDENTIALS</H3><PRE>public static final <A HREF="../../java/lang/String.html">String</A> <B>SECURITY_CREDENTIALS</B></PRE><DL><DD>Constant that holds the name of the environment property for specifying the credentials of the principal for authenticating the caller to the service. The value of the property depends on the authentication scheme. For example, it could be a hashed password, clear-text password, key, certificate, and so on. If this property is unspecified, the behaviour is determined by the service provider. <p> The value of this constant is "java.naming.security.credentials".<DD><DL><DT><B>See Also: </B><DD><A HREF="../../javax/naming/Context.html#addToEnvironment(java.lang.String, java.lang.Object)"><CODE>addToEnvironment(String, Object)</CODE></A>, <A HREF="../../javax/naming/Context.html#removeFromEnvironment(java.lang.String)"><CODE>removeFromEnvironment(String)</CODE></A></DL></DD></DL><HR><A NAME="LANGUAGE"><!-- --></A><H3>LANGUAGE</H3><PRE>public static final <A HREF="../../java/lang/String.html">String</A> <B>LANGUAGE</B></PRE><DL><DD>Constant that holds the name of the environment property for specifying the preferred language to use with the service. The value of the property is a colon-separated list of language tags as defined in RFC 1766. If this property is unspecified, the language preference is determined by the service provider. <p> The value of this constant is "java.naming.language".<DD><DL><DT><B>See Also: </B><DD><A HREF="../../javax/naming/Context.html#addToEnvironment(java.lang.String, java.lang.Object)"><CODE>addToEnvironment(String, Object)</CODE></A>, <A HREF="../../javax/naming/Context.html#removeFromEnvironment(java.lang.String)"><CODE>removeFromEnvironment(String)</CODE></A></DL></DD></DL><HR><A NAME="APPLET"><!-- --></A><H3>APPLET</H3><PRE>public static final <A HREF="../../java/lang/String.html">String</A> <B>APPLET</B></PRE><DL><DD>Constant that holds the name of the environment property for specifying an applet for the initial context constructor to use when searching for other properties. The value of this property is the <tt>java.applet.Applet</tt> instance that is being executed. This property may be specified in the environment parameter passed to the initial context constructor. When this property is set, each property that the initial context constructor looks for in the system properties is first looked for in the applet's parameter list. If this property is unspecified, the initial context constructor will search for properties only in the environment parameter passed to it, the system properties, and application resource files. <p> The value of this constant is "java.naming.applet".<DD><DL><DT><B>See Also: </B><DD><A HREF="../../javax/naming/Context.html#addToEnvironment(java.lang.String, java.lang.Object)"><CODE>addToEnvironment(String, Object)</CODE></A>, <A HREF="../../javax/naming/Context.html#removeFromEnvironment(java.lang.String)"><CODE>removeFromEnvironment(String)</CODE></A>, <A HREF="../../javax/naming/InitialContext.html"><CODE>InitialContext</CODE></A><DT><B>Since: </B><DD>1.3</DD></DL></DD></DL><!-- ========= 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="lookup(javax.naming.Name)"><!-- --></A><H3>lookup</H3><PRE>public <A HREF="../../java/lang/Object.html">Object</A> <B>lookup</B>(<A HREF="../../javax/naming/Name.html">Name</A> name) throws <A HREF="../../javax/naming/NamingException.html">NamingException</A></PRE><DL><DD>Retrieves the named object. If <tt>name</tt> is empty, returns a new instance of this context (which represents the same naming context as this context, but its environment may be modified independently and it may be accessed concurrently).<DD><DL><DT><B>Parameters:</B><DD><CODE>name</CODE> - the name of the object to look up<DT><B>Returns:</B><DD>the object bound to <tt>name</tt><DT><B>Throws:</B><DD><CODE><A HREF="../../javax/naming/NamingException.html">NamingException</A></CODE> - if a naming exception is encountered<DT><B>See Also: </B><DD><A HREF="../../javax/naming/Context.html#lookup(java.lang.String)"><CODE>lookup(String)</CODE></A>, <A HREF="../../javax/naming/Context.html#lookupLink(javax.naming.Name)"><CODE>lookupLink(Name)</CODE></A></DL></DD></DL><HR><A NAME="lookup(java.lang.String)"><!-- --></A><H3>lookup</H3><PRE>public <A HREF="../../java/lang/Object.html">Object</A> <B>lookup</B>(<A HREF="../../java/lang/String.html">String</A> name) throws <A HREF="../../javax/naming/NamingException.html">NamingException</A></PRE><DL><DD>Retrieves the named object. See <A HREF="../../javax/naming/Context.html#lookup(javax.naming.Name)"><CODE>lookup(Name)</CODE></A> for details.<DD><DL><DT><B>Parameters:</B><DD><CODE>name</CODE> - the name of the object to look up<DT><B>Returns:</B><DD>the object bound to <tt>name</tt><DT><B>Throws:</B><DD><CODE><A HREF="../../javax/naming/NamingException.html">NamingException</A></CODE> - if a naming exception is encountered</DL></DD></DL><HR><A NAME="bind(javax.naming.Name, java.lang.Object)"><!-- --></A><H3>bind</H3><PRE>public void <B>bind</B>(<A HREF="../../javax/naming/Name.html">Name</A> name, <A HREF="../../java/lang/Object.html">Object</A> obj) throws <A HREF="../../javax/naming/NamingException.html">NamingException</A></PRE><DL><DD>Binds a name to an object. All intermediate contexts and the target context (that named by all but terminal atomic component of the name) must already exist.<DD><DL><DT><B>Parameters:</B><DD><CODE>name</CODE> - the name to bind; may not be empty<DD><CODE>obj</CODE> - the object to bind; possibly null<DT><B>Throws:</B><DD><CODE><A HREF="../../javax/naming/NameAlreadyBoundException.html">NameAlreadyBoundException</A></CODE> - if name is already bound<DD><CODE><A HREF="../../javax/naming/directory/InvalidAttributesException.html">InvalidAttributesException</A></CODE> - if object did not supply all mandatory attributes<DD><CODE><A HREF="../../javax/naming/NamingException.html">NamingException</A></CODE> - if a naming exception is encountered<DT><B>See Also: </B><DD><A HREF="../../javax/naming/Context.html#bind(java.lang.String, java.lang.Object)"><CODE>bind(String, Object)</CODE></A>, <A HREF="../../javax/naming/Context.html#rebind(javax.naming.Name, java.lang.Object)"><CODE>rebind(Name, Object)</CODE></A>, <A HREF="../../javax/naming/directory/DirContext.html#bind(javax.naming.Name, java.lang.Object, javax.naming.directory.Attributes)"><CODE>DirContext.bind(Name, Object, javax.naming.directory.Attributes)</CODE></A></DL></DD></DL><HR><A NAME="bind(java.lang.String, java.lang.Object)"><!-- --></A><H3>bind</H3><PRE>public void <B>bind</B>(<A HREF="../../java/lang/String.html">String</A> name, <A HREF="../../java/lang/Object.html">Object</A> obj) throws <A HREF="../../javax/naming/NamingException.html">NamingException</A></PRE><DL><DD>Binds a name to an object. See <A HREF="../../javax/naming/Context.html#bind(javax.naming.Name, java.lang.Object)"><CODE>bind(Name, Object)</CODE></A> for details.<DD><DL><DT><B>Parameters:</B><DD><CODE>name</CODE> - the name to bind; may not be empty<DD><CODE>obj</CODE> - the object to bind; possibly null<DT><B>Throws:</B><DD><CODE><A HREF="../../javax/naming/NameAlreadyBoundException.html">NameAlreadyBoundException</A></CODE> - if name is already bound<DD><CODE><A HREF="../../javax/naming/directory/InvalidAttributesException.html">InvalidAttributesException</A></CODE> - if object did not supply all mandatory attributes<DD><CODE><A HREF="../../javax/naming/NamingException.html">NamingException</A></CODE> - if a naming exception is encountered</DL></DD></DL><HR><A NAME="rebind(javax.naming.Name, java.lang.Object)"><!-- --></A><H3>rebind</H3><PRE>public void <B>rebind</B>(<A HREF="../../javax/naming/Name.html">Name</A> name, <A HREF="../../java/lang/Object.html">Object</A> obj) throws <A HREF="../../javax/naming/NamingException.html">NamingException</A></PRE><DL><DD>Binds a name to an object, overwriting any existing binding. All intermediate contexts and the target context (that named by all but terminal atomic component of the name) must already exist. <p> If the object is a <tt>DirContext</tt>, any existing attributes associated with the name are replaced with those of the object. Otherwise, any existing attributes associated with the name remain unchanged.<DD><DL><DT><B>Parameters:</B><DD><CODE>name</CODE> - the name to bind; may not be empty<DD><CODE>obj</CODE> - the object to bind; possibly null<DT><B>Throws:</B><DD><CODE><A HREF="../../javax/naming/directory/InvalidAttributesException.html">InvalidAttributesException</A></CODE> - if object did not supply all mandatory attributes<DD><CODE><A HREF="../../javax/naming/NamingException.html">NamingException</A></CODE> - if a naming exception is encountered<DT><B>See Also: </B><DD><A HREF="../../javax/naming/Context.html#rebind(java.lang.String, java.lang.Object)"><CODE>rebind(String, Object)</CODE></A>, <A HREF="../../javax/naming/Context.html#bind(javax.naming.Name, java.lang.Object)"><CODE>bind(Name, Object)</CODE></A>, <A HREF="../../javax/naming/directory/DirContext.html#rebind(javax.naming.Name, java.lang.Object, javax.naming.directory.Attributes)"><CODE>DirContext.rebind(Name, Object, javax.naming.directory.Attributes)</CODE></A>, <A HREF="../../javax/naming/directory/DirContext.html"><CODE>DirContext</CODE></A></DL></DD></DL><HR><A NAME="rebind(java.lang.String, java.lang.Object)"><!-- --></A><H3>rebind</H3><PRE>public void <B>rebind</B>(<A HREF="../../java/lang/String.html">String</A> name, <A HREF="../../java/lang/Object.html">Object</A> obj) throws <A HREF="../../javax/naming/NamingException.html">NamingException</A></PRE><DL><DD>Binds a name to an object, overwriting any existing binding. See <A HREF="../../javax/naming/Context.html#rebind(javax.naming.Name, java.lang.Object)"><CODE>rebind(Name, Object)</CODE></A> for details.<DD><DL><DT><B>Parameters:</B><DD><CODE>name</CODE> - the name to bind; may not be empty<DD><CODE>obj</CODE> - the object to bind; possibly null<DT><B>Throws:</B><DD><CODE><A HREF="../../javax/naming/directory/InvalidAttributesException.html">InvalidAttributesException</A></CODE> - if object did not supply all mandatory attributes<DD><CODE><A HREF="../../javax/naming/NamingException.html">NamingException</A></CODE> - if a naming exception is encountered</DL></DD></DL><HR><A NAME="unbind(javax.naming.Name)"><!-- --></A><H3>unbind</H3><PRE>public void <B>unbind</B>(<A HREF="../../javax/naming/Name.html">Name</A> name) throws <A HREF="../../javax/naming/NamingException.html">NamingException</A></PRE><DL><DD>Unbinds the named object. Removes the terminal atomic name in <code>name</code> from the target context--that named by all but the terminal atomic part of <code>name</code>. <p> This method is idempotent. It succeeds even if the terminal atomic name is not bound in the target context, but throws <tt>NameNotFoundException</tt> if any of the intermediate contexts do not exist. <p> Any attributes associated with the name are removed. Intermediate contexts are not changed.<DD><DL><DT><B>Parameters:</B><DD><CODE>name</CODE> - the name to unbind; may not be empty<DT><B>Throws:</B><DD><CODE><A HREF="../../javax/naming/NameNotFoundException.html">NameNotFoundException</A></CODE> - if an intermediate context does not exist<DD><CODE><A HREF="../../javax/naming/NamingException.html">NamingException</A></CODE> - if a naming exception is encountered<DT><B>See Also: </B><DD><A HREF="../../javax/naming/Context.html#unbind(java.lang.String)"><CODE>unbind(String)</CODE></A></DL></DD></DL><HR><A NAME="unbind(java.lang.String)"><!-- --></A><H3>unbind</H3><PRE>public void <B>unbind</B>(<A HREF="../../java/lang/String.html">String</A> name) throws <A HREF="../../javax/naming/NamingException.html">NamingException</A></PRE><DL><DD>Unbinds the named object. See <A HREF="../../javax/naming/Context.html#unbind(javax.naming.Name)"><CODE>unbind(Name)</CODE></A> for details.<DD><DL><DT><B>Parameters:</B><DD><CODE>name</CODE> - the name to unbind; may not be empty<DT><B>Throws:</B><DD><CODE><A HREF="../../javax/naming/NameNotFoundException.html">NameNotFoundException</A></CODE> - if an intermediate context does not exist<DD><CODE><A HREF="../../javax/naming/NamingException.html">NamingException</A></CODE> - if a naming exception is encountered</DL></DD></DL><HR><A NAME="rename(javax.naming.Name, javax.naming.Name)"><!-- --></A><H3>rename</H3><PRE>public void <B>rename</B>(<A HREF="../../javax/naming/Name.html">Name</A> oldName, <A HREF="../../javax/naming/Name.html">Name</A> newName) throws <A HREF="../../javax/naming/NamingException.html">NamingException</A></PRE><DL
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -