📄 package-summary.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 Apr 27 23:31:52 PDT 2000 --><TITLE>Java 2 Platform SE v1.3: Package javax.naming.event</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="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Package</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-use.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"> <A HREF="../../../javax/naming/directory/package-summary.html"><B>PREV PACKAGE</B></A> <A HREF="../../../javax/naming/ldap/package-summary.html"><B>NEXT PACKAGE</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../index.html" TARGET="_top"><B>FRAMES</B></A> <A HREF="package-summary.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD></TR></TABLE><!-- =========== END OF NAVBAR =========== --><HR><H2>Package javax.naming.event</H2>Provides support for event notification when accessing naming anddirectory services.<P><B>See: </B><BR> <A HREF="#package_description"><B>Description</B></A><P><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=2><FONT SIZE="+2"><B>Interface Summary</B></FONT></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD WIDTH="15%"><B><A HREF="EventContext.html"><I>EventContext</I></A></B></TD><TD>Contains methods for registering/deregistering listeners to be notified of events fired when objects named in a context changes.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD WIDTH="15%"><B><A HREF="EventDirContext.html"><I>EventDirContext</I></A></B></TD><TD>Contains methods for registering listeners to be notified of events fired when objects named in a directory context changes.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD WIDTH="15%"><B><A HREF="NamespaceChangeListener.html"><I>NamespaceChangeListener</I></A></B></TD><TD>Specifies the methods that a listener interested in namespace changes must implement.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD WIDTH="15%"><B><A HREF="NamingListener.html"><I>NamingListener</I></A></B></TD><TD>This interface is the root of listener interfaces that handle <tt>NamingEvent</tt>s.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD WIDTH="15%"><B><A HREF="ObjectChangeListener.html"><I>ObjectChangeListener</I></A></B></TD><TD>Specifies the method that a listener of a <tt>NamingEvent</tt> with event type of <tt>OBJECT_CHANGED</tt> must implement.</TD></TR></TABLE> <P><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=2><FONT SIZE="+2"><B>Class Summary</B></FONT></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD WIDTH="15%"><B><A HREF="NamingEvent.html">NamingEvent</A></B></TD><TD>This class represents an event fired by a naming/directory service.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD WIDTH="15%"><B><A HREF="NamingExceptionEvent.html">NamingExceptionEvent</A></B></TD><TD>This class represents an event fired when the procedures/processes used to collect information for notifying listeners of <tt>NamingEvent</tt>s threw a <tt>NamingException</tt>.</TD></TR></TABLE> <P><A NAME="package_description"><!-- --></A><H2>Package javax.naming.event Description</H2><P>Provides support for event notification when accessing naming anddirectory services.<p>This package defines the event notification operations of the Java Namingand Directory Interface<font size=-2><sup>TM</sup></font> (JNDI). JNDI provides naming and directory functionality to applicationswritten in the Java programming language. It is designed to beindependent of any specific naming or directory serviceimplementation. Thus a variety of services--new, emerging, andalready deployed ones--can be accessed in a common way.<h4>Naming Events</h4><p>This package defines a <tt>NamingEvent</tt> class to represent an eventthat is generated by a naming/directory service.It also defines subinterfaces of <tt>Context</tt> and <tt>DirContext</tt>,called <tt>EventContext</tt> and <tt>EventDirContext</tt>,through which applications can register their interest in eventsfired by the context.<p><tt>NamingEvent</tt> represents an event that occurs in a naming or directory service. There are two categories of naming events:<ul><li>Those that affect the namespace (add/remove/rename an object)<li>Those that affect the objects' contents.</ul>Each category of events is handled by a corresponding listener:<tt>NamespaceChangeListener</tt>, <tt>ObjectChangeListener</tt>.<p>An application, for example, can register its interest in changes toobjects in a context as follows:<blockquote><pre>EventContext src = (EventContext)(new InitialContext()).lookup("o=wiz,c=us");src.addNamingListener("ou=users", EventContext.ONELEVEL_SCOPE, new ChangeHandler());...class ChangeHandler implements ObjectChangeListener { public void objectChanged(NamingEvent evt) { System.out.println(evt.getNewBinding()); } public void namingExceptionThrown(NamingExceptionEvent evt) { System.out.println(evt.getException()); }}</pre></blockquote><a name=THREADING></a><h4>Threading Issues</h4>When an event is dispatched to a listener, the listener method (suchas <tt>objectChanged()</tt>) may be executed in a thread other than theone in which the call to <tt>addNamingListener()</tt> was executed.The choice of which thread to use is made by the service provider.When an event is dispatched to multiple listeners, the service providermay choose (and is generally encouraged) to execute the listener methodsconcurrently in separate threads.<p>When a listener instance invokes <tt>NamingEvent.getEventContext()</tt>,it must take into account the possibility that other threads will beworking with that context concurrently. Likewise, when a listener isregistered via <tt>addNamingListener()</tt>, the registering threadmust take into account the likely possibility that the service providerwill later invoke the listeners in newly-created threads. As <tt>Context</tt>instances are not guaranteed to be thread-safe in general, all contextoperations must be synchronized as needed.<h4>Exception Handling</h4>When a listener registers for events with a context, the context mightneed to do some internal processing in order to collect informationrequired to generate the events. The context, for example, might needto make a request to the server to register interest in changeson the server that will eventually be translated into events.If an exception occurs that prevents information about the events frombeing collected, the listener will never be notified of the events.When such an exception occurs, a <tt>NamingExceptionEvent</tt> isfired to notify the listener. The listener's<tt>namingExceptionThrown()</tt> method is invoked, as shown in the sample code above,and the listener is automatically deregistered.<p><h2>Package Specification</h2><p>The following documents can be found at the <a href="http://java.sun.com/products/jndi">Java technology web site</a>:<ul> <li><a href="ftp://ftp.javasoft.com/docs/j2se1.3/jndi.ps">JNDI API Document (Postscript)</a> <li><a href="ftp://ftp.javasoft.com/docs/j2se1.3/jndi.pdf">JNDI API Document (PDF)</a></ul><!--<h2>Related Documentation</h2>For more information on JNDI, please see:<ul> <li><a href="http://java.sun.com/products/jndi/tutorial">The JNDI Tutorial</a> <li><a href="http://java.sun.com/products/jndi/examples.html">Examples</a> <li><a href="ftp://ftp.javasoft.com/docs/j2se1.3/jndiexecsumm.ps">Executive Summary (Postscript)</a> <li><a href="ftp://ftp.javasoft.com/docs/j2se1.3/jndiexecsumm.pdf">Executive Summary (PDF)</a></ul>--><P><DL><DT><B>Since: </B><DD>1.3</DD></DL><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="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Package</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-use.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"> <A HREF="../../../javax/naming/directory/package-summary.html"><B>PREV PACKAGE</B></A> <A HREF="../../../javax/naming/ldap/package-summary.html"><B>NEXT PACKAGE</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../index.html" TARGET="_top"><B>FRAMES</B></A> <A HREF="package-summary.html" TARGET="_top"><B>NO FRAMES</B></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 + -