Author: lgawron
Date: Fri Dec 10 07:50:06 2004
New Revision: 111515

URL: http://svn.apache.org/viewcvs?view=rev&rev=111515
Log:
Remove support for sharing continuations between sitemaps. This is not a 
feature - it is a bug.
Modified:
   
cocoon/trunk/src/java/org/apache/cocoon/components/flow/ContinuationsManagerImpl.java
   cocoon/trunk/src/webapp/WEB-INF/cocoon.xconf

Modified: 
cocoon/trunk/src/java/org/apache/cocoon/components/flow/ContinuationsManagerImpl.java
Url: 
http://svn.apache.org/viewcvs/cocoon/trunk/src/java/org/apache/cocoon/components/flow/ContinuationsManagerImpl.java?view=diff&rev=111515&p1=cocoon/trunk/src/java/org/apache/cocoon/components/flow/ContinuationsManagerImpl.java&r1=111514&p2=cocoon/trunk/src/java/org/apache/cocoon/components/flow/ContinuationsManagerImpl.java&r2=111515
==============================================================================
--- 
cocoon/trunk/src/java/org/apache/cocoon/components/flow/ContinuationsManagerImpl.java
       (original)
+++ 
cocoon/trunk/src/java/org/apache/cocoon/components/flow/ContinuationsManagerImpl.java
       Fri Dec 10 07:50:06 2004
@@ -106,7 +106,6 @@
     protected SortedSet expirations = Collections.synchronizedSortedSet(new 
TreeSet());
 
     private String instrumentableName;
-    private boolean isContinuationSharingBugCompatible;
     private boolean bindContinuationsToSession;
 
     private ServiceManager serviceManager;
@@ -129,7 +128,6 @@
 
     public void configure(Configuration config) {
         this.defaultTimeToLive = config.getAttributeAsInteger("time-to-live", 
(3600 * 1000));
-        this.isContinuationSharingBugCompatible = 
config.getAttributeAsBoolean("continuation-sharing-bug-compatible", false);
         this.bindContinuationsToSession = config.getAttributeAsBoolean( 
"session-bound-continuations", false );
         if (!this.bindContinuationsToSession)
             this.continuationsHolder = new WebContinuationsHolder();
@@ -193,34 +191,42 @@
             return null;
         
         WebContinuation kont = (WebContinuation) continuationsHolder.get(id);
-        if ( kont != null ) {
-            boolean interpreterMatches = 
kont.interpreterMatches(interpreterId);
-            if (!interpreterMatches && getLogger().isWarnEnabled()) {
-                getLogger().warn("WK: Continuation (" + kont.getId() 
-                                 + ") lookup for wrong interpreter. Bound to: 
" 
-                                 + kont.getInterpreterId() + ", looked up for: 
" 
-                                 + interpreterId);
-            }
-            return interpreterMatches || isContinuationSharingBugCompatible ? 
kont : null;
+        if (kont == null)
+            return null;
+            
+        if (!kont.interpreterMatches(interpreterId)) {
+            getLogger().error(
+                    "WK: Continuation (" + kont.getId()
+                            + ") lookup for wrong interpreter. Bound to: "
+                            + kont.getInterpreterId() + ", looked up for: "
+                            + interpreterId);
+            return null;
         }
-        return null;
+        return kont;
     }
 
     /**
-     * Create <code>WebContinuation</code> and generate unique identifier
-     * for it. The identifier is generated using a cryptographically strong
+     * Create <code>WebContinuation</code> and generate unique identifier for
+     * it. The identifier is generated using a cryptographically strong
      * algorithm to prevent people to generate their own identifiers.
-     *
-     * <p>It has the side effect of interning the continuation object in
-     * the <code>idToWebCont</code> hash table.
-     *
-     * @param kont an <code>Object</code> value representing continuation
-     * @param parent value representing parent <code>WebContinuation</code>
-     * @param ttl <code>WebContinuation</code> time to live
-     * @param interpreterId id of interpreter invoking continuation creation
-     * @param disposer <code>ContinuationsDisposer</code> instance to use for
-     * cleanup of the continuation.
-     * @return the generated <code>WebContinuation</code> with unique 
identifier
+     * 
+     * <p>
+     * It has the side effect of interning the continuation object in the
+     * <code>idToWebCont</code> hash table.
+     * 
+     * @param kont
+     *            an <code>Object</code> value representing continuation
+     * @param parent
+     *            value representing parent <code>WebContinuation</code>
+     * @param ttl
+     *            <code>WebContinuation</code> time to live
+     * @param interpreterId
+     *            id of interpreter invoking continuation creation
+     * @param disposer
+     *            <code>ContinuationsDisposer</code> instance to use for
+     *            cleanup of the continuation.
+     * @return the generated <code>WebContinuation</code> with unique
+     *         identifier
      */
     private WebContinuation generateContinuation(Object kont,
                                                  WebContinuation parent,

Modified: cocoon/trunk/src/webapp/WEB-INF/cocoon.xconf
Url: 
http://svn.apache.org/viewcvs/cocoon/trunk/src/webapp/WEB-INF/cocoon.xconf?view=diff&rev=111515&p1=cocoon/trunk/src/webapp/WEB-INF/cocoon.xconf&r1=111514&p2=cocoon/trunk/src/webapp/WEB-INF/cocoon.xconf&r2=111515
==============================================================================
--- cocoon/trunk/src/webapp/WEB-INF/cocoon.xconf        (original)
+++ cocoon/trunk/src/webapp/WEB-INF/cocoon.xconf        Fri Dec 10 07:50:06 2004
@@ -106,15 +106,6 @@
       | in miliseconds using the "time-to-live" attribute of
       | the <continuations-manager> element.
       |
-      | If your site is sharing continuations between sitemaps you
-      | should refactor your application to keep a continuation bound to
-      | a single sitemap. The log will contain warnings which indicate
-      | where a continuation from a different sitemap is used.
-      |
-      | When you cannot do the refactoring in one blow you can turn on
-      | compatibility with shared continuations by setting the
-      | "continuation-sharing-bug-compatible" attribute to "true".
-      |
       | The <expirations-check> element specifies different policies for
       | expiring continuations. Currently only the "periodic" type is
       | supported.
@@ -127,8 +118,7 @@
       | 'session-bound-continuations' to true.
       +-->
   <continuations-manager logger="flow.manager" time-to-live="3600000" 
-                         session-bound-continuations="false" 
-                         continuation-sharing-bug-compatible="false">
+                         session-bound-continuations="false">
     <expirations-check type="periodic">
       <offset>180000</offset>
       <period>180000</period>

Reply via email to