⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 initialcontext.html

📁 API資料大全
💻 HTML
📖 第 1 页 / 共 5 页
字号:
<!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 Apr 27 23:37:22 PDT 2000 --><TITLE>Java 2 Platform SE v1.3: Class  InitialContext</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>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/InitialContext.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>  </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM><b>Java<sup><font size=-2>TM</font></sup>&nbsp;2&nbsp;Platform<br>Std.&nbsp;Ed. v1.3</b></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">&nbsp;<A HREF="../../javax/naming/CompoundName.html"><B>PREV CLASS</B></A>&nbsp;&nbsp;<A HREF="../../javax/naming/LinkRef.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>  &nbsp;&nbsp;<A HREF="InitialContext.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">  SUMMARY: &nbsp;INNER&nbsp;|&nbsp;<A HREF="#field_summary">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: &nbsp;<A HREF="#field_detail">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><!-- =========== END OF NAVBAR =========== --><HR><!-- ======== START OF CLASS DATA ======== --><H2><FONT SIZE="-1">javax.naming</FONT><BR>Class  InitialContext</H2><PRE><A HREF="../../java/lang/Object.html">java.lang.Object</A>  |  +--<B>javax.naming.InitialContext</B></PRE><DL><DT><B>All Implemented Interfaces:</B> <DD><A HREF="../../javax/naming/Context.html">Context</A></DD></DL><DL><DT><B>Direct Known Subclasses:</B> <DD><A HREF="../../javax/naming/directory/InitialDirContext.html">InitialDirContext</A></DD></DL><HR><DL><DT>public class <B>InitialContext</B><DT>extends <A HREF="../../java/lang/Object.html">Object</A><DT>implements <A HREF="../../javax/naming/Context.html">Context</A></DL><P>This class is the starting context for performing naming operations.<p> All naming operations are relative to a context. The initial context implements the Context interface and provides the starting point for resolution of names.<p> <a name=ENVIRONMENT></a> When the initial context is constructed, its environment is initialized with properties defined in the environment parameter passed to the constructor, and in any <a href=Context.html#RESOURCEFILES>application resource files</a>. In addition, a small number of standard JNDI properties may be specified as system properties or as applet parameters (through the use of <A HREF="../../javax/naming/Context.html#APPLET"><CODE>Context.APPLET</CODE></A>). These special properties are listed in the field detail sections of the <a href=Context.html#field_detail><tt>Context</tt></a> and <a href=ldap/LdapContext.html#field_detail><tt>LdapContext</tt></a> interface documentation.<p> JNDI determines each property's value by merging the values from the following two sources, in order: <ol> <li> The first occurrence of the property from the constructor's environment parameter and (for appropriate properties) the applet parameters and system properties. <li> The application resource files (<tt>jndi.properties</tt>). </ol> For each property found in both of these two sources, or in more than one application resource file, the property's value is determined as follows.  If the property is one of the standard JNDI properties that specify a list of JNDI factories (see <a href=Context.html#LISTPROPS><tt>Context</tt></a>), all of the values are concatenated into a single colon-separated list.  For other properties, only the first value found is used.<p> The initial context implementation is determined at runtime. The default policy uses the environment property "<A HREF="../../javax/naming/Context.html#INITIAL_CONTEXT_FACTORY"><CODE>java.naming.factory.initial</CODE></A>", which contains the class name of the initial context factory. An exception to this policy is made when resolving URL strings, as described below.<p> When a URL string (a <tt>String</tt> of the form <em>scheme_id:rest_of_name</em>) is passed as a name parameter to any method, a URL context factory for handling that scheme is located and used to resolve the URL.  If no such factory is found, the initial context specified by <tt>"java.naming.factory.initial"</tt> is used.  Similarly, when a <tt>CompositeName</tt> object whose first component is a URL string is passed as a name parameter to any method, a URL context factory is located and used to resolve the first name component. See <A HREF="../../javax/naming/spi/NamingManager.html#getURLContext(java.lang.String, java.util.Hashtable)"><CODE><tt>NamingManager.getURLContext()</tt></CODE></A> for a description of how URL context factories are located.<p> This default policy of locating the initial context and URL context factories may be overridden by calling <tt>NamingManager.setInitialContextFactoryBuilder()</tt>.<p> NoInitialContextException is thrown when an initial context cannot be instantiated. This exception can be thrown during any interaction  with the InitialContext, not only when the InitialContext is constructed. For example, the implementation of the initial context might lazily retrieve the context only when actual methods are invoked on it. The application should not have any dependency on when the existence of an initial context is determined.<p> When the environment property "java.naming.factory.initial" is non-null, the InitialContext constructor will attempt to create the initial context specified therein. At that time, the initial context factory involved might throw an exception if a problem is encountered. However, it is provider implementation-dependent when it verifies and indicates to the users of the initial context any environment property- or connection- related problems. It can do so lazily--delaying until an operation is performed on the context, or eagerly, at the time the context is constructed.<p> An InitialContext instance is not synchronized against concurrent access by multiple threads. Multiple threads each manipulating a different InitialContext instance need not synchronize. Threads that need to access a single InitialContext instance concurrently should synchronize amongst themselves and provide the necessary locking.<P><DL><DT><B>Since: </B><DD>JNDI 1.1 / Java 2 Platform, Standard Edition, v 1.3</DD><DT><B>See Also: </B><DD><A HREF="../../javax/naming/Context.html"><CODE>Context</CODE></A>, <A HREF="../../javax/naming/spi/NamingManager.html#setInitialContextFactoryBuilder(javax.naming.spi.InitialContextFactoryBuilder)"><CODE>NamingManager.setInitialContextFactoryBuilder</CODE></A></DL><HR><P><!-- ======== INNER CLASS SUMMARY ======== --><!-- =========== FIELD SUMMARY =========== --><A NAME="field_summary"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=2><FONT SIZE="+2"><B>Field Summary</B></FONT></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>protected &nbsp;<A HREF="../../javax/naming/Context.html">Context</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/naming/InitialContext.html#defaultInitCtx">defaultInitCtx</A></B></CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Field holding the result of calling NamingManager.getInitialContext().</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>protected &nbsp;boolean</CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/naming/InitialContext.html#gotDefault">gotDefault</A></B></CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Field indicating whether the initial context has been obtained by calling NamingManager.getInitialContext().</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>protected &nbsp;<A HREF="../../java/util/Hashtable.html">Hashtable</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/naming/InitialContext.html#myProps">myProps</A></B></CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The environment associated with this InitialContext.</TD></TR></TABLE>&nbsp;<A NAME="fields_inherited_from_class_javax.naming.Context"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TD><B>Fields inherited from interface javax.naming.<A HREF="../../javax/naming/Context.html">Context</A></B></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><A HREF="../../javax/naming/Context.html#APPLET">APPLET</A>, <A HREF="../../javax/naming/Context.html#AUTHORITATIVE">AUTHORITATIVE</A>, <A HREF="../../javax/naming/Context.html#BATCHSIZE">BATCHSIZE</A>, <A HREF="../../javax/naming/Context.html#DNS_URL">DNS_URL</A>, <A HREF="../../javax/naming/Context.html#INITIAL_CONTEXT_FACTORY">INITIAL_CONTEXT_FACTORY</A>, <A HREF="../../javax/naming/Context.html#LANGUAGE">LANGUAGE</A>, <A HREF="../../javax/naming/Context.html#OBJECT_FACTORIES">OBJECT_FACTORIES</A>, <A HREF="../../javax/naming/Context.html#PROVIDER_URL">PROVIDER_URL</A>, <A HREF="../../javax/naming/Context.html#REFERRAL">REFERRAL</A>, <A HREF="../../javax/naming/Context.html#SECURITY_AUTHENTICATION">SECURITY_AUTHENTICATION</A>, <A HREF="../../javax/naming/Context.html#SECURITY_CREDENTIALS">SECURITY_CREDENTIALS</A>, <A HREF="../../javax/naming/Context.html#SECURITY_PRINCIPAL">SECURITY_PRINCIPAL</A>, <A HREF="../../javax/naming/Context.html#SECURITY_PROTOCOL">SECURITY_PROTOCOL</A>, <A HREF="../../javax/naming/Context.html#STATE_FACTORIES">STATE_FACTORIES</A>, <A HREF="../../javax/naming/Context.html#URL_PKG_PREFIXES">URL_PKG_PREFIXES</A></CODE></TD></TR></TABLE>&nbsp;<!-- ======== CONSTRUCTOR SUMMARY ======== --><A NAME="constructor_summary"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">

⌨️ 快捷键说明

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