📄 namingevent.html
字号:
</TABLE><A NAME="OBJECT_ADDED"><!-- --></A><H3>OBJECT_ADDED</H3><PRE>public static final int <B>OBJECT_ADDED</B></PRE><DL><DD>Naming event type for indicating that a new object has been added. The value of this constant is <tt>0</tt>.</DL><HR><A NAME="OBJECT_REMOVED"><!-- --></A><H3>OBJECT_REMOVED</H3><PRE>public static final int <B>OBJECT_REMOVED</B></PRE><DL><DD>Naming event type for indicating that an object has been removed. The value of this constant is <tt>1</tt>.</DL><HR><A NAME="OBJECT_RENAMED"><!-- --></A><H3>OBJECT_RENAMED</H3><PRE>public static final int <B>OBJECT_RENAMED</B></PRE><DL><DD>Naming event type for indicating that an object has been renamed. Note that some services might fire multiple events for a single logical rename operation. For example, the rename operation might be implemented by adding a binding with the new name and removing the old binding.<p> The old/new binding in <tt>NamingEvent</tt> may be null if the old name or new name is outside of the scope for which the listener has registered.<p> When an interior node in the namespace tree has been renamed, the topmost node which is part of the listener's scope should used to generate a rename event. The extent to which this can be supported is provider-specific. For example, a service might generate rename notifications for all descendants of the changed interior node and the corresponding provider might not be able to prevent those notifications from being propagated to the listeners.<p> The value of this constant is <tt>2</tt>.</DL><HR><A NAME="OBJECT_CHANGED"><!-- --></A><H3>OBJECT_CHANGED</H3><PRE>public static final int <B>OBJECT_CHANGED</B></PRE><DL><DD>Naming event type for indicating that an object has been changed. The changes might include the object's attributes, or the object itself. Note that some services might fire multiple events for a single modification. For example, the modification might be implemented by first removing the old binding and adding a new binding containing the same name but a different object.<p> The value of this constant is <tt>3</tt>.</DL><HR><A NAME="changeInfo"><!-- --></A><H3>changeInfo</H3><PRE>protected <A HREF="../../../java/lang/Object.html">Object</A> <B>changeInfo</B></PRE><DL><DD>Contains information about the change that generated this event.</DL><HR><A NAME="type"><!-- --></A><H3>type</H3><PRE>protected int <B>type</B></PRE><DL><DD>Contains the type of this event.<DD><DL><DT><B>See Also: </B><DD><A HREF="../../../javax/naming/event/NamingEvent.html#OBJECT_ADDED"><CODE>OBJECT_ADDED</CODE></A>, <A HREF="../../../javax/naming/event/NamingEvent.html#OBJECT_REMOVED"><CODE>OBJECT_REMOVED</CODE></A>, <A HREF="../../../javax/naming/event/NamingEvent.html#OBJECT_RENAMED"><CODE>OBJECT_RENAMED</CODE></A>, <A HREF="../../../javax/naming/event/NamingEvent.html#OBJECT_CHANGED"><CODE>OBJECT_CHANGED</CODE></A></DL></DD></DL><HR><A NAME="oldBinding"><!-- --></A><H3>oldBinding</H3><PRE>protected <A HREF="../../../javax/naming/Binding.html">Binding</A> <B>oldBinding</B></PRE><DL><DD>Contains information about the object before the change.</DL><HR><A NAME="newBinding"><!-- --></A><H3>newBinding</H3><PRE>protected <A HREF="../../../javax/naming/Binding.html">Binding</A> <B>newBinding</B></PRE><DL><DD>Contains information about the object after the change.</DL><!-- ========= CONSTRUCTOR DETAIL ======== --><A NAME="constructor_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Constructor Detail</B></FONT></TD></TR></TABLE><A NAME="NamingEvent(javax.naming.event.EventContext, int, javax.naming.Binding, javax.naming.Binding, java.lang.Object)"><!-- --></A><H3>NamingEvent</H3><PRE>public <B>NamingEvent</B>(<A HREF="../../../javax/naming/event/EventContext.html">EventContext</A> source, int type, <A HREF="../../../javax/naming/Binding.html">Binding</A> newBd, <A HREF="../../../javax/naming/Binding.html">Binding</A> oldBd, <A HREF="../../../java/lang/Object.html">Object</A> changeInfo)</PRE><DL><DD>Constructs an instance of <tt>NamingEvent</tt>.<p> The names in <tt>newBd</tt> and <tt>oldBd</tt> are to be resolved relative to the event source <tt>source</tt>. For an <tt>OBJECT_ADDED</tt> event type, <tt>newBd</tt> must not be null. For an <tt>OBJECT_REMOVED</tt> event type, <tt>oldBd</tt> must not be null. For an <tt>OBJECT_CHANGED</tt> event type, <tt>newBd</tt> and <tt>oldBd</tt> must not be null. For an <tt>OBJECT_RENAMED</tt> event type, one of <tt>newBd</tt> or <tt>oldBd</tt> may be null if the new or old binding is outside of the scope for which the listener has registered.<DD><DL><DT><B>Parameters:</B><DD><CODE>source</CODE> - The non-null context that fired this event.<DD><CODE>type</CODE> - The type of the event.<DD><CODE>newBd</CODE> - A possibly null binding before the change. See method description.<DD><CODE>oldBd</CODE> - A possibly null binding after the change. See method description.<DD><CODE>changeInfo</CODE> - A possibly null object containing information about the change.<DT><B>See Also: </B><DD><A HREF="../../../javax/naming/event/NamingEvent.html#OBJECT_ADDED"><CODE>OBJECT_ADDED</CODE></A>, <A HREF="../../../javax/naming/event/NamingEvent.html#OBJECT_REMOVED"><CODE>OBJECT_REMOVED</CODE></A>, <A HREF="../../../javax/naming/event/NamingEvent.html#OBJECT_RENAMED"><CODE>OBJECT_RENAMED</CODE></A>, <A HREF="../../../javax/naming/event/NamingEvent.html#OBJECT_CHANGED"><CODE>OBJECT_CHANGED</CODE></A></DL></DD></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="getType()"><!-- --></A><H3>getType</H3><PRE>public int <B>getType</B>()</PRE><DL><DD>Returns the type of this event.<DD><DL><DT><B>Returns:</B><DD>The type of this event.<DT><B>See Also: </B><DD><A HREF="../../../javax/naming/event/NamingEvent.html#OBJECT_ADDED"><CODE>OBJECT_ADDED</CODE></A>, <A HREF="../../../javax/naming/event/NamingEvent.html#OBJECT_REMOVED"><CODE>OBJECT_REMOVED</CODE></A>, <A HREF="../../../javax/naming/event/NamingEvent.html#OBJECT_RENAMED"><CODE>OBJECT_RENAMED</CODE></A>, <A HREF="../../../javax/naming/event/NamingEvent.html#OBJECT_CHANGED"><CODE>OBJECT_CHANGED</CODE></A></DL></DD></DL><HR><A NAME="getEventContext()"><!-- --></A><H3>getEventContext</H3><PRE>public <A HREF="../../../javax/naming/event/EventContext.html">EventContext</A> <B>getEventContext</B>()</PRE><DL><DD>Retrieves the event source that fired this event. This returns the same object as <tt>EventObject.getSource()</tt>.<p> If the result of this method is used to access the event source, for example, to look up the object or get its attributes, then it needs to be locked because implementations of <tt>Context</tt> are not guaranteed to be thread-safe (and <tt>EventContext</tt> is a subinterface of Context</tt>). See the <a href=package-summary.html#THREADING>package description</a> for more information on threading issues.<DD><DL><DT><B>Returns:</B><DD>The non-null context that fired this event.</DL></DD></DL><HR><A NAME="getOldBinding()"><!-- --></A><H3>getOldBinding</H3><PRE>public <A HREF="../../../javax/naming/Binding.html">Binding</A> <B>getOldBinding</B>()</PRE><DL><DD>Retrieves the binding of the object before the change.<p> The binding must be nonnull if the object existed before the change relative to the source context (<tt>getEventContext()</tt>). That is, it must be nonnull for <tt>OBJECT_REMOVED</tt> and <tt>OBJECT_CHANGED</tt>. For <tt>OBJECT_RENAMED</tt>, it is null if the object before the rename is outside of the scope for which the listener has registered interest; it is nonnull if the object is inside the scope before the rename.<p> The name in the binding is to be resolved relative to the event source <tt>getEventContext()</tt>. The object returned by <tt>Binding.getObject()</tt> may be null if such information is unavailable.<DD><DL><DT><B>Returns:</B><DD>The possibly null binding of the object before the change.</DL></DD></DL><HR><A NAME="getNewBinding()"><!-- --></A><H3>getNewBinding</H3><PRE>public <A HREF="../../../javax/naming/Binding.html">Binding</A> <B>getNewBinding</B>()</PRE><DL><DD>Retrieves the binding of the object after the change.<p> The binding must be nonnull if the object existed after the change relative to the source context (<tt>getEventContext()</tt>). That is, it must be nonnull for <tt>OBJECT_ADDED</tt> and <tt>OBJECT_CHANGED</tt>. For <tt>OBJECT_RENAMED</tt>, it is null if the object after the rename is outside the scope for which the listener registered interest; it is nonnull if the object is inside the scope after the rename.<p> The name in the binding is to be resolved relative to the event source <tt>getEventContext()</tt>. The object returned by <tt>Binding.getObject()</tt> may be null if such information is unavailable.<DD><DL><DT><B>Returns:</B><DD>The possibly null binding of the object after the change.</DL></DD></DL><HR><A NAME="getChangeInfo()"><!-- --></A><H3>getChangeInfo</H3><PRE>public <A HREF="../../../java/lang/Object.html">Object</A> <B>getChangeInfo</B>()</PRE><DL><DD>Retrieves the change information for this event. The value of the change information is service-specific. For example, it could be an ID that identifies the change in a change log on the server.<DD><DL><DT><B>Returns:</B><DD>The possibly null change information of this event.</DL></DD></DL><HR><A NAME="dispatch(javax.naming.event.NamingListener)"><!-- --></A><H3>dispatch</H3><PRE>public void <B>dispatch</B>(<A HREF="../../../javax/naming/event/NamingListener.html">NamingListener</A> listener)</PRE><DL><DD>Invokes the appropriate listener method on this event. The default implementation of this method handles the following event types: <tt>OBJECT_ADDED</TT>, <TT>OBJECT_REMOVED</TT>, <TT>OBJECT_RENAMED</TT>, <TT>OBJECT_CHANGED</TT>.<p> The listener method is executed in the same thread as this method. See the <a href=package-summary.html#THREADING>package description</a> for more information on threading issues.<DD><DL><DT><B>Parameters:</B><DD><CODE>listener</CODE> - The nonnull listener.</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/NamingEvent.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/event/NamingExceptionEvent.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="NamingEvent.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: INNER | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: <A HREF="#field_detail">FIELD</A> | <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 + -