public abstract class AbstractRoleManager
extends org.apache.avalon.framework.logger.AbstractLogEnabled
implements org.apache.avalon.fortress.RoleManager
| Modifier and Type | Field and Description |
|---|---|
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.
|
| Constructor and Description |
|---|
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.
|
| Modifier and Type | Method and Description |
|---|---|
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.
|
private final java.lang.ClassLoader m_loader
private final java.util.Map m_shorthands
private final java.util.Map m_classnames
private final org.apache.avalon.fortress.RoleManager m_parent
RoleManager for nested resolution.public AbstractRoleManager()
public AbstractRoleManager(org.apache.avalon.fortress.RoleManager parent)
parent - The parent RoleManager.public AbstractRoleManager(org.apache.avalon.fortress.RoleManager parent,
java.lang.ClassLoader loader)
parent - The parent RoleManagerloader - The class loaderprotected final boolean addRole(java.lang.String shortName,
java.lang.String role,
java.lang.String className,
java.lang.String handlerClassName)
shortName - the short name for the rolerole - the roleclassName - the class namehandlerClassName - the handler classnameprotected final java.lang.Class getDefaultHandler()
PerThreadComponentHandlerpublic final org.apache.avalon.fortress.RoleEntry getRoleForClassname(java.lang.String classname)
getRoleForClassname in interface org.apache.avalon.fortress.RoleManagerpublic final org.apache.avalon.fortress.RoleEntry getRoleForShortName(java.lang.String shortname)
getRoleForShortName in interface org.apache.avalon.fortress.RoleManagershortname - the short nameprotected final java.lang.ClassLoader getLoader()