Example usage for org.apache.commons.lang3.event EventListenerSupport EventListenerSupport

List of usage examples for org.apache.commons.lang3.event EventListenerSupport EventListenerSupport

Introduction

In this page you can find the example usage for org.apache.commons.lang3.event EventListenerSupport EventListenerSupport.

Prototype

public EventListenerSupport(final Class<L> listenerInterface, final ClassLoader classLoader) 

Source Link

Document

Creates an EventListenerSupport object which supports the provided listener interface using the specified class loader to create the JDK dynamic proxy.

Usage

From source file:com.savoirtech.eos.pattern.whiteboard.EventListenerWhiteboard.java

/**
 * Constructs a new EventListenerWhiteboard which tracks services of the specified listener type and
 * adds them to its {@link EventListenerSupport}.  The services will be "decorated" using the supplied
 * deocrator function./*from   w  w  w . j av  a  2  s  . com*/
 *
 * @param bundleContext the bundle context
 * @param listenerType  the listener interface
 * @param decorator     the decorator function
 */
public EventListenerWhiteboard(BundleContext bundleContext, Class<L> listenerType,
        BiFunction<L, ServiceProperties, L> decorator) {
    super(bundleContext, listenerType);
    this.listenerSupport = new EventListenerSupport<>(listenerType, listenerType.getClassLoader());
    this.decorator = decorator;
    start();
}