Change all the package names from infrautils to odlguice
[odlguice.git] / inject / inject / src / main / java / org / opendaylight / odlguice / inject / ModuleSetupRuntimeException.java
1 /*
2  * Copyright (c) 2016 Red Hat, 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.odlguice.inject;
9
10 /**
11  * Exception to throw from a static Dependency Inject Framework's "Wiring" class.
12  *
13  * <p>Also used in {@link Lifecycle#init()} and {@link Lifecycle#destroy()}, because
14  * those methods are typically called from DI's Wiring classes (typically implicitly
15  * by a DI framework, and not hand-written Wiring code).
16  *
17  * <p>For example, throw this from methods in a class implementing Guice's Module
18  * interface, or from methods annotated with Dagger's @Provides in a @Module
19  * class, which <i>"may only throw unchecked exceptions"</i>.  In particular, when you
20  * have to catch checked exceptions while creating objects, wrap them into this
21  * unchecked Exception.
22  *
23  * <p>When you use this Exception in a Dagger/Guice/etc. Module, you should
24  * probably write a simple test for the Module, just to verify it (alone) works
25  * at run-time (if there is a checked exception to catch, it probably
26  * initializes something that is non-trivial and could fail; so best to have a
27  * non-regression test for that Module).
28  *
29  * @author Michael Vorburger
30  */
31 public class ModuleSetupRuntimeException extends RuntimeException {
32
33     private static final long serialVersionUID = -1795982967617796415L;
34
35     public ModuleSetupRuntimeException(Exception cause) {
36         super(cause);
37     }
38 }