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.txt file.                                                     *
007 *                                                                           *
008 *****************************************************************************/
009package org.picocontainer;
010
011/**
012 * 
013 *
014 */
015public interface ComponentLifecycle<T> {
016
017    /**
018     * Invoke the "start" method on the component.
019     *
020     * @param container the container to "start" the component
021     */
022    void start(PicoContainer container);
023
024    /**
025     * Invoke the "stop" method on the component.
026     *
027     * @param container the container to "stop" the component
028     */
029    void stop(PicoContainer container);
030
031    /**
032     * Invoke the "dispose" method on the component.
033     *
034     * @param container the container to "dispose" the component
035     */
036    void dispose(PicoContainer container);
037
038    /**
039     * Test if a component honors a lifecycle.
040     *
041     * @return <code>true</code> if the component has a lifecycle
042     */
043    boolean componentHasLifecycle();
044
045    boolean isStarted();
046
047
048}