From: bruce m. <tr...@us...> - 2004-07-30 01:33:14
|
Update of /cvsroot/babeldoc/babeldoc/modules/core/src/com/babeldoc/core/pipeline/processor In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7955/modules/core/src/com/babeldoc/core/pipeline/processor Modified Files: AsyncPipelineStageProcessor.java IPipelineStageProcessor.java PipelineStageProcessorFactory.java ProcessorConfigInfo.java SyncPipelineStageProcessor.java ThreadPooledPipelineStageProcessor.java Log Message: javadoc and formatting here. Index: SyncPipelineStageProcessor.java =================================================================== RCS file: /cvsroot/babeldoc/babeldoc/modules/core/src/com/babeldoc/core/pipeline/processor/SyncPipelineStageProcessor.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** SyncPipelineStageProcessor.java 28 Jul 2004 21:44:19 -0000 1.6 --- SyncPipelineStageProcessor.java 30 Jul 2004 01:33:03 -0000 1.7 *************** *** 100,104 **** * Get the "owning" pipeline stage factory. * ! * @return */ public IPipelineStageFactory getStageFactory() { --- 100,104 ---- * Get the "owning" pipeline stage factory. * ! * @return pipeline stage factory. */ public IPipelineStageFactory getStageFactory() { *************** *** 107,116 **** /** ! * Returns the pipeline stage type for this particular pipeline ! * ! * @param stageName ! * ! * @return * * @throws PipelineException */ --- 107,114 ---- /** ! * Returns the pipeline stage type for this particular pipeline. * + * @param stageName name of the stage. + * @return type for the name. * @throws PipelineException */ *************** *** 124,131 **** * * @param stageName the unique name of the stage - * * @return a reference to the pipeline stage ! * ! * @throws PipelineException DOCUMENT ME! */ public IPipelineStage getPipelineStage(String stageName) --- 122,127 ---- * * @param stageName the unique name of the stage * @return a reference to the pipeline stage ! * @throws PipelineException */ public IPipelineStage getPipelineStage(String stageName) *************** *** 171,176 **** * @param ticket the tracker ticket * @param finalResults the resulting processed documents after all processing is completed ! * ! * @throws com.babeldoc.core.pipeline.PipelineException DOCUMENT ME! */ public void process(String name, PipelineDocument document, --- 167,171 ---- * @param ticket the tracker ticket * @param finalResults the resulting processed documents after all processing is completed ! * @throws PipelineException */ public void process(String name, PipelineDocument document, *************** *** 268,276 **** /** ! * Track the document on the pipeline stage ! * ! * @param pstage * ! * @throws PipelineException DOCUMENT ME! */ protected void trackDocument(IPipelineStage pstage) --- 263,270 ---- /** ! * Track the document on the pipeline stage. * ! * @param pstage pipeline stage name to track ! * @throws PipelineException */ protected void trackDocument(IPipelineStage pstage) *************** *** 288,292 **** /** ! * Get the configuration information for this processor * * @return IConfigInfo object --- 282,286 ---- /** ! * Get the configuration information for this processor. * * @return IConfigInfo object Index: PipelineStageProcessorFactory.java =================================================================== RCS file: /cvsroot/babeldoc/babeldoc/modules/core/src/com/babeldoc/core/pipeline/processor/PipelineStageProcessorFactory.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** PipelineStageProcessorFactory.java 23 Jul 2004 22:38:09 -0000 1.3 --- PipelineStageProcessorFactory.java 30 Jul 2004 01:33:03 -0000 1.4 *************** *** 1 **** ! /* ==================================================================== * The Apache Software License, Version 1.1 * * Copyright (c) 2000 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the * Apache Software Foundation (http://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * * 4. The names "Apache" and "Apache Software Foundation" must * not be used to endorse or promote products derived from this * software without prior written permission. For written * permission, please contact ap...@ap.... * * 5. Products derived from this software may not be called "Apache", * nor may "Apache" appear in their name, without prior written * permission of the Apache Software Foundation. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * ==================================================================== * * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see * <http://www.apache.org/>. * * Portions of this software are based upon public domain software * originally written at the National Center for Supercomputing Applications, * University of Illinois, Urbana-Champaign. * ==================================================================== * * Babeldoc: The Universal Document Processor * * $Header$ * $DateTime$ * $Author$ * */ package com.babeldoc.core.pipeline.processor; import com.babeldoc.core.pipeline.IPipelineStageFactory; import com.babeldoc.core.GeneralException; import com.babeldoc.core.option.IConfigData; import com.babeldoc.core.service.ServiceFactory; /** * The <code>PipelineStageProcessorFactory</code> code provides a * means to load the relevant processor for the pipelinestagefactory. * * @author bmcdonald * @version 1.1 */ public class PipelineStageProcessorFactory { public static final String PROCESSOR_TYPE = "type"; public static final String SERVICE_PROCESSOR = "PipelineStageProcessor."; /** * Quick and easy way to getChild a Pipeline stage processor implementation. If the * config object is null (no processor specified in the pipeline configuration, * then the default processor is assigned. If the configuration is given and is a * map (nested/tiered configuration), then the type is determined and a * processor is created and initialized. * * @param psFactory the pipeline stage factory associated with this processor * @param data the configuration object - this can be null * @return a completely constructed Processor - ready to go. * @throws GeneralException */ public static IPipelineStageProcessor getProcessor( IPipelineStageFactory psFactory, IConfigData data) throws GeneralException { IPipelineStageProcessor processor = null; if (data == null) { processor = new SyncPipelineStageProcessor(); } else { String processorType = data.getValue(PROCESSOR_TYPE); processor = (IPipelineStageProcessor) (ServiceFactory .getService(SERVICE_PROCESSOR + processorType)); } processor.configure(psFactory, data); return processor; } } \ No newline at end of file --- 1 ---- ! /* ==================================================================== * The Apache Software License, Version 1.1 * * Copyright (c) 2000 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the * Apache Software Foundation (http://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * * 4. The names "Apache" and "Apache Software Foundation" must * not be used to endorse or promote products derived from this * software without prior written permission. For written * permission, please contact ap...@ap.... * * 5. Products derived from this software may not be called "Apache", * nor may "Apache" appear in their name, without prior written * permission of the Apache Software Foundation. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * ==================================================================== * * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see * <http://www.apache.org/>. * * Portions of this software are based upon public domain software * originally written at the National Center for Supercomputing Applications, * University of Illinois, Urbana-Champaign. * ==================================================================== * * Babeldoc: The Universal Document Processor * * $Header$ * $DateTime$ * $Author$ * */ package com.babeldoc.core.pipeline.processor; import com.babeldoc.core.pipeline.IPipelineStageFactory; import com.babeldoc.core.GeneralException; import com.babeldoc.core.option.IConfigData; import com.babeldoc.core.service.ServiceFactory; /** * The <code>PipelineStageProcessorFactory</code> code provides a * means to load the relevant processor for the pipelinestagefactory. * * @author bmcdonald * @version 1.1 */ public class PipelineStageProcessorFactory { /** processor type string. */ public static final String PROCESSOR_TYPE = "type"; /** pipeline stage processor string. */ public static final String SERVICE_PROCESSOR = "PipelineStageProcessor."; /** * Quick and easy way to getChild a Pipeline stage processor implementation. If the * config object is null (no processor specified in the pipeline configuration, * then the default processor is assigned. If the configuration is given and is a * map (nested/tiered configuration), then the type is determined and a * processor is created and initialized. * * @param psFactory the pipeline stage factory associated with this processor * @param data the configuration object - this can be null * @return a completely constructed Processor - ready to go. * @throws GeneralException */ public static IPipelineStageProcessor getProcessor( IPipelineStageFactory psFactory, IConfigData data) throws GeneralException { IPipelineStageProcessor processor = null; if (data == null) { processor = new SyncPipelineStageProcessor(); } else { String processorType = data.getValue(PROCESSOR_TYPE); processor = (IPipelineStageProcessor) (ServiceFactory .getService(SERVICE_PROCESSOR + processorType)); } processor.configure(psFactory, data); return processor; } } \ No newline at end of file Index: AsyncPipelineStageProcessor.java =================================================================== RCS file: /cvsroot/babeldoc/babeldoc/modules/core/src/com/babeldoc/core/pipeline/processor/AsyncPipelineStageProcessor.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** AsyncPipelineStageProcessor.java 23 Jul 2004 22:38:09 -0000 1.5 --- AsyncPipelineStageProcessor.java 30 Jul 2004 01:33:03 -0000 1.6 *************** *** 88,92 **** --- 88,94 ---- private int globalMaxThreads; + /** constant for the max threads. */ public static final String MAX_THREADS = "maxThreads"; + /** default max threads. */ public static final int DEFAULT_MAX_THREADS = 5; *************** *** 96,99 **** --- 98,102 ---- * * @param stageFactory set the associated stage factory for this processor + * @param data configuration data for this processor */ public void configure(IPipelineStageFactory stageFactory, IConfigData data) { *************** *** 146,149 **** --- 149,153 ---- * @param finalResults result of the current pipeline stage process * @param maxThreads max number of threads to spawn to process the finalResults + * @throws PipelineException */ protected void processPipelineStageResultsParallel(final PipelineStageResult[] psResults, *************** *** 196,200 **** * Get the globally configured number of threads allowed. * ! * @return */ public int getGlobalMaxThreads() { --- 200,204 ---- * Get the globally configured number of threads allowed. * ! * @return global threads */ public int getGlobalMaxThreads() { *************** *** 204,208 **** /** ! * Get the configuration information for this processor * * @return IConfigInfo object --- 208,212 ---- /** ! * Get the configuration information for this processor. * * @return IConfigInfo object Index: ThreadPooledPipelineStageProcessor.java =================================================================== RCS file: /cvsroot/babeldoc/babeldoc/modules/core/src/com/babeldoc/core/pipeline/processor/ThreadPooledPipelineStageProcessor.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** ThreadPooledPipelineStageProcessor.java 23 Jul 2004 22:38:09 -0000 1.7 --- ThreadPooledPipelineStageProcessor.java 30 Jul 2004 01:33:03 -0000 1.8 *************** *** 89,95 **** --- 89,99 ---- implements IShutdownListener { + /** poolsize configuration. */ public static final String POOL_SIZE = "poolSize"; + /** keepalive configuration. */ public static final String KEEP_ALIVE = "keepAlive"; + /** default poolsize. */ public static final int DEFAULT_POOLSIZE = 5; + /** default keep alive. */ public static final int DEFAULT_KEEPALIVE = 15*1000; // 15 seconds *************** *** 103,106 **** --- 107,111 ---- * * @param stageFactory set the associated stage factory for this processor + * @param data data for the pipeline */ public void configure(IPipelineStageFactory stageFactory, IConfigData data) { *************** *** 126,129 **** --- 131,135 ---- * @param psResults results from the current pipeline stage process * @param finalResults result of the current pipeline stage process + * @throws PipelineException */ protected void processPipelineStageResults(final PipelineStageResult[] psResults, Collection finalResults) *************** *** 151,155 **** /** ! * Get the configuration information for this processor * * @return IConfigInfo object --- 157,161 ---- /** ! * Get the configuration information for this processor. * * @return IConfigInfo object Index: ProcessorConfigInfo.java =================================================================== RCS file: /cvsroot/babeldoc/babeldoc/modules/core/src/com/babeldoc/core/pipeline/processor/ProcessorConfigInfo.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ProcessorConfigInfo.java 23 Jul 2004 22:38:09 -0000 1.4 --- ProcessorConfigInfo.java 30 Jul 2004 01:33:03 -0000 1.5 *************** *** 95,101 **** extends ConfigInfo{ /** ! * This method returns options that are general to all components * ! * @return comments */ public Collection getGeneralOptions() { --- 95,101 ---- extends ConfigInfo{ /** ! * This method returns options that are general to all components. * ! * @return collection of general options. */ public Collection getGeneralOptions() { *************** *** 104,110 **** /** ! * Return an xmlized version of the of the config info * ! * @return DOCUMENT ME! */ public String toXml() { --- 104,110 ---- /** ! * Return an xmlized version of the of the config info. * ! * @return xml version of the data. */ public String toXml() { *************** *** 154,160 **** /** ! * Get all the xml definitions in one humungo xml file * ! * @return */ public static String getAllXml() { --- 154,160 ---- /** ! * Get all the xml definitions in one humungo xml file. * ! * @return all the stages xml */ public static String getAllXml() { Index: IPipelineStageProcessor.java =================================================================== RCS file: /cvsroot/babeldoc/babeldoc/modules/core/src/com/babeldoc/core/pipeline/processor/IPipelineStageProcessor.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** IPipelineStageProcessor.java 23 Jul 2004 22:38:09 -0000 1.4 --- IPipelineStageProcessor.java 30 Jul 2004 01:33:03 -0000 1.5 *************** *** 84,87 **** --- 84,88 ---- public interface IPipelineStageProcessor extends IConfigurable { + /** constant processor. */ public static final String PROCESSOR = "processor"; *************** *** 90,96 **** * * @param stageName the unique name of the stage - * * @return a reference to the pipeline stage - * * @throws PipelineException */ --- 91,95 ---- *************** *** 108,112 **** * @param finalResults the resulting processed documents after all processing is completed * ! * @throws com.babeldoc.core.pipeline.PipelineException DOCUMENT ME! */ public void process(String name, PipelineDocument document, --- 107,111 ---- * @param finalResults the resulting processed documents after all processing is completed * ! * @throws com.babeldoc.core.pipeline.PipelineException */ public void process(String name, PipelineDocument document, |