org.apache.avalon.fortress.impl.role
Class AbstractRoleManager
java.lang.Object
org.apache.avalon.framework.logger.AbstractLogEnabled
org.apache.avalon.fortress.impl.role.AbstractRoleManager
- All Implemented Interfaces:
- LogEnabled, RoleManager
- Direct Known Subclasses:
- ConfigurableRoleManager, ECMRoleManager, FortressRoleManager
- public abstract class AbstractRoleManager
- extends AbstractLogEnabled
- implements RoleManager
The Excalibur Role Manager is used for Excalibur Role Mappings. All of the information is hard-coded.
- Since:
- 4.1
- Version:
- CVS $Revision: 1.13 $ $Date: 2004/02/28 15:16:25 $
- Author:
| Field Summary |
private java.util.Map |
m_classnames
Map for classname to RoleEntry. |
private java.lang.ClassLoader |
m_loader
The classloader used to load and check roles and components. |
private RoleManager |
m_parent
Parent RoleManager for nested resolution. |
private java.util.Map |
m_shorthands
Map for shorthand to RoleEntry. |
| Fields inherited from interface org.apache.avalon.fortress.RoleManager |
ROLE |
| Method Summary |
protected boolean |
addRole(java.lang.String shortName, java.lang.String role, java.lang.String className, java.lang.String handlerClassName)
Addition of a role to the role manager. |
protected java.lang.Class |
getDefaultHandler()
Get the default component handler. |
protected java.lang.ClassLoader |
getLoader()
Get the classloader used for the RoleManager for any class that extends this one. |
RoleEntry |
getRoleForClassname(java.lang.String classname)
Get a RoleEntry for a component type. |
RoleEntry |
getRoleForShortName(java.lang.String shortname)
Return a role name relative to a supplied short name. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
m_loader
private final java.lang.ClassLoader m_loader
-
The classloader used to load and check roles and components.
m_shorthands
private final java.util.Map m_shorthands
-
Map for shorthand to RoleEntry.
m_classnames
private final java.util.Map m_classnames
-
Map for classname to RoleEntry.
m_parent
private final RoleManager m_parent
-
Parent
RoleManager for nested resolution.
AbstractRoleManager
public AbstractRoleManager()
-
Default constructor--this RoleManager has no parent.
AbstractRoleManager
public AbstractRoleManager(RoleManager parent)
-
Alternate constructor--this RoleManager has the specified parent.
- Parameters:
parent - The parent RoleManager.
AbstractRoleManager
public AbstractRoleManager(RoleManager parent,
java.lang.ClassLoader loader)
-
Create an AbstractRoleManager with the specified parent manager and the supplied classloader.
- Parameters:
parent - The parent RoleManager
loader - The class loader
addRole
protected final boolean addRole(java.lang.String shortName,
java.lang.String role,
java.lang.String className,
java.lang.String handlerClassName)
-
Addition of a role to the role manager.
-
-
- Parameters:
shortName - the shor name for the role
role - the role
className - the class name
handlerClassName - the handler classname
getDefaultHandler
protected final java.lang.Class getDefaultHandler()
-
Get the default component handler.
-
-
- Returns:
- the class for
PerThreadComponentHandler
getRoleForClassname
public final RoleEntry getRoleForClassname(java.lang.String classname)
- Description copied from interface:
RoleManager
-
Get a
RoleEntry for a component type. This facilitates self-healing configuration files where the impl reads the configuration and translates all <component/> entries to use the short hand name for readability.
-
- Specified by:
getRoleForClassname in interface RoleManager
-
- Parameters:
classname - The component type name
- Returns:
- the proper
RoleEntry
getRoleForShortName
public final RoleEntry getRoleForShortName(java.lang.String shortname)
-
Return a role name relative to a supplied short name.
-
- Specified by:
getRoleForShortName in interface RoleManager
-
- Parameters:
shortname - the short name
- Returns:
- the role entry
getLoader
protected final java.lang.ClassLoader getLoader()
-
Get the classloader used for the RoleManager for any class that extends this one.
-
-
- Returns:
- ClassLoader
Please see keelframework.org for information about new Keel releases.