You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by hl...@apache.org on 2012/10/25 00:49:33 UTC

[2/8] git commit: Add some more explanation about why MessageCatalogResource may invalidate caches via ResourceChangeTracker

Add some more explanation about why MessageCatalogResource may invalidate caches via ResourceChangeTracker


Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo
Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/cb8d22e9
Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/cb8d22e9
Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/cb8d22e9

Branch: refs/heads/5.4-js-rewrite
Commit: cb8d22e959ba5afadbcb77483fc2fbe58ebe8ead
Parents: 7b6f893
Author: Howard M. Lewis Ship <hl...@apache.org>
Authored: Wed Oct 24 14:41:10 2012 -0700
Committer: Howard M. Lewis Ship <hl...@apache.org>
Committed: Wed Oct 24 14:41:45 2012 -0700

----------------------------------------------------------------------
 .../internal/util/MessageCatalogResource.java      |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/cb8d22e9/tapestry-core/src/main/java/org/apache/tapestry5/internal/util/MessageCatalogResource.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/java/org/apache/tapestry5/internal/util/MessageCatalogResource.java b/tapestry-core/src/main/java/org/apache/tapestry5/internal/util/MessageCatalogResource.java
index 2b5a016..c2548a2 100644
--- a/tapestry-core/src/main/java/org/apache/tapestry5/internal/util/MessageCatalogResource.java
+++ b/tapestry-core/src/main/java/org/apache/tapestry5/internal/util/MessageCatalogResource.java
@@ -49,6 +49,14 @@ public class MessageCatalogResource extends VirtualResource
             {
                 bytes = null;
 
+                // What's all this then?  This MessageCatalogResource is converted, as if it was a real file, into
+                // a StreamableResource by the StreamableResourceService service; as a virtual resource, we don't have
+                // any date-time-modified information for the application message catalog (as if that was possible,
+                // given that its composed of multiple files). The ComponentMessagesSource can tell us when
+                // *some* properties file has changed (not necessarily one used in the application message catalog,
+                // but that's the breaks). When that occurs, we tell the ResourceChangeTracker to fire its invalidation
+                // event. That flushes out all the assets it has cached, including StreamableResources for JavaScript files,
+                // including the one created here to represent the application message catalog.
                 changeTracker.forceInvalidationEvent();
             }
         });