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 * Original code by Paul Hammant *
009 *****************************************************************************/
010
011 package org.picocontainer;
012
013 /**
014 * Behaviors modify the components created by a Injector with additional behaviors
015 *
016 * @author Paul Hammant
017 * @author Jörg Schaible
018 * @author Mauro Talevi
019 * @see LifecycleStrategy
020 */
021 public interface Behavior<T> extends ComponentAdapter<T> {
022
023 /**
024 * Invoke the "start" method on the component.
025 * @param container the container to "start" the component
026 */
027 void start(PicoContainer container);
028
029 /**
030 * Invoke the "stop" method on the component.
031 * @param container the container to "stop" the component
032 */
033 void stop(PicoContainer container);
034
035 /**
036 * Invoke the "dispose" method on the component.
037 * @param container the container to "dispose" the component
038 */
039 void dispose(PicoContainer container);
040
041 /**
042 * Test if a component honors a lifecycle.
043 * @return <code>true</code> if the component has a lifecycle
044 */
045 boolean componentHasLifecycle();
046
047 }