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.yangtools.concepts;
11 * Class representing a registration of an object. Such a registration is
12 * a proper resource and should be cleaned up when no longer required, so
13 * references to the object can be removed. This mechanism lies above the
14 * usual Java reference mechanism, as the entity where the object is
15 * registered may reside outside of the Java Virtual Machine.
17 public interface ObjectRegistration<T> extends Registration<T> {
19 * Return the object instance.
21 * @return Registered object.
27 * Unregisters the object. This operation is required not to invoke
28 * blocking operations. Implementations which require interaction
29 * with outside world must provide guarantees that any work is done
30 * behind the scenes and the unregistration process looks as if it
31 * has already succeeded once this method returns.
34 void close() throws Exception;