类javax.naming.ldap.UnsolicitedNotificationListener源码实例Demo

下面列出了怎么用javax.naming.ldap.UnsolicitedNotificationListener的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: dragonwell8_jdk   文件: EventSupport.java
/**
 * 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);
    }
}
 
源代码2 项目: TencentKona-8   文件: EventSupport.java
/**
 * 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);
    }
}
 
源代码3 项目: jdk8u60   文件: EventSupport.java
/**
 * 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);
    }
}
 
源代码4 项目: openjdk-jdk8u   文件: EventSupport.java
/**
 * 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);
    }
}
 
源代码5 项目: openjdk-jdk8u-backup   文件: EventSupport.java
/**
 * 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);
    }
}
 
源代码6 项目: openjdk-jdk9   文件: EventSupport.java
/**
 * 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);
    }
}
 
源代码7 项目: jdk8u-jdk   文件: EventSupport.java
/**
 * 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);
    }
}
 
源代码8 项目: hottub   文件: EventSupport.java
/**
 * 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);
    }
}
 
源代码9 项目: openjdk-8-source   文件: EventSupport.java
/**
 * 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);
    }
}
 
源代码10 项目: openjdk-8   文件: EventSupport.java
/**
 * 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);
    }
}
 
源代码11 项目: jdk8u_jdk   文件: EventSupport.java
/**
 * 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);
    }
}
 
源代码12 项目: jdk8u-jdk   文件: EventSupport.java
/**
 * 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);
    }
}
 
源代码13 项目: jdk8u-dev-jdk   文件: EventSupport.java
/**
 * 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);
    }
}
 
源代码14 项目: dragonwell8_jdk   文件: EventSupport.java
/**
 * 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);
    }
}
 
源代码15 项目: TencentKona-8   文件: EventSupport.java
/**
 * 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);
    }
}
 
源代码16 项目: jdk8u60   文件: EventSupport.java
/**
 * 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);
    }
}
 
源代码17 项目: openjdk-jdk8u   文件: EventSupport.java
/**
 * 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);
    }
}
 
源代码18 项目: openjdk-jdk8u-backup   文件: EventSupport.java
/**
 * 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);
    }
}
 
源代码19 项目: openjdk-jdk9   文件: EventSupport.java
/**
 * 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);
    }
}
 
源代码20 项目: jdk8u-jdk   文件: EventSupport.java
/**
 * 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);
    }
}
 
源代码21 项目: hottub   文件: EventSupport.java
/**
 * 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);
    }
}
 
源代码22 项目: openjdk-8-source   文件: EventSupport.java
/**
 * 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);
    }
}
 
源代码23 项目: openjdk-8   文件: EventSupport.java
/**
 * 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);
    }
}
 
源代码24 项目: jdk8u_jdk   文件: EventSupport.java
/**
 * 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);
    }
}
 
源代码25 项目: jdk8u-jdk   文件: EventSupport.java
/**
 * 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);
    }
}
 
源代码26 项目: jdk8u-dev-jdk   文件: EventSupport.java
/**
 * 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);
    }
}
 
 类所在包
 类方法
 同包方法