📄 controlfactory.html
字号:
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Constructor Detail</B></FONT></TD></TR></TABLE><A NAME="ControlFactory()"><!-- --></A><H3>ControlFactory</H3><PRE>protected <B>ControlFactory</B>()</PRE><DL></DL><!-- ============ 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="getControlInstance(javax.naming.ldap.Control)"><!-- --></A><H3>getControlInstance</H3><PRE>public abstract <A HREF="../../../javax/naming/ldap/Control.html">Control</A> <B>getControlInstance</B>(<A HREF="../../../javax/naming/ldap/Control.html">Control</A> ctl) throws <A HREF="../../../javax/naming/NamingException.html">NamingException</A></PRE><DL><DD>Creates a control using this control factory.<p> The factory is used by the service provider to return controls that it reads from the LDAP protocol as specialized control classes. Without this mechanism, the provider would be returning controls that only contained data in BER encoded format.<p> Typically, <tt>ctl</tt> is a "basic" control containing BER encoded data. The factory is used to create a specialized control implementation, usually by decoding the BER encoded data, that provides methods to access that data in a type-safe and friendly manner. <p> For example, a factory might use the BER encoded data in basic control and return an instance of a VirtualListReplyControl.<p> If this factory cannot create a control using the argument supplied, it should return null. A factory should only throw an exception if it is sure that it is the only intended factory and that no other control factories should be tried. This might happen, for example, if the BER data in the control does not match what is expected of a control with the given OID. Since this method throws <tt>NamingException</tt>, any other internally generated exception that should be propagated must be wrapped inside a <tt>NamingException</tt>.<DD><DL><DT><B>Parameters:</B><DD><CODE>ctl</CODE> - A non-null control.<DT><B>Returns:</B><DD>A possibly null Control.<DT><B>Throws:</B><DD><CODE><A HREF="../../../javax/naming/NamingException.html">NamingException</A></CODE> - If <tt>ctl</tt> contains invalid data that prevents it from being used to create a control. A factory should only thrown an exception if it knows how to produce the control (identified by the OID) but is unable to because of, for example invalid BER data.</DL></DD></DL><HR><A NAME="getControlInstance(javax.naming.ldap.Control, javax.naming.Context, java.util.Hashtable)"><!-- --></A><H3>getControlInstance</H3><PRE>public static <A HREF="../../../javax/naming/ldap/Control.html">Control</A> <B>getControlInstance</B>(<A HREF="../../../javax/naming/ldap/Control.html">Control</A> ctl, <A HREF="../../../javax/naming/Context.html">Context</A> ctx, <A HREF="../../../java/util/Hashtable.html">Hashtable</A> env) throws <A HREF="../../../javax/naming/NamingException.html">NamingException</A></PRE><DL><DD>Creates a control using known control factories. <p> The following rule is used to create the control:<ul> <li> Use the control factories specified in the <tt>LdapContext.CONTROL_FACTORIES</tt> property of the environment, and of the provider resource file associated with <tt>ctx</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 the control is the one used. If none of the factories can be loaded, return <code>ctl</code>. If an exception is encountered while creating the control, the exception is passed up to the caller.</ol> <p> Note that a control factory must be public and must have a public constructor that accepts no arguments. <p><DD><DL><DT><B>Parameters:</B><DD><CODE>ctl</CODE> - The non-null control object containing the OID and BER data.<DD><CODE>ctx</CODE> - The possibly null context in which the control is being created. If null, no such information is available.<DD><CODE>env</CODE> - The possibly null environment of the context. This is used to find the value of the <tt>LdapContext.CONTROL_FACTORIES</tt> property.<DT><B>Returns:</B><DD>A control object created using <code>ctl</code>; or <code>ctl</code> if a control 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 create the control object. If one of the factories accessed throws an exception, it is propagated up to the caller. If an error was encountered while loading and instantiating the factory and object classes, the exception is wrapped inside a <tt>NamingException</tt> is rethrown.</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="class-use/ControlFactory.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </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><b>Java<sup><font size=-2>TM</font></sup> 2 Platform<br>Std. Ed. v1.3</b></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> PREV CLASS <A HREF="../../../javax/naming/ldap/InitialLdapContext.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="ControlFactory.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: INNER | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><!-- =========== END OF NAVBAR =========== --><HR><font size="-1"><a href="http://java.sun.com/cgi-bin/bugreport.cgi">Submit a bug or feature</a><br>For further API reference and developer documentation, see <a href="http://java.sun.com/products/jdk/1.3/devdocs-vs-specs.html">Java 2 SDK SE Developer Documentation</a>. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples. <p>Java, Java 2D, and JDBC are trademarks or registered trademarks of Sun Microsystems, Inc. in the US and other countries.<br>Copyright 1993-2000 Sun Microsystems, Inc. 901 San Antonio Road<br>Palo Alto, California, 94303, U.S.A. All Rights Reserved.</font></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -