Merge "Add missing copyright text"
[controller.git] / opendaylight / md-sal / sal-binding-broker / src / main / java / org / opendaylight / controller / md / sal / binding / compat / NotificationListenerRegistration.java
1 /*
2  * Copyright (c) 2014 Cisco Systems, Inc. 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.controller.md.sal.binding.compat;
9
10 import org.opendaylight.controller.sal.binding.api.NotificationListener;
11 import org.opendaylight.yangtools.concepts.ListenerRegistration;
12 import org.opendaylight.yangtools.yang.binding.Notification;
13
14 /**
15  * A registration of a {@link NotificationListener}. Allows query of the type
16  * of the notification and dispatching the notification atomically with regard
17  * to unregistration.
18  *
19  * @param <T> Type of notification
20  */
21 interface NotificationListenerRegistration<T extends Notification> extends ListenerRegistration<NotificationListener<T>> {
22     /**
23      * Return the interface class of the notification type.
24      *
25      * @return Notification type.
26      */
27     Class<? extends Notification> getType();
28
29     /**
30      * Dispatch a notification to the listener.
31      *
32      * @param notification Notification to be dispatched
33      */
34     void notify(Notification notification);
35 }