KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > avalon > excalibur > system > handler > ComponentHandler


1 /*
2  * Copyright (C) The Apache Software Foundation. All rights reserved.
3  *
4  * This software is published under the terms of the Apache Software License
5  * version 1.1, a copy of which has been included with this distribution in
6  * the LICENSE.txt file.
7  */

8 package org.apache.avalon.excalibur.system.handler;
9
10 import org.apache.avalon.framework.activity.Initializable;
11 import org.apache.avalon.framework.activity.Disposable;
12 import org.apache.avalon.framework.component.Component;
13 import org.apache.avalon.framework.component.ComponentManager;
14 import org.apache.avalon.framework.configuration.Configuration;
15 import org.apache.avalon.framework.context.Context;
16
17 /**
18  * The ComponentHandler interface marks the ComponentHandler implementations.
19  * The desire for a ComponentHandler is to manage the instances of a Component.
20  *
21  * @author <a HREF="mailto:bloritsch@apache.org">Berin Loritsch</a>
22  * @version CVS $Revision: 1.4 $ $Date: 2002/01/30 15:44:06 $
23  * @since 4.0
24  */

25 public interface ComponentHandler
26     extends Initializable, Disposable
27 {
28     Class JavaDoc[] HANDLER_CONSTRUCTOR = new Class JavaDoc[] {
29         Class JavaDoc.class,
30         Configuration.class,
31         ComponentManager.class,
32         Context.class
33     };
34
35     /**
36      * Sometimes Components call other components during their initialization
37      * process. This is a quick test that the ComponentManager will perform
38      * before attempting to use the the ComponentHandler.
39      */

40     boolean isInitialized();
41
42     /**
43      * Gets the current reference to a Component according to the policy of the
44      * implementation.
45      */

46     Component get() throws Exception JavaDoc;
47
48     /**
49      * Puts the reference back in the ComponentHandler according to the policy
50      * of the implementation.
51      */

52     void put(Component component);
53 }
54
Popular Tags