cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r1068902 - /cayenne/main/trunk/framework/cayenne-lifecycle/src/main/java/org/apache/cayenne/lifecycle/audit/AuditableFilter.java
Date Wed, 09 Feb 2011 14:29:21 GMT
Author: aadamchik
Date: Wed Feb  9 14:29:21 2011
New Revision: 1068902

URL: http://svn.apache.org/viewvc?rev=1068902&view=rev
Log:
CAY-1534 cayenne-lifecycle: implement AuditableFilter

* exposing sync cleanup method to subclasses to simplify per-commit state management

Modified:
    cayenne/main/trunk/framework/cayenne-lifecycle/src/main/java/org/apache/cayenne/lifecycle/audit/AuditableFilter.java

Modified: cayenne/main/trunk/framework/cayenne-lifecycle/src/main/java/org/apache/cayenne/lifecycle/audit/AuditableFilter.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-lifecycle/src/main/java/org/apache/cayenne/lifecycle/audit/AuditableFilter.java?rev=1068902&r1=1068901&r2=1068902&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-lifecycle/src/main/java/org/apache/cayenne/lifecycle/audit/AuditableFilter.java
(original)
+++ cayenne/main/trunk/framework/cayenne-lifecycle/src/main/java/org/apache/cayenne/lifecycle/audit/AuditableFilter.java
Wed Feb  9 14:29:21 2011
@@ -73,12 +73,22 @@ public class AuditableFilter implements 
             }
         }
         finally {
-            threadAggregator.set(null);
+            cleanupPostSync();
         }
 
         return response;
     }
 
+    /**
+     * A method called at the end of every
+     * {@link #onSync(ObjectContext, GraphDiff, int, DataChannelFilterChain)} invocation.
+     * This implementation uses it for cleaning up thread-local state of the filter.
+     * Subclasses may override it to do their own cleanup, and are expected to call super.
+     */
+    protected void cleanupPostSync() {
+        threadAggregator.set(null);
+    }
+
     void postSync() {
         AuditableAggregator aggregator = threadAggregator.get();
         if (aggregator != null) {



Mime
View raw message