KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > avalon > fortress > impl > role > FortressRoleManager


1 /*
2  * Copyright 2003-2004 The Apache Software Foundation
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  * http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
12  * implied.
13  *
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */

17
18 package org.apache.avalon.fortress.impl.role;
19
20 import org.apache.avalon.framework.activity.Initializable;
21
22 /**
23  * The Excalibur Role Manager is used for Excalibur Role Mappings. All of
24  * the information is hard-coded.
25  *
26  * @author <a HREF="mailto:dev@avalon.apache.org">Avalon Development Team</a>
27  * @version CVS $Revision: 1.11 $ $Date: 2004/02/28 15:16:25 $
28  */

29 public final class FortressRoleManager
30     extends org.apache.avalon.fortress.impl.role.AbstractRoleManager
31     implements Initializable
32 {
33     /**
34      * Default constructor--this RoleManager has no parent.
35      */

36     public FortressRoleManager()
37     {
38         this( null );
39     }
40
41     /**
42      * Alternate constructor--this RoleManager has the specified
43      * parent.
44      *
45      * @param parent The parent <code>RoleManager</code>.
46      */

47     public FortressRoleManager( final org.apache.avalon.fortress.RoleManager parent )
48     {
49         this( parent, null );
50     }
51
52     /**
53      * Alternate constructor--this RoleManager has the specified
54      * parent and a classloader.
55      *
56      * @param parent The parent <code>RoleManager</code>.
57      * @param loader the classloader
58      */

59     public FortressRoleManager( final org.apache.avalon.fortress.RoleManager parent, final ClassLoader JavaDoc loader )
60     {
61         super( parent, loader );
62     }
63
64     /**
65      * Initialize the role manager.
66      */

67     public void initialize()
68     {
69         /* Set up DataSource relations */
70         addRole( "jdbc-datasource",
71             "org.apache.avalon.excalibur.datasource.DataSourceComponent",
72             "org.apache.avalon.excalibur.datasource.JdbcDataSource",
73             "org.apache.avalon.fortress.impl.handler.ThreadSafeComponentHandler" );
74         addRole( "j2ee-datasource",
75             "org.apache.avalon.excalibur.datasource.DataSourceComponent",
76             "org.apache.avalon.excalibur.datasource.J2eeDataSource",
77             "org.apache.avalon.fortress.impl.handler.ThreadSafeComponentHandler" );
78         addRole( "informix-datasource",
79             "org.apache.avalon.excalibur.datasource.DataSourceComponent",
80             "org.apache.avalon.excalibur.datasource.InformixDataSource",
81             "org.apache.avalon.fortress.impl.handler.ThreadSafeComponentHandler" );
82
83         /* Set up Monitor relations */
84         addRole( "monitor",
85             "org.apache.avalon.excalibur.monitor.Monitor",
86             "org.apache.avalon.excalibur.monitor.ActiveMonitor",
87             "org.apache.avalon.fortress.impl.handler.ThreadSafeComponentHandler" );
88         addRole( "passive-monitor",
89             "org.apache.avalon.excalibur.monitor.Monitor",
90             "org.apache.avalon.excalibur.monitor.PassiveMonitor",
91             "org.apache.avalon.fortress.impl.handler.ThreadSafeComponentHandler" );
92
93         /* Set up XPath relations */
94         addRole( "xalan-xpath",
95             "org.apache.excalibur.xml.xpath.XPathProcessor",
96             "org.apache.excalibur.xml.xpath.XPathProcessorImpl",
97             "org.apache.avalon.fortress.impl.handler.ThreadSafeComponentHandler" );
98         addRole( "jaxpath",
99             "org.apache.excalibur.xml.xpath.XPathProcessor",
100             "org.apache.excalibur.xml.xpath.JaxenProcessorImpl",
101             "org.apache.avalon.fortress.impl.handler.ThreadSafeComponentHandler" );
102
103         /* Set up SourceResolver relations */
104         addRole( "resolver",
105             "org.apache.excalibur.source.SourceResolver",
106             "org.apache.excalibur.source.impl.SourceResolverImpl",
107             "org.apache.avalon.fortress.impl.handler.ThreadSafeComponentHandler" );
108
109         /* Set up XML parser relations */
110         addRole( "parser",
111             "org.apache.excalibur.xml.dom.DOMParser",
112             "org.apache.excalibur.xml.impl.JaxpParser",
113             "org.apache.avalon.fortress.impl.handler.PerThreadComponentHandler" );
114         addRole( "xerces-parser",
115             "org.apache.excalibur.xml.dom.DOMParser",
116             "org.apache.excalibur.xml.impl.XercesParser",
117             "org.apache.avalon.fortress.impl.handler.FactoryComponentHandler" );
118     }
119 }
120
121
Popular Tags