Update of /cvsroot/babeldoc/babeldoc/modules/scanner/src/com/babeldoc/scanner/rmi
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv20577/modules/scanner/src/com/babeldoc/scanner/rmi
Modified Files:
RemoteScannerClient.java
Log Message:
Activate RMI scanner (babeldoc scanmon) and add Scanner controler
Index: RemoteScannerClient.java
===================================================================
RCS file: /cvsroot/babeldoc/babeldoc/modules/scanner/src/com/babeldoc/scanner/rmi/RemoteScannerClient.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** RemoteScannerClient.java 14 Aug 2003 02:34:21 -0000 1.7
--- RemoteScannerClient.java 3 Dec 2007 16:37:18 -0000 1.8
***************
*** 68,73 ****
--- 68,76 ----
import com.babeldoc.core.BabeldocCommand;
import com.babeldoc.core.I18n;
+ import com.babeldoc.core.option.IConfigData;
+ import com.babeldoc.core.option.IConfigInfo;
import com.babeldoc.scanner.ScannerException;
+ import com.babeldoc.scanner.ScannerWorkerVO;
import org.apache.commons.cli.CommandLine;
***************
*** 85,90 ****
* <strong>IRemoteScanner</strong> Remote interface to control the scanner.
*
! * @author Bmcdonald
! * @version 1.0
*/
public class RemoteScannerClient extends BabeldocCommand {
--- 88,93 ----
* <strong>IRemoteScanner</strong> Remote interface to control the scanner.
*
! * @author Paspes
! * @version 1.8
*/
public class RemoteScannerClient extends BabeldocCommand {
***************
*** 224,236 ****
* @throws RemoteException
*/
! private void getScannerConfiguration(IRemoteScanner scanner)
! throws RemoteException {
! // IConfig config = scanner.getConfiguration();
! //
! // for (Iterator i = config.getChildrenNameSet().iterator(); i.hasNext();) {
! // String key = i.next().toString();
! // String value = config.getString(key);
! // System.out.println(key + " = " + value);
! // }
}
--- 227,237 ----
* @throws RemoteException
*/
! public static IConfigInfo getScannerConfiguration(IRemoteScanner scanner, int index)
! throws ScannerException,RemoteException {
! ScannerWorkerVO[] workersVO = scanner.getWorkers();
! if(index<workersVO.length){
! return workersVO[index].getInfo();
! }
! throw new ScannerException("Index not fount" + index + ". Length:" + workersVO.length);
}
***************
*** 244,257 ****
* @throws ScannerException DOCUMENT ME!
*/
! private void getThreadOptions(IRemoteScanner scanner, String name)
! throws RemoteException, ScannerException {
! // ScannerThreadConfig config = scanner.getThreadOptions(name);
! // if ((config != null) && (config.getChildrenNameSet().size() > 0)) {
! // for (Iterator i = config.getChildrenNameSet().iterator(); i.hasNext();) {
! // String key = i.next().toString();
! // String value = config.getChild(key);
! // System.out.println(key + " = " + value);
! // }
! // }
}
--- 245,255 ----
* @throws ScannerException DOCUMENT ME!
*/
! public static IConfigData getThreadOptions(IRemoteScanner scanner,int index)
! throws RemoteException, ScannerException {
! ScannerWorkerVO[] workersVO = scanner.getWorkers();
! if(index<workersVO.length){
! return workersVO[index].getConfig();
! }
! throw new ScannerException("Index not fount" + index + ". Length:" + workersVO.length);
}
***************
*** 263,275 ****
* @throws RemoteException
*/
! private void listThreadNames(IRemoteScanner scanner)
throws RemoteException {
! // String[] names = scanner.getScannerThreadNames();
! //
! // if ((names != null) && (names.length > 0)) {
! // for (int i = 0; i < names.length; ++i) {
! // System.out.println(names[i]);
! // }
! // }
}
}
--- 261,272 ----
* @throws RemoteException
*/
! public static String[] listThreadNames(IRemoteScanner scanner)
throws RemoteException {
! ScannerWorkerVO[] workersVO = scanner.getWorkers();
! String[] names = new String[workersVO.length];
! for (int i = 0; i < workersVO.length; ++i) {
! names[i] = workersVO[i].getName();
! }
! return names;
}
}
|