[DAISY] Updated: Introduction
[email protected] Sun, 17 Aug 2008 19:17:15 +0000 (GMT+00:00)
| Newsgroups | gmane.text.xml.cocoon.documentation |
|---|---|
| Message-ID | <[email protected]> |
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:17: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: 5770 bytes (previous version: 2831 bytes)
Content diff:
(63 equal lines skipped)
<pre>http://localhost:8080/cocoon-jms-sample/eventcache/action?event=one</pre>
+++ <h1>Configuration</h1>
+++
+++ <p>All of the previously used components are configured, using Spring and the
+++ ActiveMQ <em>amq </em>namespace. The sample's Spring bean definition looks as
+++ follows:</p>
+++
+++ <pre> <!-- Event aware generator bean inherits from the jx generator -->
+++ <bean name="org.apache.cocoon.generation.Generator/EventCacheSample"
+++ class="org.apache.cocoon.samples.EventAwareGenerator" scope="prototype"
+++ parent="org.apache.cocoon.generation.Generator/jx" />
+++
+++ <!-- 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>
+++
+++ <!-- lets create an embedded ActiveMQ Broker -->
+++ <amq:broker useJmx="false" persistent="false">
+++ <amq:transportConnectors>
+++ <amq:transportConnector uri="tcp://localhost:0" />
+++ </amq:transportConnectors>
+++ </amq:broker>
+++
+++ <!-- the topic to use -->
+++ <amq:topic id="org.apache.cocoon.jms.sample.topic" physicalName="org.apache.activemq.spring.Test.spring.embedded" />
+++
+++ <!-- JMS ConnectionFactory to use, configuring the embedded broker using XML -->
+++ <amq:connectionFactory id="org.apache.cocoon.jms.sample.jmsFactory" brokerURL="vm://localhost" />
+++
+++ <!-- Spring JMS Template -->
+++ <bean id="org.apache.cocoon.jms.sample.myJmsTemplate"
+++ class="org.springframework.jms.core.JmsTemplate">
+++ <property name="connectionFactory">
+++ <!-- lets wrap in a pool to avoid creating a connection per send -->
+++ <bean class="org.springframework.jms.connection.SingleConnectionFactory">
+++ <property name="targetConnectionFactory">
+++ <ref local="org.apache.cocoon.jms.sample.jmsFactory" />
+++ </property>
+++ </bean>
+++ </property>
+++ </bean>
+++
+++ <bean id="org.apache.cocoon.jms.sample.consumerJmsTemplate" class="org.springframework.jms.core.JmsTemplate">
+++ <property name="connectionFactory"´ref="org.apache.cocoon.jms.sample.jmsFactory" />
+++ </bean>
+++
+++ <bean id="org.apache.cocoon.jms.sample.JMSEventMessageListener"
+++ class="org.apache.cocoon.acting.JMSEventMessageListener" init-method="init" destroy-method="destroy" scope="singleton">
+++ <property name="template" ref="org.apache.cocoon.jms.sample.consumerJmsTemplate" />
+++ <property name="subscriptionId" value="topicconsumer" />
+++ <property name="destination" ref="org.apache.cocoon.jms.sample.topic" />
+++ <property name="cache" ref="org.apache.cocoon.caching.Cache/EventAware" />
+++ </bean></pre>
+++
<h1>Further reading</h1>
<p>If you want to lean more about events and EventAware cache, please have a
(4 equal lines skipped)