|
From: <mic...@us...> - 2003-11-12 22:18:10
|
Update of /cvsroot/babeldoc/babeldoc/modules/scanner/src/com/babeldoc/scanner/jmx
In directory sc8-pr-cvs1:/tmp/cvs-serv21577/modules/scanner/src/com/babeldoc/scanner/jmx
Modified Files:
Tag: TEMP_MIKEA
ScannerServiceMBean.java ScannerService.java
Log Message:
This branch has an augmented jmx scanner, and a new pipeline stage for jfreereports.
Index: ScannerServiceMBean.java
===================================================================
RCS file: /cvsroot/babeldoc/babeldoc/modules/scanner/src/com/babeldoc/scanner/jmx/ScannerServiceMBean.java,v
retrieving revision 1.3
retrieving revision 1.3.2.1
diff -C2 -d -r1.3 -r1.3.2.1
*** ScannerServiceMBean.java 27 Jun 2003 14:00:15 -0000 1.3
--- ScannerServiceMBean.java 12 Nov 2003 22:18:06 -0000 1.3.2.1
***************
*** 92,95 ****
--- 92,101 ----
public String getConfigUrl() throws Exception;
+ public void setBabeldocHome(String home) throws Exception;
+
+ public String getBabeldocHome() throws Exception;
+
+ public String getStateString() throws Exception;
+
/**
* TODO: DOCUMENT ME!
Index: ScannerService.java
===================================================================
RCS file: /cvsroot/babeldoc/babeldoc/modules/scanner/src/com/babeldoc/scanner/jmx/ScannerService.java,v
retrieving revision 1.5
retrieving revision 1.5.2.1
diff -C2 -d -r1.5 -r1.5.2.1
*** ScannerService.java 27 Jun 2003 14:00:15 -0000 1.5
--- ScannerService.java 12 Nov 2003 22:18:06 -0000 1.5.2.1
***************
*** 66,76 ****
package com.babeldoc.scanner.jmx;
import com.babeldoc.scanner.Scanner;
/**
* MBean service support for jboss. Start up the scanner
- */
- /**
* MBean implementor - this is for embedding the scanner into a mbean container
* like jboss or weblogic, etc, etc. Generally a good idea, the only problem
--- 66,77 ----
package com.babeldoc.scanner.jmx;
+ import com.babeldoc.core.LogService;
import com.babeldoc.scanner.Scanner;
+ import java.net.URL;
+
/**
* MBean service support for jboss. Start up the scanner
* MBean implementor - this is for embedding the scanner into a mbean container
* like jboss or weblogic, etc, etc. Generally a good idea, the only problem
***************
*** 81,84 ****
--- 82,91 ----
*/
public class ScannerService implements ScannerServiceMBean {
+ private static LogService log =
+ LogService.getInstance(ScannerService.class.getName());
+ public static final int STATE_STOPPED = 0;
+ public static final int STATE_STARTED = 1;
+ public static final String stateDescriptions[] = new String[] {"scanner.002", "scanner.001"};
+ int state = 0;
Scanner scanner = null;
***************
*** 94,114 ****
*/
public void setConfigUrl(String configUrl) throws Exception {
! this.configUrl = configUrl;
! System.out.println("setConfigUrl: " + configUrl);
}
/**
! * Start the service mbean
*
! * @return DOCUMENT ME!
*
! * @throws Exception DOCUMENT ME!
*/
public String getConfigUrl() throws Exception {
! System.out.println("getConfigUrl: " + configUrl);
!
! return this.configUrl;
}
!
/**
* Start the service mbean
--- 101,158 ----
*/
public void setConfigUrl(String configUrl) throws Exception {
! this.configUrl = configUrl;
! getLog().logInfo("setConfigUrl: " + configUrl);
}
/**
! * Get the configUrl setting
*
! * @return configUrl DOCUMENT ME!
*
! * @throws Exception
*/
public String getConfigUrl() throws Exception {
! getLog().logInfo("getConfigUrl: " + configUrl);
! return this.configUrl;
}
!
! /**
! * Set the babeldoc home
! *
! * @param babeldoc.home The babeldoc home directory
! *
! * @throws Exception
! */
! public void setBabeldocHome(String home) throws Exception {
! System.setProperty("babeldoc.home", home);
! getLog().logInfo("setBabeldocHome: " + home);
! }
!
! /**
! * Get the babeldoc home
! *
! * @return babeldoc.home The babeldoc home directory
! *
! * @throws Exception
! */
! public String getBabeldocHome() throws Exception {
! String home = System.getProperty("babeldoc.home");
! getLog().logInfo("getBabeldocHome: " + home);
! return (home);
! }
!
! /**
! * Get the state string
! *
! * @return StateString The string describing the current state
! *
! * @throws Exception
! */
! public String getStateString() throws Exception {
! getLog().logInfo("getStateString: " +
! com.babeldoc.core.I18n.get(stateDescriptions[state]));
! return (com.babeldoc.core.I18n.get(stateDescriptions[state]));
! }
!
/**
* Start the service mbean
***************
*** 117,125 ****
*/
public void start() throws Exception {
! scanner = new Scanner(new String[] { });
! //TODO: Double check this since it maybe won't work... Did anyone used this anyway???
! scanner.start();
! System.out.println(com.babeldoc.core.I18n.get("scanner.001"));
}
--- 161,185 ----
*/
public void start() throws Exception {
!
! /* This section determines what the usual babeldoc.home will be for a standard
! * JBoss system. This will be ignored by other J2EE application containers,
! * but we should probably look at putting good defaults in for them too.
! */
! String babeldocHome = System.getProperty("jboss.server.config.url");
! if ((babeldocHome != null) && (babeldocHome.length() > 0)) {
! // This assumes that jboss.server.conf.url will always be a file://
! // Not sure if babeldoc can handle a non-file home directory, e.g. ftp://
! URL urlHome = new URL(babeldocHome);
! setBabeldocHome(urlHome.getFile());
! }
!
! scanner = new Scanner(new String[] { });
! //TODO: Double check this since it maybe won't work... Did anyone used this anyway???
! // MCA: I checked, it works.
! // TODO: Remove this and above comments before 1.3 release.
! scanner.start();
! state = ScannerService.STATE_STARTED;
! getLog().logInfo(com.babeldoc.core.I18n.get(stateDescriptions[state]));
}
***************
*** 130,135 ****
*/
public void stop() throws Exception {
! scanner.stop();
! System.out.println(com.babeldoc.core.I18n.get("scanner.002"));
}
! }
--- 190,211 ----
*/
public void stop() throws Exception {
! if (scanner == null) {
! state = ScannerService.STATE_STOPPED;
! }
! if (state != ScannerService.STATE_STOPPED) {
! scanner.stop();
! scanner.finishUp();
! scanner = null;
! }
! state = ScannerService.STATE_STOPPED;
! getLog().logInfo(com.babeldoc.core.I18n.get(stateDescriptions[state]));
}
!
! public static LogService getLog() {
! return log;
! }
!
! public static void setLog(LogService log) {
! ScannerService.log = log;
! }
! }
\ No newline at end of file
|