org.apache.avalon.fortress.impl.role
Class AbstractRoleManager

java.lang.Object
  extended by org.apache.avalon.framework.logger.AbstractLogEnabled
      extended by org.apache.avalon.fortress.impl.role.AbstractRoleManager
All Implemented Interfaces:
org.apache.avalon.fortress.RoleManager, org.apache.avalon.framework.logger.LogEnabled
Direct Known Subclasses:
ConfigurableRoleManager, ECMRoleManager, FortressRoleManager

public abstract class AbstractRoleManager
extends org.apache.avalon.framework.logger.AbstractLogEnabled
implements org.apache.avalon.fortress.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.14 $ $Date: 2004/04/05 08:46:06 $
Author:
Avalon Development Team

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  org.apache.avalon.fortress.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
 
Constructor Summary
AbstractRoleManager()
          Default constructor--this RoleManager has no parent.
AbstractRoleManager(org.apache.avalon.fortress.RoleManager parent)
          Alternate constructor--this RoleManager has the specified parent.
AbstractRoleManager(org.apache.avalon.fortress.RoleManager parent, java.lang.ClassLoader loader)
          Create an AbstractRoleManager with the specified parent manager and the supplied classloader.
 
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.
 org.apache.avalon.fortress.RoleEntry getRoleForClassname(java.lang.String classname)
           
 org.apache.avalon.fortress.RoleEntry getRoleForShortName(java.lang.String shortname)
          Return a role name relative to a supplied short name.
 
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

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 org.apache.avalon.fortress.RoleManager m_parent
Parent RoleManager for nested resolution.

Constructor Detail

AbstractRoleManager

public AbstractRoleManager()
Default constructor--this RoleManager has no parent.


AbstractRoleManager

public AbstractRoleManager(org.apache.avalon.fortress.RoleManager parent)
Alternate constructor--this RoleManager has the specified parent.

Parameters:
parent - The parent RoleManager.

AbstractRoleManager

public AbstractRoleManager(org.apache.avalon.fortress.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
Method Detail

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 short 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 org.apache.avalon.fortress.RoleEntry getRoleForClassname(java.lang.String classname)
Specified by:
getRoleForClassname in interface org.apache.avalon.fortress.RoleManager

getRoleForShortName

public final org.apache.avalon.fortress.RoleEntry getRoleForShortName(java.lang.String shortname)
Return a role name relative to a supplied short name.

Specified by:
getRoleForShortName in interface org.apache.avalon.fortress.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