cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r1196716 - in /cayenne/main/trunk: docs/doc/src/main/resources/ framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/rop/client/ framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configurat...
Date Wed, 02 Nov 2011 17:46:18 GMT
Author: aadamchik
Date: Wed Nov  2 17:46:18 2011
New Revision: 1196716

URL: http://svn.apache.org/viewvc?rev=1196716&view=rev
Log:
CAY-1637 [PATCH] DataContextFactory is cumbersome to customize

patch by John Huss

Modified:
    cayenne/main/trunk/docs/doc/src/main/resources/RELEASE-NOTES.txt
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/rop/client/CayenneContextFactory.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/server/DataContextFactory.java

Modified: cayenne/main/trunk/docs/doc/src/main/resources/RELEASE-NOTES.txt
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/docs/doc/src/main/resources/RELEASE-NOTES.txt?rev=1196716&r1=1196715&r2=1196716&view=diff
==============================================================================
--- cayenne/main/trunk/docs/doc/src/main/resources/RELEASE-NOTES.txt (original)
+++ cayenne/main/trunk/docs/doc/src/main/resources/RELEASE-NOTES.txt Wed Nov  2 17:46:18 2011
@@ -16,6 +16,7 @@ Changes/New Features Since 3.1M3:
 CAY-1603 Improve custom ExtendedType registration API
 CAY-1608 Implement constructor injection support for DefaultAdhocObjectFactory
 CAY-1618 Create database adapters instances with proper injection
+CAY-1637 [PATCH] DataContextFactory is cumbersome to customize
 
 Bug Fixes Since 3.1M3:
 

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/rop/client/CayenneContextFactory.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/rop/client/CayenneContextFactory.java?rev=1196716&r1=1196715&r2=1196716&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/rop/client/CayenneContextFactory.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/rop/client/CayenneContextFactory.java
Wed Nov  2 17:46:18 2011
@@ -55,8 +55,12 @@ public class CayenneContextFactory imple
                 ClientModule.CONTEXT_LIFECYCLE_EVENTS,
                 false);
 
-        CayenneContext context = new CayenneContext(parent, changeEvents, lifecycleEvents);
+        CayenneContext context = newInstance(parent, changeEvents, lifecycleEvents);
         context.setQueryCache(new NestedQueryCache(queryCache));
         return context;
     }
+    
+    protected CayenneContext newInstance(DataChannel parent, boolean changeEventsEnabled,
boolean lifecycleEventsEnabled) {
+        return new CayenneContext(parent, changeEventsEnabled, lifecycleEventsEnabled);
+    }
 }

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/server/DataContextFactory.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/server/DataContextFactory.java?rev=1196716&r1=1196715&r2=1196716&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/server/DataContextFactory.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/configuration/server/DataContextFactory.java
Wed Nov  2 17:46:18 2011
@@ -80,7 +80,7 @@ public class DataContextFactory implemen
                 dataDomain.getProperties(),
                 eventManager);
 
-        DataContext context = new DataContext(
+        DataContext context = newInstance(
                 parent, objectStoreFactory.createObjectStore(snapshotCache));
         context.setValidatingObjectsOnCommit(dataDomain.isValidatingObjectsOnCommit());
         context.setQueryCache(new NestedQueryCache(queryCache));
@@ -92,7 +92,7 @@ public class DataContextFactory implemen
         // pass it in constructor.
         ObjectStore objectStore = objectStoreFactory.createObjectStore(null);
 
-        DataContext context = new DataContext(parent, objectStore);
+        DataContext context = newInstance(parent, objectStore);
 
         context.setValidatingObjectsOnCommit(parent.isValidatingObjectsOnCommit());
         context.setUsingSharedSnapshotCache(parent.isUsingSharedSnapshotCache());
@@ -109,10 +109,14 @@ public class DataContextFactory implemen
                 .getSharedSnapshotCache() : new DataRowStore(parent.getName(), parent
                 .getProperties(), eventManager);
 
-        DataContext context = new DataContext(
+        DataContext context = newInstance(
                 parent, objectStoreFactory.createObjectStore(snapshotCache));
         context.setValidatingObjectsOnCommit(parent.isValidatingObjectsOnCommit());
         context.setQueryCache(new NestedQueryCache(queryCache));
         return context;
     }
+    
+    protected DataContext newInstance(DataChannel parent, ObjectStore objectStore) {
+        return new DataContext(parent, objectStore);
+    }
 }



Mime
View raw message