Add NoOp{Listener,Object}Registration
[yangtools.git] / common / concepts / src / main / java / org / opendaylight / yangtools / concepts / ObjectRegistration.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 javax.annotation.Nonnull;
11
12 /**
13  * Class representing a registration of an object. Such a registration is a proper resource and should be cleaned up
14  * when no longer required, so references to the object can be removed. This mechanism lies above the usual Java
15  * reference mechanism, as the entity where the object is registered may reside outside of the Java Virtual Machine.
16  *
17  * @param <T> Type of registered object
18  */
19 public interface ObjectRegistration<T> extends Registration {
20     /**
21      * Return the object instance.
22      *
23      * @return Registered object.
24      */
25     @Nonnull T getInstance();
26 }