You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pivot.apache.org by sm...@apache.org on 2012/07/20 17:58:51 UTC

svn commit: r1363858 - in /pivot/branches/2.0.x: tutorials/www/list-buttons.xml wtk/src/org/apache/pivot/wtk/ApplicationContext.java

Author: smartini
Date: Fri Jul 20 15:58:51 2012
New Revision: 1363858

URL: http://svn.apache.org/viewvc?rev=1363858&view=rev
Log:
add some info on resource cache usage if it has to be/stay small

Modified:
    pivot/branches/2.0.x/tutorials/www/list-buttons.xml
    pivot/branches/2.0.x/wtk/src/org/apache/pivot/wtk/ApplicationContext.java

Modified: pivot/branches/2.0.x/tutorials/www/list-buttons.xml
URL: http://svn.apache.org/viewvc/pivot/branches/2.0.x/tutorials/www/list-buttons.xml?rev=1363858&r1=1363857&r2=1363858&view=diff
==============================================================================
--- pivot/branches/2.0.x/tutorials/www/list-buttons.xml (original)
+++ pivot/branches/2.0.x/tutorials/www/list-buttons.xml Fri Jul 20 15:58:51 2012
@@ -139,13 +139,16 @@ limitations under the License.
         </source>
 
         <p>
-            Note that this example makes use of the global resource cache to store the loaded
-            images. This cache can be used to store any kind of application-specific data that may
+            This example makes use of the global resource cache to store the loaded images.
+            This cache can be used to store any kind of application-specific data that may
             be expensive to load. Entries are keyed by the URL from which they were retrieved, and,
             once placed in the cache, are available to all code within the application. When the
             list button's selection changes, the application first looks for an image in the
-            resource cache; if it is not found, it is loaded and added to the cache. It is then set
-            as the "image" property of the image view and displayed.
+            resource cache; if it is not found, it is loaded and added to the cache.
+            It is then set as the "image" property of the image view and displayed.
+            Note that the global cache does not have a way to limiting the number of elements
+            to contain, so the cache continues to grow; to keep it small you have
+            to manually remove old elements from it when they are no more necessary.
         </p>
     </body>
 </document>

Modified: pivot/branches/2.0.x/wtk/src/org/apache/pivot/wtk/ApplicationContext.java
URL: http://svn.apache.org/viewvc/pivot/branches/2.0.x/wtk/src/org/apache/pivot/wtk/ApplicationContext.java?rev=1363858&r1=1363857&r2=1363858&view=diff
==============================================================================
--- pivot/branches/2.0.x/wtk/src/org/apache/pivot/wtk/ApplicationContext.java (original)
+++ pivot/branches/2.0.x/wtk/src/org/apache/pivot/wtk/ApplicationContext.java Fri Jul 20 15:58:51 2012
@@ -1439,6 +1439,10 @@ public abstract class ApplicationContext
 
     /**
      * Resource cache dictionary implementation.
+     * <p>
+     * Note that this implementation does not have a way to limiting the number of elements
+     * to contain, so the cache continues to grow; to keep it small you have
+     * to manually remove old elements from it when they are no more necessary.
      */
     public static final class ResourceCacheDictionary
         implements Dictionary<URL, Object>, Iterable<URL> {