org.apache.cocoon.components.treeprocessor.sitemap
Class ComponentsSelector

java.lang.Object
  extended by org.apache.avalon.framework.logger.AbstractLogEnabled
      extended by org.apache.avalon.excalibur.component.AbstractDualLogEnabled
          extended by org.apache.avalon.excalibur.component.ExcaliburComponentSelector
              extended by org.apache.cocoon.components.ExtendedComponentSelector
                  extended by org.apache.cocoon.components.treeprocessor.sitemap.ComponentsSelector
All Implemented Interfaces:
RoleManageable, LoggerManageable, LogKitManageable, Disposable, Initializable, Component, ComponentSelector, Composable, Configurable, Contextualizable, LogEnabled, Loggable, ThreadSafe, ParentAware, OutputComponentSelector, SitemapComponentSelector, Instrumentable, InstrumentManageable

public class ComponentsSelector
extends ExtendedComponentSelector
implements OutputComponentSelector, SitemapComponentSelector

Component selector for sitemap components.

Version:
CVS $Id: ComponentsSelector.html 1304258 2012-03-23 10:09:27Z ilgrosso $
Author:
Sylvain Wallez, Upayavira

Field Summary
static int ACTION
           
static String[] COMPONENT_NAMES
           
static int GENERATOR
           
static int MATCHER
           
static int PIPELINE
           
static int READER
           
static int SELECTOR
           
static String[] SELECTOR_ROLES
           
static int SERIALIZER
           
static int TRANSFORMER
           
static int UNKNOWN
           
 
Fields inherited from class org.apache.cocoon.components.ExtendedComponentSelector
classLoader, defaultHint, parentLocator, parentSelector, roleName, roles
 
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
ComponentsSelector()
           
 
Method Summary
 void addComponent(Object hint, Class clazz, Configuration config)
          Add a component in this selector.
 void configure(Configuration config)
          Configure this selector.
 void dispose()
           
protected  String getClassAttributeName()
          Get the attribute for class names.
protected  String getComponentInstanceName()
          Return the component instance name according to the selector role (e.g.
 String[] getLabels(Object hint)
           
 String getMimeTypeForHint(Object hint)
          Get the MIME type for a given hint.
 String getPipelineHint(Object hint)
           
 boolean hasLabel(Object hint, String label)
           
 void initialize()
          Ensure system-defined components exist (e.g.
 void setParentLocator(ComponentLocator locator)
          Set the parent component manager and the role name
 
Methods inherited from class org.apache.cocoon.components.ExtendedComponentSelector
canRelease, getDefaultHint, getDefaultHintAttributeName, getRoleName, hasComponent, hasDeclaredComponent, release, select, setRoleManager
 
Methods inherited from class org.apache.avalon.excalibur.component.ExcaliburComponentSelector
addComponentInstance, compose, contextualize, getChildInstrumentables, getComponentHandler, getComponentHandlers, getInstrumentableName, getInstruments, 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
 
Methods inherited from interface org.apache.avalon.framework.component.ComponentSelector
hasComponent, release, select
 

Field Detail

UNKNOWN

public static final int UNKNOWN
See Also:
Constant Field Values

GENERATOR

public static final int GENERATOR
See Also:
Constant Field Values

TRANSFORMER

public static final int TRANSFORMER
See Also:
Constant Field Values

SERIALIZER

public static final int SERIALIZER
See Also:
Constant Field Values

READER

public static final int READER
See Also:
Constant Field Values

MATCHER

public static final int MATCHER
See Also:
Constant Field Values

SELECTOR

public static final int SELECTOR
See Also:
Constant Field Values

ACTION

public static final int ACTION
See Also:
Constant Field Values

PIPELINE

public static final int PIPELINE
See Also:
Constant Field Values

SELECTOR_ROLES

public static final String[] SELECTOR_ROLES

COMPONENT_NAMES

public static final String[] COMPONENT_NAMES
Constructor Detail

ComponentsSelector

public ComponentsSelector()
Method Detail

setParentLocator

public void setParentLocator(ComponentLocator locator)
                      throws ComponentException
Description copied from interface: ParentAware
Set the parent component manager and the role name

Specified by:
setParentLocator in interface ParentAware
Overrides:
setParentLocator in class ExtendedComponentSelector
Throws:
ComponentException

getComponentInstanceName

protected String getComponentInstanceName()
Return the component instance name according to the selector role (e.g. "action" for "org.apache.cocoon.acting.Action").

Overrides:
getComponentInstanceName in class ExtendedComponentSelector
Returns:
null, but can be changed by subclasses

getClassAttributeName

protected String getClassAttributeName()
Get the attribute for class names. This is "src" for known roles, and "class" (the default) for other roles.

Overrides:
getClassAttributeName in class ExtendedComponentSelector
Returns:
"class", but can be changed by subclasses

configure

public void configure(Configuration config)
               throws ConfigurationException
Description copied from class: ExtendedComponentSelector
Configure this selector. This is the main difference with the parent class :

addComponent

public void addComponent(Object hint,
                         Class clazz,
                         Configuration config)
                  throws ComponentException
Add a component in this selector. If needed, also register it's MIME type.

Overrides:
addComponent in class ExcaliburComponentSelector
Throws:
ComponentException

initialize

public void initialize()
Ensure system-defined components exist (e.g. <aggregator>) and initialize the selector.

Specified by:
initialize in interface Initializable
Overrides:
initialize in class ExcaliburComponentSelector

getMimeTypeForHint

public String getMimeTypeForHint(Object hint)
Get the MIME type for a given hint.

Specified by:
getMimeTypeForHint in interface OutputComponentSelector
Parameters:
hint - the component hint
Returns:
the MIME type for this hint, or null.

hasLabel

public boolean hasLabel(Object hint,
                        String label)
Specified by:
hasLabel in interface SitemapComponentSelector

getLabels

public String[] getLabels(Object hint)
Specified by:
getLabels in interface SitemapComponentSelector

getPipelineHint

public String getPipelineHint(Object hint)
Specified by:
getPipelineHint in interface SitemapComponentSelector

dispose

public void dispose()
Specified by:
dispose in interface Disposable
Overrides:
dispose in class ExtendedComponentSelector


Copyright © 1999-2010 The Apache Software Foundation. All Rights Reserved.