Search in sources :

Example 1 with NamingListener

use of javax.naming.event.NamingListener in project jdk8u_jdk by JetBrains.

the class EventQueue method run.

/**
     * Pull events off the queue and dispatch them.
     */
public void run() {
    QueueElement qe;
    try {
        while ((qe = dequeue()) != null) {
            EventObject e = qe.event;
            Vector<NamingListener> v = qe.vector;
            for (int i = 0; i < v.size(); i++) {
                if (e instanceof NamingEvent) {
                    ((NamingEvent) e).dispatch(v.elementAt(i));
                // An exception occurred: if notify all naming listeners
                } else if (e instanceof NamingExceptionEvent) {
                    ((NamingExceptionEvent) e).dispatch(v.elementAt(i));
                } else if (e instanceof UnsolicitedNotificationEvent) {
                    ((UnsolicitedNotificationEvent) e).dispatch((UnsolicitedNotificationListener) v.elementAt(i));
                }
            }
            qe = null;
            e = null;
            v = null;
        }
    } catch (InterruptedException e) {
    // just die
    }
}
Also used : NamingListener(javax.naming.event.NamingListener) UnsolicitedNotificationEvent(javax.naming.ldap.UnsolicitedNotificationEvent) NamingEvent(javax.naming.event.NamingEvent) NamingExceptionEvent(javax.naming.event.NamingExceptionEvent) EventObject(java.util.EventObject)

Aggregations

EventObject (java.util.EventObject)1 NamingEvent (javax.naming.event.NamingEvent)1 NamingExceptionEvent (javax.naming.event.NamingExceptionEvent)1 NamingListener (javax.naming.event.NamingListener)1 UnsolicitedNotificationEvent (javax.naming.ldap.UnsolicitedNotificationEvent)1