|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.avalon.framework.logger.AbstractLogEnabled org.apache.avalon.excalibur.component.AbstractDualLogEnabled org.apache.avalon.excalibur.component.ExcaliburComponentSelector org.apache.cocoon.components.ExtendedComponentSelector
public class ExtendedComponentSelector
An extension of ExcaliburComponentSelector
that can have a parent
and accepts a wider variety of configurations.
Field Summary | |
---|---|
protected ClassLoader |
classLoader
The class loader to use |
protected String |
defaultHint
The default hint |
protected ComponentLocator |
parentLocator
The parent locator, if any |
protected ExtendedComponentSelector |
parentSelector
The parent selector, if any |
protected String |
roleName
The role of this selector. |
protected RoleManager |
roles
The role manager |
Fields inherited from class org.apache.avalon.excalibur.component.ExcaliburComponentSelector |
---|
m_context |
Fields inherited from interface org.apache.excalibur.instrument.Instrumentable |
---|
EMPTY_INSTRUMENT_ARRAY, EMPTY_INSTRUMENTABLE_ARRAY |
Constructor Summary | |
---|---|
ExtendedComponentSelector()
Create the ComponentSelector with the Thread context ClassLoader |
|
ExtendedComponentSelector(ClassLoader loader)
Create the ComponentSelector with a ClassLoader |
Method Summary | |
---|---|
protected boolean |
canRelease(Component component)
|
void |
configure(Configuration config)
Configure this selector. |
void |
dispose()
|
protected String |
getClassAttributeName()
Get the name of the attribute giving the class name of a component. |
protected String |
getComponentInstanceName()
Get the name for component-instance elements (i.e. components not defined by their role shortcut. |
String |
getDefaultHint()
Get the default hint, if any for this selector. |
protected String |
getDefaultHintAttributeName()
Get the name of the attribute giving the default hint to use if none is given. |
protected String |
getRoleName(Configuration config)
Get the role name for this selector. |
boolean |
hasComponent(Object hint)
Does this selector or its parent have the given hint ? |
protected boolean |
hasDeclaredComponent(Object hint)
Does this selector declare a given hint? |
void |
release(Component component)
|
Component |
select(Object hint)
|
void |
setParentLocator(ComponentLocator locator)
Set the parent component manager and the role name |
void |
setRoleManager(RoleManager roles)
Configure the RoleManager. |
Methods inherited from class org.apache.avalon.excalibur.component.ExcaliburComponentSelector |
---|
addComponent, addComponentInstance, compose, contextualize, getChildInstrumentables, getComponentHandler, getComponentHandlers, getInstrumentableName, getInstruments, initialize, setInstrumentableName, setInstrumentManager, setLoggerManager, setLogKitManager |
Methods inherited from class org.apache.avalon.excalibur.component.AbstractDualLogEnabled |
---|
getLogkitLogger, setLogger |
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 |
---|
protected RoleManager roles
protected ExtendedComponentSelector parentSelector
protected ComponentLocator parentLocator
protected ClassLoader classLoader
protected String roleName
configure()
.
protected String defaultHint
Constructor Detail |
---|
public ExtendedComponentSelector()
public ExtendedComponentSelector(ClassLoader loader)
Method Detail |
---|
protected String getComponentInstanceName()
null
, any element having a 'class'
attribute will be considered as a component instance.
The default here is to return null
, and subclasses can redefine
this method to return particular values.
null
, but can be changed by subclassesprotected String getClassAttributeName()
class
", but can be changed by subclassesprotected String getDefaultHintAttributeName()
null
,
no default hint can be specified.
default
", but can be changed by subclassespublic void setRoleManager(RoleManager roles)
setRoleManager
in interface RoleManageable
setRoleManager
in class ExcaliburComponentSelector
protected String getRoleName(Configuration config)
configure()
to set the value of this.roleName
.
null if it couldn't be determined.
public void configure(Configuration config) throws ConfigurationException
getComponentInstanceName()
returns null
,
any child configurations having a attribute named as the result of
getClassAttributeName()
, is considered as a component instance.
getComponentInstanceName()
returns a non-null value,
only child configurations having this name are considered as a
component instance.
ExcaliburComponentSelector
.
configure
in interface Configurable
configure
in class ExcaliburComponentSelector
config
- the configuration
ConfigurationException
- if some hints aren't definedpublic String getDefaultHint()
public Component select(Object hint) throws ComponentException
select
in interface ComponentSelector
select
in class ExcaliburComponentSelector
ComponentException
public void release(Component component)
release
in interface ComponentSelector
release
in class ExcaliburComponentSelector
public boolean hasComponent(Object hint)
hasComponent
in interface ComponentSelector
hasComponent
in class ExcaliburComponentSelector
protected boolean hasDeclaredComponent(Object hint)
hint
- the hint to check for
true
if this selector has the specified hintpublic void setParentLocator(ComponentLocator locator) throws ComponentException
ParentAware
setParentLocator
in interface ParentAware
ComponentException
public void dispose()
dispose
in interface Disposable
dispose
in class ExcaliburComponentSelector
protected boolean canRelease(Component component)
canRelease
in class ExcaliburComponentSelector
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |