click-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sa...@apache.org
Subject svn commit: r924514 - in /click/trunk/click/examples/src/org/apache/click/examples: page/table/TableSorting.java service/CustomerService.java
Date Wed, 17 Mar 2010 22:01:36 GMT
Author: sabob
Date: Wed Mar 17 22:01:36 2010
New Revision: 924514

URL: http://svn.apache.org/viewvc?rev=924514&view=rev
Log:
expose explicit shared cache usage

Modified:
    click/trunk/click/examples/src/org/apache/click/examples/page/table/TableSorting.java
    click/trunk/click/examples/src/org/apache/click/examples/service/CustomerService.java

Modified: click/trunk/click/examples/src/org/apache/click/examples/page/table/TableSorting.java
URL: http://svn.apache.org/viewvc/click/trunk/click/examples/src/org/apache/click/examples/page/table/TableSorting.java?rev=924514&r1=924513&r2=924514&view=diff
==============================================================================
--- click/trunk/click/examples/src/org/apache/click/examples/page/table/TableSorting.java
(original)
+++ click/trunk/click/examples/src/org/apache/click/examples/page/table/TableSorting.java
Wed Mar 17 22:01:36 2010
@@ -75,8 +75,10 @@ public class TableSorting extends Border
         // Return sorted data to the table.
         table.setDataProvider(new DataProvider<Customer>() {
             public List<Customer> getData() {
+                boolean useSharedCache = true;
                 return customerService.getCustomersSortedBy(table.getSortedColumn(),
-                                                            table.isSortedAscending());
+                                                            table.isSortedAscending(),
+                                                            useSharedCache);
             }
         });
 

Modified: click/trunk/click/examples/src/org/apache/click/examples/service/CustomerService.java
URL: http://svn.apache.org/viewvc/click/trunk/click/examples/src/org/apache/click/examples/service/CustomerService.java?rev=924514&r1=924513&r2=924514&view=diff
==============================================================================
--- click/trunk/click/examples/src/org/apache/click/examples/service/CustomerService.java
(original)
+++ click/trunk/click/examples/src/org/apache/click/examples/service/CustomerService.java
Wed Mar 17 22:01:36 2010
@@ -64,20 +64,28 @@ public class CustomerService extends Cay
     }
 
     @SuppressWarnings("unchecked")
-    public List<Customer> getCustomersSortedBy(String property, boolean ascending)
{
+    public List<Customer> getCustomersSortedBy(String property, boolean ascending,
+        boolean useSharedCache) {
 
         SelectQuery query = new SelectQuery(Customer.class);
         if (property != null) {
             query.addOrdering(property, ascending);
         }
 
-        // Example use of shared cache which is managed with oscache.properties
-        query.setCacheStrategy(QueryCacheStrategy.SHARED_CACHE);
+        if (useSharedCache) {
+            // Example use of shared cache which is managed with oscache.properties
+            query.setCacheStrategy(QueryCacheStrategy.SHARED_CACHE);
+        }
 
         return performQuery(query);
     }
 
     @SuppressWarnings("unchecked")
+    public List<Customer> getCustomersSortedBy(String property, boolean ascending)
{
+        return getCustomersSortedBy(property, ascending, false);
+    }
+
+    @SuppressWarnings("unchecked")
     public List<Customer> getCustomers(String name, Date startDate) {
         SelectQuery query = new SelectQuery(Customer.class);
 



Mime
View raw message