|
From: <tr...@us...> - 2003-06-30 22:16:45
|
Update of /cvsroot/babeldoc/babeldoc/modules/scanner/src/com/babeldoc/scanner
In directory sc8-pr-cvs1:/tmp/cvs-serv22611/src/com/babeldoc/scanner
Modified Files:
Scanner.java ScannerFactory.java
Log Message:
updated the scanner code to use the feeder factory code.
Index: Scanner.java
===================================================================
RCS file: /cvsroot/babeldoc/babeldoc/modules/scanner/src/com/babeldoc/scanner/Scanner.java,v
retrieving revision 1.19
retrieving revision 1.20
diff -C2 -d -r1.19 -r1.20
*** Scanner.java 27 Jun 2003 14:00:12 -0000 1.19
--- Scanner.java 30 Jun 2003 22:16:42 -0000 1.20
***************
*** 66,75 ****
package com.babeldoc.scanner;
! import com.babeldoc.core.BabeldocCommand;
! import com.babeldoc.core.I18n;
! import com.babeldoc.core.LogService;
! import com.babeldoc.core.RmiRegistry;
import com.babeldoc.core.pipeline.feeder.AsynchronousFeeder;
import com.babeldoc.core.pipeline.feeder.IFeederQueue;
import com.babeldoc.scanner.rmi.IRemoteScanner;
--- 66,74 ----
package com.babeldoc.scanner;
! import com.babeldoc.core.*;
import com.babeldoc.core.pipeline.feeder.AsynchronousFeeder;
import com.babeldoc.core.pipeline.feeder.IFeederQueue;
+ import com.babeldoc.core.pipeline.feeder.FeederFactory;
+ import com.babeldoc.core.pipeline.feeder.IFeeder;
import com.babeldoc.scanner.rmi.IRemoteScanner;
***************
*** 93,101 ****
public class Scanner extends BabeldocCommand {
private static LogService log = LogService.getInstance(Scanner.class.getName());
! private AsynchronousFeeder feeder;
private Collection workers;
private ScannerFactory factory;
private ScannerWorkerScheduler scheduler;
/**
* Constructor with all the command line arguments
--- 92,102 ----
public class Scanner extends BabeldocCommand {
private static LogService log = LogService.getInstance(Scanner.class.getName());
! private IFeeder feeder;
private Collection workers;
private ScannerFactory factory;
private ScannerWorkerScheduler scheduler;
+ public static final String SCANNER_FEEDER = "scanner";
+
/**
* Constructor with all the command line arguments
***************
*** 136,141 ****
/**
! *
! */
public void finishUp() {
this.stop();
--- 137,142 ----
/**
! *
! */
public void finishUp() {
this.stop();
***************
*** 181,187 ****
}
! /**
! *
! */
public void saveConfiguration() {
// TODO Auto-generated method stub
--- 182,188 ----
}
! /**
! *
! */
public void saveConfiguration() {
// TODO Auto-generated method stub
***************
*** 194,217 ****
super.setupCommandLine(options);
options.addOption(OptionBuilder.isRequired(false).hasArg(true)
! .withDescription(I18n.get(
! "scanner.Scanner.option.scanner")).withLongOpt("scanner").create('s'));
options.addOption(OptionBuilder.isRequired(false).hasArg(false)
! .withDescription(I18n.get(
! "scanner.Scanner.option.rmi")).withLongOpt("rmi").create('r'));
options.addOption(OptionBuilder.isRequired(false).hasArg(true)
! .withDescription(I18n.get(
! "scanner.Scanner.option.port")).withLongOpt("port").create('p'));
}
/**
! *
! */
public void start() throws ScannerException {
factory = ScannerFactory.getInstance();
log.logInfo("Starting feeder...");
! IFeederQueue queue = factory.getQueue();
! feeder = new AsynchronousFeeder(queue);
!
//handleRemoteServer(-1);
log.logInfo("Initializing workers:");
--- 195,221 ----
super.setupCommandLine(options);
options.addOption(OptionBuilder.isRequired(false).hasArg(true)
! .withDescription(I18n.get(
! "scanner.Scanner.option.scanner")).withLongOpt("scanner").create('s'));
options.addOption(OptionBuilder.isRequired(false).hasArg(false)
! .withDescription(I18n.get(
! "scanner.Scanner.option.rmi")).withLongOpt("rmi").create('r'));
options.addOption(OptionBuilder.isRequired(false).hasArg(true)
! .withDescription(I18n.get(
! "scanner.Scanner.option.port")).withLongOpt("port").create('p'));
}
/**
! *
! */
public void start() throws ScannerException {
factory = ScannerFactory.getInstance();
log.logInfo("Starting feeder...");
! // feeder = new AsynchronousFeeder(queue);
! try {
! feeder = FeederFactory.getInstance().getFeeder(SCANNER_FEEDER);
! } catch (GeneralException e) {
! e.printStackTrace(); //To change body of catch statement use Options | File Templates.
! }
//handleRemoteServer(-1);
log.logInfo("Initializing workers:");
***************
*** 246,251 ****
/**
! *
! */
public void stop() {
log.logInfo("Shutting down...");
--- 250,255 ----
/**
! *
! */
public void stop() {
log.logInfo("Shutting down...");
***************
*** 253,257 ****
this.scheduler.stopAll();
! this.feeder.stopRunning();
log.logInfo("Stopping feeder");
}
--- 257,261 ----
this.scheduler.stopAll();
! ((AsynchronousFeeder) this.feeder).stopRunning();
log.logInfo("Stopping feeder");
}
Index: ScannerFactory.java
===================================================================
RCS file: /cvsroot/babeldoc/babeldoc/modules/scanner/src/com/babeldoc/scanner/ScannerFactory.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** ScannerFactory.java 27 Jun 2003 14:00:13 -0000 1.6
--- ScannerFactory.java 30 Jun 2003 22:16:42 -0000 1.7
***************
*** 145,160 ****
/**
- *
- */
- public IFeederQueue getQueue() throws ScannerException {
- //TODO: Implement reading queue configuration
- try {
- return new DiskQueue("queue");
- } catch (Exception e) {
- throw new ScannerException("Error creating queue", e);
- }
- }
-
- /**
* Get scanner worker with name workerName.
*
--- 145,148 ----
|