tapestry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kao...@apache.org
Subject svn commit: r1157179 - in /tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services: PersistentFieldManager.java PersistentFieldManagerImpl.java
Date Fri, 12 Aug 2011 16:35:15 GMT
Author: kaosko
Date: Fri Aug 12 16:35:14 2011
New Revision: 1157179

URL: http://svn.apache.org/viewvc?rev=1157179&view=rev
Log:
Make it possible to discard persistent fields for specific strategy only

Modified:
    tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/PersistentFieldManager.java
    tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/PersistentFieldManagerImpl.java

Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/PersistentFieldManager.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/PersistentFieldManager.java?rev=1157179&r1=1157178&r2=1157179&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/PersistentFieldManager.java
(original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/PersistentFieldManager.java
Fri Aug 12 16:35:14 2011
@@ -52,4 +52,15 @@ public interface PersistentFieldManager
      * @param pageName logical name of page whose persistent field data is to be discarded
      */
     void discardChanges(String pageName);
+    
+    /**
+     * Discards changes on the indicated page for a specific strategy only. This will not
affect pages that have already 
+     * been attached to this request, but will affect subsequent page attachments in this
and later requests.
+     *
+     * @param pageName logical name of page whose persistent field data is to be discarded
+     * 
+     * @param strategyName name of the strategy of which field data is to be discarded
+     */
+    void discardChanges(String pageName, String strategyName);
+    
 }

Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/PersistentFieldManagerImpl.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/PersistentFieldManagerImpl.java?rev=1157179&r1=1157178&r2=1157179&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/PersistentFieldManagerImpl.java
(original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/PersistentFieldManagerImpl.java
Fri Aug 12 16:35:14 2011
@@ -14,6 +14,9 @@
 
 package org.apache.tapestry5.internal.services;
 
+import java.util.Collection;
+import java.util.Map;
+
 import org.apache.tapestry5.ComponentResources;
 import org.apache.tapestry5.SymbolConstants;
 import org.apache.tapestry5.ioc.internal.util.CollectionFactory;
@@ -26,9 +29,6 @@ import org.apache.tapestry5.services.Per
 import org.apache.tapestry5.services.PersistentFieldChange;
 import org.apache.tapestry5.services.PersistentFieldStrategy;
 
-import java.util.Collection;
-import java.util.Map;
-
 public class PersistentFieldManagerImpl implements PersistentFieldManager
 {
     private final MetaDataLocator metaDataLocator;
@@ -73,6 +73,12 @@ public class PersistentFieldManagerImpl 
         }
     }
 
+    public void discardChanges(String pageName, String strategyName) {
+        PersistentFieldStrategy strategy = strategies.get(strategyName);
+        if (strategy != null) strategy.discardChanges(pageName);
+	  }
+    
+    
     public void postChange(String pageName, ComponentResources resources, String fieldName,
Object newValue)
     {
         String strategyName = findStrategy(resources, fieldName);



Mime
View raw message