cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r449419 - in /incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/access: ClientServerChannel.java ClientServerChannelQueryAction.java
Date Sun, 24 Sep 2006 16:01:12 GMT
Author: aadamchik
Date: Sun Sep 24 09:01:11 2006
New Revision: 449419

URL: http://svn.apache.org/viewvc?view=rev&rev=449419
Log:
CAY-666 - preventing exposure of DataContext outside ClientServerChannel , so that we could
transparently enable/disable wrapping

Modified:
    incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/access/ClientServerChannel.java
    incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/access/ClientServerChannelQueryAction.java

Modified: incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/access/ClientServerChannel.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/access/ClientServerChannel.java?view=diff&rev=449419&r1=449418&r2=449419
==============================================================================
--- incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/access/ClientServerChannel.java
(original)
+++ incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/access/ClientServerChannel.java
Sun Sep 24 09:01:11 2006
@@ -23,6 +23,7 @@
 import org.apache.cayenne.DataChannel;
 import org.apache.cayenne.ObjectContext;
 import org.apache.cayenne.QueryResponse;
+import org.apache.cayenne.cache.QueryCache;
 import org.apache.cayenne.event.EventManager;
 import org.apache.cayenne.graph.GraphDiff;
 import org.apache.cayenne.map.EntityResolver;
@@ -79,7 +80,11 @@
         return new ClientServerChannelQueryAction(this, query).execute();
     }
 
-    DataContext getServerContext() {
+    QueryCache getQueryCache() {
+        return serverContext.getQueryCache();
+    }
+    
+    DataChannel getParentChannel() {
         return serverContext;
     }
 

Modified: incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/access/ClientServerChannelQueryAction.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/access/ClientServerChannelQueryAction.java?view=diff&rev=449419&r1=449418&r2=449419
==============================================================================
--- incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/access/ClientServerChannelQueryAction.java
(original)
+++ incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/access/ClientServerChannelQueryAction.java
Sun Sep 24 09:01:11 2006
@@ -55,7 +55,7 @@
 
     ClientServerChannelQueryAction(ClientServerChannel channel, Query query) {
         this.channel = channel;
-        this.serverResolver = channel.getServerContext().getEntityResolver();
+        this.serverResolver = channel.getEntityResolver();
         this.serverQuery = query;
         this.serverMetadata = serverQuery.getMetaData(serverResolver);
     }
@@ -80,8 +80,7 @@
                 && serverMetadata.getFetchLimit() > 0
                 && serverMetadata.getCacheKey() != null) {
 
-            List cachedList = channel.getServerContext().getQueryCache().get(
-                    serverMetadata);
+            List cachedList = channel.getQueryCache().get(serverMetadata);
             if (cachedList == null) {
                 throw new CayenneRuntimeException("No cached list for "
                         + serverMetadata.getCacheKey());
@@ -103,7 +102,7 @@
     }
 
     private void runQuery() {
-        this.response = channel.getServerContext().onQuery(null, serverQuery);
+        this.response = channel.getParentChannel().onQuery(null, serverQuery);
     }
 
     private boolean interceptIncrementalListConversion() {
@@ -114,7 +113,7 @@
             if (list.size() > pageSize && list instanceof IncrementalFaultList)
{
 
                 // cache
-                channel.getServerContext().getQueryCache().put(serverMetadata, list);
+                channel.getQueryCache().put(serverMetadata, list);
 
                 // extract and convert firts page
 



Mime
View raw message