2 * Copyright (c) 2013 Cisco 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
8 package org.opendaylight.protocol.bgp.rib;
10 import javax.annotation.concurrent.ThreadSafe;
12 import org.opendaylight.protocol.concepts.InitialListenerEvents;
13 import org.opendaylight.protocol.concepts.ListenerRegistration;
16 public abstract class AbstractRIBChangeListener implements RIBEventListener {
18 synchronized public final void onRIBEvent(final RIBEvent event) {
19 onRIBEventImpl(event);
22 abstract protected void onRIBEventImpl(final RIBEvent event);
24 synchronized public final ListenerRegistration<RIBEventListener> register(final RIB rib) {
25 InitialListenerEvents<RIBEventListener, RIBEvent> ile = rib.registerListener(this);
26 for (RIBEvent e : ile.getEvents())
29 return ile.getRegistration();