001 /******************************************************************************* 002 * Copyright (C) PicoContainer Organization. All rights reserved. 003 * --------------------------------------------------------------------------- 004 * The software in this package is published under the terms of the BSD style 005 * license a copy of which has been included with this distribution in the 006 * LICENSE.txt file. 007 ******************************************************************************/ 008 package org.picocontainer.script; 009 010 /** 011 * Enumeration for lifecycle behaviors with the container builders. 012 * @author Michael Rimov 013 * 014 */ 015 public enum LifecycleMode { 016 /** 017 * Uses standard lifecycle methods -- start is called when the 018 * container is started, and stop is called when the container 019 * is stopped and disposed. 020 */ 021 AUTO_LIFECYCLE, 022 023 /** 024 * No start/stop methods are called when the containers are built/killed. 025 * Dispose, is called. //TODO: Dispose called? Proper or improper. 026 */ 027 NO_LIFECYCLE; 028 029 /** 030 * Returns true if lifecycle methods should be called. 031 * @return 032 */ 033 public boolean isInvokeLifecycle() { 034 return (this.equals(AUTO_LIFECYCLE)); 035 } 036 }