org.apache.cocoon.components.source.impl
Class AbstractConfigurableSourceDescriptor

java.lang.Object
  extended by org.apache.avalon.framework.logger.AbstractLogEnabled
      extended by org.apache.cocoon.components.source.impl.AbstractConfigurableSourceInspector
          extended by org.apache.cocoon.components.source.impl.AbstractConfigurableSourceDescriptor
All Implemented Interfaces:
Component, Configurable, LogEnabled, SourceDescriptor, SourceInspector
Direct Known Subclasses:
SimpleJdbcSourceDescriptor

public abstract class AbstractConfigurableSourceDescriptor
extends AbstractConfigurableSourceInspector
implements SourceDescriptor

Abstract base class SourceDescriptors that want to configure the set of properties they handle beforehand.

Knowing which properties an inspector handles beforehand greatly improves property management performance.

Author:
Unico Hommes

Field Summary
 
Fields inherited from interface org.apache.cocoon.components.source.SourceDescriptor
ROLE
 
Constructor Summary
AbstractConfigurableSourceDescriptor()
           
 
Method Summary
protected abstract  void doRemoveSourceProperty(Source source, String namespace, String name)
          Do the actual work of removing the given property from the provided Source.
protected abstract  void doSetSourceProperty(Source source, SourceProperty property)
          Do the actual work of setting the provided SourceProperty on the given Source.
 void removeSourceProperty(Source source, String namespace, String name)
          Checks if this SourceDescriptor is configured to handle the given property and if so forwards the call to doRemoveSourceProperty().
 void setSourceProperty(Source source, SourceProperty property)
          Checks if this SourceDescriptor is configured to handle the given property and if so forwards the call to doSetSourceProperty().
 
Methods inherited from class org.apache.cocoon.components.source.impl.AbstractConfigurableSourceInspector
configure, doGetSourceProperty, getPropertyTypes, getSourceProperties, getSourceProperty, handlesProperty
 
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.cocoon.components.source.SourceInspector
getSourceProperties, getSourceProperty, getValidity, handlesProperty
 

Constructor Detail

AbstractConfigurableSourceDescriptor

public AbstractConfigurableSourceDescriptor()
Method Detail

removeSourceProperty

public final void removeSourceProperty(Source source,
                                       String namespace,
                                       String name)
                                throws SourceException
Checks if this SourceDescriptor is configured to handle the given property and if so forwards the call to doRemoveSourceProperty().

Specified by:
removeSourceProperty in interface SourceDescriptor
Parameters:
source - the Source to remove the property from
namespace - namespace identifier of the property to remove
name - name of the property to remove
Throws:
SourceException

setSourceProperty

public final void setSourceProperty(Source source,
                                    SourceProperty property)
                             throws SourceException
Checks if this SourceDescriptor is configured to handle the given property and if so forwards the call to doSetSourceProperty().

Specified by:
setSourceProperty in interface SourceDescriptor
Parameters:
source - the Source to set the SourceProperty on
property - the SourceProperty to set
Throws:
SourceException

doRemoveSourceProperty

protected abstract void doRemoveSourceProperty(Source source,
                                               String namespace,
                                               String name)
                                        throws SourceException
Do the actual work of removing the given property from the provided Source.

Throws:
SourceException

doSetSourceProperty

protected abstract void doSetSourceProperty(Source source,
                                            SourceProperty property)
                                     throws SourceException
Do the actual work of setting the provided SourceProperty on the given Source.

Throws:
SourceException


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