Separate out {Identity,Equality}QueuedNotificationManager
[yangtools.git] / common / util / src / main / java / org / opendaylight / yangtools / util / concurrent / EqualityQueuedNotificationManager.java
1 /*
2  * Copyright (c) 2019 PANTHEON.tech, s.r.o. and others.  All rights reserved.
3  *
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
7  */
8 package org.opendaylight.yangtools.util.concurrent;
9
10 import com.google.common.annotations.Beta;
11 import java.util.concurrent.Executor;
12 import org.eclipse.jdt.annotation.NonNullByDefault;
13 import org.opendaylight.yangtools.util.concurrent.QueuedNotificationManager.BatchedInvoker;
14
15 @Beta
16 @NonNullByDefault
17 public final class EqualityQueuedNotificationManager<L, N> extends AbstractQueuedNotificationManager<L, L, N> {
18     public EqualityQueuedNotificationManager(final String name, final Executor executor, final int maxQueueCapacity,
19             final BatchedInvoker<L, N> listenerInvoker) {
20         super(name, executor, maxQueueCapacity, listenerInvoker);
21     }
22
23     @Override
24     L wrap(final L listener) {
25         return listener;
26     }
27
28     @Override
29     L unwrap(final L key) {
30         return key;
31     }
32 }