Deprecate ListenerRegistration for removal
[yangtools.git] / common / concepts / src / main / java / org / opendaylight / yangtools / concepts / ListenerRegistration.java
1 /*
2  * Copyright (c) 2013 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.yangtools.concepts;
9
10 import java.util.EventListener;
11
12 /**
13  * Class representing a {@link Registration} of an {@link EventListener}. This interface provides the additional
14  * guarantee that the process of unregistration cannot fail for predictable reasons.
15  *
16  * @param <T> Type of registered listener
17  * @deprecated Use {@link ObjectRegistration} instead
18  */
19 @Deprecated(since = "12.0.0", forRemoval = true)
20 public interface ListenerRegistration<T extends EventListener> extends ObjectRegistration<T> {
21     /**
22      * Unregister the listener. Note that invocations enqueued to the listener are not subject to synchronization
23      * rules, and events may be delivered to the listener after this method completes.
24      *
25      * <p>
26      * While the interface contract allows an implementation to ignore the occurrence of RuntimeExceptions,
27      * implementations are strongly encouraged to deal with such exceptions internally and to ensure invocations of
28      * this method do not fail in such circumstances.
29      */
30     @Override
31     void close();
32 }