devdaily home | apple | java | perl | unix | directory | blog

What this is

This file is included in the DevDaily.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Other links

The source code

/*****************************************************************************
 * Copyright (C) PicoContainer Organization. All rights reserved.            *
 * ------------------------------------------------------------------------- *
 * The software in this package is published under the terms of the BSD      *
 * style license a copy of which has been included with this distribution in *
 * the LICENSE.txt file.                                                     *
 *****************************************************************************/
package org.picocontainer;

/**
 * An interface which specifies the lifecyle strategy on the component instance.
 * Lifecycle strategies are used by component adapters to delegate the lifecyle
 * operations on the component instances.
 *
 * @author Paul Hammant
 * @author Peter Royal
 * @author Jörg Schaible
 * @author Mauro Talevi
 * @see org.picocontainer.Startable
 * @see org.picocontainer.Disposable
 */
public interface LifecycleStrategy {
    
    /**
     * Invoke the "start" method on the component instance if this is startable.
     * It is up to the implementation of the strategy what "start" and "startable" means.
     * 
     * @param component the instance of the component to start
     */
    void start(Object component);
    
    /**
     * Invoke the "stop" method on the component instance if this is stoppable.
     * It is up to the implementation of the strategy what "stop" and "stoppable" means.
     * 
     * @param component the instance of the component to stop
     */
    void stop(Object component);

    /**
     * Invoke the "dispose" method on the component instance if this is disposable.
     * It is up to the implementation of the strategy what "dispose" and "disposable" means.
     * 
     * @param component the instance of the component to dispose
     */
    void dispose(Object component);

    /**
     * Test if a component instance has a lifecycle.
     * @param type the component's type
     * 
     * @return <code>true if the component has a lifecycle
     */
    boolean hasLifecycle(Class type);

}




Copyright 1998-2008 Alvin Alexander
All Rights Reserved.
 
devdaily.com is based in louisville, kentucky, and this web site is hosted by godaddy.com