cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r462965 - in /incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src: main/java/org/apache/cayenne/ main/java/org/apache/cayenne/access/ main/java/org/apache/cayenne/cache/ main/java/org/apache/cayenne/util/ test/java/org/apache/cayenne/cache/
Date Wed, 11 Oct 2006 21:30:30 GMT
Author: aadamchik
Date: Wed Oct 11 14:30:29 2006
New Revision: 462965

URL: http://svn.apache.org/viewvc?view=rev&rev=462965
Log:
CAY-685 OSQueryCache concurrency improvements
renaming the new entry factory interface to QueryCacheEntryFactory

Added:
    incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/cache/QueryCacheEntryFactory.java
      - copied, changed from r462961, incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/cache/CacheObjectFactory.java
Removed:
    incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/cache/CacheObjectFactory.java
Modified:
    incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/CayenneContextQueryAction.java
    incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/access/DataDomainQueryAction.java
    incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/cache/MapQueryCache.java
    incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/cache/OSQueryCache.java
    incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/cache/QueryCache.java
    incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/util/ObjectContextQueryAction.java
    incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/cache/MockQueryCache.java

Modified: incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/CayenneContextQueryAction.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/CayenneContextQueryAction.java?view=diff&rev=462965&r1=462964&r2=462965
==============================================================================
--- incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/CayenneContextQueryAction.java
(original)
+++ incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/CayenneContextQueryAction.java
Wed Oct 11 14:30:29 2006
@@ -22,7 +22,7 @@
 import java.util.Collection;
 import java.util.Iterator;
 
-import org.apache.cayenne.cache.CacheObjectFactory;
+import org.apache.cayenne.cache.QueryCacheEntryFactory;
 import org.apache.cayenne.cache.QueryCache;
 import org.apache.cayenne.query.Query;
 import org.apache.cayenne.query.RefreshQuery;
@@ -74,8 +74,8 @@
         return ((CayenneContext) actingContext).getQueryCache();
     }
 
-    protected CacheObjectFactory getCacheObjectFactory() {
-        return new CacheObjectFactory() {
+    protected QueryCacheEntryFactory getCacheObjectFactory() {
+        return new QueryCacheEntryFactory() {
 
             public Object createObject() {
                 if (interceptPaginatedQuery() != DONE) {

Modified: incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/access/DataDomainQueryAction.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/access/DataDomainQueryAction.java?view=diff&rev=462965&r1=462964&r2=462965
==============================================================================
--- incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/access/DataDomainQueryAction.java
(original)
+++ incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/access/DataDomainQueryAction.java
Wed Oct 11 14:30:29 2006
@@ -34,7 +34,7 @@
 import org.apache.cayenne.ObjectId;
 import org.apache.cayenne.Persistent;
 import org.apache.cayenne.QueryResponse;
-import org.apache.cayenne.cache.CacheObjectFactory;
+import org.apache.cayenne.cache.QueryCacheEntryFactory;
 import org.apache.cayenne.cache.QueryCache;
 import org.apache.cayenne.map.DataMap;
 import org.apache.cayenne.map.DbRelationship;
@@ -328,7 +328,7 @@
         }
 
         QueryCache queryCache = domain.getQueryCache();
-        CacheObjectFactory factory = getCacheObjectFactory();
+        QueryCacheEntryFactory factory = getCacheObjectFactory();
 
         if (cache) {
             List cachedResults = queryCache.get(metadata, factory);
@@ -352,8 +352,8 @@
         return DONE;
     }
     
-    private CacheObjectFactory getCacheObjectFactory() {
-        return new CacheObjectFactory() {
+    private QueryCacheEntryFactory getCacheObjectFactory() {
+        return new QueryCacheEntryFactory() {
 
             public Object createObject() {
                 runQueryInTransaction();

Modified: incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/cache/MapQueryCache.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/cache/MapQueryCache.java?view=diff&rev=462965&r1=462964&r2=462965
==============================================================================
--- incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/cache/MapQueryCache.java
(original)
+++ incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/cache/MapQueryCache.java
Wed Oct 11 14:30:29 2006
@@ -64,11 +64,11 @@
 
     /**
      * Returns a non-null cached value. If it is not present in the cache, it is obtained
-     * by calling {@link CacheObjectFactory#createObject()} without blocking the cache. As
+     * by calling {@link QueryCacheEntryFactory#createObject()} without blocking the cache.
As
      * a result there is a potential of multiple threads to be updating cache in parallel
-
      * this wouldn't lead to corruption of the cache, but can be suboptimal.
      */
-    public List get(QueryMetadata metadata, CacheObjectFactory factory) {
+    public List get(QueryMetadata metadata, QueryCacheEntryFactory factory) {
         List result = get(metadata);
         if (result == null) {
             Object newObject = factory.createObject();

Modified: incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/cache/OSQueryCache.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/cache/OSQueryCache.java?view=diff&rev=462965&r1=462964&r2=462965
==============================================================================
--- incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/cache/OSQueryCache.java
(original)
+++ incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/cache/OSQueryCache.java
Wed Oct 11 14:30:29 2006
@@ -261,11 +261,11 @@
 
     /**
      * Returns a non-null cached value. If it is not present in the cache, it is obtained
-     * by calling {@link CacheObjectFactory#createObject()}. Whether the cache provider
+     * by calling {@link QueryCacheEntryFactory#createObject()}. Whether the cache provider
      * will block on the entry update or not is controlled by "cache.blocking"
      * configuration property and is "false" by default.
      */
-    public List get(QueryMetadata metadata, CacheObjectFactory factory) {
+    public List get(QueryMetadata metadata, QueryCacheEntryFactory factory) {
         String key = metadata.getCacheKey();
         if (key == null) {
             return null;

Modified: incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/cache/QueryCache.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/cache/QueryCache.java?view=diff&rev=462965&r1=462964&r2=462965
==============================================================================
--- incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/cache/QueryCache.java
(original)
+++ incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/cache/QueryCache.java
Wed Oct 11 14:30:29 2006
@@ -45,7 +45,7 @@
      * from running the same query when a missing entry is requested by multiple threads
      * simultaneously.
      */
-    List get(QueryMetadata metadata, CacheObjectFactory factory);
+    List get(QueryMetadata metadata, QueryCacheEntryFactory factory);
 
     void put(QueryMetadata metadata, List results);
 

Copied: incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/cache/QueryCacheEntryFactory.java
(from r462961, incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/cache/CacheObjectFactory.java)
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/cache/QueryCacheEntryFactory.java?view=diff&rev=462965&p1=incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/cache/CacheObjectFactory.java&r1=462961&p2=incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/cache/QueryCacheEntryFactory.java&r2=462965
==============================================================================
--- incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/cache/CacheObjectFactory.java
(original)
+++ incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/cache/QueryCacheEntryFactory.java
Wed Oct 11 14:30:29 2006
@@ -24,7 +24,7 @@
  * @since 3.0
  * @author Andrus Adamchik
  */
-public interface CacheObjectFactory {
+public interface QueryCacheEntryFactory {
 
     /**
      * Provides a fresh value of the cache entry. Normally this operation would perform a

Modified: incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/util/ObjectContextQueryAction.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/util/ObjectContextQueryAction.java?view=diff&rev=462965&r1=462964&r2=462965
==============================================================================
--- incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/util/ObjectContextQueryAction.java
(original)
+++ incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/util/ObjectContextQueryAction.java
Wed Oct 11 14:30:29 2006
@@ -27,7 +27,7 @@
 import org.apache.cayenne.ObjectId;
 import org.apache.cayenne.Persistent;
 import org.apache.cayenne.QueryResponse;
-import org.apache.cayenne.cache.CacheObjectFactory;
+import org.apache.cayenne.cache.QueryCacheEntryFactory;
 import org.apache.cayenne.cache.QueryCache;
 import org.apache.cayenne.property.ArcProperty;
 import org.apache.cayenne.property.ClassDescriptor;
@@ -231,7 +231,7 @@
         }
 
         QueryCache queryCache = getQueryCache();
-        CacheObjectFactory factory = getCacheObjectFactory();
+        QueryCacheEntryFactory factory = getCacheObjectFactory();
 
         if (cache) {
             List cachedResults = queryCache.get(metadata, factory);
@@ -258,8 +258,8 @@
     /**
      * @since 3.0
      */
-    protected CacheObjectFactory getCacheObjectFactory() {
-        return new CacheObjectFactory() {
+    protected QueryCacheEntryFactory getCacheObjectFactory() {
+        return new QueryCacheEntryFactory() {
 
             public Object createObject() {
                 runQuery();

Modified: incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/cache/MockQueryCache.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/cache/MockQueryCache.java?view=diff&rev=462965&r1=462964&r2=462965
==============================================================================
--- incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/cache/MockQueryCache.java
(original)
+++ incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/cache/MockQueryCache.java
Wed Oct 11 14:30:29 2006
@@ -31,7 +31,7 @@
         return null;
     }
 
-    public List get(QueryMetadata metadata, CacheObjectFactory factory) {
+    public List get(QueryMetadata metadata, QueryCacheEntryFactory factory) {
         return null;
     }
 



Mime
View raw message