A document has been updated: http://cocoon.zones.apache.org/daisy/documentation/1500.html
Document ID: 1500 Branch: main Language: default Name: JMSPublisherAction (unchanged) Document Type: Sitemap Component (unchanged) Updated on: 8/17/08 6:39:56 PM Updated by: Lukas Lang A new version has been created, state: draft Parts ===== Long description ---------------- This part has been added. Mime type: text/xml File name: null Size: 2546 bytes Content: <html> <body> <p>JMSPublisherAction is based on AbstractMessagePublisher and used as a sitemap action to send simple JMS (Java Message Service) text messages to an injected destination, which could either be a topic or a queue. The message must be provided as a sitemap parameter.</p> <h3>Example</h3> <p>Assuming, we run the following sitemap on a Cocoon web application:</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:match> </map:pipeline> </map:pipelines> </map:sitemap></pre> <p>As a request matches the pattern <em>action</em>, <map:act /> is called. The request must provide the parameter event. Saying, the URL looks as follows:</p> <pre>http://localhost:8080/cocoon-jms-sample/action?event=one</pre> <p>A text message will be created and sent to the provided destination. This sample is part of the cocoon-jms-sample block, using JMS messages for content invalidation of an EventAware cache.</p> <h3>Configuration</h3> <p>The action is configured, using Spring's dependency injection mechanism. In this example, we gain benefit of using Spring's JMS capabilities, which provide a template for message posting and delivery via callback interface. Please see the JMS <a href="daisy:1501">sample</a> block for further information, which uses <a href="http://activemq.apache.org">ActiveMQ</a> as an embedded message broker.</p> <pre> <!-- Action bean --> <bean name="org.apache.cocoon.acting.Action/JMSPublisherAction" class="org.apache.cocoon.acting.JMSPublisherAction" scope="prototype"> <property name="template" ref="org.apache.cocoon.jms.sample.myJmsTemplate" /> <property name="destination" ref="org.apache.cocoon.jms.sample.topic"/> </bean> </pre> </body> </html> Fields ====== CocoonComponentReference: Action (new field) CocoonBlock: jms (new field) FQ Java class: org.apache.cocoon.acting.JMSPublisherAction (new field)
