2 * Copyright (c) 2016 Red Hat, 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.infrautils.inject;
11 * Something which can be {@link #init()}-ialized and {@link #destroy()}-d.
13 * <p>Annotated so that Dependency Injection Frameworks (whichever) automatically call these methods during wiring.
15 * @see AbstractLifecycle
17 * @author Michael Vorburger
19 public interface Lifecycle {
22 * Initialize the object.
24 * @throws ModuleSetupRuntimeException if initialization failed
26 void init() throws ModuleSetupRuntimeException;
31 * @throws ModuleSetupRuntimeException if destruction failed
33 void destroy() throws ModuleSetupRuntimeException;