001    /*****************************************************************************
002     * Copyright (c) PicoContainer Organization. All rights reserved.            *
003     * ------------------------------------------------------------------------- *
004     * The software in this package is published under the terms of the BSD      *
005     * style license a copy of which has been included with this distribution in *
006     * the license.html file.                                                    *
007     *                                                                           *
008     * Idea by Rachel Davies, Original code by Aslak Hellesoy and Paul Hammant   *
009     *****************************************************************************/
010    package org.picocontainer;
011    
012    /**
013     * An interface which is implemented by components that need to dispose of resources during the shutdown of that
014     * component. The {@link Disposable#dispose()} must be called once during shutdown, directly after {@link
015     * Startable#stop()} (if the component implements the {@link Startable} interface).
016     * @version $Revision: 1570 $
017     * @see org.picocontainer.Startable the Startable interface if you need to <code>start()</code> and
018     *      <code>stop()</code> semantics.
019     * @see org.picocontainer.PicoContainer the main PicoContainer interface (and hence its subinterfaces and
020     *      implementations like {@link org.picocontainer.defaults.DefaultPicoContainer}) implement this interface.
021     * @since 1.0
022     */
023    public interface Disposable {
024        /**
025         * Dispose this component. The component should deallocate all resources. The contract for this method defines a
026         * single call at the end of this component's life.
027         */
028        void dispose();
029    }