< prev index next >

src/java.naming/share/classes/com/sun/jndi/ldap/EventSupport.java

Print this page

        

*** 1,7 **** /* ! * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this --- 1,7 ---- /* ! * Copyright (c) 1999, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this
*** 76,109 **** *<p> * *When a context no longer needs this EventSupport, it should invoke *cleanup() on it. *<p> ! *<h4>Registration</h4> *When a registration request is made, this class attempts to find an *existing notifier that's already working on the request. If one is *found, the listener is added to the notifier's list. If one is not found, *a new notifier is created for the listener. * ! *<h4>Deregistration</h4> *When a deregistration request is made, this class attempts to find its *corresponding notifier. If the notifier is found, the listener is removed *from the notifier's list. If the listener is the last listener on the list, *the notifier's thread is terminated and removed from this class's hashtable. *Nothing happens if the notifier is not found. * ! *<h4>Event Dispatching</h4> *The notifiers are responsible for gather information for generating events *requested by their respective listeners. When a notifier gets sufficient *information to generate an event, it creates invokes the *appropriate {@code fireXXXEvent} on this class with the information and list of *listeners. This causes an event and the list of listeners to be added *to the <em>event queue</em>. *This class maintains an event queue and a dispatching thread that dequeues *events from the queue and dispatches them to the listeners. * ! *<h4>Synchronization</h4> *This class is used by the main thread (LdapCtx) to add/remove listeners. *It is also used asynchronously by NamingEventNotifiers threads and *the context's Connection thread. It is used by the notifier threads to *queue events and to update the notifiers list when the notifiers exit. *It is used by the Connection thread to fire unsolicited notifications. --- 76,109 ---- *<p> * *When a context no longer needs this EventSupport, it should invoke *cleanup() on it. *<p> ! *<h2>Registration</h2> *When a registration request is made, this class attempts to find an *existing notifier that's already working on the request. If one is *found, the listener is added to the notifier's list. If one is not found, *a new notifier is created for the listener. * ! *<h2>Deregistration</h2> *When a deregistration request is made, this class attempts to find its *corresponding notifier. If the notifier is found, the listener is removed *from the notifier's list. If the listener is the last listener on the list, *the notifier's thread is terminated and removed from this class's hashtable. *Nothing happens if the notifier is not found. * ! *<h2>Event Dispatching</h2> *The notifiers are responsible for gather information for generating events *requested by their respective listeners. When a notifier gets sufficient *information to generate an event, it creates invokes the *appropriate {@code fireXXXEvent} on this class with the information and list of *listeners. This causes an event and the list of listeners to be added *to the <em>event queue</em>. *This class maintains an event queue and a dispatching thread that dequeues *events from the queue and dispatches them to the listeners. * ! *<h2>Synchronization</h2> *This class is used by the main thread (LdapCtx) to add/remove listeners. *It is also used asynchronously by NamingEventNotifiers threads and *the context's Connection thread. It is used by the notifier threads to *queue events and to update the notifiers list when the notifiers exit. *It is used by the Connection thread to fire unsolicited notifications.
< prev index next >