2 * Copyright (c) 2014 Brocade Communications Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
9 package org.opendaylight.yangtools.util.concurrent;
11 import java.util.concurrent.RejectedExecutionException;
14 * Interface for a class that manages queuing and dispatching notifications for multiple listeners.
16 * @author Thomas Pantelis
18 * @param <L> the listener type
19 * @param <N> the notification type
21 public interface NotificationManager<L, N> {
24 * Submits a notification to be queued and dispatched to the given listener.
26 * <p><b>Note:</b> This method may block if the listener queue is currently full.
28 * @param listener the listener to notify
29 * @param notification the notification to dispatch
30 * @throws RejectedExecutionException if the notification can't be queued for dispatching
32 void submitNotification( L listener, N notification );
35 * Submits notifications to be queued and dispatched to the given listener.
37 * <p><b>Note:</b> This method may block if the listener queue is currently full.
39 * @param listener the listener to notify
40 * @param notifications the notifications to dispatch
41 * @throws RejectedExecutionException if a notification can't be queued for dispatching
43 void submitNotifications( final L listener, Iterable<N> notifications);