Deprecate ListenerRegistration for removal
[yangtools.git] / common / concepts / src / main / java / org / opendaylight / yangtools / concepts / Registration.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 /**
11  * Class representing a registration. Such a registration is a proper resource and should be cleaned up when no longer
12  * required.
13  */
14 public interface Registration extends AutoCloseable {
15     /**
16      * Unregisters the object. This operation is required not to invoke blocking operations. Implementations which
17      * require interaction with outside world must provide guarantees that any work is done behind the scenes and
18      * the unregistration process looks as if it has already succeeded once this method returns.
19      *
20      * <p>
21      * The above requirement does not necessarily mean that all interactions with the registered entity seize before
22      * this method returns, but they should complete within a reasonable time frame.
23      *
24      * <p>
25      * While the interface contract allows an implementation to ignore the occurrence of RuntimeExceptions,
26      * implementations are strongly encouraged to deal with such exceptions internally and to ensure invocations of
27      * this method do not fail in such circumstances.
28      */
29     @Override
30     void close();
31 }