KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > avalon > phoenix > AbstractBlock


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.phoenix;
9
10 import org.apache.avalon.framework.component.ComponentException;
11 import org.apache.avalon.framework.component.ComponentManager;
12 import org.apache.avalon.framework.component.Composable;
13 import org.apache.avalon.framework.configuration.Configurable;
14 import org.apache.avalon.framework.configuration.Configuration;
15 import org.apache.avalon.framework.configuration.ConfigurationException;
16 import org.apache.avalon.framework.context.Context;
17 import org.apache.avalon.framework.context.Contextualizable;
18 import org.apache.avalon.framework.logger.AbstractLogEnabled;
19
20 /**
21  * This is an <code>AbstractBlock</code> that makes deployment a bit
22  * easier.
23  *
24  * @author <a HREF="mailto:bloritsch@apache.org">Berin Loritsch</a>
25  * @author <a HREF="mailto:peter at apache.org">Peter Donald</a>
26  * @version CVS $Revision: 1.10 $ $Date: 2002/08/06 11:57:39 $
27  * @deprecated As Block interface is deprecated this class is also
28  * deprecated with no replacement.
29  */

30 public abstract class AbstractBlock
31     extends AbstractLogEnabled
32     implements Block, Contextualizable, Composable, Configurable
33 {
34     private BlockContext m_context;
35
36     private Configuration m_configuration;
37
38     private ComponentManager m_componentManager;
39
40     public void contextualize( final Context context )
41     {
42         m_context = (BlockContext)context;
43     }
44
45     public void configure( final Configuration configuration )
46         throws ConfigurationException
47     {
48         m_configuration = configuration;
49     }
50
51     public void compose( final ComponentManager componentManager )
52         throws ComponentException
53     {
54         m_componentManager = componentManager;
55     }
56
57     protected final BlockContext getBlockContext()
58     {
59         return m_context;
60     }
61
62     protected final ComponentManager getComponentManager()
63     {
64         return m_componentManager;
65     }
66
67     /**
68      * Retrieve cached configuration values.
69      *
70      * @return the configuration
71      * @deprecated No Block should be relying on AbstractBlock to implement Configurable
72      */

73     protected final Configuration getConfiguration()
74     {
75         return m_configuration;
76     }
77 }
78
Popular Tags