KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > avalon > fortress > RoleManager


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;
19
20 /**
21  * RoleManager Interface, use this to specify the Components and how they
22  * correspond to easy shorthand names. The RoleManager assumes a one to one
23  * relationship of shorthand names to classes, and a flat relationship of
24  * classes to roles. Any one role can have multiple classes associated with
25  * it.
26  *
27  * @author <a HREF="mailto:dev@avalon.apache.org">Avalon Development Team</a>
28  * @version CVS $Revision: 1.9 $ $Date: 2004/02/28 15:16:24 $
29  * @since 4.1
30  */

31 public interface RoleManager
32 {
33     /**
34      * Convenience constant to make lookup of the RoleManager easer.
35      */

36     String JavaDoc ROLE = RoleManager.class.getName();
37
38     /**
39      * Get a <code>RoleEntry</code> for a short name. The short name is an
40      * alias for a component type.
41      *
42      * @param shortname The shorthand name for the component type.
43      *
44      * @return the proper {@link org.apache.avalon.fortress.RoleEntry}
45      */

46     RoleEntry getRoleForShortName( String JavaDoc shortname );
47
48     /**
49      * Get a <code>RoleEntry</code> for a component type. This facilitates
50      * self-healing configuration files where the impl reads the
51      * configuration and translates all <code>&lt;component/&gt;</code>
52      * entries to use the short hand name for readability.
53      *
54      * @param classname The component type name
55      *
56      * @return the proper {@link org.apache.avalon.fortress.RoleEntry}
57      */

58     RoleEntry getRoleForClassname( String JavaDoc classname );
59 }
60
Popular Tags