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

📄 namingmanager.html

📁 API資料大全
💻 HTML
📖 第 1 页 / 共 3 页
字号:
</TR></TABLE>&nbsp;<P><!-- ============ FIELD DETAIL =========== --><A NAME="field_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Field Detail</B></FONT></TD></TR></TABLE><A NAME="CPE"><!-- --></A><H3>CPE</H3><PRE>public static final <A HREF="../../../java/lang/String.html">String</A> <B>CPE</B></PRE><DL><DD>Constant that holds the name of the environment property into which <tt>getContinuationContext()</tt> stores the value of its <tt>CannotProceedException</tt> parameter. This property is inherited by the continuation context, and may be used by that context's service provider to inspect the fields of the exception.<p> The value of this constant is "java.naming.spi.CannotProceedException".<DD><DL><DT><B>See Also: </B><DD><A HREF="../../../javax/naming/spi/NamingManager.html#getContinuationContext(javax.naming.CannotProceedException)"><CODE>getContinuationContext(javax.naming.CannotProceedException)</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="setObjectFactoryBuilder(javax.naming.spi.ObjectFactoryBuilder)"><!-- --></A><H3>setObjectFactoryBuilder</H3><PRE>public static void <B>setObjectFactoryBuilder</B>(<A HREF="../../../javax/naming/spi/ObjectFactoryBuilder.html">ObjectFactoryBuilder</A>&nbsp;builder)                                    throws <A HREF="../../../javax/naming/NamingException.html">NamingException</A></PRE><DL><DD>The ObjectFactoryBuilder determines the policy used when trying to load object factories. See getObjectInstance() and class ObjectFactory for a description of the default policy. setObjectFactoryBuilder() overrides this default policy by installing an ObjectFactoryBuilder. Subsequent object factories will be loaded and created using the installed builder.<p> The builder can only be installed if the executing thread is allowed (by the security manager's checkSetFactory() method) to do so. Once installed, the builder cannot be replaced.<p><DD><DL><DT><B>Parameters:</B><DD><CODE>builder</CODE> - The factory builder to install. If null, no builder			is installed.<DT><B>Throws:</B><DD><CODE><A HREF="../../../java/lang/SecurityException.html">SecurityException</A></CODE> - Factory builder cannot be installed		for security reasons.<DD><CODE><A HREF="../../../javax/naming/NamingException.html">NamingException</A></CODE> - Factory build cannot be installed for         a non-security-related reason.<DD><CODE><A HREF="../../../java/lang/IllegalStateException.html">IllegalStateException</A></CODE> - If a factory has already been installed.<DT><B>See Also: </B><DD><A HREF="../../../javax/naming/spi/NamingManager.html#getObjectInstance(java.lang.Object, javax.naming.Name, javax.naming.Context, java.util.Hashtable)"><CODE>getObjectInstance(java.lang.Object, javax.naming.Name, javax.naming.Context, java.util.Hashtable)</CODE></A>, <A HREF="../../../javax/naming/spi/ObjectFactory.html"><CODE>ObjectFactory</CODE></A>, <A HREF="../../../javax/naming/spi/ObjectFactoryBuilder.html"><CODE>ObjectFactoryBuilder</CODE></A>, <A HREF="../../../java/lang/SecurityManager.html#checkSetFactory()"><CODE>SecurityManager.checkSetFactory()</CODE></A></DL></DD></DL><HR><A NAME="getObjectInstance(java.lang.Object, javax.naming.Name, javax.naming.Context, java.util.Hashtable)"><!-- --></A><H3>getObjectInstance</H3><PRE>public static <A HREF="../../../java/lang/Object.html">Object</A> <B>getObjectInstance</B>(<A HREF="../../../java/lang/Object.html">Object</A>&nbsp;refInfo,                                       <A HREF="../../../javax/naming/Name.html">Name</A>&nbsp;name,                                       <A HREF="../../../javax/naming/Context.html">Context</A>&nbsp;nameCtx,                                       <A HREF="../../../java/util/Hashtable.html">Hashtable</A>&nbsp;environment)                                throws <A HREF="../../../java/lang/Exception.html">Exception</A></PRE><DL><DD>Creates an instance of an object for the specified object  and environment. <p> If an object factory builder has been installed, it is used to create a factory for creating the object. Otherwise, the following rules are used to create the object:<ol> <li>If <code>refInfo</code> is a <code>Reference</code>     or <code>Referenceable</code> containing a factory class name,    use the named factory to create the object.    Return <code>refInfo</code> if the factory cannot be created.    Under JDK 1.1, if the factory class must be loaded from a location    specified in the reference, a <tt>SecurityManager</tt> must have    been installed or the factory creation will fail.    If an exception is encountered while creating the factory,    it is passed up to the caller. <li>If <tt>refInfo</tt> is a <tt>Reference</tt> or    <tt>Referenceable</tt> with no factory class name,    and the address or addresses are <tt>StringRefAddr</tt>s with    address type "URL",    try the URL context factory corresponding to each URL's scheme id    to create the object (see <tt>getURLContext()</tt>).    If that fails, continue to the next step. <li> Use the object factories specified in     the <tt>Context.OBJECT_FACTORIES</tt> property of the environment,    and of the provider resource file associated with    <tt>nameCtx</tt>, in that order.    The value of this property is a colon-separated list of factory    class names that are tried in order, and the first one that succeeds    in creating an object is the one used.    If none of the factories can be loaded,    return <code>refInfo</code>.    If an exception is encountered while creating the object, the    exception is passed up to the caller.</ol><p> Service providers that implement the <tt>DirContext</tt> interface should use <tt>DirectoryManager.getObjectInstance()</tt>, not this method. Service providers that implement only the <tt>Context</tt> interface should use this method. <p> Note that an object factory (an object that implements the ObjectFactory interface) must be public and must have a public constructor that  accepts no arguments. <p> The <code>name</code> and <code>nameCtx</code> parameters may optionally be used to specify the name of the object being created. <code>name</code> is the name of the object, relative to context <code>nameCtx</code>.  This information could be useful to the object factory or to the object implementation.	If there are several possible contexts from which the object	could be named -- as will often be the case -- it is up to	the caller to select one.  A good rule of thumb is to select the "deepest" context available. If <code>nameCtx</code> is null, <code>name</code> is relative to the default initial context.  If no name is being specified, the <code>name</code> parameter should be null.<DD><DL><DT><B>Parameters:</B><DD><CODE>refInfo</CODE> - The possibly null object for which to create an object.<DD><CODE>name</CODE> - The name of this object relative to <code>nameCtx</code>.		Specifying a name is optional; if it is		omitted, <code>name</code> should be null.<DD><CODE>nameCtx</CODE> - The context relative to which the <code>name</code>		parameter is specified.  If null, <code>name</code> is		relative to the default initial context.<DD><CODE>environment</CODE> - The possibly null environment to 		be used in the creation of the object factory and the object.<DT><B>Returns:</B><DD>An object created using <code>refInfo</code>; or		<code>refInfo</code> if an object cannot be created using		the algorithm described above.<DT><B>Throws:</B><DD><CODE><A HREF="../../../javax/naming/NamingException.html">NamingException</A></CODE> - if a naming exception was encountered 	while attempting to get a URL context, or if one of the		factories accessed throws a NamingException.<DD><CODE><A HREF="../../../java/lang/Exception.html">Exception</A></CODE> - if one of the factories accessed throws an		exception, or if an error was encountered while loading	        and instantiating the factory and object classes.		A factory should only throw an exception if it does not want		other factories to be used in an attempt to create an object. 	See ObjectFactory.getObjectInstance().<DT><B>See Also: </B><DD><A HREF="../../../javax/naming/spi/NamingManager.html#getURLContext(java.lang.String, java.util.Hashtable)"><CODE>getURLContext(java.lang.String, java.util.Hashtable)</CODE></A>, <A HREF="../../../javax/naming/spi/ObjectFactory.html"><CODE>ObjectFactory</CODE></A>, <A HREF="../../../javax/naming/spi/ObjectFactory.html#getObjectInstance(java.lang.Object, javax.naming.Name, javax.naming.Context, java.util.Hashtable)"><CODE>ObjectFactory.getObjectInstance(java.lang.Object, javax.naming.Name, javax.naming.Context, java.util.Hashtable)</CODE></A></DL></DD></DL><HR><A NAME="getURLContext(java.lang.String, java.util.Hashtable)"><!-- --></A><H3>getURLContext</H3><PRE>public static <A HREF="../../../javax/naming/Context.html">Context</A> <B>getURLContext</B>(<A HREF="../../../java/lang/String.html">String</A>&nbsp;scheme,                                    <A HREF="../../../java/util/Hashtable.html">Hashtable</A>&nbsp;environment)                             throws <A HREF="../../../javax/naming/NamingException.html">NamingException</A></PRE><DL><DD>Creates a context for the given URL scheme id.  <p> The resulting context is for resolving URLs of the scheme <code>scheme</code>. The resulting context is not tied to a specific URL. It is able to handle arbitrary URLs with  the specified scheme.  <p> The class name of the factory that creates the resulting context  has the naming convention <i>scheme-id</i>URLContextFactory  (e.g. "ftpURLContextFactory" for the "ftp" scheme-id),  in the package specified as follows. The <tt>Context.URL_PKG_PREFIXES</tt> environment property (which may contain values taken from applet parameters, system properties, or application resource files) contains a colon-separated list of package prefixes.  Each package prefix in the property is tried in the order specified to load the factory class. The default package prefix is "com.sun.jndi.url" (if none of the specified packages work, this default is tried). The complete package name is constructed using the package prefix, concatenated with the scheme id.<p> For example, if the scheme id is "ldap", and the  <tt>Context.URL_PKG_PREFIXES</tt> property contains "com.widget:com.wiz.jndi", the naming manager would attempt to load the following classes until one is successfully instantiated:<ul> <li>com.widget.ldap.ldapURLContextFactory	<li>com.wiz.jndi.ldap.ldapURLContextFactory	<li>com.sun.jndi.url.ldap.ldapURLContextFactory</ul> If none of the package prefixes work, null is returned.<p> If a factory is instantiated, it is invoked with the following parameters to produce the resulting context. <p> <code>factory.getObjectInstance(null, environment);</code> <p> For example, invoking getObjectInstance() as shown above on a LDAP URL context factory would return a context that can resolve LDAP urls (e.g. "ldap://ldap.wiz.com/o=wiz,c=us", "ldap://ldap.umich.edu/o=umich,c=us", ...).<p> Note that an object factory (an object that implements the ObjectFactory

⌨️ 快捷键说明

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