bloritsch 01/12/27 12:42:32 Modified: src/org/apache/cocoon Cocoon.java src/org/apache/cocoon/reading DatabaseReader.java Log: apply synchronization patch to Cocoon.java Revision Changes Path 1.36 +9 -23 xml-cocoon2/src/org/apache/cocoon/Cocoon.java Index: Cocoon.java =================================================================== RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/Cocoon.java,v retrieving revision 1.35 retrieving revision 1.36 diff -u -r1.35 -r1.36 --- Cocoon.java 2001/12/19 11:52:44 1.35 +++ Cocoon.java 2001/12/27 20:42:32 1.36 @@ -104,7 +104,7 @@ * @author <a href="mailto:[EMAIL PROTECTED]">Pierpaolo Fumagalli</a> (Apache Software Foundation, Exoffice Technologies) * @author <a href="mailto:[EMAIL PROTECTED]">Stefano Mazzocchi</a> * @author <a href="mailto:[EMAIL PROTECTED]">Leo Sutic</a> - * @version CVS $Revision: 1.35 $ $Date: 2001/12/19 11:52:44 $ + * @version CVS $Revision: 1.36 $ $Date: 2001/12/27 20:42:32 $ */ public class Cocoon extends AbstractLoggable @@ -146,11 +146,8 @@ private boolean disposed = false; /** active request count */ - private static int activeRequestCount = 0; + private volatile int activeRequestCount = 0; - /** maximum request count */ - private static int maxRequestCount = 0; - /** the Processor if it is ThreadSafe */ private Processor threadSafeProcessor = null; @@ -520,7 +517,6 @@ msg.append("SCHEME: ").append(request.getScheme()).append(lineSeparator); msg.append("AUTH TYPE: ").append(request.getAuthType()).append(lineSeparator).append(lineSeparator); msg.append("CURRENT ACTIVE REQUESTS: ").append(activeRequestCount).append(lineSeparator); - msg.append("MAXIMUM ACTIVE REQUESTS: ").append(maxRequestCount).append(lineSeparator).append(lineSeparator); // log all of the request parameters Enumeration e = request.getParameterNames(); @@ -598,7 +594,7 @@ try { if (this.getLogger().isDebugEnabled()) { - incRequestCount(); + ++activeRequestCount; if (this.getLogger().isDebugEnabled()) { this.debug(environment, null, null); } @@ -617,7 +613,7 @@ } } finally { if (this.getLogger().isDebugEnabled()) { - decRequestCount(); + --activeRequestCount; } } } @@ -640,7 +636,7 @@ try { if (this.getLogger().isDebugEnabled()) { - incRequestCount(); + ++activeRequestCount; if (this.getLogger().isDebugEnabled()) { this.debug(environment, pipeline, eventPipeline); } @@ -660,7 +656,7 @@ } finally { if (this.getLogger().isDebugEnabled()) { - decRequestCount(); + --activeRequestCount; } } } @@ -722,20 +718,10 @@ } } - /** - * Increment active request count for incoming requests, and save this - * result if it's the maximum. - */ - private static synchronized void incRequestCount() { - if (++activeRequestCount > maxRequestCount) { - maxRequestCount = activeRequestCount; - } - } - /** - * Decrement active request count. + * Accessor for active request count */ - private static synchronized void decRequestCount() { - --activeRequestCount; + public int getActiveRequestCount() { + return activeRequestCount; } } 1.12 +1 -1 xml-cocoon2/src/org/apache/cocoon/reading/DatabaseReader.java Index: DatabaseReader.java =================================================================== RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/reading/DatabaseReader.java,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- DatabaseReader.java 2001/11/13 16:50:38 1.11 +++ DatabaseReader.java 2001/12/27 20:42:32 1.12 @@ -100,7 +100,7 @@ this.resource = set.getBlob(1); if (this.resource == null) { - throw new ResourceNotFoundException("There is no image with that key"); + throw new ResourceNotFoundException("There is no resource with that key"); } }
---------------------------------------------------------------------- In case of troubles, e-mail: [EMAIL PROTECTED] To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]