Update of /cvsroot/babeldoc/babeldoc/modules/core/src/com/babeldoc/core/pipeline
In directory sc8-pr-cvs1:/tmp/cvs-serv27423/src/com/babeldoc/core/pipeline
Modified Files:
IPipelineStageFactory.java PipelineFactory.java
PipelineStageFactory.java
Added Files:
PipelineStageFactoryInfo.java
Log Message:
Now pipeline stage factories get to be IConfigurable too!! This is to support the work I am doing in the J2ee module.
--- NEW FILE: PipelineStageFactoryInfo.java ---
package com.babeldoc.core.pipeline;
import com.babeldoc.core.option.*;
import com.babeldoc.core.pipeline.processor.IPipelineStageProcessor;
import com.babeldoc.core.pipeline.processor.PipelineStageProcessorFactory;
import java.util.Collection;
import java.util.ArrayList;
/**
* Pipeline stage factory configuration options.
*
* @author bmcdonald
* @version 1.1
*/
abstract public class PipelineStageFactoryInfo
extends ConfigInfo{
/** Service type for pipeline stages */
public static final ServiceTypeConfigOptionType PIPELINE_FACTORY_TYPE =
new ServiceTypeConfigOptionType(PipelineStageFactoryType.SERVICE_PREFIX);
/** Service type for processor stages */
public static final ServiceTypeConfigOptionType PROCESSOR_TYPE =
new ServiceTypeConfigOptionType(PipelineStageProcessorFactory.SERVICE_PROCESSOR);
/**
* This method returns options that are general to all components
*
* @return comments
*/
public Collection getGeneralOptions() {
Collection general = new ArrayList();
//adding general scanner options
general.add(new ConfigOption(PipelineFactory.TYPE,
PIPELINE_FACTORY_TYPE, null, true, "Pipeline type"));
// This is the type description of the complex type - it consist
// of just one kind of subtype - the <variable>=<value> and is
// passed verbatim to the processor factory
IConfigOptionType processorType = new ComplexConfigOptionType(
new ConfigOption[] { new ConfigOption(PipelineStageProcessorFactory.PROCESSOR_TYPE,
PROCESSOR_TYPE, "Processor type")});
general.add(new ConfigOption(IPipelineStageProcessor.PROCESSOR,
processorType, null, false, "The processor configuration options"));
return general;
}
/**
* Return an xmlized version of the of the config info
*
* @return String of configuration information.
*/
public String toXml() {
return null;
}
}
Index: IPipelineStageFactory.java
===================================================================
RCS file: /cvsroot/babeldoc/babeldoc/modules/core/src/com/babeldoc/core/pipeline/IPipelineStageFactory.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** IPipelineStageFactory.java 12 Aug 2003 23:44:44 -0000 1.10
--- IPipelineStageFactory.java 27 Aug 2003 03:13:35 -0000 1.11
***************
*** 68,71 ****
--- 68,72 ----
import com.babeldoc.core.INamed;
import com.babeldoc.core.option.IConfigData;
+ import com.babeldoc.core.option.IConfigurable;
import com.babeldoc.core.journal.IJournalTicket;
***************
*** 75,80 ****
/**
* IPipelineStageFactory - A factory / manager for pipeline stages. This is one of hte
! * most important classes in babeldoc and its handling of the pipelines.
! *
*
* @author Bmcdonald
--- 76,82 ----
/**
* IPipelineStageFactory - A factory / manager for pipeline stages. This is one of hte
! * most important classes in babeldoc and its handling of the pipelines. This interface
! * extends IConfigurable which means that there is a getInfo method which allows for
! * implementing classes to describe all the applicable configuration options.
*
* @author Bmcdonald
***************
*** 82,86 ****
*/
public interface IPipelineStageFactory
! extends INamed {
/**
* Get all the pipeline stage names in this factory
--- 84,88 ----
*/
public interface IPipelineStageFactory
! extends INamed, IConfigurable {
/**
* Get all the pipeline stage names in this factory
***************
*** 92,96 ****
public String[] getAllPipelineStageNames()
throws PipelineException;
-
/**
--- 94,97 ----
Index: PipelineFactory.java
===================================================================
RCS file: /cvsroot/babeldoc/babeldoc/modules/core/src/com/babeldoc/core/pipeline/PipelineFactory.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** PipelineFactory.java 12 Aug 2003 23:44:44 -0000 1.11
--- PipelineFactory.java 27 Aug 2003 03:13:35 -0000 1.12
***************
*** 89,93 ****
* @version 1.0
*/
! public class PipelineFactory implements IPipelineFactory {
/** constants for the configuration stuff */
public static final String CONFIG_NAME = "pipeline/config";
--- 89,94 ----
* @version 1.0
*/
! public class PipelineFactory
! implements IPipelineFactory {
/** constants for the configuration stuff */
public static final String CONFIG_NAME = "pipeline/config";
Index: PipelineStageFactory.java
===================================================================
RCS file: /cvsroot/babeldoc/babeldoc/modules/core/src/com/babeldoc/core/pipeline/PipelineStageFactory.java,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -d -r1.17 -r1.18
*** PipelineStageFactory.java 12 Aug 2003 23:44:44 -0000 1.17
--- PipelineStageFactory.java 27 Aug 2003 03:13:35 -0000 1.18
***************
*** 92,103 ****
/** The resolver */
! private IPipelineStageResolver resolver;
/** The logging serving instance */
private LogService log;
- /** Holds the options */
- private IConfigData options;
-
/** reference to the pipeline stage processor */
private IPipelineStageProcessor processor;
--- 92,100 ----
/** The resolver */
! protected IPipelineStageResolver resolver;
/** The logging serving instance */
private LogService log;
/** reference to the pipeline stage processor */
private IPipelineStageProcessor processor;
***************
*** 170,179 ****
throws PipelineException {
! this.options = options;
// Setup the processor
try {
! this.processor = PipelineStageProcessorFactory.getProcessor(this,
! options.getChild(IPipelineStageProcessor.PROCESSOR));
} catch (GeneralException e) {
throw new PipelineException("", e);
--- 167,176 ----
throws PipelineException {
! this.getInfo().applyConfigData(options);
// Setup the processor
try {
! IConfigData processorConfig = options.getChild(IPipelineStageProcessor.PROCESSOR);
! this.processor = PipelineStageProcessorFactory.getProcessor(this, processorConfig);
} catch (GeneralException e) {
throw new PipelineException("", e);
***************
*** 182,194 ****
/**
- * Get the options on this pipeline stage factory
- *
- * @return the options
- */
- public IConfigData getOptions() {
- return this.options;
- }
-
- /**
* Get all the pipieline stage connections between stages
*
--- 179,182 ----
***************
*** 206,225 ****
/**
! * Set the resolver.
! *
! * @param resolver DOCUMENT ME!
! */
! public void setResolver(IPipelineStageResolver resolver) {
! this.resolver = resolver;
! }
!
! /**
! * Get the resolver.
*
* @return a reference to the pipeline stage resolver
*/
! public IPipelineStageResolver getResolver() {
! return resolver;
! }
/**
--- 194,204 ----
/**
! * Get the resolver. If the resolver is null, then extract
! * whatever information from the configuration options to
! * create the resolver.
*
* @return a reference to the pipeline stage resolver
*/
! abstract public IPipelineStageResolver getResolver();
/**
***************
*** 261,265 ****
* @return log service!
*/
! protected com.babeldoc.core.LogService getLog() {
if (log == null) {
log = LogService.getInstance(this.getClass().getName());
--- 240,244 ----
* @return log service!
*/
! protected LogService getLog() {
if (log == null) {
log = LogService.getInstance(this.getClass().getName());
***************
*** 269,272 ****
--- 248,257 ----
}
+ /**
+ * Get the processor. This has already been setup correctly in the
+ * setOptions method.
+ *
+ * @return
+ */
public IPipelineStageProcessor getProcessor() {
return processor;
|