javax.naming.ldap.UnsolicitedNotificationListener Java Examples

The following examples show how to use javax.naming.ldap.UnsolicitedNotificationListener. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: EventSupport.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Adds <tt>l</tt> to list of listeners interested in <tt>nm</tt>
 * and filter.
 */
synchronized void addNamingListener(String nm, String filter,
    SearchControls ctls, NamingListener l) throws NamingException {

    if (l instanceof ObjectChangeListener ||
        l instanceof NamespaceChangeListener) {
        NotifierArgs args = new NotifierArgs(nm, filter, ctls, l);

        NamingEventNotifier notifier = notifiers.get(args);
        if (notifier == null) {
            notifier = new NamingEventNotifier(this, ctx, args, l);
            notifiers.put(args, notifier);
        } else {
            notifier.addNamingListener(l);
        }
    }
    if (l instanceof UnsolicitedNotificationListener) {
        // Add listener to this's list of unsolicited notifiers
        if (unsolicited == null) {
            unsolicited = new Vector<>(3);
        }
        unsolicited.addElement((UnsolicitedNotificationListener)l);
    }
}
 
Example #2
Source File: EventSupport.java    From jdk8u-dev-jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Adds <tt>l</tt> to list of listeners interested in <tt>nm</tt>
 * and filter.
 */
synchronized void addNamingListener(String nm, String filter,
    SearchControls ctls, NamingListener l) throws NamingException {

    if (l instanceof ObjectChangeListener ||
        l instanceof NamespaceChangeListener) {
        NotifierArgs args = new NotifierArgs(nm, filter, ctls, l);

        NamingEventNotifier notifier = notifiers.get(args);
        if (notifier == null) {
            notifier = new NamingEventNotifier(this, ctx, args, l);
            notifiers.put(args, notifier);
        } else {
            notifier.addNamingListener(l);
        }
    }
    if (l instanceof UnsolicitedNotificationListener) {
        // Add listener to this's list of unsolicited notifiers
        if (unsolicited == null) {
            unsolicited = new Vector<>(3);
        }
        unsolicited.addElement((UnsolicitedNotificationListener)l);
    }
}
 
Example #3
Source File: EventSupport.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Adds <tt>l</tt> to list of listeners interested in <tt>nm</tt>
 * and filter.
 */
synchronized void addNamingListener(String nm, String filter,
    SearchControls ctls, NamingListener l) throws NamingException {

    if (l instanceof ObjectChangeListener ||
        l instanceof NamespaceChangeListener) {
        NotifierArgs args = new NotifierArgs(nm, filter, ctls, l);

        NamingEventNotifier notifier = notifiers.get(args);
        if (notifier == null) {
            notifier = new NamingEventNotifier(this, ctx, args, l);
            notifiers.put(args, notifier);
        } else {
            notifier.addNamingListener(l);
        }
    }
    if (l instanceof UnsolicitedNotificationListener) {
        // Add listener to this's list of unsolicited notifiers
        if (unsolicited == null) {
            unsolicited = new Vector<>(3);
        }
        unsolicited.addElement((UnsolicitedNotificationListener)l);
    }
}
 
Example #4
Source File: EventSupport.java    From jdk8u_jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Adds <tt>l</tt> to list of listeners interested in <tt>nm</tt>
 * and filter.
 */
synchronized void addNamingListener(String nm, String filter,
    SearchControls ctls, NamingListener l) throws NamingException {

    if (l instanceof ObjectChangeListener ||
        l instanceof NamespaceChangeListener) {
        NotifierArgs args = new NotifierArgs(nm, filter, ctls, l);

        NamingEventNotifier notifier = notifiers.get(args);
        if (notifier == null) {
            notifier = new NamingEventNotifier(this, ctx, args, l);
            notifiers.put(args, notifier);
        } else {
            notifier.addNamingListener(l);
        }
    }
    if (l instanceof UnsolicitedNotificationListener) {
        // Add listener to this's list of unsolicited notifiers
        if (unsolicited == null) {
            unsolicited = new Vector<>(3);
        }
        unsolicited.addElement((UnsolicitedNotificationListener)l);
    }
}
 
Example #5
Source File: EventSupport.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Adds <tt>l</tt> to list of listeners interested in <tt>nm</tt>
 * and filter.
 */
synchronized void addNamingListener(String nm, String filter,
    SearchControls ctls, NamingListener l) throws NamingException {

    if (l instanceof ObjectChangeListener ||
        l instanceof NamespaceChangeListener) {
        NotifierArgs args = new NotifierArgs(nm, filter, ctls, l);

        NamingEventNotifier notifier = notifiers.get(args);
        if (notifier == null) {
            notifier = new NamingEventNotifier(this, ctx, args, l);
            notifiers.put(args, notifier);
        } else {
            notifier.addNamingListener(l);
        }
    }
    if (l instanceof UnsolicitedNotificationListener) {
        // Add listener to this's list of unsolicited notifiers
        if (unsolicited == null) {
            unsolicited = new Vector<>(3);
        }
        unsolicited.addElement((UnsolicitedNotificationListener)l);
    }
}
 
Example #6
Source File: EventSupport.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Adds <tt>l</tt> to list of listeners interested in <tt>nm</tt>
 * and filter.
 */
synchronized void addNamingListener(String nm, String filter,
    SearchControls ctls, NamingListener l) throws NamingException {

    if (l instanceof ObjectChangeListener ||
        l instanceof NamespaceChangeListener) {
        NotifierArgs args = new NotifierArgs(nm, filter, ctls, l);

        NamingEventNotifier notifier = notifiers.get(args);
        if (notifier == null) {
            notifier = new NamingEventNotifier(this, ctx, args, l);
            notifiers.put(args, notifier);
        } else {
            notifier.addNamingListener(l);
        }
    }
    if (l instanceof UnsolicitedNotificationListener) {
        // Add listener to this's list of unsolicited notifiers
        if (unsolicited == null) {
            unsolicited = new Vector<>(3);
        }
        unsolicited.addElement((UnsolicitedNotificationListener)l);
    }
}
 
Example #7
Source File: EventSupport.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Adds <tt>l</tt> to list of listeners interested in <tt>nm</tt>
 * and filter.
 */
synchronized void addNamingListener(String nm, String filter,
    SearchControls ctls, NamingListener l) throws NamingException {

    if (l instanceof ObjectChangeListener ||
        l instanceof NamespaceChangeListener) {
        NotifierArgs args = new NotifierArgs(nm, filter, ctls, l);

        NamingEventNotifier notifier = notifiers.get(args);
        if (notifier == null) {
            notifier = new NamingEventNotifier(this, ctx, args, l);
            notifiers.put(args, notifier);
        } else {
            notifier.addNamingListener(l);
        }
    }
    if (l instanceof UnsolicitedNotificationListener) {
        // Add listener to this's list of unsolicited notifiers
        if (unsolicited == null) {
            unsolicited = new Vector<>(3);
        }
        unsolicited.addElement((UnsolicitedNotificationListener)l);
    }
}
 
Example #8
Source File: EventSupport.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Adds {@code l} to list of listeners interested in {@code nm}
 * and filter.
 */
synchronized void addNamingListener(String nm, String filter,
    SearchControls ctls, NamingListener l) throws NamingException {

    if (l instanceof ObjectChangeListener ||
        l instanceof NamespaceChangeListener) {
        NotifierArgs args = new NotifierArgs(nm, filter, ctls, l);

        NamingEventNotifier notifier = notifiers.get(args);
        if (notifier == null) {
            notifier = new NamingEventNotifier(this, ctx, args, l);
            notifiers.put(args, notifier);
        } else {
            notifier.addNamingListener(l);
        }
    }
    if (l instanceof UnsolicitedNotificationListener) {
        // Add listener to this's list of unsolicited notifiers
        if (unsolicited == null) {
            unsolicited = new Vector<>(3);
        }
        unsolicited.addElement((UnsolicitedNotificationListener)l);
    }
}
 
Example #9
Source File: EventSupport.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Adds <tt>l</tt> to list of listeners interested in <tt>nm</tt>
 * and filter.
 */
synchronized void addNamingListener(String nm, String filter,
    SearchControls ctls, NamingListener l) throws NamingException {

    if (l instanceof ObjectChangeListener ||
        l instanceof NamespaceChangeListener) {
        NotifierArgs args = new NotifierArgs(nm, filter, ctls, l);

        NamingEventNotifier notifier = notifiers.get(args);
        if (notifier == null) {
            notifier = new NamingEventNotifier(this, ctx, args, l);
            notifiers.put(args, notifier);
        } else {
            notifier.addNamingListener(l);
        }
    }
    if (l instanceof UnsolicitedNotificationListener) {
        // Add listener to this's list of unsolicited notifiers
        if (unsolicited == null) {
            unsolicited = new Vector<>(3);
        }
        unsolicited.addElement((UnsolicitedNotificationListener)l);
    }
}
 
Example #10
Source File: EventSupport.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Adds <tt>l</tt> to list of listeners interested in <tt>nm</tt>
 * and filter.
 */
synchronized void addNamingListener(String nm, String filter,
    SearchControls ctls, NamingListener l) throws NamingException {

    if (l instanceof ObjectChangeListener ||
        l instanceof NamespaceChangeListener) {
        NotifierArgs args = new NotifierArgs(nm, filter, ctls, l);

        NamingEventNotifier notifier = notifiers.get(args);
        if (notifier == null) {
            notifier = new NamingEventNotifier(this, ctx, args, l);
            notifiers.put(args, notifier);
        } else {
            notifier.addNamingListener(l);
        }
    }
    if (l instanceof UnsolicitedNotificationListener) {
        // Add listener to this's list of unsolicited notifiers
        if (unsolicited == null) {
            unsolicited = new Vector<>(3);
        }
        unsolicited.addElement((UnsolicitedNotificationListener)l);
    }
}
 
Example #11
Source File: EventSupport.java    From dragonwell8_jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Adds <tt>l</tt> to list of listeners interested in <tt>nm</tt>
 * and filter.
 */
synchronized void addNamingListener(String nm, String filter,
    SearchControls ctls, NamingListener l) throws NamingException {

    if (l instanceof ObjectChangeListener ||
        l instanceof NamespaceChangeListener) {
        NotifierArgs args = new NotifierArgs(nm, filter, ctls, l);

        NamingEventNotifier notifier = notifiers.get(args);
        if (notifier == null) {
            notifier = new NamingEventNotifier(this, ctx, args, l);
            notifiers.put(args, notifier);
        } else {
            notifier.addNamingListener(l);
        }
    }
    if (l instanceof UnsolicitedNotificationListener) {
        // Add listener to this's list of unsolicited notifiers
        if (unsolicited == null) {
            unsolicited = new Vector<>(3);
        }
        unsolicited.addElement((UnsolicitedNotificationListener)l);
    }
}
 
Example #12
Source File: EventSupport.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Adds <tt>l</tt> to list of listeners interested in <tt>nm</tt>
 * and filter.
 */
synchronized void addNamingListener(String nm, String filter,
    SearchControls ctls, NamingListener l) throws NamingException {

    if (l instanceof ObjectChangeListener ||
        l instanceof NamespaceChangeListener) {
        NotifierArgs args = new NotifierArgs(nm, filter, ctls, l);

        NamingEventNotifier notifier = notifiers.get(args);
        if (notifier == null) {
            notifier = new NamingEventNotifier(this, ctx, args, l);
            notifiers.put(args, notifier);
        } else {
            notifier.addNamingListener(l);
        }
    }
    if (l instanceof UnsolicitedNotificationListener) {
        // Add listener to this's list of unsolicited notifiers
        if (unsolicited == null) {
            unsolicited = new Vector<>(3);
        }
        unsolicited.addElement((UnsolicitedNotificationListener)l);
    }
}
 
Example #13
Source File: EventSupport.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Adds <tt>l</tt> to list of listeners interested in <tt>nm</tt>
 * and filter.
 */
synchronized void addNamingListener(String nm, String filter,
    SearchControls ctls, NamingListener l) throws NamingException {

    if (l instanceof ObjectChangeListener ||
        l instanceof NamespaceChangeListener) {
        NotifierArgs args = new NotifierArgs(nm, filter, ctls, l);

        NamingEventNotifier notifier = notifiers.get(args);
        if (notifier == null) {
            notifier = new NamingEventNotifier(this, ctx, args, l);
            notifiers.put(args, notifier);
        } else {
            notifier.addNamingListener(l);
        }
    }
    if (l instanceof UnsolicitedNotificationListener) {
        // Add listener to this's list of unsolicited notifiers
        if (unsolicited == null) {
            unsolicited = new Vector<>(3);
        }
        unsolicited.addElement((UnsolicitedNotificationListener)l);
    }
}
 
Example #14
Source File: EventSupport.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Adds <tt>l</tt> to list of listeners interested in <tt>nm</tt>.
 */
/*
 * Make the add/removeNamingListeners synchronized to:
 * 1. protect usage of 'unsolicited', which may be read by
 *    the Connection thread when dispatching unsolicited notification.
 * 2. ensure that NamingEventNotifier thread's access to 'notifiers'
 *    is safe
 */
synchronized void addNamingListener(String nm, int scope,
    NamingListener l) throws NamingException {

    if (l instanceof ObjectChangeListener ||
        l instanceof NamespaceChangeListener) {
        NotifierArgs args = new NotifierArgs(nm, scope, l);

        NamingEventNotifier notifier = notifiers.get(args);
        if (notifier == null) {
            notifier = new NamingEventNotifier(this, ctx, args, l);
            notifiers.put(args, notifier);
        } else {
            notifier.addNamingListener(l);
        }
    }
    if (l instanceof UnsolicitedNotificationListener) {
        // Add listener to this's list of unsolicited notifiers
        if (unsolicited == null) {
            unsolicited = new Vector<>(3);
        }

        unsolicited.addElement((UnsolicitedNotificationListener)l);
    }
}
 
Example #15
Source File: EventSupport.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Adds <tt>l</tt> to list of listeners interested in <tt>nm</tt>.
 */
/*
 * Make the add/removeNamingListeners synchronized to:
 * 1. protect usage of 'unsolicited', which may be read by
 *    the Connection thread when dispatching unsolicited notification.
 * 2. ensure that NamingEventNotifier thread's access to 'notifiers'
 *    is safe
 */
synchronized void addNamingListener(String nm, int scope,
    NamingListener l) throws NamingException {

    if (l instanceof ObjectChangeListener ||
        l instanceof NamespaceChangeListener) {
        NotifierArgs args = new NotifierArgs(nm, scope, l);

        NamingEventNotifier notifier = notifiers.get(args);
        if (notifier == null) {
            notifier = new NamingEventNotifier(this, ctx, args, l);
            notifiers.put(args, notifier);
        } else {
            notifier.addNamingListener(l);
        }
    }
    if (l instanceof UnsolicitedNotificationListener) {
        // Add listener to this's list of unsolicited notifiers
        if (unsolicited == null) {
            unsolicited = new Vector<>(3);
        }

        unsolicited.addElement((UnsolicitedNotificationListener)l);
    }
}
 
Example #16
Source File: EventSupport.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Adds <tt>l</tt> to list of listeners interested in <tt>nm</tt>.
 */
/*
 * Make the add/removeNamingListeners synchronized to:
 * 1. protect usage of 'unsolicited', which may be read by
 *    the Connection thread when dispatching unsolicited notification.
 * 2. ensure that NamingEventNotifier thread's access to 'notifiers'
 *    is safe
 */
synchronized void addNamingListener(String nm, int scope,
    NamingListener l) throws NamingException {

    if (l instanceof ObjectChangeListener ||
        l instanceof NamespaceChangeListener) {
        NotifierArgs args = new NotifierArgs(nm, scope, l);

        NamingEventNotifier notifier = notifiers.get(args);
        if (notifier == null) {
            notifier = new NamingEventNotifier(this, ctx, args, l);
            notifiers.put(args, notifier);
        } else {
            notifier.addNamingListener(l);
        }
    }
    if (l instanceof UnsolicitedNotificationListener) {
        // Add listener to this's list of unsolicited notifiers
        if (unsolicited == null) {
            unsolicited = new Vector<>(3);
        }

        unsolicited.addElement((UnsolicitedNotificationListener)l);
    }
}
 
Example #17
Source File: EventSupport.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Adds <tt>l</tt> to list of listeners interested in <tt>nm</tt>.
 */
/*
 * Make the add/removeNamingListeners synchronized to:
 * 1. protect usage of 'unsolicited', which may be read by
 *    the Connection thread when dispatching unsolicited notification.
 * 2. ensure that NamingEventNotifier thread's access to 'notifiers'
 *    is safe
 */
synchronized void addNamingListener(String nm, int scope,
    NamingListener l) throws NamingException {

    if (l instanceof ObjectChangeListener ||
        l instanceof NamespaceChangeListener) {
        NotifierArgs args = new NotifierArgs(nm, scope, l);

        NamingEventNotifier notifier = notifiers.get(args);
        if (notifier == null) {
            notifier = new NamingEventNotifier(this, ctx, args, l);
            notifiers.put(args, notifier);
        } else {
            notifier.addNamingListener(l);
        }
    }
    if (l instanceof UnsolicitedNotificationListener) {
        // Add listener to this's list of unsolicited notifiers
        if (unsolicited == null) {
            unsolicited = new Vector<>(3);
        }

        unsolicited.addElement((UnsolicitedNotificationListener)l);
    }
}
 
Example #18
Source File: EventSupport.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Adds <tt>l</tt> to list of listeners interested in <tt>nm</tt>.
 */
/*
 * Make the add/removeNamingListeners synchronized to:
 * 1. protect usage of 'unsolicited', which may be read by
 *    the Connection thread when dispatching unsolicited notification.
 * 2. ensure that NamingEventNotifier thread's access to 'notifiers'
 *    is safe
 */
synchronized void addNamingListener(String nm, int scope,
    NamingListener l) throws NamingException {

    if (l instanceof ObjectChangeListener ||
        l instanceof NamespaceChangeListener) {
        NotifierArgs args = new NotifierArgs(nm, scope, l);

        NamingEventNotifier notifier = notifiers.get(args);
        if (notifier == null) {
            notifier = new NamingEventNotifier(this, ctx, args, l);
            notifiers.put(args, notifier);
        } else {
            notifier.addNamingListener(l);
        }
    }
    if (l instanceof UnsolicitedNotificationListener) {
        // Add listener to this's list of unsolicited notifiers
        if (unsolicited == null) {
            unsolicited = new Vector<>(3);
        }

        unsolicited.addElement((UnsolicitedNotificationListener)l);
    }
}
 
Example #19
Source File: EventSupport.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Adds <tt>l</tt> to list of listeners interested in <tt>nm</tt>.
 */
/*
 * Make the add/removeNamingListeners synchronized to:
 * 1. protect usage of 'unsolicited', which may be read by
 *    the Connection thread when dispatching unsolicited notification.
 * 2. ensure that NamingEventNotifier thread's access to 'notifiers'
 *    is safe
 */
synchronized void addNamingListener(String nm, int scope,
    NamingListener l) throws NamingException {

    if (l instanceof ObjectChangeListener ||
        l instanceof NamespaceChangeListener) {
        NotifierArgs args = new NotifierArgs(nm, scope, l);

        NamingEventNotifier notifier = notifiers.get(args);
        if (notifier == null) {
            notifier = new NamingEventNotifier(this, ctx, args, l);
            notifiers.put(args, notifier);
        } else {
            notifier.addNamingListener(l);
        }
    }
    if (l instanceof UnsolicitedNotificationListener) {
        // Add listener to this's list of unsolicited notifiers
        if (unsolicited == null) {
            unsolicited = new Vector<>(3);
        }

        unsolicited.addElement((UnsolicitedNotificationListener)l);
    }
}
 
Example #20
Source File: EventSupport.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Adds <tt>l</tt> to list of listeners interested in <tt>nm</tt>.
 */
/*
 * Make the add/removeNamingListeners synchronized to:
 * 1. protect usage of 'unsolicited', which may be read by
 *    the Connection thread when dispatching unsolicited notification.
 * 2. ensure that NamingEventNotifier thread's access to 'notifiers'
 *    is safe
 */
synchronized void addNamingListener(String nm, int scope,
    NamingListener l) throws NamingException {

    if (l instanceof ObjectChangeListener ||
        l instanceof NamespaceChangeListener) {
        NotifierArgs args = new NotifierArgs(nm, scope, l);

        NamingEventNotifier notifier = notifiers.get(args);
        if (notifier == null) {
            notifier = new NamingEventNotifier(this, ctx, args, l);
            notifiers.put(args, notifier);
        } else {
            notifier.addNamingListener(l);
        }
    }
    if (l instanceof UnsolicitedNotificationListener) {
        // Add listener to this's list of unsolicited notifiers
        if (unsolicited == null) {
            unsolicited = new Vector<>(3);
        }

        unsolicited.addElement((UnsolicitedNotificationListener)l);
    }
}
 
Example #21
Source File: EventSupport.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Adds <tt>l</tt> to list of listeners interested in <tt>nm</tt>.
 */
/*
 * Make the add/removeNamingListeners synchronized to:
 * 1. protect usage of 'unsolicited', which may be read by
 *    the Connection thread when dispatching unsolicited notification.
 * 2. ensure that NamingEventNotifier thread's access to 'notifiers'
 *    is safe
 */
synchronized void addNamingListener(String nm, int scope,
    NamingListener l) throws NamingException {

    if (l instanceof ObjectChangeListener ||
        l instanceof NamespaceChangeListener) {
        NotifierArgs args = new NotifierArgs(nm, scope, l);

        NamingEventNotifier notifier = notifiers.get(args);
        if (notifier == null) {
            notifier = new NamingEventNotifier(this, ctx, args, l);
            notifiers.put(args, notifier);
        } else {
            notifier.addNamingListener(l);
        }
    }
    if (l instanceof UnsolicitedNotificationListener) {
        // Add listener to this's list of unsolicited notifiers
        if (unsolicited == null) {
            unsolicited = new Vector<>(3);
        }

        unsolicited.addElement((UnsolicitedNotificationListener)l);
    }
}
 
Example #22
Source File: EventSupport.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Adds <tt>l</tt> to list of listeners interested in <tt>nm</tt>.
 */
/*
 * Make the add/removeNamingListeners synchronized to:
 * 1. protect usage of 'unsolicited', which may be read by
 *    the Connection thread when dispatching unsolicited notification.
 * 2. ensure that NamingEventNotifier thread's access to 'notifiers'
 *    is safe
 */
synchronized void addNamingListener(String nm, int scope,
    NamingListener l) throws NamingException {

    if (l instanceof ObjectChangeListener ||
        l instanceof NamespaceChangeListener) {
        NotifierArgs args = new NotifierArgs(nm, scope, l);

        NamingEventNotifier notifier = notifiers.get(args);
        if (notifier == null) {
            notifier = new NamingEventNotifier(this, ctx, args, l);
            notifiers.put(args, notifier);
        } else {
            notifier.addNamingListener(l);
        }
    }
    if (l instanceof UnsolicitedNotificationListener) {
        // Add listener to this's list of unsolicited notifiers
        if (unsolicited == null) {
            unsolicited = new Vector<>(3);
        }

        unsolicited.addElement((UnsolicitedNotificationListener)l);
    }
}
 
Example #23
Source File: EventSupport.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Adds <tt>l</tt> to list of listeners interested in <tt>nm</tt>.
 */
/*
 * Make the add/removeNamingListeners synchronized to:
 * 1. protect usage of 'unsolicited', which may be read by
 *    the Connection thread when dispatching unsolicited notification.
 * 2. ensure that NamingEventNotifier thread's access to 'notifiers'
 *    is safe
 */
synchronized void addNamingListener(String nm, int scope,
    NamingListener l) throws NamingException {

    if (l instanceof ObjectChangeListener ||
        l instanceof NamespaceChangeListener) {
        NotifierArgs args = new NotifierArgs(nm, scope, l);

        NamingEventNotifier notifier = notifiers.get(args);
        if (notifier == null) {
            notifier = new NamingEventNotifier(this, ctx, args, l);
            notifiers.put(args, notifier);
        } else {
            notifier.addNamingListener(l);
        }
    }
    if (l instanceof UnsolicitedNotificationListener) {
        // Add listener to this's list of unsolicited notifiers
        if (unsolicited == null) {
            unsolicited = new Vector<>(3);
        }

        unsolicited.addElement((UnsolicitedNotificationListener)l);
    }
}
 
Example #24
Source File: EventSupport.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Adds <tt>l</tt> to list of listeners interested in <tt>nm</tt>.
 */
/*
 * Make the add/removeNamingListeners synchronized to:
 * 1. protect usage of 'unsolicited', which may be read by
 *    the Connection thread when dispatching unsolicited notification.
 * 2. ensure that NamingEventNotifier thread's access to 'notifiers'
 *    is safe
 */
synchronized void addNamingListener(String nm, int scope,
    NamingListener l) throws NamingException {

    if (l instanceof ObjectChangeListener ||
        l instanceof NamespaceChangeListener) {
        NotifierArgs args = new NotifierArgs(nm, scope, l);

        NamingEventNotifier notifier = notifiers.get(args);
        if (notifier == null) {
            notifier = new NamingEventNotifier(this, ctx, args, l);
            notifiers.put(args, notifier);
        } else {
            notifier.addNamingListener(l);
        }
    }
    if (l instanceof UnsolicitedNotificationListener) {
        // Add listener to this's list of unsolicited notifiers
        if (unsolicited == null) {
            unsolicited = new Vector<>(3);
        }

        unsolicited.addElement((UnsolicitedNotificationListener)l);
    }
}
 
Example #25
Source File: EventSupport.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Adds <tt>l</tt> to list of listeners interested in <tt>nm</tt>.
 */
/*
 * Make the add/removeNamingListeners synchronized to:
 * 1. protect usage of 'unsolicited', which may be read by
 *    the Connection thread when dispatching unsolicited notification.
 * 2. ensure that NamingEventNotifier thread's access to 'notifiers'
 *    is safe
 */
synchronized void addNamingListener(String nm, int scope,
    NamingListener l) throws NamingException {

    if (l instanceof ObjectChangeListener ||
        l instanceof NamespaceChangeListener) {
        NotifierArgs args = new NotifierArgs(nm, scope, l);

        NamingEventNotifier notifier = notifiers.get(args);
        if (notifier == null) {
            notifier = new NamingEventNotifier(this, ctx, args, l);
            notifiers.put(args, notifier);
        } else {
            notifier.addNamingListener(l);
        }
    }
    if (l instanceof UnsolicitedNotificationListener) {
        // Add listener to this's list of unsolicited notifiers
        if (unsolicited == null) {
            unsolicited = new Vector<>(3);
        }

        unsolicited.addElement((UnsolicitedNotificationListener)l);
    }
}
 
Example #26
Source File: EventSupport.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Adds {@code l} to list of listeners interested in {@code nm}.
 */
/*
 * Make the add/removeNamingListeners synchronized to:
 * 1. protect usage of 'unsolicited', which may be read by
 *    the Connection thread when dispatching unsolicited notification.
 * 2. ensure that NamingEventNotifier thread's access to 'notifiers'
 *    is safe
 */
synchronized void addNamingListener(String nm, int scope,
    NamingListener l) throws NamingException {

    if (l instanceof ObjectChangeListener ||
        l instanceof NamespaceChangeListener) {
        NotifierArgs args = new NotifierArgs(nm, scope, l);

        NamingEventNotifier notifier = notifiers.get(args);
        if (notifier == null) {
            notifier = new NamingEventNotifier(this, ctx, args, l);
            notifiers.put(args, notifier);
        } else {
            notifier.addNamingListener(l);
        }
    }
    if (l instanceof UnsolicitedNotificationListener) {
        // Add listener to this's list of unsolicited notifiers
        if (unsolicited == null) {
            unsolicited = new Vector<>(3);
        }

        unsolicited.addElement((UnsolicitedNotificationListener)l);
    }
}