X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-common-impl%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fmd%2Fsal%2Fcommon%2Fimpl%2FListenerRegistry.java;h=f337b5509e1a4cda6d4c1488bef048be5d8adeef;hb=59cb3e27630fb1fd965152f9e1584213e89fa62f;hp=d884dc81e0865f83242602c1cc422957e6a569eb;hpb=a3dbf5335c352c7463674e31314ce2b5285cb6fe;p=controller.git diff --git a/opendaylight/md-sal/sal-common-impl/src/main/java/org/opendaylight/controller/md/sal/common/impl/ListenerRegistry.java b/opendaylight/md-sal/sal-common-impl/src/main/java/org/opendaylight/controller/md/sal/common/impl/ListenerRegistry.java index d884dc81e0..f337b5509e 100644 --- a/opendaylight/md-sal/sal-common-impl/src/main/java/org/opendaylight/controller/md/sal/common/impl/ListenerRegistry.java +++ b/opendaylight/md-sal/sal-common-impl/src/main/java/org/opendaylight/controller/md/sal/common/impl/ListenerRegistry.java @@ -1,12 +1,18 @@ +/* + * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0 which accompanies this distribution, + * and is available at http://www.eclipse.org/legal/epl-v10.html + */ package org.opendaylight.controller.md.sal.common.impl; +import static com.google.common.base.Preconditions.checkNotNull; + import java.util.Collections; import java.util.EventListener; import java.util.HashSet; import java.util.Set; -import java.util.concurrent.ConcurrentHashMap; - -import static com.google.common.base.Preconditions.*; import org.opendaylight.yangtools.concepts.AbstractObjectRegistration; import org.opendaylight.yangtools.concepts.ListenerRegistration; @@ -25,15 +31,15 @@ public class ListenerRegistry { return unmodifiableView; } - + public ListenerRegistration register(T listener) { checkNotNull(listener, "Listener should not be null."); ListenerRegistrationImpl ret = new ListenerRegistrationImpl(listener); listeners.add(ret); return ret; } - - + + @SuppressWarnings("rawtypes") private void remove(ListenerRegistrationImpl registration) { listeners.remove(registration);