KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > javax > naming > ldap > UnsolicitedNotificationEvent


1 /*
2  * @(#)UnsolicitedNotificationEvent.java 1.8 03/12/19
3  *
4  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7
8 package javax.naming.ldap;
9
10 /**
11  * This class represents an event fired in response to an unsolicited
12  * notification sent by the LDAP server.
13  *
14  * @author Rosanna Lee
15  * @author Scott Seligman
16  * @author Vincent Ryan
17  * @version 1.8 03/12/19
18  *
19  * @see UnsolicitedNotification
20  * @see UnsolicitedNotificationListener
21  * @see javax.naming.event.EventContext#addNamingListener
22  * @see javax.naming.event.EventDirContext#addNamingListener
23  * @see javax.naming.event.EventContext#removeNamingListener
24  * @since 1.3
25  */

26
27 public class UnsolicitedNotificationEvent extends java.util.EventObject JavaDoc {
28     /**
29      * The notification that caused this event to be fired.
30      * @serial
31      */

32     private UnsolicitedNotification JavaDoc notice;
33
34     /**
35      * Constructs a new instance of <tt>UnsolicitedNotificationEvent</tt>.
36      *
37      * @param src The non-null source that fired the event.
38      * @param notice The non-null unsolicited notification.
39      */

40     public UnsolicitedNotificationEvent(Object JavaDoc src,
41     UnsolicitedNotification JavaDoc notice) {
42     super(src);
43     this.notice = notice;
44     }
45     
46
47     /**
48      * Returns the unsolicited notification.
49      * @return The non-null unsolicited notification that caused this
50      * event to be fired.
51      */

52     public UnsolicitedNotification JavaDoc getNotification() {
53     return notice;
54     }
55
56     /**
57      * Invokes the <tt>notificationReceived()</tt> method on
58      * a listener using this event.
59      * @param listener The non-null listener on which to invoke
60      * <tt>notificationReceived</tt>.
61      */

62     public void dispatch(UnsolicitedNotificationListener JavaDoc listener) {
63     listener.notificationReceived(this);
64     }
65
66     private static final long serialVersionUID = -2382603380799883705L;
67 }
68
Popular Tags