You are viewing a plain text version of this content. The canonical link for it is here.
Posted to slide-dev@jakarta.apache.org by oz...@apache.org on 2004/05/10 10:12:45 UTC
cvs commit: jakarta-slide/src/stores/org/apache/slide/store/txfile AbstractTxFileStoreService.java
ozeigermann 2004/05/10 01:12:45
Modified: src/stores/org/apache/slide/store/txfile/rm/impl
FileResourceManager.java
src/stores/org/apache/slide/store/txfile
AbstractTxFileStoreService.java
Log:
Made debug mode configurable
Revision Changes Path
1.11 +21 -5 jakarta-slide/src/stores/org/apache/slide/store/txfile/rm/impl/FileResourceManager.java
Index: FileResourceManager.java
===================================================================
RCS file: /home/cvs/jakarta-slide/src/stores/org/apache/slide/store/txfile/rm/impl/FileResourceManager.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- FileResourceManager.java 6 May 2004 15:40:29 -0000 1.10
+++ FileResourceManager.java 10 May 2004 08:12:45 -0000 1.11
@@ -191,7 +191,7 @@
protected boolean dirty = false;
protected int operationMode = OPERATION_MODE_STOPPED;
protected long defaultTimeout = DEFAULT_TIMEOUT_MSECS;
- protected boolean debug = true;
+ protected boolean debug;
protected StoreLogger logger;
@@ -209,13 +209,29 @@
* Creates a new resouce manager operation on the specified directories.
*
* @param storeDir directory where main data should go after commit
- * @param workDir directory where transactions store temporary data
+ * @param workDir directory where transactions store temporary data
+ * @param urlEncodePath if set to <code>true</code> encodes all paths to allow for any kind of characters
+ * @param logger the logger to be used by this store
*/
public FileResourceManager(String storeDir, String workDir, boolean urlEncodePath, StoreLogger logger) {
+ this(storeDir, workDir, urlEncodePath, logger, false);
+ }
+
+ /**
+ * Creates a new resouce manager operation on the specified directories.
+ *
+ * @param storeDir directory where main data should go after commit
+ * @param workDir directory where transactions store temporary data
+ * @param urlEncodePath if set to <code>true</code> encodes all paths to allow for any kind of characters
+ * @param logger the logger to be used by this store
+ * @param debug if set to <code>true</code> logs all locking information to "transaction.log" for debugging inspection
+ */
+ public FileResourceManager(String storeDir, String workDir, boolean urlEncodePath, StoreLogger logger, boolean debug) {
this.workDir = workDir;
this.storeDir = storeDir;
this.urlEncodePath = urlEncodePath;
this.logger = logger;
+ this.debug = debug;
}
/**
1.11 +14 -6 jakarta-slide/src/stores/org/apache/slide/store/txfile/AbstractTxFileStoreService.java
Index: AbstractTxFileStoreService.java
===================================================================
RCS file: /home/cvs/jakarta-slide/src/stores/org/apache/slide/store/txfile/AbstractTxFileStoreService.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- AbstractTxFileStoreService.java 19 Feb 2004 16:58:26 -0000 1.10
+++ AbstractTxFileStoreService.java 10 May 2004 08:12:45 -0000 1.11
@@ -60,7 +60,8 @@
protected static final String STORE_DIR_PARAMETER = "rootpath";
protected static final String WORK_DIR_PARAMETER = "workpath";
protected static final String TIMEOUT_PARAMETER = "timeout";
- protected static final String URLENCODE_PATH = "url-encode-path";
+ protected static final String URLENCODE_PATH_PARAMETER = "url-encode-path";
+ protected static final String DEBUG_MODE_PARAMETER = "debug";
protected FileResourceManager rm;
protected boolean started = false;
@@ -86,8 +87,14 @@
new File(storeDir).mkdirs();
new File(workDir).mkdirs();
+ boolean debug = false;
+ String debugString = (String) parameters.get(DEBUG_MODE_PARAMETER);
+ if (debugString != null) {
+ debug = "true".equals(debugString);
+ }
+
boolean urlEncodePath = false;
- String urlEncodePathString = (String) parameters.get(URLENCODE_PATH);
+ String urlEncodePathString = (String) parameters.get(URLENCODE_PATH_PARAMETER);
if (urlEncodePathString != null) {
urlEncodePath = "true".equals(urlEncodePathString);
}
@@ -97,7 +104,8 @@
storeDir,
workDir,
urlEncodePath,
- new StoreLogger(getLogger(), FileResourceManager.class.getName()));
+ new StoreLogger(getLogger(), FileResourceManager.class.getName()),
+ debug);
getLogger().log(
"File Store configured to " + storeDir + ", working directory " + workDir,
---------------------------------------------------------------------
To unsubscribe, e-mail: slide-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-dev-help@jakarta.apache.org