You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by as...@apache.org on 2011/12/18 06:09:10 UTC
svn commit: r1220336 [1/8] - in /qpid/trunk/qpid/java: ./
client/src/main/java/org/apache/qpid/client/ jca/ jca/example/
jca/example/conf/ jca/example/src/ jca/example/src/main/
jca/example/src/main/java/ jca/example/src/main/java/org/ jca/example/src/...
Author: astitcher
Date: Sun Dec 18 05:09:07 2011
New Revision: 1220336
URL: http://svn.apache.org/viewvc?rev=1220336&view=rev
Log:
QPID-3044: Implement JCA Adapter for Java JMS client
- Large contributions from Weston Price & Kevin Conner
Added:
qpid/trunk/qpid/java/jca/
qpid/trunk/qpid/java/jca/README-GERONIMO.txt
qpid/trunk/qpid/java/jca/README-JBOSS.txt
qpid/trunk/qpid/java/jca/README.txt
qpid/trunk/qpid/java/jca/build.xml
qpid/trunk/qpid/java/jca/example/
qpid/trunk/qpid/java/jca/example/.gitignore
qpid/trunk/qpid/java/jca/example/README.txt
qpid/trunk/qpid/java/jca/example/build-geronimo-properties.xml
qpid/trunk/qpid/java/jca/example/build-jboss-properties.xml
qpid/trunk/qpid/java/jca/example/build-properties.xml
qpid/trunk/qpid/java/jca/example/build-properties.xml.temp
qpid/trunk/qpid/java/jca/example/build.xml
qpid/trunk/qpid/java/jca/example/conf/
qpid/trunk/qpid/java/jca/example/conf/application.xml
qpid/trunk/qpid/java/jca/example/conf/ejb-jar.xml
qpid/trunk/qpid/java/jca/example/conf/geronimo-application.xml
qpid/trunk/qpid/java/jca/example/conf/geronimo-ra.xml
qpid/trunk/qpid/java/jca/example/conf/jboss-web.xml
qpid/trunk/qpid/java/jca/example/conf/jboss.xml
qpid/trunk/qpid/java/jca/example/conf/log4j.properties
qpid/trunk/qpid/java/jca/example/conf/qpid-jca-ds.xml
qpid/trunk/qpid/java/jca/example/conf/web.xml
qpid/trunk/qpid/java/jca/example/qpid-jca-example-properties.xml
qpid/trunk/qpid/java/jca/example/src/
qpid/trunk/qpid/java/jca/example/src/main/
qpid/trunk/qpid/java/jca/example/src/main/java/
qpid/trunk/qpid/java/jca/example/src/main/java/org/
qpid/trunk/qpid/java/jca/example/src/main/java/org/apache/
qpid/trunk/qpid/java/jca/example/src/main/java/org/apache/qpid/
qpid/trunk/qpid/java/jca/example/src/main/java/org/apache/qpid/jca/
qpid/trunk/qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/
qpid/trunk/qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/client/
qpid/trunk/qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/client/QpidRequestResponseClient.java
qpid/trunk/qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/client/QpidTestClient.java
qpid/trunk/qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/client/QpidTestUtil.java
qpid/trunk/qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/ejb/
qpid/trunk/qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/ejb/QpidGoodByeListenerBean.java
qpid/trunk/qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/ejb/QpidGoodByeSubscriberBean.java
qpid/trunk/qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/ejb/QpidHelloListenerBean.java
qpid/trunk/qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/ejb/QpidHelloSubscriberBean.java
qpid/trunk/qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/ejb/QpidJMSResponderBean.java
qpid/trunk/qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/ejb/QpidTest.java
qpid/trunk/qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/ejb/QpidTestBean.java
qpid/trunk/qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/ejb/QpidTestLocal.java
qpid/trunk/qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/ejb/QpidTestRemote.java
qpid/trunk/qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/ejb/QpidUtil.java
qpid/trunk/qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/web/
qpid/trunk/qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/web/QpidTestServlet.java
qpid/trunk/qpid/java/jca/src/
qpid/trunk/qpid/java/jca/src/main/
qpid/trunk/qpid/java/jca/src/main/java/
qpid/trunk/qpid/java/jca/src/main/java/org/
qpid/trunk/qpid/java/jca/src/main/java/org/apache/
qpid/trunk/qpid/java/jca/src/main/java/org/apache/qpid/
qpid/trunk/qpid/java/jca/src/main/java/org/apache/qpid/ra/
qpid/trunk/qpid/java/jca/src/main/java/org/apache/qpid/ra/ConnectionFactoryObjectFactory.java
qpid/trunk/qpid/java/jca/src/main/java/org/apache/qpid/ra/ConnectionFactoryProperties.java
qpid/trunk/qpid/java/jca/src/main/java/org/apache/qpid/ra/QpidRABytesMessage.java
qpid/trunk/qpid/java/jca/src/main/java/org/apache/qpid/ra/QpidRAConnectionFactory.java
qpid/trunk/qpid/java/jca/src/main/java/org/apache/qpid/ra/QpidRAConnectionFactoryImpl.java
qpid/trunk/qpid/java/jca/src/main/java/org/apache/qpid/ra/QpidRAConnectionManager.java
qpid/trunk/qpid/java/jca/src/main/java/org/apache/qpid/ra/QpidRAConnectionMetaData.java
qpid/trunk/qpid/java/jca/src/main/java/org/apache/qpid/ra/QpidRAConnectionRequestInfo.java
qpid/trunk/qpid/java/jca/src/main/java/org/apache/qpid/ra/QpidRACredential.java
qpid/trunk/qpid/java/jca/src/main/java/org/apache/qpid/ra/QpidRAException.java
qpid/trunk/qpid/java/jca/src/main/java/org/apache/qpid/ra/QpidRALocalTransaction.java
qpid/trunk/qpid/java/jca/src/main/java/org/apache/qpid/ra/QpidRAMCFProperties.java
qpid/trunk/qpid/java/jca/src/main/java/org/apache/qpid/ra/QpidRAManagedConnection.java
qpid/trunk/qpid/java/jca/src/main/java/org/apache/qpid/ra/QpidRAManagedConnectionFactory.java
qpid/trunk/qpid/java/jca/src/main/java/org/apache/qpid/ra/QpidRAMapMessage.java
qpid/trunk/qpid/java/jca/src/main/java/org/apache/qpid/ra/QpidRAMessage.java
qpid/trunk/qpid/java/jca/src/main/java/org/apache/qpid/ra/QpidRAMessageConsumer.java
qpid/trunk/qpid/java/jca/src/main/java/org/apache/qpid/ra/QpidRAMessageListener.java
qpid/trunk/qpid/java/jca/src/main/java/org/apache/qpid/ra/QpidRAMessageProducer.java
qpid/trunk/qpid/java/jca/src/main/java/org/apache/qpid/ra/QpidRAMetaData.java
qpid/trunk/qpid/java/jca/src/main/java/org/apache/qpid/ra/QpidRAObjectMessage.java
qpid/trunk/qpid/java/jca/src/main/java/org/apache/qpid/ra/QpidRAProperties.java
qpid/trunk/qpid/java/jca/src/main/java/org/apache/qpid/ra/QpidRAQueueBrowser.java
qpid/trunk/qpid/java/jca/src/main/java/org/apache/qpid/ra/QpidRAQueueReceiver.java
qpid/trunk/qpid/java/jca/src/main/java/org/apache/qpid/ra/QpidRAQueueSender.java
qpid/trunk/qpid/java/jca/src/main/java/org/apache/qpid/ra/QpidRASession.java
qpid/trunk/qpid/java/jca/src/main/java/org/apache/qpid/ra/QpidRASessionFactory.java
qpid/trunk/qpid/java/jca/src/main/java/org/apache/qpid/ra/QpidRASessionFactoryImpl.java
qpid/trunk/qpid/java/jca/src/main/java/org/apache/qpid/ra/QpidRASessionImpl.java
qpid/trunk/qpid/java/jca/src/main/java/org/apache/qpid/ra/QpidRAStreamMessage.java
qpid/trunk/qpid/java/jca/src/main/java/org/apache/qpid/ra/QpidRATextMessage.java
qpid/trunk/qpid/java/jca/src/main/java/org/apache/qpid/ra/QpidRATopicPublisher.java
qpid/trunk/qpid/java/jca/src/main/java/org/apache/qpid/ra/QpidRATopicSubscriber.java
qpid/trunk/qpid/java/jca/src/main/java/org/apache/qpid/ra/QpidRAXAResource.java
qpid/trunk/qpid/java/jca/src/main/java/org/apache/qpid/ra/QpidResourceAdapter.java
qpid/trunk/qpid/java/jca/src/main/java/org/apache/qpid/ra/Util.java
qpid/trunk/qpid/java/jca/src/main/java/org/apache/qpid/ra/admin/
qpid/trunk/qpid/java/jca/src/main/java/org/apache/qpid/ra/admin/AdminObjectFactory.java
qpid/trunk/qpid/java/jca/src/main/java/org/apache/qpid/ra/admin/QpidBindingURL.java
qpid/trunk/qpid/java/jca/src/main/java/org/apache/qpid/ra/admin/QpidConnectionFactoryProxy.java
qpid/trunk/qpid/java/jca/src/main/java/org/apache/qpid/ra/admin/QpidDestinationProxy.java
qpid/trunk/qpid/java/jca/src/main/java/org/apache/qpid/ra/admin/QpidQueue.java
qpid/trunk/qpid/java/jca/src/main/java/org/apache/qpid/ra/admin/QpidTopic.java
qpid/trunk/qpid/java/jca/src/main/java/org/apache/qpid/ra/inflow/
qpid/trunk/qpid/java/jca/src/main/java/org/apache/qpid/ra/inflow/QpidActivation.java
qpid/trunk/qpid/java/jca/src/main/java/org/apache/qpid/ra/inflow/QpidActivationSpec.java
qpid/trunk/qpid/java/jca/src/main/java/org/apache/qpid/ra/inflow/QpidMessageHandler.java
qpid/trunk/qpid/java/jca/src/main/java/org/apache/qpid/ra/tm/
qpid/trunk/qpid/java/jca/src/main/java/org/apache/qpid/ra/tm/GeronimoTransactionManagerLocator.java
qpid/trunk/qpid/java/jca/src/main/java/org/apache/qpid/ra/tm/JBoss7TransactionManagerLocator.java
qpid/trunk/qpid/java/jca/src/main/java/org/apache/qpid/ra/tm/JBossTransactionManagerLocator.java
qpid/trunk/qpid/java/jca/src/main/resources/
qpid/trunk/qpid/java/jca/src/main/resources/META-INF/
qpid/trunk/qpid/java/jca/src/main/resources/META-INF/jboss-ra.xml
qpid/trunk/qpid/java/jca/src/main/resources/META-INF/ra.xml (with props)
qpid/trunk/qpid/java/lib/geronimo-ejb_3.0_spec-1.0.1.jar
qpid/trunk/qpid/java/lib/geronimo-j2ee-connector_1.5_spec-2.0.0.jar
qpid/trunk/qpid/java/lib/geronimo-jta_1.1_spec-1.1.1.jar
qpid/trunk/qpid/java/lib/geronimo-kernel-2.2.1.jar
Modified:
qpid/trunk/qpid/java/build.deps
qpid/trunk/qpid/java/build.xml
qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/AMQConnectionFactory.java
qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/AMQQueueBrowser.java
qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/TopicPublisherAdapter.java
Modified: qpid/trunk/qpid/java/build.deps
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/build.deps?rev=1220336&r1=1220335&r2=1220336&view=diff
==============================================================================
--- qpid/trunk/qpid/java/build.deps (original)
+++ qpid/trunk/qpid/java/build.deps Sun Dec 18 05:09:07 2011
@@ -29,6 +29,10 @@ commons-logging=lib/commons-logging-1.0.
derby-db=lib/derby-10.6.1.0.jar
geronimo-jms=lib/geronimo-jms_1.1_spec-1.0.jar
+geronimo-j2ee=lib/geronimo-j2ee-connector_1.5_spec-2.0.0.jar
+geronimo-jta=lib/geronimo-jta_1.1_spec-1.1.1.jar
+geronimo-kernel=lib/geronimo-kernel-2.2.1.jar
+geronimo-openejb=lib/geronimo-ejb_3.0_spec-1.0.1.jar
junit=lib/junit-3.8.1.jar
@@ -136,7 +140,11 @@ broker-plugins-experimental-info.test.li
management-eclipse-plugin.test.libs=${test.libs}
management-common.test.libs=${test.libs}
+# JCA Resource adapter
+ra.libs=${geronimo-j2ee} ${geronimo-jta} ${geronimo-jms} ${slf4j-api} ${geronimo-kernel} ${geronimo-openejb}
+
# optional bdbstore module deps
bdb-je=lib/bdbstore/je-4.0.117.jar
bdbstore.libs=${bdb-je}
bdbstore.test.libs=${test.libs}
+
Modified: qpid/trunk/qpid/java/build.xml
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/build.xml?rev=1220336&r1=1220335&r2=1220336&view=diff
==============================================================================
--- qpid/trunk/qpid/java/build.xml (original)
+++ qpid/trunk/qpid/java/build.xml Sun Dec 18 05:09:07 2011
@@ -32,8 +32,9 @@
<property name="modules.management" value="${management}"/>
<property name="modules.plugin" value="${broker-plugins} ${client-plugins}"/>
<property name="modules.opt" value=""/>
+ <property name="modules.jca" value="jca"/>
<property name="modules" value="${modules.core} ${modules.examples}
- ${modules.management} ${modules.tests} ${modules.plugin} ${modules.opt}"/>
+ ${modules.management} ${modules.tests} ${modules.plugin} ${modules.opt} ${modules.jca}"/>
<property name="qpid.jar" location="${build.lib}/qpid-all.jar"/>
<basename property="qpid.jar.name" file="${qpid.jar}"/>
Modified: qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/AMQConnectionFactory.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/AMQConnectionFactory.java?rev=1220336&r1=1220335&r2=1220336&view=diff
==============================================================================
--- qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/AMQConnectionFactory.java (original)
+++ qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/AMQConnectionFactory.java Sun Dec 18 05:09:07 2011
@@ -46,6 +46,12 @@ public class AMQConnectionFactory implem
{
private final ConnectionURL _connectionDetails;
+ // The default constructor is necessary to allow AMQConnectionFactory to be deserialised from JNDI
+ public AMQConnectionFactory()
+ {
+ _connectionDetails = null;
+ }
+
public AMQConnectionFactory(final String url) throws URLSyntaxException
{
if (url == null)
Modified: qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/AMQQueueBrowser.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/AMQQueueBrowser.java?rev=1220336&r1=1220335&r2=1220336&view=diff
==============================================================================
--- qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/AMQQueueBrowser.java (original)
+++ qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/AMQQueueBrowser.java Sun Dec 18 05:09:07 2011
@@ -30,6 +30,7 @@ import javax.jms.Queue;
import javax.jms.QueueBrowser;
import java.util.ArrayList;
import java.util.Enumeration;
+import java.util.NoSuchElementException;
import java.util.concurrent.atomic.AtomicBoolean;
public class AMQQueueBrowser implements QueueBrowser
@@ -112,9 +113,12 @@ public class AMQQueueBrowser implements
public QueueBrowserEnumeration(BasicMessageConsumer consumer) throws JMSException
{
- _nextMessage = consumer == null ? null : consumer.receiveBrowse();
+ if (consumer != null)
+ {
+ _consumer = consumer;
+ prefetchMessage();
+ }
_logger.info("QB:created with first element:" + _nextMessage);
- _consumer = consumer;
}
public boolean hasMoreElements()
@@ -126,18 +130,46 @@ public class AMQQueueBrowser implements
public Object nextElement()
{
Message msg = _nextMessage;
+ if (msg == null)
+ {
+ throw new NoSuchElementException("No messages") ;
+ }
try
{
_logger.info("QB:nextElement about to receive");
- _nextMessage = _consumer.receiveBrowse();
+ prefetchMessage();
_logger.info("QB:nextElement received:" + _nextMessage);
}
catch (JMSException e)
{
_logger.warn("Exception caught while queue browsing", e);
_nextMessage = null;
+ try
+ {
+ closeConsumer() ;
+ }
+ catch (final JMSException jmse) {} // ignore
}
return msg;
}
- }
+
+ private void prefetchMessage() throws JMSException
+ {
+ _nextMessage = _consumer.receiveBrowse();
+ if (_nextMessage == null)
+ {
+ closeConsumer() ;
+ }
+ }
+
+ private void closeConsumer() throws JMSException
+ {
+ if (_consumer != null)
+ {
+ BasicMessageConsumer consumer = _consumer ;
+ _consumer = null ;
+ consumer.close() ;
+ }
+ }
+ }
}
Modified: qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/TopicPublisherAdapter.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/TopicPublisherAdapter.java?rev=1220336&r1=1220335&r2=1220336&view=diff
==============================================================================
--- qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/TopicPublisherAdapter.java (original)
+++ qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/TopicPublisherAdapter.java Sun Dec 18 05:09:07 2011
@@ -123,7 +123,7 @@ public class TopicPublisherAdapter imple
public void send(Destination dest, Message msg) throws JMSException
{
checkPreConditions();
- checkTopic(_topic);
+ checkTopic(dest);
_delegate.send(dest, msg);
}
Added: qpid/trunk/qpid/java/jca/README-GERONIMO.txt
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/jca/README-GERONIMO.txt?rev=1220336&view=auto
==============================================================================
--- qpid/trunk/qpid/java/jca/README-GERONIMO.txt (added)
+++ qpid/trunk/qpid/java/jca/README-GERONIMO.txt Sun Dec 18 05:09:07 2011
@@ -0,0 +1,29 @@
+Qpid JCA Resource Adapter
+
+Apache Geronimo 2.x Installation and Configuration Instructions
+
+Overview
+========
+The Qpid Resource Adapter is a JCA 1.5 compliant resource adapter that allows
+for JEE integration between EE applications and AMQP 0.10 message brokers.
+
+The adapter provides both outbound and inbound connectivity and
+exposes a variety of options to fine tune your messaging applications.
+Currently the adapter only supports C++ based brokers and has only been tested with Apache Qpid C++ broker.
+
+
+The following document explains how to configure the resource adapter for deployment in Geronimo 2.x
+
+Configuration and Deployment
+============================
+
+The Apache Geronimo 2.x application server requires the use of an RA deployment plan to deploy and configure
+a resource adapter. A sample deployment plan has been provided as geronimo-ra.xml which is included in the
+META-INF directory of the qpid-ra-<version>.rar file. If you need to modify this file, simply extract
+the RAR file, edit the geronimo-ra.xml file and recompress the file.
+
+Please refer to the general README.txt file for a description of each configuration property
+the adapter supports for resource adapter, managedconnectionfatory and activationspec level configuration.
+
+
+
Added: qpid/trunk/qpid/java/jca/README-JBOSS.txt
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/jca/README-JBOSS.txt?rev=1220336&view=auto
==============================================================================
--- qpid/trunk/qpid/java/jca/README-JBOSS.txt (added)
+++ qpid/trunk/qpid/java/jca/README-JBOSS.txt Sun Dec 18 05:09:07 2011
@@ -0,0 +1,168 @@
+Qpid JCA Resource Adapter
+
+JBoss EAP 5.x Installation and Configuration Instructions
+
+Overview
+========
+The Qpid Resource Adapter is a JCA 1.5 compliant resource adapter that allows
+for JEE integration between EE applications and AMQP 0.10 message brokers.
+
+The adapter provides both outbound and inbound connectivity and
+exposes a variety of options to fine tune your messaging applications.
+Currently the adapter only supports C++ based brokers and has only been tested with Apache Qpid C++ broker.
+
+The following document explains how to configure the resource adapter for deployment in JBoss EAP 5.x.
+
+
+Deployment
+==========
+To deploy the Qpid JCA adapter for either JBoss EAP, simply copy the qpid-ra-<version>.rar file
+to your JBoss deploy directory. By default this can be found at JBOSS_ROOT/server/<server-name>/deploy,
+where JBOSS_ROOT denotes the root directory of your JBoss installation and <server-name> denotes the
+name of your deployment server. A successful adapter installation will be accompanied by the
+following INFO message:
+
+ INFO [QpidResourceAdapter] Qpid resource adaptor started
+
+At this point the adapter is deployed and ready for configuration.
+
+Configuration Overview
+======================
+The standard configuration mechanism for 1.5 JCA adapters is the ra.xml
+deployment descriptor. Like other EE based descriptors this file can be found
+in the META-INF directory of the provided EE artifact (ie .rar file). A majority
+of the properties in the ra.xml will seem familiar to anyone who has worked with
+Apache Qpid in a standalone environment. A reasonable set of configuration defaults
+have been provided.
+
+The resource adapter configuration properties provide generic properties for both
+inbound and outbound connectivity. These properties can be overridden when deploying
+managed connection factories as well as inbound activations using the standard JBoss
+configuration artifacts, the *-ds.xml file and MDB activation spec . A sample *-ds.xml file,
+qpid-jca-ds.xml, can be found in your Qpid JCA resource adapter directory.
+
+The general README.txt file provides a detailed description of all the properties associated
+with the Qpid JCA Resource adapter. Please consult this file for further explanation of
+how configuration properties are treated within the Qpid JCA adapter.
+
+ConnectionFactory Configuration
+======================================
+As per the JCA specification, the standard outbound-connectivity component is the
+ConnectionFactory. In EAP 5.x ConnectionFactories are configured
+via the *-ds.xml file. As previously mentioned, a sample *-ds.xml file, qpid-jca-ds.xml
+hasbeen provided with your distribution. This file can be easily modified to suit
+your development/deployment needs. The following describes the ConnectionFactory
+portion of the sample file.
+
+XA ConnectionFactory
+====================
+ <tx-connection-factory>
+ <jndi-name>QpidJMSXA</jndi-name>
+ <xa-transaction/>
+ <rar-name>qpid-ra-<ra-version>.rar</rar-name>
+ <connection-definition>org.apache.qpid.ra.QpidRAConnectionFactory</connection-definition>
+ <config-property name="connectionURL">amqp://guest:guest@/test?brokerlist='tcp://localhost:5672?sasl_mechs='ANONYMOUS''</config-property>
+ <max-pool-size>20</max-pool-size>
+ </tx-connection-factory>
+
+The QpidJMSXA connection factory defines an XA capable ManagedConnectionFactory. You will need to insert your particular rar version for
+the rar-name property. The jndi-name and connectionURL property are both configurable and can be modified for your environment. After deployment
+the ConnectionFactory will be bound into JNDI under the name
+
+java:<jndi-name>
+
+For the previous example, this would resolve to
+
+java:QpidJMSXA
+
+Local ConnectionFactory
+=======================
+ <tx-connection-factory>
+ <jndi-name>QpidJMS</jndi-name>
+ <rar-name>qpid-ra-0.10.rar</rar-name>
+ <local-transaction/>
+ <config-property name="useLocalTx" type="java.lang.Boolean">true</config-property>
+ <config-property name="connectionURL">amqp://anonymous:@client/test?brokerlist='tcp://localhost:5672?sasl_mechs='ANONYMOUS''</config-property>
+ <connection-definition>org.apache.qpid.ra.QpidRAConnectionFactory</connection-definition>
+ <max-pool-size>20</max-pool-size>
+ </tx-connection-factory>
+
+The QpidJMS connection factory defines a non XA connection factory. Typically this is used as a specialized ConnectionFactory where either XA
+is not desired, or you are running with a clustered Qpid Broker configuration which at this time, does not support XA. The configuration
+properties mirror those of the XA ConnectionFactory.
+
+Admininstered Object Configuration
+==================================
+Destinations (queues, topics) are configured in EAP via JCA standard Administered Objects (AdminObjects). These objects
+are placed within the *-ds.xml file alongside your ConnectionFactory configurations. The sample file qpid-jca-ds.xml
+provides two such objects
+
+ <mbean code="org.jboss.resource.deployment.AdminObject"
+ name="qpid.jca:name=HelloQueue">
+ <attribute name="JNDIName">Hello</attribute>
+ <depends optional-attribute-name="RARName">jboss.jca:service=RARDeployment,name='qpid-ra-0.10.rar'</depends>
+ <attribute name="Type">javax.jms.Destination</attribute>
+ <attribute name="Properties">
+ destinationType=QUEUE
+ destinationAddress=amq.direct
+ </attribute>
+ </mbean>
+
+The above XML defines a JMS Queue which is bound into JNDI as
+
+queue/HelloQueue
+
+This destination can be retrieved from JNDI and be used for the consumption or production of messages. The desinationAddress property
+can be customized for your environment. Please see the Qpid Java Client documentation for specific configuration options.
+
+ <mbean code="org.jboss.resource.deployment.AdminObject"
+ name="qpid.jca:name=HelloTopic">
+ <attribute name="JNDIName">HelloTopic</attribute>
+ <depends optional-attribute-name="RARName">jboss.jca:service=RARDeployment,name='qpid-ra-0.10.rar'</depends>
+ <attribute name="Type">javax.jms.Destination</attribute>
+ <attribute name="Properties">
+ destinationType=TOPIC
+ destinationAddress=amq.topic
+ </attribute>
+ </mbean>
+
+
+The above XML defines a JMS Topic which is bound into JNDI as
+
+HelloTopic
+
+This destination can be retrieved from JNDI and be used for the consumption or production of messages. The desinationAddress property
+can be customized for your environment. Please see the Qpid Java Client documentation for specific configuration options.
+
+
+ <mbean code="org.jboss.resource.deployment.AdminObject"
+ name="qpid.jca:name=QpidConnectionFactory">
+ <attribute name="JNDIName">QpidConnectionFactory</attribute>
+ <depends optional-attribute-name="RARName">jboss.jca:service=RARDeployment,name='qpid-ra-0.10.rar'</depends>
+ <attribute name="Type">javax.jms.ConnectionFactory</attribute>
+ <attribute name="Properties">
+ connectionURL=amqp://anonymous:@client/test?brokerlist='tcp://localhost:5672?sasl_mechs='ANONYMOUS''
+ </attribute>
+ </mbean>
+
+The above XML defines a ConnectionFactory that can be used external to EAP 5.x. Typically this connection factory
+is used by standalone or 'thin' clients that do not require an application server. This object is bound into
+the EAP 5.x JNDI tree as
+
+QpidConnectionFactory
+
+ActivationSpec Configuration
+============================
+The standard method for inbound communication is the MessageDrivenBean architecture with is configured
+via the ActivationSpec mechanism. Please see the general README.tx file for an explanation of the
+QpidActivationSpec, as well as general inbound connectivity options.
+
+An ActivationSpec can either be configured via the Java Annotation mechanism, or in the ejb-jar.xml deployment
+descriptor.
+
+Summary
+=======
+The above description for the Qpid JCA adapter for EAP 5.x is just a general guide for deploying and configuring
+the Qpid JCA adapter. The sample file provided can be easily modified and it is expected you will do so to
+conform to your own environment.
+
Added: qpid/trunk/qpid/java/jca/README.txt
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/jca/README.txt?rev=1220336&view=auto
==============================================================================
--- qpid/trunk/qpid/java/jca/README.txt (added)
+++ qpid/trunk/qpid/java/jca/README.txt Sun Dec 18 05:09:07 2011
@@ -0,0 +1,241 @@
+Qpid JCA Resource Adapter Installation/Configuration Instructions
+
+Overview
+========
+The Qpid Resource Adapter is a JCA 1.5 compliant resource adapter that allows
+for JEE integration between EE applications and AMQP 0.10 message brokers.
+
+The adapter provides both outbound and inbound connectivity and
+exposes a variety of options to fine tune your messaging applications. Currently
+the adapter only supports C++ based brokers and has only been tested with Apache Qpid C++ broker.
+
+The following document explains general configuration information for the Qpid JCA RA. Details for
+specific application server platforms are provided in separate README files typically designated as
+README-<server-platform>.txt.
+
+Configuration
+=============
+As per the JCA specification, there are four main components of a JCA resource adapter:
+
+ The ResourceAdapter JavaBean
+ The ManagedConnectionFactory JavaBean
+ The ActivationSpec JavaBean
+ Administered Objects
+
+Each of these components provide configuration options in the form of properties. The Resource Adapter
+JavaBean provides a set of global configuration options while the ManagedConnectionFactory JavaBean allows
+for the configuration of outbound connectivity options. The ActivationSpec JavaBean provides configuration
+options for inbound connectivity.
+
+When a ManagedConnectionFactory JavaBean or ActivationSpec JavaBean are deployed they can choose to inherit
+the configuration properties from the ResourceAdapter or provide specific properties which in turn will override
+the defaults.
+
+While some of the properties from the three componets are specific to the JCA adapter, a majority of the
+properties directly correspond the the Qpid JMS client. As such, it is strongly encouraged your familiarize
+yourself with the correct syntax, configuration options for the JMS client as well as the JCA adapter. Similarly,
+familiarity with the 1.5 JCA specification is encouraged though not strictly required.
+
+The ResourceAdapter JavaBean
+============================
+
+The ResourceAdapter JavaBean provides global configuration options for both inbound and outbound connectivity.
+The set of ResourceAdapter properties are described below. The ResourceAdapter properties can be found in the META-INF/ra.xml
+deployment descriptor which is provided with the adapter. Note, deploying a ResourceAdapter, ManagedConnectionFactory
+or ActivationSpec is application server specific. As such, this document provides an explanation of these properties
+but not how they are configured as this is environment specific.
+
+ResourceAdapter JavaBean Properties
+===================================
+
+ClientID
+ The unique client identifier. From the JMS API this is used only in the context of durable subscriptions.
+Default: client_id
+
+SetupAttempts
+ The number of attempts the ResourceAdapter will make to successfully setup an inbound activation on deployment, or when an exception
+ occurs at runtime.
+Default: 5
+
+SetupInterval
+ The interval in milliseconds the adapter will wait between setup attempts.
+Default: 5000
+
+UseLocalTx
+ Whether or not to use local transactions instead of XA.
+Default: false
+
+DefaultUserName
+ The default user name to use.
+Default: guest
+
+DefaultPassword
+ The default password to use.
+Default: guest
+
+Host
+ The hostname/ip address of the broker.
+Default: localhost
+
+Port
+ The port of the broker.
+Default: 5672
+
+Path
+ The virtual path for the connection factory.
+Default: test
+
+ConnectionURL
+ The full connection URL to the broker.
+Default:amqp://guest:guest@/test?brokerlist='tcp://localhost:5672'
+
+TransactionManagerLocatorClass
+ The class responsible for locating the transaction manager within a specific application server. This is a ResourceAdapter
+ Java Bean specific property and is application server specific. As such, it is currently commented out. Two examples have
+ been provided.
+Default: none
+
+TransactionManagerLocatorMethod
+ The specific method on the class above used to acquire a reference to the platform specific transaction manager.
+ This is a ResourceAdapter Java Bean specific property and is application server specific.
+ As such, it is currently commented out. Two examples have been provided.
+Default:none
+
+Note, if you require XA support, both the TransactionManagerLocatorClass and the TransactionManagerLocatorMethod
+properties MUST be set. While application servers typically provide a mechanism to do this in the form of a specific
+deployment descriptor, or GUI console, the ra.xml file can also be modified directly.
+
+The ManagedConnectionFactory JavaBean
+=====================================
+
+The ManagedConnectionFactory JavaBean provides outbound connectivity for the Qpid JCA adapter. In addition to most of the properties
+inherited from the ResourceAdapter JavaBean, the ManagedConnectionFactory JavaBean provides specific properties only applicable
+to outbound connectivity.
+
+sessionDefaulType
+ The default type of Session. Currently unused.
+Default: java.jms.Queue
+
+useTryLock
+ Multi-purpose property used to specify both that a lock on the underlying managed connection should be used, as well as the
+ wait duration to aquire the lock. Primarily used for transaction management. A null or zero value will atttempt to acquire
+ the lock without a duration. Anything greater than zero will wait n number of seconds before failing to acquire the lock.
+Default:0
+
+KeyStorePassword
+ The KeyStore password for SSL
+Default:none
+
+KeyStorePath
+ The path to the KeyStore.
+Default:none
+
+CertType
+ The type of certificate.
+Default:SunX509
+
+The ActivationSpec JavaBean
+===========================
+The ActivationSpec JavaBean provides inbound connectivity for the Qpid JCA adapter. In addition to most of the properties
+inherited from the ResourceAdapter JavaBean, the ActivationSpec JavaBean provides specific properties only applicable
+to inbound connectivity. As opposed to the ResourceAdapter and ManagedConnectionFactory JavaBean a majority of the
+ActivationSpec JavaBean properties have no default value. It is expected that these will be provided via Java annotations
+or deployment descriptor configuration properties. The Qpid JCA adapter provides inbound connectivity in conjunction
+with the Message Driven Bean architecture from the EJB 3.x specification.
+
+UseJNDI
+ Whether or not to attempt looking up an inbound destination from JNDI. If false, an attempt will be made to construct
+ the destination from the other ActivationSpec properties.
+Default: true
+
+Destination
+ The name of the destination on which to listen for messages.
+Default:none
+
+DestinationType
+ The type of destination on which to listen. Valid values are javax.jms.Queue or java.jms.Topic.
+Default:none
+
+MessageSelector
+ The JMS properties that will be used in selecting specific message. Please see the JMS specification for further details.
+Default:none
+
+AcknowlegeMode
+ Whether or not the client or consumer will acknowledge any messages it receives. Ignored in a transacted scenario.
+ Please see the JMS specification for more details.
+Default:AUTO_ACKNOWLEDGE
+
+SubscriptionDurablity
+ Whether or not the subscription is durable.
+Default:none
+
+SubscriptionName
+ The name of the subscription.
+Default:none
+
+MaxSession
+ The maximum number of sessions that this activation supports.
+Default:15
+
+TransactionTimeout
+ The timeout for the XA transaction for inbound messages.
+Default:0
+
+PrefetchLow
+ Qpid specific -- TODO more explanation
+
+PrefetchHigh
+ Qpid specific -- TODO more explanation
+
+
+Administered Objects
+======================
+The JCA specification provides for administered objects. Ass per the specification, administered objects are
+JavaBeans that specific to the messaging provider. The Qpid JCA Resource Adapter provides two administered
+objects that can be used to configure JMS destinations and a specialized JMS Connection Factory respectively.
+Both these administered objects have properities to support configuration and deployment.
+
+QpidDestinationProxy
+====================
+ The QpidDestinationProxy allows a developer, deployer or adminstrator to create destinations (queues or topic) and
+ bind these destinations into JNDI. The following lists the properties applicable to the QpidDestinationProxy
+
+destinationType
+ The type of destination to create. Valid values are QUEUE or TOPIC.
+
+destinationAddress
+ The address string of the destination. Please see the Qpid Java JMS client documentation for valid values.
+
+QpidConnectionFactoryProxy
+ The QpidConnectionFactoryProxy allows for a non-JCA ConnectionFactory to be bound into the JNDI tree. This
+ ConnectionFactory can in turn be used outside of the application server. Typically a ConnectionFactory of
+ this sort is used by Swing or other two-tier clients not requiring JCA. The QpidConnectionFactoryProxy provides
+ one property
+
+connectionURL
+ This is the url used to configure the connection factory. Please see the Qpid Java Client documentation for
+ further details.
+
+
+Transaction Support
+===================
+The Qpid JCA Resource Adapter provides three levels of transaction support: XA, LocalTransactions and NoTransaction.
+Typical usage of the Qpid JCA Resource adapter implies the use of XA transactions, though there are certain scenarios
+where this is not preferred. Transaction support configuration is application server specific and as such, is explained
+in the corresponding documentation for each supported application server. However, there are two limitations with
+the Qpid JCA adapter at this time:
+
+1) Currently, the Qpid C++ broker does not support he use of XA within the context of clustered brokers. As such, if
+you are running in a cluster, you will need to configure the adapter to use LocalTransactions.
+
+2)XARecovery is currently not implemented. In the case of a system failure, in doubt transactions will have to be
+manually resolved by and administrator or otherwise qualified personnel.
+
+Conclusion
+==========
+The above documentation provides a general description of the capabilities and configuration properites of the
+Qpid JCA Resource Adapter. As previously mentioned, deploying an adapter in an application server requires
+specific descriptors and configuration mechanisms. Please see the accompanying doc for your application server
+for further details.
+
+
Added: qpid/trunk/qpid/java/jca/build.xml
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/jca/build.xml?rev=1220336&view=auto
==============================================================================
--- qpid/trunk/qpid/java/jca/build.xml (added)
+++ qpid/trunk/qpid/java/jca/build.xml Sun Dec 18 05:09:07 2011
@@ -0,0 +1,69 @@
+<!--
+ -
+ - Licensed to the Apache Software Foundation (ASF) under one
+ - or more contributor license agreements. See the NOTICE file
+ - distributed with this work for additional information
+ - regarding copyright ownership. The ASF licenses this file
+ - to you under the Apache License, Version 2.0 (the
+ - "License"); you may not use this file except in compliance
+ - with the License. You may obtain a copy of the License at
+ -
+ - http://www.apache.org/licenses/LICENSE-2.0
+ -
+ - Unless required by applicable law or agreed to in writing,
+ - software distributed under the License is distributed on an
+ - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ - KIND, either express or implied. See the License for the
+ - specific language governing permissions and limitations
+ - under the License.
+ -
+ -->
+<project name="Qpid JCA RA" default="build">
+
+ <property name="module.depends" value="common client"/>
+ <property name="module.name" value="ra"/>
+
+ <import file="../module.xml"/>
+
+ <property name="module.rar" value="${build.lib}/${project.name}-${module.name}-${project.version}.rar"/>
+ <property name="module.resources" value="src/main/resources"/>
+
+
+ <target name="rar" depends="jar">
+ <jar destfile="${module.rar}">
+ <fileset dir="${module.resources}">
+ <include name="**/*.xml"/>
+ </fileset>
+ <fileset dir="${build.lib}">
+ <include name="${project.name}-ra-${project.version}.jar"/>
+ <include name="${project.name}-client-${project.version}.jar"/>
+ <include name="${project.name}-common-${project.version}.jar"/>
+ </fileset>
+ </jar>
+ </target>
+
+ <!-- Create properties file for examples -->
+ <target name="example-properties-file">
+ <copy file="example/build-properties.xml.temp" tofile="example/build-properties.xml">
+ <filterset>
+ <filter token="project.version" value="${project.version}"/>
+ </filterset>
+ </copy>
+ </target>
+
+ <!-- Copy jars for standalone examples -->
+ <target name="example-jars">
+ <mkdir dir="example/lib"/>
+ <copy todir="example/lib">
+ <fileset dir="${build.lib}">
+ <include name="${project.name}-ra-${project.version}.jar"/>
+ <include name="${project.name}-client-${project.version}.jar"/>
+ <include name="${project.name}-common-${project.version}.jar"/>
+ </fileset>
+ </copy>
+ </target>
+
+ <target name="examples" depends="example-properties-file, example-jars"/>
+
+ <target name="build" depends="rar, examples"/>
+</project>
Added: qpid/trunk/qpid/java/jca/example/.gitignore
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/jca/example/.gitignore?rev=1220336&view=auto
==============================================================================
--- qpid/trunk/qpid/java/jca/example/.gitignore (added)
+++ qpid/trunk/qpid/java/jca/example/.gitignore Sun Dec 18 05:09:07 2011
@@ -0,0 +1,2 @@
+build/*
+lib/*
Added: qpid/trunk/qpid/java/jca/example/README.txt
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/jca/example/README.txt?rev=1220336&view=auto
==============================================================================
--- qpid/trunk/qpid/java/jca/example/README.txt (added)
+++ qpid/trunk/qpid/java/jca/example/README.txt Sun Dec 18 05:09:07 2011
@@ -0,0 +1,277 @@
+Qpid JCA Example
+
+Overview
+=======
+The Qpid JCA example provides a sample JEE application that demonstrates how to
+configure, install and run applications using the Qpid JCA adapter for EE
+connectivity and the Apache Qpid C++ Broker. This example code can be used as a
+convenient starting point for your own development and deployment
+efforts. Currently the example is supported on JBoss EAP 5.x, JBoss 6.x and
+Apache Geronimo 2.x.
+
+Example Components
+===================
+Currently the example application consists of the following components:
+
+Destinations and ConnectionFactories
+
+Any messaging application relies on destinations (queues or topics )
+in order to produce or consume messages.The Qpid JCA example provides
+five destinations by default:
+
+ HelloTopic
+ GoodByeTopic
+ HelloGoodByeTopic
+ HelloQueue
+ GoodByeQueue
+ QpidResponderQueue
+
+
+Similar to destinations, ConnectionFactories are a core component of both JMS
+and JCA. ConnectionFactories provide the necessary starting point to make a connection,
+establish a session and produce or consume (or both) messages from your JMS provider.
+
+The Qpid JCA example provides three connection factories by default:
+
+ QpidJMSXA
+ QpidJMS
+ QpidConnectionFactory
+
+Each of these ConnectionFactories varies in their capabilities and the context in which
+they should be used. These concepts will be explained later in this document.
+
+The deployment configuration for destinations, and ConnectionFactories varies by platform.
+In JBossEAP, the configuration mechanism is a *-ds.xml file. Geronimo 2.2.x has the notion
+of a deployment plan in the form of a geronimo-ra.xml file.
+
+The Qpid JCA Example provides both a qpid-jca-ds.xml file as well as a geronimo-ra.xml deployment
+plan. Both mechanisms provide a reasonable set of defaults to allow you to deploy the Qpid JCA
+adapter in either environment and get up and running quickly.
+
+EJB 3.x
+
+There are a six EJB 3.x components provided as part of the example.
+
+ QpidHelloSubscriberBean - MessageDrivenBean (MDB)
+ QpidGoodByeSubscriberBean - (MDB)
+ QpidHelloListenerBean - (MDB)
+ QpidGoodByeListenerBean - (MDB)
+ QpidJMSResponderBean - (MDB)
+ QpidTestBean - Stateless Session Bean (SLSB)
+
+Servlet 2.5
+
+ QpidTestServlet
+
+A sample EE 2.5 servlet is provided allowing testing from a browser versus a JNDI
+client
+
+EE EAR archive
+ An EAR wrapper for the ejb and web components.
+
+
+ An RMI client used to excercise the EJB 3.x component.
+
+Sample *-ds.xml file
+ A sample *-ds.xml file is provided to create destinations and ManagedConnectionFactories
+ in the JBoss environment.
+
+Sample geronimo-ra.xml
+ A sample geronimo-ra.xml file is provided to create destinations and ManagedConnectionFactories
+ in the Geronimo environment. This file is semantically equivalent to the JBoss *-ds.xml artifact.
+
+A build.xml file
+ An ant build.xml file to configure, install and deploy the aforementioned components.
+
+
+Requirements
+============
+
+Depending upon your target platform (eg. JBoss EAP or Geronimo) you will need to set either
+the JBOSS_HOME or GERONIMO_HOME property. By default, these properties are assumed to be
+set from your environment. This can be modified in the build.xml file.
+
+JBoss EAP 5.x, JBoss 6.x
+ To use the sample application you will need to have JBoss EAP 5.x or JBoss 6.x running.
+
+Geronimo 2.x
+ To use the sample application you will need to have Geronimo 2.x running.
+
+Apache Qpid Broker
+ To run the sample it is assumed you have an Apache Qpid C++ broker configured and running.
+ The example code assumes that the broker will run at localhost on port 5672. This can be
+ modified within the build.xml file if this does not suit your particular environment.
+
+
+Quickstart
+==========
+After satifsying the above requirements you are ready to deploy and run the example application.
+The steps to deploy and run in the supported application servers are largely the same, however,
+if you are targeting JBoss you will either need to modify the property in the example build.xml file
+
+
+ <property name="target.platform" value="geronimo"/>
+
+to be jboss
+
+ <property name="target.platform" value="jboss"/>
+
+or set this property via the command line.
+
+Example:
+
+ ant -Dtarget.platform=jboss <target>
+
+**Note**
+Any time you wish to change platforms, this property needs to be modified and a complete clean
+and rebuild needs to be performed.
+
+Step 1 -- Package, Deploy and configure the Qpid JCA adapter
+
+The core component of the example is the Qpid JCA adapter. The following lists the steps
+for the respective platforms
+
+**Note**
+
+Regardless of platform, if you are building the Qpid JCA adapter from source code
+you will need to use to package the RAR file via the Ant build system. To do this, from
+the example directory execute
+
+ ant deploy-rar
+
+This task packages the adapter and includes the necessary dependent jar files.
+
+
+JBoss
+ There are no additional steps to package the adapter for JBoss deployment. Simply copy
+ the qpid-ra-<qpid.version>rar to your JBoss deploy directory.
+
+ To configure the Qpid JCA Adapter in JBoss the *-ds.xml file mechanism is used. A sample
+ file is provided in the conf directory.
+
+ If the defaults are suitable, you can simply execute
+
+ ant deploy-ds
+
+ While any property can be modified in the qpid-jca-ds.xml file, typically you will want to
+ change the URL of the broker to which you are trying to connect. Rather than modifying
+ the qpid-jca-ds.xml file directly you can modify the
+
+ <property name="broker.url" value="amqp://anonymous:@client/test?brokerlist='tcp://localhost:5672?sasl_mechs='ANONYMOUS''"/>
+
+ line in the build.xml file. This will dynamically insert the broker.url value into the qpid-jca-ds.xml file.
+
+ Once this file is copied to your JBoss deploy directory and you received no exceptions, the adapter is now deployed, configured
+ and ready for use.
+
+Geronimo
+ By default, the Qpid JCA adapter ships with the geronimo-ra.xml deployment plan embedded
+ in the RAR file. This file is located in the META-INF directory alongside the ra.xml file.
+ By default the adapter is configured to access a broker located at localhost with the
+ default port of 5672. The ANONYMOUS security mechanism is also in use. If this is not
+ desirable, you have two approaches to configure the adapter.
+
+
+ 1) Extract the META-INF/ra.xml file from the RAR file, modify and recompress the RAR archive
+ with the updated contents.
+
+ 2) Use the example build system to package the adapter. The example build.xml file includes
+ a target
+
+ package-rar
+
+ that can be used to package the RAR file as well as allowing changes to the geronimo-ra.xml
+ file without having to extract the RAR file by hand. The conf/geronimo-ra.xml file is used
+ when you use the example build system.
+
+ While any property can be modified in the geronimo-ra.xml file, typically you will want to
+ change the URL of the broker to which you are trying to connect. Rather than modifying
+ the geronimo-ra.xml file directly you can modify the
+
+
+ <property name="broker.url" value="amqp://anonymous:@client/test?brokerlist='tcp://10.0.1.44:5672?sasl_mechs='ANONYMOUS''"/>
+
+ line in the build.xml file. This will dynamically insert the broker.url value into the geronimo-ra.xml file.
+
+ Once you have made your modifications you can execute
+
+
+ ant clean package-rar deploy-rar
+
+ Note, your Geronimo server must be running and your GERONIMO_HOME environment variable must be set. Barring any exceptions, the
+ adapter is now deployed and ready for use in Geronimo.
+
+
+Step 2 -- Deploy the application component(s).
+
+As previously mentioned, the adapter comes with a variety of EE components for use in your respective application server. You can choose to deploy
+these components individually, or as a single EAR archive. This document assumes that you will use the EAR to deploy and run the example.
+
+The command to package and deploy the EAR archive is the same across application servers. Executing the following command
+
+ant deploy-ear
+
+will, depending upon platform, package the EAR and deploy the archive in your respective environment. Once this step is executed, the example
+is ready for use.
+
+
+Step 3 -- Test the Example
+
+The Qpid JCA example provides an EJB application, as well as a Web application. Both can be used to test/run the example:
+
+EJB
+If you want to use the EJB application to test the example you can execute
+
+ ant run-client
+
+Running this command will perform a JNDI lookup of the SLSB in either JBoss or Geronimo and send a simple string to the SLSB. The SLSB will receive
+this string, construct a JMS message and place this message on a configured queue. The MDB will in turn receive this message and print the contents
+to the console.
+
+The main properties involved in this task are
+
+server.host
+jndi.context
+
+These vary depending upon which application server you are runnning. These can be modified to suit your environment. Looking at the run-client task you
+will see the following:
+
+
+ <sysproperty key="qpid.ejb.name" value="qpid-jcaex/QpidTestBean/remote"/>
+
+This is the JNDI name of the SLSB component and it varies by application server. Typically you do not have to change this. Also, the task supports another property
+
+
+ <sysproperty key="qpid.message" value="insert-value-here"/>
+
+You can set this property if you want to modify the message contents being routed through the system.
+
+Web
+The Qpid JCA Example comes with a web application. To access the web component, simply use a browser of your choice and navigate to
+
+http://<server-host-name>:<server-port>/qpid-jca-web/qpid
+
+where server-host and server-port are the host and port where you are running your application server. By default this is localhost:8080. Similar to the EJB component,
+the web application supports a few options:
+
+
+http://<server-host-name>:<server-port>/qpid-jca-web/qpid?messsage=<yourmessage>
+
+will allow you to customize the message contents that are routed through the system. By default, the Web application posts to a configured queue in the system. If you want to
+test XA functionality, or use an alternate approach, you can specify
+
+
+http://<server-host-name>:<server-port>/qpid-jca-web/qpid?useEJB=true
+
+instead of posting to a queue, the web application will use the local interface of the EJB component to send the message. This is functionally equivalent to running the
+RMI client.
+
+
+Summary
+=======
+While conceptually simple, the Qpid JCA example provides a majority of the component types and messaging patterns you are most likely to use your development efforts.
+With the Web and EJB components, you can experiment with various aspects of JCA as well as EE development in general using the Qpid Broker as your messaging provider.
+While this documentation highlights the major components and steps needed to take to get the example running, the possiblities for modifcation are numerous. You are
+encouraged to experiment with the example as you develop your own messaging applications.
+
+
Added: qpid/trunk/qpid/java/jca/example/build-geronimo-properties.xml
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/jca/example/build-geronimo-properties.xml?rev=1220336&view=auto
==============================================================================
--- qpid/trunk/qpid/java/jca/example/build-geronimo-properties.xml (added)
+++ qpid/trunk/qpid/java/jca/example/build-geronimo-properties.xml Sun Dec 18 05:09:07 2011
@@ -0,0 +1,169 @@
+<!--
+ -
+ - Licensed to the Apache Software Foundation (ASF) under one
+ - or more contributor license agreements. See the NOTICE file
+ - distributed with this work for additional information
+ - regarding copyright ownership. The ASF licenses this file
+ - to you under the Apache License, Version 2.0 (the
+ - "License"); you may not use this file except in compliance
+ - with the License. You may obtain a copy of the License at
+ -
+ - http://www.apache.org/licenses/LICENSE-2.0
+ -
+ - Unless required by applicable law or agreed to in writing,
+ - software distributed under the License is distributed on an
+ - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ - KIND, either express or implied. See the License for the
+ - specific language governing permissions and limitations
+ - under the License.
+ -
+ -->
+<project name="qpid-jca-example-geronimo-properties" basedir="." default="">
+
+ <property name="geronimo.jndi.scheme" value="name"/>
+ <property name="qpid.xacf.jndi.name" value="jca:/qpid.jca/QpidJCAAdapter/JCAManagedConnectionFactory/QpidJMSXA"/>
+ <property name="qpid.cf.jndi.name" value="jca:/qpid.jca/QpidJCAAdapter/JCAAdminObject/QpidConnectionFactory"/>
+ <property name="qpid.hello.queue.jndi.name" value="jca:/qpid.jca/QpidJCAAdapter/JCAAdminObject/HelloQueue"/>
+ <property name="qpid.goodbye.queue.jndi.name" value="jca:/qpid.jca/QpidJCAAdapter/JCAAdminObject/GoodByeQueue"/>
+ <property name="qpid.responder.queue.jndi.name" value="jca:/qpid.jca/QpidJCAAdapter/JCAAdminObject/ResponderQueue"/>
+ <property name="qpid.hello.topic.jndi.name" value="jca:/qpid.jca/QpidJCAAdapter/JCAAdminObject/HelloTopic"/>
+ <property name="qpid.goodbye.topic.jndi.name" value="jca:/qpid.jca/QpidJCAAdapter/JCAAdminObject/GoodByeTopic"/>
+ <property name="qpid.ejb.jndi.name" value="name="QpidTestEJB""/>
+ <property name="qpid.ejb.name" value="QpidTestBeanRemote"/>
+
+ <property name="jndi.context" value="org.openejb.client.RemoteInitialContextFactory"/>
+ <property name="server.host" value="ejbd://localhost:4201"/>
+ <property name="geronimo.home" location="${env.GERONIMO_HOME}"/>
+ <property name="geronimo.user" value="system"/>
+ <property name="geronimo.password" value="manager"/>
+
+ <property name="geronimo.rar.group.id" value="qpid.jca"/>
+ <property name="geronimo.rar.artifact.id" value="QpidJCAAdapter"/>
+ <property name="geronimo.rar.version" value="1.0"/>
+ <property name="geronimo.rar.type" value="rar"/>
+ <property name="geronimo.rar.id" value="${geronimo.rar.group.id}/${geronimo.rar.artifact.id}/${geronimo.rar.version}/${geronimo.rar.type}"/>
+
+ <property name="geronimo.ejb.group.id" value="qpid.jca.example"/>
+ <property name="geronimo.ejb.artifact.id" value="QpidJCAEJBExample"/>
+ <property name="geronimo.ejb.version" value="1.0"/>
+ <property name="geronimo.ejb.type" value="car"/>
+ <property name="geronimo.ejb.id" value="${geronimo.ejb.group.id}/${geronimo.ejb.artifact.id}/${geronimo.ejb.version}/${geronimo.ejb.type}"/>
+
+ <property name="geronimo.war.group.id" value="qpid.jca.example"/>
+ <property name="geronimo.war.artifact.id" value="QpidJCAWebExample"/>
+ <property name="geronimo.war.version" value="1.0"/>
+ <property name="geronimo.war.type" value="war"/>
+ <property name="geronimo.war.id" value="${geronimo.war.group.id}/${geronimo.war.artifact.id}/${geronimo.war.version}/${geronimo.war.type}"/>
+
+ <property name="geronimo.ear.group.id" value="qpid.jca.example"/>
+ <property name="geronimo.ear.artifact.id" value="QpidJCAEARExample"/>
+ <property name="geronimo.ear.version" value="1.0"/>
+ <property name="geronimo.ear.type" value="ear"/>
+ <property name="geronimo.ear.id" value="${geronimo.ear.group.id}/${geronimo.ear.artifact.id}/${geronimo.ear.version}/${geronimo.ear.type}"/>
+
+ <property name="geronimo.rar.plan" value="${gen.dir}/geronimo-ra.xml"/>
+ <property name="geronimo.ear.plan" value="${gen.dir}/geronimo-application.xml"/>
+
+ <path id="compile.classpath">
+ <fileset dir="${geronimo.home}/repository/org/apache/geronimo/specs">
+ <include name="geronimo-jms_1.1_spec/1.1.1/geronimo-jms_1.1_spec-1.1.1.jar"/>
+ <include name="geronimo-servlet_2.5_spec/1.2/geronimo-servlet_2.5_spec-1.2.jar"/>
+ <include name="geronimo-ejb_3.0_spec/1.0.1/geronimo-ejb_3.0_spec-1.0.1.jar"/>
+ <include name="geronimo-jta_1.1_spec/1.1.1/geronimo-jta_1.1_spec-1.1.1.jar"/>
+ </fileset>
+ <fileset dir="${geronimo.home}/lib/">
+ <include name="slf4j-api-*.jar"/>
+ </fileset>
+ </path>
+
+ <path id="run.classpath">
+ <fileset dir="${lib.dir}">
+ <include name="qpid-ra-*.jar"/>
+ <include name="qpid-client-*.jar"/>
+ <include name="qpid-common-*.jar"/>
+ </fileset>
+ <fileset dir="${geronimo.home}/repository/org/apache/geronimo/specs">
+ <include name="geronimo-j2ee-connector_1.5_spec/2.0.0/geronimo-j2ee-connector_1.5_spec-2.0.0.jar"/>
+ <include name="geronimo-jms_1.1_spec/1.1.1/geronimo-jms_1.1_spec-1.1.1.jar"/>
+ <include name="geronimo-servlet_2.5_spec/1.2/geronimo-servlet_2.5_spec-1.2.jar"/>
+ <include name="geronimo-ejb_3.0_spec/1.0.1/geronimo-ejb_3.0_spec-1.0.1.jar"/>
+ <include name="geronimo-jta_1.1_spec/1.1.1/geronimo-jta_1.1_spec-1.1.1.jar"/>
+ </fileset>
+ <fileset dir="${geronimo.home}/lib/">
+ <include name="slf4j-api-*.jar"/>
+ <include name="slf4j-log4j*-*.jar"/>
+ <include name="log4j-*.jar"/>
+ </fileset>
+ <fileset dir="${geronimo.home}/repository/org/apache/openejb/openejb-client/3.1.4/"/>
+ </path>
+
+ <filterset id="extra.filterset">
+ <filter token="geronimo.ejb.group.id" value="${geronimo.ejb.group.id}"/>
+ <filter token="geronimo.ejb.artifact.id" value="${geronimo.ejb.artifact.id}"/>
+ <filter token="geronimo.ejb.version" value="${geronimo.ejb.version}"/>
+ <filter token="geronimo.ejb.type" value="${geronimo.ejb.type}"/>
+ <filter token="geronimo.war.group.id" value="${geronimo.war.group.id}"/>
+ <filter token="geronimo.war.artifact.id" value="${geronimo.war.artifact.id}"/>
+ <filter token="geronimo.war.version" value="${geronimo.war.version}"/>
+ <filter token="geronimo.war.type" value="${geronimo.war.type}"/>
+ <filter token="geronimo.ear.group.id" value="${geronimo.ear.group.id}"/>
+ <filter token="geronimo.ear.artifact.id" value="${geronimo.ear.artifact.id}"/>
+ <filter token="geronimo.ear.version" value="${geronimo.ear.version}"/>
+ <filter token="geronimo.ear.type" value="${geronimo.ear.type}"/>
+ </filterset>
+
+ <macrodef name="geronimo">
+ <attribute name="user" default="${geronimo.user}"/>
+ <attribute name="password" default="${geronimo.password}"/>
+ <attribute name="action" default="list-modules"/>
+ <attribute name="module"/>
+ <attribute name="plan" default=""/>
+ <sequential>
+ <exec executable="${geronimo.home}/bin/deploy.sh">
+ <arg line="-u @{user} -p @{password} @{action} @{module} @{plan}"/>
+ </exec>
+ </sequential>
+ </macrodef>
+
+ <!-- Deployment is target specific so is included here -->
+ <target name="deploy-rar" depends="generate" description="Deploy the RAR file.">
+ <geronimo action="deploy" module="${qpid.jca.dir}/${rar.name}" plan="${geronimo.rar.plan}"/>
+ </target>
+
+ <target name="undeploy-rar" description="Undeploys the RAR deployment.">
+ <geronimo action="undeploy" module="${geronimo.rar.id}"/>
+ </target>
+
+ <target name="start-rar" description="Starts the RAR deployment in the Geronimo environment.">
+ <geronimo action="start" module="${geronimo.rar.id}"/>
+ </target>
+
+ <target name="stop-rar" description="Stops the RAR deployment in the Geronimo environment.">
+ <geronimo action="stop" module="${geronimo.rar.id}"/>
+ </target>
+
+ <target name="restart-rar" description="Restarts the RAR deployment in the Geronimo environment.">
+ <geronimo action="restart" module="${geronimo.rar.id}"/>
+ </target>
+
+ <target name="deploy-ear" depends="package-ear" description="Deploys the EAR archive.">
+ <geronimo action="deploy" module="${build.dir}/${ear.name}" plan="${geronimo.ear.plan}"/>
+ </target>
+
+ <target name="undeploy-ear" description="Undeployes the EAR archive.">
+ <geronimo action="undeploy" module="${geronimo.ear.id}"/>
+ </target>
+
+ <target name="start-ear" description="Starts the EAR deployment in the Geronimo environment.">
+ <geronimo action="start" module="${geronimo.ear.id}"/>
+ </target>
+
+ <target name="stop-ear" description="Stops the EAR deployment in the Geronimo environment.">
+ <geronimo action="stop" module="${geronimo.ear.id}"/>
+ </target>
+
+ <target name="restart-ear" description="Restarts the EAR deployment in the Geronimo environment.">
+ <geronimo action="restart" module="${geronimo.ear.id}"/>
+ </target>
+
+</project>
Added: qpid/trunk/qpid/java/jca/example/build-jboss-properties.xml
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/jca/example/build-jboss-properties.xml?rev=1220336&view=auto
==============================================================================
--- qpid/trunk/qpid/java/jca/example/build-jboss-properties.xml (added)
+++ qpid/trunk/qpid/java/jca/example/build-jboss-properties.xml Sun Dec 18 05:09:07 2011
@@ -0,0 +1,115 @@
+<!--
+ -
+ - Licensed to the Apache Software Foundation (ASF) under one
+ - or more contributor license agreements. See the NOTICE file
+ - distributed with this work for additional information
+ - regarding copyright ownership. The ASF licenses this file
+ - to you under the Apache License, Version 2.0 (the
+ - "License"); you may not use this file except in compliance
+ - with the License. You may obtain a copy of the License at
+ -
+ - http://www.apache.org/licenses/LICENSE-2.0
+ -
+ - Unless required by applicable law or agreed to in writing,
+ - software distributed under the License is distributed on an
+ - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ - KIND, either express or implied. See the License for the
+ - specific language governing permissions and limitations
+ - under the License.
+ -
+-->
+<project name="qpid-jca-example-jboss-properties" basedir="." default="">
+
+ <property name="jboss.jndi.scheme" value="mappedName"/>
+ <property name="qpid.xacf.jndi.name" value="java:QpidJMSXA"/>
+ <property name="qpid.cf.jndi.name" value="QpidConnectionFactory"/>
+ <property name="qpid.hello.topic.jndi.name" value="HelloTopic"/>
+ <property name="qpid.goodbye.topic.jndi.name" value="GoodByeTopic"/>
+ <property name="qpid.hello.queue.jndi.name" value="HelloQueue"/>
+ <property name="qpid.goodbye.queue.jndi.name" value="GoodByeQueue"/>
+ <property name="qpid.responder.queue.jndi.name" value="QpidResponderQueue"/>
+ <property name="qpid.ejb.jndi.name" value="mappedName="QpidTestEJB""/>
+ <property name="qpid.ejb.ref.name" value="QpidTestBean/local"/>
+ <property name="qpid.ejb.name" value="qpid-jcaex/QpidTestBean/remote"/>
+
+ <property name="jndi.context" value="org.jnp.interfaces.NamingContextFactory"/>
+ <property name="server.host" value="jnp://localhost:1099"/>
+
+ <property name="jboss.home" location="${env.JBOSS_HOME}"/>
+ <property name="jboss.server" value="default"/>
+ <property name="jboss.deploy" location="${jboss.home}/server/${jboss.server}/deploy"/>
+ <property name="jboss.client" location="${jboss.home}/client"/>
+
+ <path id="compile.classpath">
+ <fileset dir="${jboss.client}">
+ <!-- JBoss 5-->
+ <include name="jboss-javaee.jar"/>
+
+ <!-- JBoss 6 -->
+ <include name="jboss-servlet-api_3.0_spec.jar"/>
+ <include name="jboss-jms-api_1.1_spec.jar"/>
+ <include name="jboss-ejb-api_3.1_spec.jar"/>
+ <include name="jboss-transaction-api_1.1_spec.jar"/>
+
+ <!-- Common to JBoss 5/6 -->
+ <include name="slf4j-api.jar"/>
+ </fileset>
+
+ <!-- JBoss 5 -->
+ <fileset dir="${jboss.home}/common/lib">
+ <include name="servlet-api.jar"/>
+ </fileset>
+ </path>
+
+ <path id="run.classpath">
+ <fileset dir="${lib.dir}">
+ <include name="qpid-ra-*.jar"/>
+ <include name="qpid-client-*.jar"/>
+ <include name="qpid-common-*.jar"/>
+ </fileset>
+ <fileset dir="${jboss.client}">
+ <!-- Shortcut to get it working!-->
+ <include name="jbossall-client.jar"/>
+ </fileset>
+ </path>
+
+ <filterset id="extra.filterset"/>
+
+ <!-- Deployment is target specific so is included here -->
+ <target name="deploy-rar" description="Deploy the RAR file.">
+ <copy todir="${jboss.deploy}" overwrite="true">
+ <fileset dir="${qpid.jca.dir}">
+ <include name="${rar.name}"/>
+ </fileset>
+ </copy>
+ </target>
+
+ <target name="undeploy-rar" description="Undeploys the RAR deployment.">
+ <delete file="${jboss.deploy}/${rar.name}"/>
+ </target>
+
+ <target name="deploy-ear" depends="package-ear" description="Deploys the EAR archive.">
+ <copy todir="${jboss.deploy}" overwrite="true">
+ <fileset dir="${build.dir}">
+ <include name="${ear.name}"/>
+ </fileset>
+ </copy>
+ </target>
+
+ <target name="undeploy-ear" description="Undeploys the EAR archive.">
+ <delete file="${jboss.deploy}/${ear.name}"/>
+ </target>
+
+ <target name="deploy-ds" depends="generate" description="Deploys the ds.xml file to the JBoss environment.">
+ <copy todir="${jboss.deploy}" overwrite="true">
+ <fileset dir="${gen.dir}">
+ <include name="qpid-jca-ds.xml"/>
+ </fileset>
+ </copy>
+ </target>
+
+ <target name="undeploy-ds" description="Undeploys the ds.xml file from the JBoss environment.">
+ <delete file="${jboss.deploy}/qpid-jca-ds.xml"/>
+ </target>
+
+</project>
Added: qpid/trunk/qpid/java/jca/example/build-properties.xml
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/jca/example/build-properties.xml?rev=1220336&view=auto
==============================================================================
--- qpid/trunk/qpid/java/jca/example/build-properties.xml (added)
+++ qpid/trunk/qpid/java/jca/example/build-properties.xml Sun Dec 18 05:09:07 2011
@@ -0,0 +1,23 @@
+<!--
+ -
+ - Licensed to the Apache Software Foundation (ASF) under one
+ - or more contributor license agreements. See the NOTICE file
+ - distributed with this work for additional information
+ - regarding copyright ownership. The ASF licenses this file
+ - to you under the Apache License, Version 2.0 (the
+ - "License"); you may not use this file except in compliance
+ - with the License. You may obtain a copy of the License at
+ -
+ - http://www.apache.org/licenses/LICENSE-2.0
+ -
+ - Unless required by applicable law or agreed to in writing,
+ - software distributed under the License is distributed on an
+ - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ - KIND, either express or implied. See the License for the
+ - specific language governing permissions and limitations
+ - under the License.
+ -
+ -->
+<project name="qpid-jca-example-build-properties" basedir="." default="">
+ <property name="qpid.ver" value="0.15"/>
+</project>
Added: qpid/trunk/qpid/java/jca/example/build-properties.xml.temp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/jca/example/build-properties.xml.temp?rev=1220336&view=auto
==============================================================================
--- qpid/trunk/qpid/java/jca/example/build-properties.xml.temp (added)
+++ qpid/trunk/qpid/java/jca/example/build-properties.xml.temp Sun Dec 18 05:09:07 2011
@@ -0,0 +1,23 @@
+<!--
+ -
+ - Licensed to the Apache Software Foundation (ASF) under one
+ - or more contributor license agreements. See the NOTICE file
+ - distributed with this work for additional information
+ - regarding copyright ownership. The ASF licenses this file
+ - to you under the Apache License, Version 2.0 (the
+ - "License"); you may not use this file except in compliance
+ - with the License. You may obtain a copy of the License at
+ -
+ - http://www.apache.org/licenses/LICENSE-2.0
+ -
+ - Unless required by applicable law or agreed to in writing,
+ - software distributed under the License is distributed on an
+ - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ - KIND, either express or implied. See the License for the
+ - specific language governing permissions and limitations
+ - under the License.
+ -
+ -->
+<project name="qpid-jca-example-build-properties" basedir="." default="">
+ <property name="qpid.ver" value="@project.version@"/>
+</project>
Added: qpid/trunk/qpid/java/jca/example/build.xml
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/jca/example/build.xml?rev=1220336&view=auto
==============================================================================
--- qpid/trunk/qpid/java/jca/example/build.xml (added)
+++ qpid/trunk/qpid/java/jca/example/build.xml Sun Dec 18 05:09:07 2011
@@ -0,0 +1,204 @@
+<!--
+ -
+ - Licensed to the Apache Software Foundation (ASF) under one
+ - or more contributor license agreements. See the NOTICE file
+ - distributed with this work for additional information
+ - regarding copyright ownership. The ASF licenses this file
+ - to you under the Apache License, Version 2.0 (the
+ - "License"); you may not use this file except in compliance
+ - with the License. You may obtain a copy of the License at
+ -
+ - http://www.apache.org/licenses/LICENSE-2.0
+ -
+ - Unless required by applicable law or agreed to in writing,
+ - software distributed under the License is distributed on an
+ - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ - KIND, either express or implied. See the License for the
+ - specific language governing permissions and limitations
+ - under the License.
+ -
+ -->
+<project name="qpid-jca-example" default="help" basedir="">
+
+ <!-- Valid target platforms are currently geronimo & jboss -->
+ <property name="target.platform" value="geronimo"/>
+
+ <!-- Change to BURL for older syntax support -->
+ <property name="qpid.dest_syntax" value="ADDR"/>
+
+ <!-- Broker specific properties. By default in the adapter we use localhost here you an override this with host specific info-->
+ <property name="broker.address" value="localhost"/>
+
+ <!-- Properties controlling running sample standalone client -->
+ <property name="client.use.ejb" value="false"/> <!-- uses JNDI/JMS or JNDI/RMI -->
+ <property name="client.message" value="Hello Qpid World"/>
+ <property name="client.message.count" value="1"/>
+ <property name="client.use.topic" value="false"/> <!-- Use topic/queue -->
+ <property name="client.say.goodbye" value="false"/>
+
+ <!-- Pull in environment vars as properties -->
+ <property environment="env"/>
+
+ <!-- QPID version property -->
+ <import file="${basedir}/build-properties.xml"/>
+
+ <import file="${basedir}/qpid-jca-example-properties.xml"/>
+
+ <!-- Target specific properties/targets -->
+ <import file="${basedir}/build-${target.platform}-properties.xml"/>
+
+ <macrodef name="compile">
+ <attribute name="classpath"/>
+ <sequential>
+ <javac srcdir="${gen.dir}"
+ destdir="${build.classes.dir}"
+ classpathref="@{classpath}"
+ debug="true" optimize="false"/>
+ </sequential>
+ </macrodef>
+
+ <echo message="Using Qpid version ${qpid.ver}"/>
+ <echo message="Building for platform ${target.platform}"/>
+ <echo message="Broker url is currently set to ${broker.url}"/>
+ <echo message="Qpid Destination Syntax is ${qpid.dest_syntax}"/>
+
+ <target name="init">
+ <mkdir dir="${build.classes.dir}"/>
+ <mkdir dir="${gen.dir}"/>
+ <mkdir dir="${log.dir}"/>
+ </target>
+
+ <target name="generate" depends="init">
+ <copy todir="${gen.dir}" overwrite="true">
+ <fileset dir="${conf.dir}"/>
+ <filterset>
+ <filter token="rar.name" value="${rar.name}"/>
+ <filter token="ejb.name" value="${ejb.name}"/>
+ <filter token="war.name" value="${war.name}"/>
+
+ <filter token="broker.url" value="${broker.url}"/>
+
+ <filter token="qpid.hello.topic.dest.address" value="${qpid.hello.topic.dest.address}"/>
+ <filter token="qpid.goodbye.topic.dest.address" value="${qpid.goodbye.topic.dest.address}"/>
+ <filter token="qpid.hellogoodbye.topic.dest.address" value="${qpid.hellogoodbye.topic.dest.address}"/>
+ <filter token="qpid.hello.queue.dest.address" value="${qpid.hello.queue.dest.address}"/>
+ <filter token="qpid.goodbye.queue.dest.address" value="${qpid.goodbye.queue.dest.address}"/>
+ <filter token="qpid.responder.queue.dest.address" value="${qpid.responder.queue.dest.address}"/>
+
+ </filterset>
+ <filterset refid="extra.filterset"/>
+ </copy>
+ <copy todir="${gen.dir}">
+ <fileset dir="${src.dir}"/>
+ <filterset>
+ <filter token="rar.name" value="${rar.name}"/>
+ <filter token="broker.url" value="${broker.url}"/>
+ <filter token="jndi.scheme" value="${jndi.scheme}"/>
+ <filter token="qpid.xacf.jndi.name" value="${qpid.xacf.jndi.name}"/>
+ <filter token="qpid.hello.topic.jndi.name" value="${qpid.hello.topic.jndi.name}"/>
+ <filter token="qpid.goodbye.topic.jndi.name" value="${qpid.goodbye.topic.jndi.name}"/>
+ <filter token="qpid.hello.queue.jndi.name" value="${qpid.hello.queue.jndi.name}"/>
+ <filter token="qpid.goodbye.queue.jndi.name" value="${qpid.goodbye.queue.jndi.name}"/>
+ <filter token="qpid.responder.queue.jndi.name" value="${qpid.responder.queue.jndi.name}"/>
+ <filter token="qpid.ejb.jndi.name" value="${qpid.ejb.jndi.name}"/>
+ </filterset>
+ </copy>
+ </target>
+
+ <target name="compile" depends="generate" description="Compiles the source files for the Qpid JCA example">
+ <compile classpath="compile.classpath"/>
+ </target>
+
+ <target name="package-war" depends="compile" description="Packages the WAR file for deployment.">
+ <war destfile="${build.dir}/${war.name}" webxml="${gen.dir}/web.xml">
+ <classes dir="${build.classes.dir}">
+ <include name="org/apache/qpid/jca/example/web/**"/>
+ </classes>
+ <webinf dir="${gen.dir}">
+ <include name="jboss-web.xml"/>
+ </webinf>
+ </war>
+ </target>
+
+ <target name="package-ejb" depends="compile" description="Packages the EJB archive for deployment.">
+ <jar destfile="${build.dir}/${ejb.name}" basedir="${build.classes.dir}">
+ <include name="org/apache/qpid/jca/example/ejb/**/*.class"/>
+ <metainf dir="${gen.dir}">
+ <include name="jboss.xml"/>
+ <include name="ejb-jar.xml"/>
+ </metainf>
+ </jar>
+ </target>
+
+ <target name="package-ear" depends="generate, package-war, package-ejb" description="Packages the EAR archive for deployment.">
+ <jar destfile="${build.dir}/${ear.name}" basedir="${build.dir}">
+ <include name="*.war"/>
+ <include name="*.jar"/>
+ <metainf dir="${gen.dir}">
+ <include name="application.xml"/>
+ </metainf>
+ </jar>
+ </target>
+
+ <target name="run-client" depends="compile" description="Runs the RMI client.">
+ <java classname="org.apache.qpid.jca.example.client.QpidTestClient">
+ <classpath>
+ <pathelement path="${build.classes.dir}"/>
+ <path refid="run.classpath"/>
+ </classpath>
+ <sysproperty key="java.naming.factory.initial" value="${jndi.context}"/>
+ <sysproperty key="java.naming.provider.url" value="${server.host}"/>
+ <sysproperty key="qpid.ejb.name" value="${qpid.ejb.name}"/>
+ <sysproperty key="qpid.cf.name" value="${qpid.cf.jndi.name}"/>
+ <sysproperty key="qpid.dest_syntax" value="${qpid.dest_syntax}"/>
+ <sysproperty key="qpid.dest.name" value="${qpid.hello.queue.jndi.name}"/>
+ <sysproperty key="log4j.configuration" value="file://${conf.dir}/log4j.properties"/>
+
+ <sysproperty key="qpid.message" value="${client.message}"/>
+ <sysproperty key="message.count" value="${client.message.count}"/>
+ <sysproperty key="use.topic" value="${client.use.topic}"/>
+ <sysproperty key="use.ejb" value="${client.use.ejb}"/>
+ <sysproperty key="say.goodbye" value="${client.say.goodbye}"/>
+ </java>
+ </target>
+
+ <target name="run-reqresp" depends="compile">
+ <java classname="org.apache.qpid.jca.example.client.QpidRequestResponseClient">
+ <classpath>
+ <pathelement path="${build.classes.dir}"/>
+ <path refid="run.classpath"/>
+ </classpath>
+ <sysproperty key="java.naming.factory.initial" value="${jndi.context}"/>
+ <sysproperty key="java.naming.provider.url" value="${server.host}"/>
+ <sysproperty key="qpid.message" value="Hello, World"/>
+ <sysproperty key="message.count" value="1"/>
+ <sysproperty key="thread.count" value="5"/>
+ <sysproperty key="qpid.cf.name" value="${qpid.cf.jndi.name}"/>
+ <sysproperty key="qpid.dest.name" value="${qpid.responder.queue.jndi.name}"/>
+ <sysproperty key="log4j.configuration" value="file://${conf.dir}/log4j.properties"/>
+ <sysproperty key="qpid.dest_syntax" value="${qpid.dest_syntax}"/>
+ </java>
+ </target>
+
+ <target name="clean" description="Deletes the build directory and all related files.">
+ <delete dir="${build.dir}"/>
+ </target>
+
+ <target name="help">
+ <echo>
+
+ ant compile
+ This will compile all the source code for the Qpid JCA example project to the ${build.classes.dir} directory.
+
+ ant deploy-rar deploy-ear
+ Deploys a particular component which could be rar, ear (or ds for JBoss)
+
+ ant undeploy-ear undeploy-rar
+ Undeploys a particular component which could be rar, ear (or ds for JBoss)
+
+ ant run-client run-reqresp
+ Runs the RMI/thin client or the request-response client example
+ </echo>
+ </target>
+
+</project>
Added: qpid/trunk/qpid/java/jca/example/conf/application.xml
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/jca/example/conf/application.xml?rev=1220336&view=auto
==============================================================================
--- qpid/trunk/qpid/java/jca/example/conf/application.xml (added)
+++ qpid/trunk/qpid/java/jca/example/conf/application.xml Sun Dec 18 05:09:07 2011
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ -
+ - Licensed to the Apache Software Foundation (ASF) under one
+ - or more contributor license agreements. See the NOTICE file
+ - distributed with this work for additional information
+ - regarding copyright ownership. The ASF licenses this file
+ - to you under the Apache License, Version 2.0 (the
+ - "License"); you may not use this file except in compliance
+ - with the License. You may obtain a copy of the License at
+ -
+ - http://www.apache.org/licenses/LICENSE-2.0
+ -
+ - Unless required by applicable law or agreed to in writing,
+ - software distributed under the License is distributed on an
+ - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ - KIND, either express or implied. See the License for the
+ - specific language governing permissions and limitations
+ - under the License.
+ -
+ -->
+<application xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="5"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/application_5.xsd">
+
+ <module>
+ <ejb>@ejb.name@</ejb>
+ </module>
+
+ <module>
+ <web>
+ <web-uri>@war.name@</web-uri>
+ <context-root>/qpid-jca-web</context-root>
+ </web>
+ </module>
+
+</application>
+
Added: qpid/trunk/qpid/java/jca/example/conf/ejb-jar.xml
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/jca/example/conf/ejb-jar.xml?rev=1220336&view=auto
==============================================================================
--- qpid/trunk/qpid/java/jca/example/conf/ejb-jar.xml (added)
+++ qpid/trunk/qpid/java/jca/example/conf/ejb-jar.xml Sun Dec 18 05:09:07 2011
@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+ -
+ - Licensed to the Apache Software Foundation (ASF) under one
+ - or more contributor license agreements. See the NOTICE file
+ - distributed with this work for additional information
+ - regarding copyright ownership. The ASF licenses this file
+ - to you under the Apache License, Version 2.0 (the
+ - "License"); you may not use this file except in compliance
+ - with the License. You may obtain a copy of the License at
+ -
+ - http://www.apache.org/licenses/LICENSE-2.0
+ -
+ - Unless required by applicable law or agreed to in writing,
+ - software distributed under the License is distributed on an
+ - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ - KIND, either express or implied. See the License for the
+ - specific language governing permissions and limitations
+ - under the License.
+ -
+ -->
+<ejb-jar xmlns="http://java.sun.com/xml/ns/javaee" version="3.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
+ http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd">
+
+ <enterprise-beans>
+ <message-driven>
+ <ejb-name>QpidHelloListenerBean</ejb-name>
+ <resource-ref>
+ <res-ref-name>QpidJMSXA</res-ref-name>
+ <res-type>javax.jms.ConnectionFactory</res-type>
+ <res-auth>Container</res-auth>
+ <res-sharing-scope>Shareable</res-sharing-scope>
+ </resource-ref>
+ </message-driven>
+ <message-driven>
+ <ejb-name>QpidHelloSubscriberBean</ejb-name>
+ <resource-ref>
+ <res-ref-name>QpidJMSXA</res-ref-name>
+ <res-type>javax.jms.ConnectionFactory</res-type>
+ <res-auth>Container</res-auth>
+ <res-sharing-scope>Shareable</res-sharing-scope>
+ </resource-ref>
+ </message-driven>
+ <message-driven>
+ <ejb-name>QpidJMSResponderBean</ejb-name>
+ <resource-ref>
+ <res-ref-name>QpidJMSXA</res-ref-name>
+ <res-type>javax.jms.ConnectionFactory</res-type>
+ <res-auth>Container</res-auth>
+ <res-sharing-scope>Shareable</res-sharing-scope>
+ </resource-ref>
+ </message-driven>
+ <session>
+ <ejb-name>QpidTestBean</ejb-name>
+ <resource-ref>
+ <res-ref-name>QpidJMSXA</res-ref-name>
+ <res-type>javax.jms.ConnectionFactory</res-type>
+ <res-auth>Container</res-auth>
+ <res-sharing-scope>Shareable</res-sharing-scope>
+ </resource-ref>
+ </session>
+ </enterprise-beans>
+
+
+</ejb-jar>
---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project: http://qpid.apache.org
Use/Interact: mailto:commits-subscribe@qpid.apache.org