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

java.lang.Object
  extended byorg.apache.avalon.framework.logger.AbstractLogEnabled
      extended byorg.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.14 $ $Date: 2004/04/05 08:46:06 $
Author:
Avalon Development Team

Field Summary
 
Fields inherited from interface org.apache.avalon.fortress.RoleManager
ROLE
 
Constructor Summary
AbstractRoleManager()
          Default constructor--this RoleManager has no parent.
AbstractRoleManager(RoleManager parent)
          Alternate constructor--this RoleManager has the specified parent.
AbstractRoleManager(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.
 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 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
 

Constructor Detail

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
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 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


Copyright © 1997-2005 The Apache Software Foundation. All Rights Reserved.