You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by cz...@apache.org on 2002/11/14 15:33:08 UTC
cvs commit: xml-cocoon2/src/java/org/apache/cocoon Cocoon.java
cziegeler 2002/11/14 06:33:07
Modified: src/java/org/apache/cocoon/components/source/impl
SitemapSource.java
src/java/org/apache/cocoon/components
CocoonComponentManager.java
src/java/org/apache/cocoon Cocoon.java
Log:
Start fixing bug 12293
Revision Changes Path
1.18 +9 -1 xml-cocoon2/src/java/org/apache/cocoon/components/source/impl/SitemapSource.java
Index: SitemapSource.java
===================================================================
RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/source/impl/SitemapSource.java,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- SitemapSource.java 8 Aug 2002 02:10:40 -0000 1.17
+++ SitemapSource.java 14 Nov 2002 14:33:07 -0000 1.18
@@ -133,6 +133,9 @@
/** Do I need a refresh ? */
private boolean needsRefresh;
+ /** The unique key for this processing */
+ private Object processKey;
+
/**
* Construct a new object
*/
@@ -300,6 +303,7 @@
reset();
try {
+ this.processKey = CocoonComponentManager.startProcessing();
this.environment.setURI(this.prefix, this.uri);
this.processingPipeline = this.processor.processInternal(this.environment);
this.pipelineProcessor = this.environment.changeToLastContext();
@@ -385,6 +389,10 @@
}
private void reset() {
+ if (this.processKey != null) {
+ CocoonComponentManager.endProcessing(this.processKey);
+ this.processKey = null;
+ }
if (this.processingPipeline != null) this.processingPipeline.release();
this.processingPipeline = null;
this.sourceValidity = null;
1.28 +21 -1 xml-cocoon2/src/java/org/apache/cocoon/components/CocoonComponentManager.java
Index: CocoonComponentManager.java
===================================================================
RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/CocoonComponentManager.java,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -r1.27 -r1.28
--- CocoonComponentManager.java 8 Aug 2002 02:10:39 -0000 1.27
+++ CocoonComponentManager.java 14 Nov 2002 14:33:07 -0000 1.28
@@ -177,6 +177,26 @@
}
/**
+ * This hook has to be called before a request is processed.
+ * The hook is called by the Cocoon component and by the
+ * cocoon protocol implementation.
+ * @return A unique key within this thread.
+ */
+ public static Object startProcessing() {
+ return null;
+ }
+
+ /**
+ * This hook has to be called before a request is processed.
+ * The hook is called by the Cocoon component and by the
+ * cocoon protocol implementation.
+ * @param key A unique key within this thread return by
+ * {@link startProcessing()}.
+ */
+ public static void endProcessing(Object key) {
+ }
+
+ /**
* Return the current environment (for the cocoon: protocol)
*/
public static Environment getCurrentEnvironment() {
1.41 +3 -1 xml-cocoon2/src/java/org/apache/cocoon/Cocoon.java
Index: Cocoon.java
===================================================================
RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/Cocoon.java,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -r1.40 -r1.41
--- Cocoon.java 21 Sep 2002 02:41:53 -0000 1.40
+++ Cocoon.java 14 Nov 2002 14:33:07 -0000 1.41
@@ -584,6 +584,7 @@
}
environment.setComponents( this.sourceResolver, this.xmlizer );
+ Object key = CocoonComponentManager.startProcessing();
try {
boolean result;
if (this.getLogger().isDebugEnabled()) {
@@ -610,6 +611,7 @@
environment.tryResetResponse();
throw any;
} finally {
+ CocoonComponentManager.endProcessing(key);
if (this.getLogger().isDebugEnabled()) {
--activeRequestCount;
}
----------------------------------------------------------------------
In case of troubles, e-mail: webmaster@xml.apache.org
To unsubscribe, e-mail: cocoon-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-cvs-help@xml.apache.org