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 package org.picocontainer.lifecycle; 009 010 /** 011 * Current lifecycle state of the container. 012 * @author Michael Rimov 013 */ 014 public interface LifecycleState { 015 016 void removingComponent(); 017 018 /** 019 * Start is normally allowed if the object is constructed or 020 * already stopped. It is not allowed if the system is already 021 * started or disposed. 022 * @return true if start lifecycle methods should be allowed. 023 */ 024 void starting(); 025 026 /** 027 * Stop is normally only allowed while the current 028 * container state is STARTED. 029 * @return true if stop is allowed. 030 */ 031 void stopping(); 032 033 void stopped(); 034 035 boolean isStarted(); 036 037 /** 038 * Dispose is normally only allowed if the object has not been already 039 * disposed, and it is not started. 040 * @return 041 */ 042 void disposing(); 043 044 void disposed(); 045 }