A document has been updated: http://cocoon.zones.apache.org/daisy/documentation/1501.html
Document ID: 1501 Branch: main Language: default Name: Introduction (unchanged) Document Type: Cocoon Document (unchanged) Updated on: 8/17/08 7:09:07 PM Updated by: Lukas Lang A new version has been created, state: draft Parts ===== Content ------- This part has been updated. Mime type: text/xml (unchanged) File name: (unchanged) Size: 2831 bytes (previous version: 37 bytes) Content diff: --- <html><body><p>TODO</p></body></html> +++ <html> +++ <body> +++ +++ <h1>Summary</h1> +++ +++ <p>The cocoon-jms-sample block uses simple JMS text messages for invalidation of +++ EventAware cached content. This page should give you a basic overview, of what's +++ going on, when running the sample.</p> +++ +++ <h1>Documentation</h1> +++ +++ <p>The sample makes use of EventAware capabilities and consists of the following +++ components:</p> +++ +++ <ul> +++ <li>one EventAwareGenerator</li> +++ <li>an embedded ActiveMQ message broker</li> +++ <li>a message topic</li> +++ <li>a JMSEventMessageListener</li> +++ <li>JMSPublisherActions</li> +++ </ul> +++ +++ <p>Assuming, that our sample runs the following sitemap, defining a +++ CachingProcessingPipeline:</p> +++ +++ <pre><map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0"> +++ <map:components> +++ <map:pipes default="caching"> +++ <map:pipe logger="core.sitemap" name="event-aware" src="org.apache.cocoon.components.pipeline.impl.CachingProcessingPipeline"> +++ <parameter name="cache-role" value="org.apache.cocoon.caching.Cache/EventAware" /> +++ </map:pipe> +++ </map:pipes> +++ </map:components> +++ <map:pipelines> +++ <map:pipeline type="event-aware"> +++ <map:match pattern="action"> +++ <map:act type="JMSPublisherAction"> +++ <map:parameter name="message" value="{request-param:event}" /> +++ </map:act> +++ <map:redirect-to uri="demo?pageKey={request-param:pageKey}&amp;rand={random:x}" /> +++ </map:match> +++ <map:match pattern="*"> +++ <map:generate src="eventcache.xml" type="EventCacheSample"> +++ <map:parameter name="KEY" value="{request-param:pageKey}" /> +++ ... +++ </map:generate> +++ <map:serialize /> +++ </map:match> +++ </map:pipeline> +++ </map:pipelines> +++ </map:sitemap></pre> +++ +++ <p>As a request is sent to the webapplication and matches the wildcard pattern, +++ a page, including date and time of generation is being generated and stored in +++ an EventAware cache. The request must contain a <em>pageKey </em>parameter, +++ identifying cached content. As an example,</p> +++ +++ <pre>http://localhost:8080/cocoon-jms-sample/eventcache/demo?pageKey=one</pre> +++ +++ <p>would generate a site, associated with the key <em>one</em>. The +++ EventAwareGenerator would responde the same page, as long as it is not +++ invalidated manually by invoking an action, which sends a JMS notification to +++ the JMSEventMessageListener:</p> +++ +++ <pre>http://localhost:8080/cocoon-jms-sample/eventcache/action?event=one</pre> +++ +++ <h1>Further reading</h1> +++ +++ <p>If you want to lean more about events and EventAware cache, please have a +++ look at the <a href="daisy:1478">cocoon-eventcache</a> block.</p> +++ +++ </body> +++ </html> Fields ====== CocoonBlock: jms (new field)