Example usage for java.util.concurrent CopyOnWriteArraySet size

List of usage examples for java.util.concurrent CopyOnWriteArraySet size

Introduction

In this page you can find the example usage for java.util.concurrent CopyOnWriteArraySet size.

Prototype

public int size() 

Source Link

Document

Returns the number of elements in this set.

Usage

From source file:de.taimos.dvalin.interconnect.core.spring.DaemonEvents.java

@SuppressWarnings("rawtypes")
void emit(final IVO event) {
    if (this.listeners.containsKey(event.getClass())) {
        final CopyOnWriteArraySet<IDaemonEventListener> l = this.listeners.get(event.getClass());
        if (l.size() != 0) {
            this.logger.info("Event " + event.getClass().getSimpleName());
        }/*  w w w .j  a  v  a  2s .com*/
        for (final IDaemonEventListener listener : l) {
            this.executor.execute(new Runnable() {

                @SuppressWarnings("unchecked")
                @Override
                public void run() {
                    listener.onEvent(event);
                }
            });
        }
    }
}