All Downloads are FREE. Search and download functionalities are using the official Maven repository.

ru.vyarus.guice.ext.managed.destroyable.Destroyable Maven / Gradle / Ivy

There is a newer version: 2.0.1
Show newest version
package ru.vyarus.guice.ext.managed.destroyable;

/**
 * Marker interface for beans which require some finalization logic (@PostConstruct alternative).
 *
 * @author Vyacheslav Rusakov
 * @since 30.06.2014
 */
public interface Destroyable {

    /**
     * Called on context shutdown (by default on jvm shutdown), but may be called manually through destroy manager
     * {@code ru.vyarus.guice.ext.managed.destroyable.DestroyableManager#destroy()}.
     * Will be called one time no matter how many time destroy will be asked by manager.
     * It is safe to avoid explicit exception handling (except special cases required by logic).
     *
     * @throws Exception  on any unrecoverable error
     */
    void preDestroy() throws Exception;
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy