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 * @see org.picocontainer.Startable the Startable interface if you need to <code>start()</code> and 017 * <code>stop()</code> semantics. 018 * @see org.picocontainer.PicoContainer the main PicoContainer interface (and hence its subinterfaces and 019 * implementations like {@link DefaultPicoContainer}) implement this interface. 020 */ 021 public interface Disposable { 022 /** 023 * Dispose this component. The component should deallocate all resources. The contract for this method defines a 024 * single call at the end of this component's life. 025 */ 026 void dispose(); 027 }