From 0a0baee45ebcff44635907d457c4ff6810b09c87 Mon Sep 17 00:00:00 2001 From: Alex Rudyy Date: Wed, 15 Apr 2015 09:47:28 +0000 Subject: QPID-6481: Move java source tree to top level git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1673693 13f79535-47bb-0310-9956-ffa450edef68 --- qpid/java/jca/example/.gitignore | 23 -- qpid/java/jca/example/README-EXAMPLE.txt | 258 ------------- qpid/java/jca/example/README-GERONIMO.txt | 87 ----- qpid/java/jca/example/README-GLASSFISH.txt | 102 ----- qpid/java/jca/example/README-JBOSS.txt | 125 ------ qpid/java/jca/example/README-JBOSS7.txt | 147 ------- .../java/jca/example/build-geronimo-properties.xml | 196 ---------- .../jca/example/build-glassfish-properties.xml | 137 ------- qpid/java/jca/example/build-jboss-properties.xml | 122 ------ qpid/java/jca/example/build-jboss7-properties.xml | 132 ------- qpid/java/jca/example/build-properties.xml.temp | 24 -- qpid/java/jca/example/build.xml | 206 ---------- qpid/java/jca/example/conf/application.xml | 37 -- qpid/java/jca/example/conf/ejb-jar.xml | 40 -- .../java/jca/example/conf/geronimo-application.xml | 121 ------ qpid/java/jca/example/conf/geronimo-ra.xml | 141 ------- qpid/java/jca/example/conf/glassfish-ejb-jar.xml | 90 ----- qpid/java/jca/example/conf/glassfish-resources.xml | 94 ----- qpid/java/jca/example/conf/glassfish-web.xml | 46 --- .../jca/example/conf/jboss-ejb-client.properties | 12 - qpid/java/jca/example/conf/jboss-web.xml | 39 -- qpid/java/jca/example/conf/jboss.xml | 52 --- qpid/java/jca/example/conf/log4j.properties | 36 -- qpid/java/jca/example/conf/qpid-jca-ds.xml | 126 ------ qpid/java/jca/example/conf/qpid-standalone.xml | 422 --------------------- qpid/java/jca/example/conf/web.xml | 50 --- .../jca/example/qpid-jca-example-properties.xml | 84 ---- .../example/client/QpidRequestResponseClient.java | 159 -------- .../qpid/jca/example/client/QpidTestClient.java | 134 ------- .../qpid/jca/example/client/QpidTestUtil.java | 52 --- .../jca/example/ejb/QpidGoodByeListenerBean.java | 65 ---- .../jca/example/ejb/QpidGoodByeSubscriberBean.java | 66 ---- .../jca/example/ejb/QpidHelloListenerBean.java | 98 ----- .../jca/example/ejb/QpidHelloSubscriberBean.java | 99 ----- .../qpid/jca/example/ejb/QpidJMSResponderBean.java | 104 ----- .../org/apache/qpid/jca/example/ejb/QpidTest.java | 30 -- .../apache/qpid/jca/example/ejb/QpidTestBean.java | 104 ----- .../apache/qpid/jca/example/ejb/QpidTestLocal.java | 29 -- .../qpid/jca/example/ejb/QpidTestRemote.java | 29 -- .../org/apache/qpid/jca/example/ejb/QpidUtil.java | 90 ----- .../example/web/QpidRequestResponseServlet.java | 283 -------------- .../qpid/jca/example/web/QpidTestServlet.java | 229 ----------- 42 files changed, 4520 deletions(-) delete mode 100644 qpid/java/jca/example/.gitignore delete mode 100644 qpid/java/jca/example/README-EXAMPLE.txt delete mode 100644 qpid/java/jca/example/README-GERONIMO.txt delete mode 100644 qpid/java/jca/example/README-GLASSFISH.txt delete mode 100644 qpid/java/jca/example/README-JBOSS.txt delete mode 100644 qpid/java/jca/example/README-JBOSS7.txt delete mode 100644 qpid/java/jca/example/build-geronimo-properties.xml delete mode 100644 qpid/java/jca/example/build-glassfish-properties.xml delete mode 100644 qpid/java/jca/example/build-jboss-properties.xml delete mode 100644 qpid/java/jca/example/build-jboss7-properties.xml delete mode 100644 qpid/java/jca/example/build-properties.xml.temp delete mode 100644 qpid/java/jca/example/build.xml delete mode 100644 qpid/java/jca/example/conf/application.xml delete mode 100644 qpid/java/jca/example/conf/ejb-jar.xml delete mode 100644 qpid/java/jca/example/conf/geronimo-application.xml delete mode 100644 qpid/java/jca/example/conf/geronimo-ra.xml delete mode 100644 qpid/java/jca/example/conf/glassfish-ejb-jar.xml delete mode 100644 qpid/java/jca/example/conf/glassfish-resources.xml delete mode 100644 qpid/java/jca/example/conf/glassfish-web.xml delete mode 100644 qpid/java/jca/example/conf/jboss-ejb-client.properties delete mode 100644 qpid/java/jca/example/conf/jboss-web.xml delete mode 100644 qpid/java/jca/example/conf/jboss.xml delete mode 100644 qpid/java/jca/example/conf/log4j.properties delete mode 100644 qpid/java/jca/example/conf/qpid-jca-ds.xml delete mode 100644 qpid/java/jca/example/conf/qpid-standalone.xml delete mode 100644 qpid/java/jca/example/conf/web.xml delete mode 100644 qpid/java/jca/example/qpid-jca-example-properties.xml delete mode 100644 qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/client/QpidRequestResponseClient.java delete mode 100644 qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/client/QpidTestClient.java delete mode 100644 qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/client/QpidTestUtil.java delete mode 100644 qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/ejb/QpidGoodByeListenerBean.java delete mode 100644 qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/ejb/QpidGoodByeSubscriberBean.java delete mode 100644 qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/ejb/QpidHelloListenerBean.java delete mode 100644 qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/ejb/QpidHelloSubscriberBean.java delete mode 100644 qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/ejb/QpidJMSResponderBean.java delete mode 100644 qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/ejb/QpidTest.java delete mode 100644 qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/ejb/QpidTestBean.java delete mode 100644 qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/ejb/QpidTestLocal.java delete mode 100644 qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/ejb/QpidTestRemote.java delete mode 100644 qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/ejb/QpidUtil.java delete mode 100644 qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/web/QpidRequestResponseServlet.java delete mode 100644 qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/web/QpidTestServlet.java (limited to 'qpid/java/jca/example') diff --git a/qpid/java/jca/example/.gitignore b/qpid/java/jca/example/.gitignore deleted file mode 100644 index 624fd61581..0000000000 --- a/qpid/java/jca/example/.gitignore +++ /dev/null @@ -1,23 +0,0 @@ -# -# 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. -# - -build/* -lib/* -*.swp -build-properties.xml diff --git a/qpid/java/jca/example/README-EXAMPLE.txt b/qpid/java/jca/example/README-EXAMPLE.txt deleted file mode 100644 index 7ff331116c..0000000000 --- a/qpid/java/jca/example/README-EXAMPLE.txt +++ /dev/null @@ -1,258 +0,0 @@ -# -# 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. -# -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 JEE -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. - -Example Components -=================== -Currently the example application consists of the following components: - -Destinations -============ -Any messaging application relies on destinations (queues or topics ) -in order to produce or consume messages.The Qpid JCA example provides -the following destinations: - - HelloTopic - GoodByeTopic - HelloQueue - GoodByeQueue - QpidRequestQueue - QpidResponseQueue - -Each destination is configured for the respective application server in which -the examples will be run. Generally the example application allows for sending -messages to a Hello. Depending on a configuration option, once -a message is received by the Hello component, the Hello component can also be -sent to a GoodBye component. - -The QpidRequest/Response destinations provide the destinations for the -request/reponse messaging pattern. - - -ConnectionFactories -=================== -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. By default, the Qpid JCA examples use the QpidJMSXA connection factory -which provides for full XA transaction support. The QpidJMS connection factory provides a -local JMS transaction CF and is currently deprecated, though it has been maintained for -backwards compatibility. The QpidConnectionFactory is a specialized ConnectionFactory designed -to be used outside of a JEE application server. This CF has been provided to support non-managed -clients that want to use the JNDI facilities of JEE. - -The deployment configuration for destinations, and ConnectionFactories varies by JEE platform. -Please see the application server specific documentation for specific instructions. - -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) - -Generally, the name of the EJB component corresponds to the aforementioned destinations -listed above in the consumption of messages. - -QpidTestServlet -A sample EE 2.5 servlet is provided allowing testing from a browser versus a RMI or JMS -based client. - -QpidTestClient -A Java based client allowing for both RMI or JMS access to the sample application. RMI or -JMS access is based on configuration options. - -QpidRequestResponseClient -A Java based client allowing for a request/response application. - -EE EAR archive - An EAR wrapper for the ejb and web components. - -A build.xml file - An ant build.xml file to configure, install and deploy the aforementioned components. - -Requirements -============ -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. The broker -address can be modified in the build-properties.xml file. - -Examples -=============== -Using the Qpid JCA examples is the same regardless of preferred JEE application server. -The provided clients and supported options are listed below. - -QpidTestClient -============== -As previously mentioned, the Qpid JCA example provides an RMI/JMS Java client to test -the application. Executing the command - -ant-run client - -will execute the QpidTestClient client with the default options. - -QpidTestClient Options - -client.use.ejb (build.xml) -Setting this value to false will result in the QpidTestClient using JMS to send messages to -the configured destination. -Default:true - -client.message -The text content of the JMS message sent to the configured destination. -Default: Hello Qpid World! - -client.message.count -The number of messages that will be sent to the configured destionation. -Default: 1 - -client.use.topic -Setting this value to true will send messages to HelloTopic versus HelloQueue. -Default:false - -client.say.goodbye -Setting this value to true will cause the listener on the Hello Queue/Topic to send a -message to the GoodBye Queue/Topic -Default:false - - -QpidRequestResponseClient -========================= -Similar to the QpidTestClient, the QpidRequestResponseClient is a Java based application that allows for -sending messages to a destination. The QpidRequestResponseClient also provides the capability for the -application to listen for a response. Executing the command - -ant run-reqresp - -will run the application with the default options. - -QpidRequestResponseClient Options - -QpidTestServlet -=============== -Similar to the QpidTestClient application, the Qpid JCA examples also provides a JEE Servlet to test and run the -application. This Servlet can be used as an alternative, or in conjunction with the Java application. The Servlet -can be reached via the following URL: - -http://:/qpid-jca-web/qpid - -where server-host and server-port are the host and port where you are running your application server. - -QpidTestServlet Options - -The QpidTestServlet options can be configured by appending certain values to the above URL. These values are -listed below and generally correspond, both in name and purpose, to the Java application configuration options. - -message -The text content of the JMS message sent to the configured destination. -Default: Hello World! - -useEJB -Setting this value to true will result in the QpidTestServlet using the QpidTestBean SLSB to -send the message to the configured destination. By default the QpidTestServlet uses JMS. -Default:false - -count -The number of messages that will be sent to the configured destionation. -Default: 1 - -useTopic -Setting this value to true will send messages to HelloTopic versus HelloQueue. -Default:false - -sayGoodBye -Setting this value to true will cause the listener on the Hello Queue/Topic to send a -message to the GoodBye Queue/Topic -Default:false - -useXA -Setting this value to true will cause the QpidTestServlet to do all activity within the -context of an XA transaction. -Default:false - -useTX -Setting this value to true will cause the QpidTestServlet to do all activity within the -context of a JMS transation. -Default:false - - -Note, the useXA and useTX are mutually exclusive. Setting both to true, the QpidTestServlet -will choose XA over a JMS transaction. - -QpidRequestResponseServlet -========================== -Similar to the QpidRequestResponseClient application, the Qpid JCA examples also provides a JEE Servlet -to execute the request/response type messaging pattern. The Servlet can be reached via the following url: - -http://:/qpid-jca-web/qpid-reqresp - -where server-host and server-port are the host and port where you are running your application server. - -QpidRequestResponseServlet Options - -message -The text content of the JMS message sent to the configured destination. -Default: Hello World! - -count -The number of messages that will be sent to the configured destionation. -Default: 1 - -useXA -Setting this value to true will cause the QpidTestServlet to do all activity within the -context of an XA transaction. -Default:false - -Summary -======= -While conceptually simple, the Qpid JCA examples provide 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 work -to develop your own messaging applications. - -***Note*** -Due to the way Ant handle XML escape characters in the Copy task, if you are attempting to deploy the -examples to a clustered broker configuration, you will need to modify the resultant XML configuration -file to remove the '&' character and replace it with the & character. This file varies by app -server. Please see the app server specific documentation for your platform for further details. - diff --git a/qpid/java/jca/example/README-GERONIMO.txt b/qpid/java/jca/example/README-GERONIMO.txt deleted file mode 100644 index 51cf2c4e9c..0000000000 --- a/qpid/java/jca/example/README-GERONIMO.txt +++ /dev/null @@ -1,87 +0,0 @@ -# -# 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. -# -Qpid JCA Example - Apache Geronimo 2.x - -Overview -======== -This document explains the steps required to configure and -deploy the Qpid JCA examples for the Apache Geronimo environment. -General information can be found in the README.txt file. - -The Apache Geronimo environment provides two methods for deploying -JEE application components: the web-based administration console and the -command line based deployment environment. This document only explains -the command line environment. Please see the Apache Geronimo 2.x -documentation for the web-based console. - -Requirements -============ -In order to deploy the Qpid JCA adapter, as well as the example application, -the GERONIMO_HOME environemnt variable must be set. The environment variable -should point to the root of your Apache Geronimo 2.x install directory. - -In order to automatically deploy the Qpid JCA Adapter, the QPID_JCA_HOME -environment variable needs to be set. The environment variable should point -to the directory which contains the Qpid JCA Adapter. If building from the -source tree, by default this can be found at - -QPID_ROOT/java/build/lib - -If installing from RPM or other binary distribution, this can vary by platform. - -Prior to deploying any application component, the Apache Geronimo application -should be started and available for requests. - - -Deploy the Qpid JCA Adapter -============================== -Once the above requirements are satisfied the command - -ant deploy-rar - -will attempt to use the Apache Geronimo deployer to install the Qpid JCA -adapter into the Apache Geronimo environment. Any errors will be reported -back to the client for further examination. Once the above command executes -successfully, the Qpid JCA adapter has been deployed, configured and is ready -for use. - - -Deploy the Qpid JCA Examples -============================ -After the Qpid JCA adapter is deployed, executing the command - -ant deploy-ear - -will attempt to use the Apache Geronimo deploy to install the Qpid JCA -example EAR into the Apache Geronimo environment. Any errors will be reported -back to the client for further examination. Once the above command executes -successfully, the Qpid JCA example application is deployed, configured and ready -for use. - -The build-geronimo-properties.xml file contain Apache Geronimo specific values -and Ant targets that can be used to suit your development requirements. - -The README.txt file in this directory provides the necessary instructions for using the Qpid JCA -adapter and example application. - - - - - - diff --git a/qpid/java/jca/example/README-GLASSFISH.txt b/qpid/java/jca/example/README-GLASSFISH.txt deleted file mode 100644 index ccbc257c04..0000000000 --- a/qpid/java/jca/example/README-GLASSFISH.txt +++ /dev/null @@ -1,102 +0,0 @@ -# -# 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. -# -Qpid JCA Example - Glassfish 3.x - -Overview -======== -This document explains the steps required to configure and -deploy the Qpid JCA examples for the Glassfish 3.x environment. - -The Glassfish environment provides two methods for deploying -JEE application components: the web-based administration console -and the asadmin command line utility. This document only explains -the command line utility. Please see the Glassfish 3.x -documentation for the web-based console approach. - -Requirements -============ -In order to deploy the Qpid JCA adapter, as well as the example application, -the GLASSFISH_HOME environemnt variable must be set. The environment variable -should point to the root of your Glassfish installation. - -In order to automatically deploy the Qpid JCA Adapter from the build system, -the QPID_JCA_HOME environment variable needs to be set. -The environment variable should point to the directory which contains the -Qpid JCA Adapter. If building from the source tree, by default this can be found at - -QPID_ROOT/java/build/lib - -If installing from RPM or other binary distribution, this can vary by OS platform. - -The Qpid JCA examples assume the Apache Geronimo application server as the default -target platform. This can be modified in two ways: - -1) Modify the build.xml file and change the target.platform property: - -Example: - - - - -2) Set the target.platform property via the command line: - -Example: - -ant -Dtarget.platform=glassfish - -Note, if you choose the second method, all command line invocations must include -the target.platform variable. For the remainder of this document, we will assume -the second approach. - -Prior to deploying any application component, the Glassfish application server -should be started and available for requests. - - -Deploy and configure the Qpid JCA Adapter -============================== -Once the above requirements are satisfied the command - -ant -Dtarget.platform=glassfish deploy-rar - -will attempt to invoke the asadmin utility to deploy and configure the -Qpid JCA adapter. Once this step completes succesfully the Qpid JCA adapter -is deployed, configured and ready for use. - - -Deploy the Qpid JCA Examples -============================ -After the Qpid JCA adapter is deployed, executing the command - -ant -Dtarget.platform=glassfish deploy-ear - -will attempt to deploy the Qpid JCA example EAR into the Glassfish environment. -Once the above command executes successfully, the Qpid JCA example application -is deployed, configured and ready for use. - -The build-glassfish-properties.xml file contains Glassfish specific configuration options -and Ant targets that can be used to suit your development requirements. Executing - -ant -Dtarget.platform=glassfish -p - -will list the appropriate targets and provide a simple description for each. - -The README.txt file in this directory provides the necessary instructions for using -the Qpid JCA adapter and example application which is consistent across all supported -JEE platforms. - diff --git a/qpid/java/jca/example/README-JBOSS.txt b/qpid/java/jca/example/README-JBOSS.txt deleted file mode 100644 index ffc750a078..0000000000 --- a/qpid/java/jca/example/README-JBOSS.txt +++ /dev/null @@ -1,125 +0,0 @@ -# -# 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. -# -Qpid JCA Example - JBoss EAP 5.x, JBoss 5.x, 6.x - -Overview -======== -This document explains the steps required to configure and -deploy the Qpid JCA examples for both the JBoss EAP 5.x -environment as well as the JBoss 5.x/6.x community edition -(herafter simply referred to as JBoss). General information -can be found in the README.txt file. - -Requirements -============ -In order to deploy the Qpid JCA adapter, as well as the example application, -the JBOSS_HOME environemnt variable must be set. The environment variable -should point to the root of your JBoss installation. - -In order to automatically deploy the Qpid JCA Adapter from the build system, -the QPID_JCA_HOME environment variable needs to be set. -The environment variable should point to the directory which contains the -Qpid JCA Adapter. If building from the source tree, by default this can be found at - -QPID_ROOT/java/build/lib - -If installing from RPM or other binary distribution, this can vary by platform. - -If you do not want to use the build system to deploy the Qpid JCA adapter, you -can simply copy the qpid-ra-0..rar file to the - -JBOSS_HOME/server//deploy - -directory. By default, the example assumes the JBoss 'default' server profile will -be used. This can be modified in the build-jboss-properties.xml file. - -The Qpid JCA examples assume the Apache Geronimo application server as the default -target platform. This can be modified in two ways: - -1) Modify the build.xml file and change the target.platform property: - -Example: - - - - -2) Set the target.platform property via the command line: - -Example: - -ant -Dtarget.platform=jboss - -Note, if you choose the second method, all command line invocations must include -the target.platform. For the remainder of this document, we will assume the second -approach. - -Prior to deploying any application component, the JBoss application server -should be started and available for requests. - - - - -Deploy and configure the Qpid JCA Adapter -============================== -Once the above requirements are satisfied the command - -ant -Dtarget.platform= jboss deploy-rar - -will copy the Qpid JCA adapter to JBoss server deploy directory. - -To configure JCA resources in the JBoss environment, the *-ds.xml configuration file -is used. The command - -ant -Dtarget.platform=jboss deploy-ds - -will accomplish this task using the defaults provided. Any errors will be reported -in the - -JBOSS_HOME/server//log/server.log - -file or on the console. - -Once the above commands execute successfully, the Qpid JCA adapter is deployed, configured -and ready for use. - - -Deploy the Qpid JCA Examples -============================ -After the Qpid JCA adapter is deployed, executing the command - -ant -Dtarget.platform=jboss deploy-ear - -will attempt to deploy the Qpid JCA example EAR into the JBoss environment. -Once the above command executes successfully, the Qpid JCA example application is deployed, -configured and ready for use. - -Note, if making modifications to either the Qpid JCA adapter or *-ds.xml configuration, the -EAR archive will need to be redeployed. This is a JBoss JCA issue and not due to the Qpid JCA -adapter. - -The build-jboss-properties.xml file contains JBoss specific configuration options -and Ant targets that can be used to suit your development requirements. - -The README.txt file in this directory provides the necessary instructions for using the Qpid JCA -adapter and example application which is consistent across all supported JEE platforms. - - - - - diff --git a/qpid/java/jca/example/README-JBOSS7.txt b/qpid/java/jca/example/README-JBOSS7.txt deleted file mode 100644 index ae12078cd0..0000000000 --- a/qpid/java/jca/example/README-JBOSS7.txt +++ /dev/null @@ -1,147 +0,0 @@ -# -# 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. -# -Qpid JCA Example - JBoss AS 7 - -Overview -======== -This document explains the steps required to configure and -deploy the Qpid JCA examples for the JBoss AS 7 environment. -General information about the example can be found in the -README-EXAMPLE.txt file. - -Requirements -============ -In order to deploy the Qpid JCA adapter, as well as the example application, -the JBOSS_HOME environemnt variable must be set. The environment variable -should point to the root of your JBoss installation. - -In order to automatically deploy the Qpid JCA Adapter from the build system, -the QPID_JCA_HOME environment variable needs to be set. -The environment variable should point to the directory which contains the -Qpid JCA Adapter. If building from the source tree, by default this can be found at - -QPID_ROOT/java/build/lib - -If installing from RPM or other binary distribution, this can vary by platform. - -If you do not want to use the build system to deploy the Qpid JCA adapter, you -can simply copy the qpid-ra-0..rar file to the - -JBOSS_HOME//deployments - -directory. By default, the example assumes the JBoss 'standalone' server profile will -be used. This can be modified in the build-jboss7-properties.xml file. - -The Qpid JCA examples assume the Apache Geronimo application server as the default -target platform. This can be modified in two ways: - -1) Modify the build.xml file and change the target.platform property: - -Example: - - - - -2) Set the target.platform property via the command line: - -Example: - -ant -Dtarget.platform=jboss7 - -Note, if you choose the second method, all command line invocations must include -the target.platform. For the remainder of this document, we will assume the second -approach. - -As opposed to earlier versions of JBoss AS, JBoss AS 7 uses a different approach for -configuring JCA resources. JBoss AS 7 provides support for different server profiles -each configured through an XML based configuration file. In order to configure the -Qpid JCA adapter for the JBoss AS 7 environment, a complete XML configuration has been -provided in the conf/ directory as conf/qpid-standalone.xml. In order to configure this -file execute the following command: - -ant -Dtarget.platform=jboss7 generate - -The result of this command will produce a file build/gen/qpid-standalone.xml file. To -deploy this file copy the file to: - -JBOSS_HOME/standalone/configuration - -Prior to deploying any application component, the JBoss application server -should be started and available for requests. In order to use the qpid-standalone.xml -file generated in the previous step, when starting JBoss AS 7 invoke the following: - -./standalone.sh -c qpid-standalone.xml - - -Note, the above method completely replaces the default messaging provider in JBoss AS 7. -Currently there is no way to have two separate messaging providers deployed within the same -server. It assumed that this will be addressed in a later version of JBoss AS 7. - - -Deploy the Qpid JCA Adapter -============================== -Once the above requirements are satisfied the command - -ant -Dtarget.platform=jboss7 deploy-rar - -will copy the Qpid JCA adapter to JBoss AS 7 server deploy directory. - -Once the above commands execute successfully, the Qpid JCA adapter is deployed, configured -and ready for use. - - -Deploy the Qpid JCA Examples -============================ -After the Qpid JCA adapter is deployed, executing the command - -ant -Dtarget.platform=jboss7 deploy-ear - -will attempt to deploy the Qpid JCA example EAR into the JBoss AS 7 environment. -Once the above command executes successfully, the Qpid JCA example application is -deployed, configured and ready for use. - -If you choose to use the standalone 'thin' EJB3 client example, you will need to configure -the security realm for your application. Please see - -http://www.mastertheboss.com/jboss-as-7/jboss-as-7-remote-ejb-client-tutorial - -on instructions for how to do this in the JBoss7 environment. Once this is done you -will need to change the conf/jboss-ejb-client.properties file to use your recently -configured username/password for your application: - -remote.connection.default.username=CHANGEME -remote.connection.default.password=CHANGEME - -Modify these properties to use the username/password you configured in the -above step. - -Currently there is an issue with 'hot-deployment' in the JBoss AS 7 environment. -If you need to re-deploy the EAR file, restarting JBoss AS 7 is required. - -The build-jboss7-properties.xml file contains JBoss AS 7 specific configuration options -and Apache Ant targets that can be used to suit your development requirements. - -The README.txt file in this directory provides the necessary instructions for using the Qpid JCA -adapter and example application which is consistent across all supported JEE platforms. - - - - - - diff --git a/qpid/java/jca/example/build-geronimo-properties.xml b/qpid/java/jca/example/build-geronimo-properties.xml deleted file mode 100644 index 3c84b7634a..0000000000 --- a/qpid/java/jca/example/build-geronimo-properties.xml +++ /dev/null @@ -1,196 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/qpid/java/jca/example/build-glassfish-properties.xml b/qpid/java/jca/example/build-glassfish-properties.xml deleted file mode 100644 index 90561e70cf..0000000000 --- a/qpid/java/jca/example/build-glassfish-properties.xml +++ /dev/null @@ -1,137 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/qpid/java/jca/example/build-jboss-properties.xml b/qpid/java/jca/example/build-jboss-properties.xml deleted file mode 100644 index f79793d9c4..0000000000 --- a/qpid/java/jca/example/build-jboss-properties.xml +++ /dev/null @@ -1,122 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/qpid/java/jca/example/build-jboss7-properties.xml b/qpid/java/jca/example/build-jboss7-properties.xml deleted file mode 100644 index e24719ba8e..0000000000 --- a/qpid/java/jca/example/build-jboss7-properties.xml +++ /dev/null @@ -1,132 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/qpid/java/jca/example/build-properties.xml.temp b/qpid/java/jca/example/build-properties.xml.temp deleted file mode 100644 index 1d62db9af5..0000000000 --- a/qpid/java/jca/example/build-properties.xml.temp +++ /dev/null @@ -1,24 +0,0 @@ - - - - - diff --git a/qpid/java/jca/example/build.xml b/qpid/java/jca/example/build.xml deleted file mode 100644 index 7a75f9abc6..0000000000 --- a/qpid/java/jca/example/build.xml +++ /dev/null @@ -1,206 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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 - - - - diff --git a/qpid/java/jca/example/conf/application.xml b/qpid/java/jca/example/conf/application.xml deleted file mode 100644 index d181bcda67..0000000000 --- a/qpid/java/jca/example/conf/application.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - @ejb.name@ - - - - - @war.name@ - /qpid-jca-web - - - - - diff --git a/qpid/java/jca/example/conf/ejb-jar.xml b/qpid/java/jca/example/conf/ejb-jar.xml deleted file mode 100644 index a1aa859d96..0000000000 --- a/qpid/java/jca/example/conf/ejb-jar.xml +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - - QpidHelloListenerBean - - - QpidHelloSubscriberBean - - - QpidJMSResponderBean - - - - - diff --git a/qpid/java/jca/example/conf/geronimo-application.xml b/qpid/java/jca/example/conf/geronimo-application.xml deleted file mode 100644 index 384f6b2e75..0000000000 --- a/qpid/java/jca/example/conf/geronimo-application.xml +++ /dev/null @@ -1,121 +0,0 @@ - - - - - - - @geronimo.ear.group.id@ - @geronimo.ear.artifact.id@ - @geronimo.ear.version@ - @geronimo.ear.type@ - - - - - - qpid-jcaex-web.war - - - - - @geronimo.war.group.id@ - @geronimo.war.artifact.id@ - @geronimo.war.version@ - @geronimo.war.type@ - - - - - qpid.jca - QpidJCAAdapter - 1.0 - rar - - - - - /qpid-jca-web - - - - - - - qpid-jcaex-ejb.jar - - - - - @geronimo.ejb.group.id@ - @geronimo.ejb.artifact.id@ - @geronimo.ejb.version@ - @geronimo.ejb.type@ - - - - - qpid.jca - QpidJCAAdapter - 1.0 - rar - - - - - - - QpidHelloListenerBean - - QpidResourceAdapter - - - - QpidGoodByeListenerBean - - QpidResourceAdapter - - - - QpidHelloSubscriberBean - - QpidResourceAdapter - - - - QpidGoodByeSubscriberBean - - QpidResourceAdapter - - - - QpidJMSResponderBean - - QpidResourceAdapter - - - - - - diff --git a/qpid/java/jca/example/conf/geronimo-ra.xml b/qpid/java/jca/example/conf/geronimo-ra.xml deleted file mode 100644 index a7511f647f..0000000000 --- a/qpid/java/jca/example/conf/geronimo-ra.xml +++ /dev/null @@ -1,141 +0,0 @@ - - - - - - qpid.jca - QpidJCAAdapter - 1.0 - rar - - - - - QpidResourceAdapter - client_id - org.apache.qpid.ra.tm.GeronimoTransactionManagerLocator - getTransactionManager - - true - - DefaultWorkManager - - - - - org.apache.qpid.ra.QpidRAConnectionFactory - - QpidJMSXA - javax.jms.QueueConnectionFactory - javax.jms.TopicConnectionFactory - @broker.url@ - - - - - 20 - 0 - - - - - - - - - org.apache.qpid.ra.admin.QpidTopic - org.apache.qpid.ra.admin.QpidTopicImpl - - Dummy - amq.topic - - - - org.apache.qpid.ra.admin.QpidTopic - org.apache.qpid.ra.admin.QpidTopicImpl - - HelloTopic - @qpid.hello.topic.dest.address@ - - - - org.apache.qpid.ra.admin.QpidTopic - org.apache.qpid.ra.admin.QpidTopicImpl - - GoodByeTopic - @qpid.goodbye.topic.dest.address@ - - - - - org.apache.qpid.ra.admin.QpidQueue - org.apache.qpid.ra.admin.QpidQueueImpl - - HelloQueue - @qpid.hello.queue.dest.address@ - - - - org.apache.qpid.ra.admin.QpidQueue - org.apache.qpid.ra.admin.QpidQueueImpl - - GoodByeQueue - @qpid.goodbye.queue.dest.address@ - - - - org.apache.qpid.ra.admin.QpidQueue - org.apache.qpid.ra.admin.QpidQueueImpl - - RequestQueue - @qpid.request.queue.dest.address@ - - - - org.apache.qpid.ra.admin.QpidQueue - org.apache.qpid.ra.admin.QpidQueueImpl - - ResponseQueue - @qpid.response.queue.dest.address@ - - - - javax.jms.ConnectionFactory - org.apache.qpid.ra.admin.QpidConnectionFactoryProxy - - QpidConnectionFactory - @broker.url@ - - - - - diff --git a/qpid/java/jca/example/conf/glassfish-ejb-jar.xml b/qpid/java/jca/example/conf/glassfish-ejb-jar.xml deleted file mode 100644 index 3416e2b4ae..0000000000 --- a/qpid/java/jca/example/conf/glassfish-ejb-jar.xml +++ /dev/null @@ -1,90 +0,0 @@ - - - - - - - QpidHelloListenerBean - HelloQueue - - qpid-ra-@rar.ver@ - - - QpidJMSXA - QpidJMSXA - - - - QpidGoodByeListenerBean - GoodByeQueue - - qpid-ra-@rar.ver@ - - - QpidJMSXA - QpidJMSXA - - - - QpidHelloSubscriberBean - HelloTopic - - qpid-ra-@rar.ver@ - - - QpidJMSXA - QpidJMSXA - - - - QpidGoodByeSubscriberBean - GoodByeTopic - - qpid-ra-@rar.ver@ - - - QpidJMSXA - QpidJMSXA - - - - QpidJMSResponderBean - QpidResponderQueue - - qpid-ra-@rar.ver@ - - - QpidJMSXA - QpidJMSXA - - - - QpidTestBean - QpidTestBean - - QpidJMSXA - QpidJMSXA - - - - - diff --git a/qpid/java/jca/example/conf/glassfish-resources.xml b/qpid/java/jca/example/conf/glassfish-resources.xml deleted file mode 100644 index ce1fc5b764..0000000000 --- a/qpid/java/jca/example/conf/glassfish-resources.xml +++ /dev/null @@ -1,94 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/qpid/java/jca/example/conf/glassfish-web.xml b/qpid/java/jca/example/conf/glassfish-web.xml deleted file mode 100644 index 3aa49c01b1..0000000000 --- a/qpid/java/jca/example/conf/glassfish-web.xml +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - qpid-jca-web - - - QpidTestBean - QpidTestBean - - - - QpidJMSXA - QpidJMSXA - - - HelloQueue - HelloQueue - - - HelloTopic - HelloTopic - - - - diff --git a/qpid/java/jca/example/conf/jboss-ejb-client.properties b/qpid/java/jca/example/conf/jboss-ejb-client.properties deleted file mode 100644 index 9b62e6794c..0000000000 --- a/qpid/java/jca/example/conf/jboss-ejb-client.properties +++ /dev/null @@ -1,12 +0,0 @@ -endpoint.name=client-endpoint -remote.connectionprovider.create.options.org.xnio.Options.SSL_ENABLED=false - -remote.connections=default - -remote.connection.default.host=localhost -remote.connection.default.port = 4447 -remote.connection.default.connect.options.org.xnio.Options.SASL_POLICY_NOANONYMOUS=false - -remote.connection.default.username=CHANGEME -remote.connection.default.password=CHANGEME - diff --git a/qpid/java/jca/example/conf/jboss-web.xml b/qpid/java/jca/example/conf/jboss-web.xml deleted file mode 100644 index 32a97d1c35..0000000000 --- a/qpid/java/jca/example/conf/jboss-web.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - - - QpidJMSXA - javax.jms.ConnectionFactory - java:/QpidJMSXA - - - QpidJMS - javax.jms.ConnectionFactory - java:/QpidJMS - - - QpidTestBean - qpid-jcaex/QpidTestBean/local - - qpid-jca-web - - diff --git a/qpid/java/jca/example/conf/jboss.xml b/qpid/java/jca/example/conf/jboss.xml deleted file mode 100644 index 0f22797789..0000000000 --- a/qpid/java/jca/example/conf/jboss.xml +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - - QpidHelloListenerBean - @rar.name@ - - - QpidGoodByeListenerBean - @rar.name@ - - - QpidHelloSubscriberBean - @rar.name@ - - - QpidGoodByeSubscriberBean - @rar.name@ - - - QpidJMSResponderBean - @rar.name@ - - - - diff --git a/qpid/java/jca/example/conf/log4j.properties b/qpid/java/jca/example/conf/log4j.properties deleted file mode 100644 index 1139ab9e85..0000000000 --- a/qpid/java/jca/example/conf/log4j.properties +++ /dev/null @@ -1,36 +0,0 @@ -# -# 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. -# -log4j.rootLogger=DEBUG, CONSOLE, FILE - -#Console Appender -log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender -log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout -log4j.appender.CONSOLE.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n - -#File Appender -log4j.appender.FILE=org.apache.log4j.FileAppender -log4j.appender.FILE.File=./build/log/qpid-jca-example.log -log4j.appender.FILE.layout=org.apache.log4j.PatternLayout -log4j.appender.FILE.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n - -log4j.logger.org.jboss=WARN -log4j.logger.org.jnp.interfaces=WARN -log4j.logger.org.apache.qpid=ERROR -log4j.logger.org.apache.qpid.jca.example=DEBUG - diff --git a/qpid/java/jca/example/conf/qpid-jca-ds.xml b/qpid/java/jca/example/conf/qpid-jca-ds.xml deleted file mode 100644 index ad75876808..0000000000 --- a/qpid/java/jca/example/conf/qpid-jca-ds.xml +++ /dev/null @@ -1,126 +0,0 @@ - - - - - - HelloTopic - jboss.jca:service=RARDeployment,name='@rar.name@' - org.apache.qpid.ra.admin.QpidTopic - - DestinationAddress=@qpid.hello.topic.dest.address@ - - - - - GoodByeTopic - jboss.jca:service=RARDeployment,name='@rar.name@' - org.apache.qpid.ra.admin.QpidTopic - - DestinationAddress=@qpid.goodbye.topic.dest.address@ - - - - - HelloGoodByeTopic - jboss.jca:service=RARDeployment,name='@rar.name@' - org.apache.qpid.ra.admin.QpidTopic - - DestinationAddress=@qpid.hellogoodbye.topic.dest.address@ - - - - - HelloQueue - jboss.jca:service=RARDeployment,name='@rar.name@' - org.apache.qpid.ra.admin.QpidQueue - - DestinationAddress=@qpid.hello.queue.dest.address@ - - - - - GoodByeQueue - jboss.jca:service=RARDeployment,name='@rar.name@' - org.apache.qpid.ra.admin.QpidQueue - - DestinationAddress=@qpid.goodbye.queue.dest.address@ - - - - - QpidRequestQueue - jboss.jca:service=RARDeployment,name='@rar.name@' - org.apache.qpid.ra.admin.QpidQueue - - DestinationAddress=@qpid.request.queue.dest.address@ - - - - - QpidResponseQueue - jboss.jca:service=RARDeployment,name='@rar.name@' - org.apache.qpid.ra.admin.QpidQueue - - DestinationAddress=@qpid.response.queue.dest.address@ - - - - QpidConnectionFactory - jboss.jca:service=RARDeployment,name='@rar.name@' - javax.jms.ConnectionFactory - - ConnectionURL=@broker.url@ - - - - - - QpidJMS - @rar.name@ - - true - @broker.url@ - javax.jms.Queue - org.apache.qpid.ra.QpidRAConnectionFactory - 20 - - - - - QpidJMSXA - - @rar.name@ - @broker.url@ - javax.jms.Queue - org.apache.qpid.ra.QpidRAConnectionFactory - 20 - - - diff --git a/qpid/java/jca/example/conf/qpid-standalone.xml b/qpid/java/jca/example/conf/qpid-standalone.xml deleted file mode 100644 index 2e22bd3f99..0000000000 --- a/qpid/java/jca/example/conf/qpid-standalone.xml +++ /dev/null @@ -1,422 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - jdbc:h2:mem:test;DB_CLOSE_DELAY=-1 - - - h2 - - - - sa - - - sa - - - - - - - org.h2.jdbcx.JdbcDataSource - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1 - - - - - - - - - - - - - - - - - - - - - @rar.name@ - - - XATransaction - - - @broker.url@ - - - org.apache.qpid.ra.tm.JBoss7TransactionManagerLocator - - - getTm - - - - - @broker.url@ - - - javax.jms.Queue - - - - - - - @broker.url@ - - - - - @qpid.hello.topic.dest.address@ - - - - - @qpid.goodbye.topic.dest.address@ - - - - - @qpid.goodbye.queue.dest.address@ - - - - - @qpid.hello.queue.dest.address@ - - - - - @qpid.request.queue.dest.address@ - - - - - @qpid.response.queue.dest.address@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - true - - - ${jboss.bind.address:127.0.0.1} - - - - Standard-Endpoint-Config - - - - - Recording-Endpoint-Config - - - - - ##SOAP11_HTTP ##SOAP11_HTTP_MTOM ##SOAP12_HTTP ##SOAP12_HTTP_MTOM - - - - RecordingHandler - - - org.jboss.ws.common.invocation.RecordingServerHandler - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/qpid/java/jca/example/conf/web.xml b/qpid/java/jca/example/conf/web.xml deleted file mode 100644 index 6e53d7beba..0000000000 --- a/qpid/java/jca/example/conf/web.xml +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - QpidTestServlet - QpidTestServlet - org.apache.qpid.jca.example.web.QpidTestServlet - 1 - - - - QpidRequestResponseServlet - QpidRequestResponseServlet - org.apache.qpid.jca.example.web.QpidRequestResponseServlet - 1 - - - - QpidTestServlet - /qpid - - - - QpidRequestResponseServlet - /qpid-reqresp - - - - diff --git a/qpid/java/jca/example/qpid-jca-example-properties.xml b/qpid/java/jca/example/qpid-jca-example-properties.xml deleted file mode 100644 index ab0f6267ba..0000000000 --- a/qpid/java/jca/example/qpid-jca-example-properties.xml +++ /dev/null @@ -1,84 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/client/QpidRequestResponseClient.java b/qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/client/QpidRequestResponseClient.java deleted file mode 100644 index fd5b3efff0..0000000000 --- a/qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/client/QpidRequestResponseClient.java +++ /dev/null @@ -1,159 +0,0 @@ -/* - * - * 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. - * - */ -package org.apache.qpid.jca.example.client; - -import java.util.concurrent.CountDownLatch; -import java.util.concurrent.TimeUnit; - -import javax.jms.Connection; -import javax.jms.ConnectionFactory; -import javax.jms.Destination; -import javax.jms.Message; -import javax.jms.MessageListener; -import javax.jms.MessageProducer; -import javax.jms.Session; -import javax.jms.TextMessage; -import javax.naming.InitialContext; - -import org.apache.qpid.jca.example.ejb.QpidUtil; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class QpidRequestResponseClient implements MessageListener, Runnable -{ - private static final Logger _log = LoggerFactory.getLogger(QpidRequestResponseClient.class); - - private static final String DEFAULT_CF_JNDI = "QpidConnectionFactory"; - private static final String DEFAULT_DESTINATION_JNDI = "QpidRequestQueue"; - private static final String DEFAULT_MESSAGE = "Hello, World!"; - private static final int DEFAULT_MESSAGE_COUNT = 1; - private static final int DEFAULT_THREAD_COUNT = 1; - private static CountDownLatch THREAD_LATCH; - private static InitialContext CONTEXT; - - private ConnectionFactory _connectionFactory; - private Connection _connection; - private Session _session; - private CountDownLatch _latch = null; - private int _count = DEFAULT_MESSAGE_COUNT; - - /** - * @param args - */ - public static void main(String[] args) throws Exception - { - int threadCount = (System.getProperty("thread.count") == null) - ? DEFAULT_THREAD_COUNT : Integer.valueOf(System.getProperty("thread.count")); - - _log.debug("Creating " + threadCount + " threads for execution."); - - THREAD_LATCH = new CountDownLatch(threadCount); - - CONTEXT = new InitialContext(); - - for(int i = 0; i < threadCount; i++) - { - new Thread(new QpidRequestResponseClient()).start(); - } - - _log.debug("Waiting for " + threadCount + " to finish."); - THREAD_LATCH.await(10, TimeUnit.SECONDS); - - QpidUtil.closeResources(CONTEXT); - } - - @Override - public void onMessage(Message message) - { - _latch.countDown(); - - if(message instanceof TextMessage) - { - try - { - _log.debug("Thread " + Thread.currentThread().getId() + " received response message with content " + ((TextMessage)message).getText()); - } - catch(Exception e) - { - _log.error(e.getMessage(), e); - } - } - - if(_latch.getCount() == _count) - { - QpidUtil.closeResources(_session, _connection); - } - - THREAD_LATCH.countDown(); - - } - - public void run() - { - MessageProducer producer = null; - Destination requestQueue = null; - Destination responseQueue = null; - - String cfName = (System.getProperty("qpid.cf.name") == null) ? DEFAULT_CF_JNDI : System.getProperty("qpid.cf.name"); - String destName = (System.getProperty("qpid.dest.name") == null) ? DEFAULT_DESTINATION_JNDI : System.getProperty("qpid.dest.name"); - - try - { - _count = (System.getProperty("message.count") == null) ? DEFAULT_MESSAGE_COUNT : Integer.valueOf(System.getProperty("message.count")); - _latch = new CountDownLatch(_count); - - _connectionFactory = (ConnectionFactory)QpidTestUtil.getFromJNDI(CONTEXT, cfName); - requestQueue = (Destination)QpidTestUtil.getFromJNDI(CONTEXT, destName); - _connection = _connectionFactory.createConnection(); - _session = _connection.createSession(false, Session.AUTO_ACKNOWLEDGE); - producer = _session.createProducer(requestQueue); - responseQueue = _session.createTemporaryQueue(); - _session.createConsumer(responseQueue).setMessageListener(this); - - - _connection.start(); - - String content = (System.getProperty("qpid.message") == null) ? DEFAULT_MESSAGE : System.getProperty("qpid.message"); - - for(int i = 0; i < _count; i++) - { - TextMessage message = _session.createTextMessage(); - message.setText(content); - message.setJMSReplyTo(responseQueue); - producer.send(message); - - } - - _latch.await(); - - } - catch(Exception e) - { - _log.error(e.getMessage(), e); - } - finally - { - QpidUtil.closeResources(producer); - } - - } - -} diff --git a/qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/client/QpidTestClient.java b/qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/client/QpidTestClient.java deleted file mode 100644 index f21b8ea07d..0000000000 --- a/qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/client/QpidTestClient.java +++ /dev/null @@ -1,134 +0,0 @@ -/* - * - * 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. - * - */ -package org.apache.qpid.jca.example.client; - -import javax.jms.Connection; -import javax.jms.ConnectionFactory; -import javax.jms.Destination; -import javax.jms.MessageProducer; -import javax.jms.Session; -import javax.jms.TextMessage; -import javax.naming.Context; -import javax.naming.InitialContext; - -import org.apache.qpid.jca.example.ejb.QpidTest; -import org.apache.qpid.jca.example.ejb.QpidUtil; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class QpidTestClient -{ - private static final Logger _log = LoggerFactory.getLogger(QpidTestClient.class); - - private static final String DEFAULT_EJB_JNDI = "QpidTestBean/remote"; - private static final String DEFAULT_CF_JNDI = "QpidConnectionFactory"; - private static final String DEFAULT_MESSAGE = "Hello,World!"; - private static final int DEFAULT_MESSAGE_COUNT = 1; - private static final boolean DEFAULT_USE_TOPIC = false; - private static final boolean DEFAULT_USE_EJB = true; - private static final String DEFAULT_DESTINATION_JNDI = "HelloQueue"; - private static final boolean DEFAULT_SAY_GOODBYE = false; - - public static void main(String[] args) throws Exception - { - String content = (System.getProperty("qpid.message") == null) ? DEFAULT_MESSAGE : System.getProperty("qpid.message"); - boolean useEJB = (System.getProperty("use.ejb") == null) ? DEFAULT_USE_EJB : Boolean.valueOf(System.getProperty("use.ejb")); - int total = (System.getProperty("message.count") == null) ? DEFAULT_MESSAGE_COUNT : Integer.valueOf(System.getProperty("message.count")); - boolean useTopic = (System.getProperty("use.topic") == null) ? DEFAULT_USE_TOPIC : Boolean.valueOf(System.getProperty("use.topic")); - String destType = (useTopic) ? "Topic" : "Queue"; - boolean goodbye = (System.getProperty("say.goodbye") == null) ? DEFAULT_SAY_GOODBYE : Boolean.valueOf(System.getProperty("say.goodbye")); - - _log.debug("Environment: "); - _log.debug("JNDI IntialContectFactory: " + System.getProperty("java.naming.factory.initial")); - _log.debug("JNDI Provider: " + System.getProperty("java.naming.provider.url")); - _log.debug("Message content: " + content); - _log.debug("Message count:" + total); - _log.debug("Protocol: " + ((useEJB) ? "EJB" : "JMS")); - _log.debug("Destination Type: " + destType); - _log.debug("Say GoodBye : " + goodbye); - - Context context = new InitialContext(); - - if(useEJB) - { - - String ejbName = (System.getProperty("qpid.ejb.name") == null) ? DEFAULT_EJB_JNDI : System.getProperty("qpid.ejb.name"); - - QpidTest ejb = (QpidTest)QpidTestUtil.getFromJNDI(context, ejbName); - - _log.debug("Found SLSB " + ejbName + "in JNDI"); - ejb.testQpidAdapter(content, total, useTopic, false, goodbye); - - } - else - { - ConnectionFactory connectionFactory = null; - Connection connection = null; - Session session = null; - MessageProducer messageProducer = null; - Destination destination = null; - int count = 0; - - String cfName = (System.getProperty("qpid.cf.name") == null) ? DEFAULT_CF_JNDI : System.getProperty("qpid.cf.name"); - String destName = (System.getProperty("qpid.dest.name") == null) ? DEFAULT_DESTINATION_JNDI : System.getProperty("qpid.dest.name"); - - _log.debug("Using JMS with CF name " + cfName + " and Destination name " + destName + " to send " + total + " message(s) with content " + content); - - try - { - _log.debug("Using JNDI at " + System.getProperty("java.naming.provider.url")); - - connectionFactory = (ConnectionFactory)QpidTestUtil.getFromJNDI(context, cfName); - destination = (Destination)QpidTestUtil.getFromJNDI(context, destName); - - _log.debug("Using CF: " + connectionFactory); - _log.debug("Destination " + destination); - - connection = connectionFactory.createConnection(); - session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE); - messageProducer = session.createProducer(destination); - - _log.debug("Sending " + total + " message(s) with content: " + content + " to destination " + destName); - - for(int i = 0; i < total; i++) - { - TextMessage message = session.createTextMessage(content); - message.setBooleanProperty("say.goodbye", goodbye); - messageProducer.send(message); - count++; - } - - - } - catch(Exception e) - { - _log.error(e.getMessage(),e); - } - finally - { - QpidUtil.closeResources(session, connection, context); - } - - _log.debug(count + " message(s) sent successfully"); - } - - } -} diff --git a/qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/client/QpidTestUtil.java b/qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/client/QpidTestUtil.java deleted file mode 100644 index 7a53335d79..0000000000 --- a/qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/client/QpidTestUtil.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * - * 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. - * - */ -package org.apache.qpid.jca.example.client; - -import javax.naming.Context; -import javax.naming.NamingException; -import javax.naming.Reference; -import javax.naming.spi.NamingManager; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class QpidTestUtil { - private static final Logger _log = LoggerFactory.getLogger(QpidTestUtil.class); - - /* - * Encapsulate looking up in JNDI and working around a seeming bug in OpenEJB which returns a - * Reference when it should just return an object constructed from it - */ - static Object getFromJNDI(Context context, String name) throws NamingException, Exception - { - Object o = context.lookup(name); - if (o instanceof Reference) - { - _log.debug("Got a Reference back from JNDI for " + name + " - working around"); - return NamingManager.getObjectInstance(o, null, null, null); - } - else - { - return o; - } - } - -} diff --git a/qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/ejb/QpidGoodByeListenerBean.java b/qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/ejb/QpidGoodByeListenerBean.java deleted file mode 100644 index bdb722a87b..0000000000 --- a/qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/ejb/QpidGoodByeListenerBean.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * - * 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. - * - */ -package org.apache.qpid.jca.example.ejb; - -import java.util.Date; - -import javax.ejb.ActivationConfigProperty; -import javax.ejb.MessageDriven; -import javax.jms.Message; -import javax.jms.MessageListener; -import javax.jms.TextMessage; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@MessageDriven(activationConfig = { - @ActivationConfigProperty(propertyName = "acknowledgeMode", propertyValue = "Auto-acknowledge"), - @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue"), - @ActivationConfigProperty(propertyName = "destination", propertyValue = "@jndi.prefix@@qpid.goodbye.queue.jndi.name@"), - @ActivationConfigProperty(propertyName = "connectionURL", propertyValue = "@broker.url@"), - @ActivationConfigProperty(propertyName = "useLocalTx", propertyValue = "false"), - @ActivationConfigProperty(propertyName = "maxSession", propertyValue = "10") -}) -public class QpidGoodByeListenerBean implements MessageListener -{ - private static final Logger _log = LoggerFactory.getLogger(QpidGoodByeListenerBean.class); - - @Override - public void onMessage(Message message) - { - try - { - if(message instanceof TextMessage) - { - String content = ((TextMessage)message).getText(); - - _log.info("Received text message with contents: [" + content + "] at " + new Date()); - } - } - catch(Exception e) - { - _log.error(e.getMessage(), e); - } - - } - -} diff --git a/qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/ejb/QpidGoodByeSubscriberBean.java b/qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/ejb/QpidGoodByeSubscriberBean.java deleted file mode 100644 index f2e4d6aaa5..0000000000 --- a/qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/ejb/QpidGoodByeSubscriberBean.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * - * 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. - * - */ -package org.apache.qpid.jca.example.ejb; - -import java.util.Date; - -import javax.ejb.ActivationConfigProperty; -import javax.ejb.MessageDriven; -import javax.jms.Message; -import javax.jms.MessageListener; -import javax.jms.TextMessage; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@MessageDriven(activationConfig = { - @ActivationConfigProperty(propertyName = "acknowledgeMode", propertyValue = "Auto-acknowledge"), - @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Topic"), - @ActivationConfigProperty(propertyName = "destination", propertyValue = "@jndi.prefix@@qpid.goodbye.topic.jndi.name@"), - @ActivationConfigProperty(propertyName = "connectionURL", propertyValue = "@broker.url@"), - @ActivationConfigProperty(propertyName = "subscriptionDurability", propertyValue = "NotDurable"), - @ActivationConfigProperty(propertyName = "maxSession", propertyValue = "10") -}) - -public class QpidGoodByeSubscriberBean implements MessageListener -{ - private static final Logger _log = LoggerFactory.getLogger(QpidGoodByeSubscriberBean.class); - - @Override - public void onMessage(Message message) - { - try - { - if(message instanceof TextMessage) - { - String content = ((TextMessage)message).getText(); - - _log.info("Received text message with contents: [" + content + "] at " + new Date()); - } - } - catch(Exception e) - { - _log.error(e.getMessage(), e); - } - - } - -} diff --git a/qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/ejb/QpidHelloListenerBean.java b/qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/ejb/QpidHelloListenerBean.java deleted file mode 100644 index 75e0acab79..0000000000 --- a/qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/ejb/QpidHelloListenerBean.java +++ /dev/null @@ -1,98 +0,0 @@ -/* - * - * 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. - * - */ -package org.apache.qpid.jca.example.ejb; - -import java.util.Date; - -import javax.annotation.PostConstruct; -import javax.annotation.Resource; -import javax.ejb.ActivationConfigProperty; -import javax.ejb.MessageDriven; -import javax.jms.Connection; -import javax.jms.ConnectionFactory; -import javax.jms.Destination; -import javax.jms.Message; -import javax.jms.MessageListener; -import javax.jms.MessageProducer; -import javax.jms.Session; -import javax.jms.TextMessage; -import javax.naming.InitialContext; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@MessageDriven(activationConfig = { - @ActivationConfigProperty(propertyName = "acknowledgeMode", propertyValue = "Auto-acknowledge"), - @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue"), - @ActivationConfigProperty(propertyName = "destination", propertyValue = "@jndi.prefix@@qpid.hello.queue.jndi.name@"), - @ActivationConfigProperty(propertyName = "connectionURL", propertyValue = "@broker.url@"), - @ActivationConfigProperty(propertyName = "maxSession", propertyValue = "10") -}) -public class QpidHelloListenerBean implements MessageListener -{ - private static final Logger _log = LoggerFactory.getLogger(QpidHelloListenerBean.class); - - @Resource(@jndi.scheme@="@qpid.xacf.jndi.name@") - private ConnectionFactory _connectionFactory; - - @Resource(@jndi.scheme@="@qpid.goodbye.queue.jndi.name@") - private Destination _queue; - - @Override - public void onMessage(Message message) - { - Connection connection = null; - Session session = null; - MessageProducer messageProducer = null; - TextMessage response = null; - - try - { - if(message instanceof TextMessage) - { - String content = ((TextMessage)message).getText(); - - _log.info("Received text message with contents: [" + content + "] at " + new Date()); - - StringBuffer temp = new StringBuffer(); - temp.append("QpidHelloListenerBean received message with content: [" + content); - temp.append("] at " + new Date()); - - if(message.propertyExists("say.goodbye") && message.getBooleanProperty("say.goodbye")) - { - connection = _connectionFactory.createConnection(); - session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE); - messageProducer = session.createProducer(_queue); - response = session.createTextMessage(temp.toString()); - messageProducer.send(response); - } - } - } - catch(Exception e) - { - _log.error(e.getMessage(), e); - } - finally - { - QpidUtil.closeResources(session, connection); - } - } -} diff --git a/qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/ejb/QpidHelloSubscriberBean.java b/qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/ejb/QpidHelloSubscriberBean.java deleted file mode 100644 index 882c85fa18..0000000000 --- a/qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/ejb/QpidHelloSubscriberBean.java +++ /dev/null @@ -1,99 +0,0 @@ -/* - * - * 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. - * - */ -package org.apache.qpid.jca.example.ejb; - -import java.util.Date; - -import javax.annotation.Resource; -import javax.ejb.ActivationConfigProperty; -import javax.ejb.MessageDriven; -import javax.jms.Connection; -import javax.jms.ConnectionFactory; -import javax.jms.Destination; -import javax.jms.Message; -import javax.jms.MessageListener; -import javax.jms.MessageProducer; -import javax.jms.Session; -import javax.jms.TextMessage; -import javax.naming.InitialContext; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - - -@MessageDriven(activationConfig = { - @ActivationConfigProperty(propertyName = "acknowledgeMode", propertyValue = "Auto-acknowledge"), - @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Topic"), - @ActivationConfigProperty(propertyName = "destination", propertyValue = "@jndi.prefix@@qpid.hello.topic.jndi.name@"), - @ActivationConfigProperty(propertyName = "connectionURL", propertyValue = "@broker.url@"), - @ActivationConfigProperty(propertyName = "subscriptionDurability", propertyValue = "NotDurable"), - @ActivationConfigProperty(propertyName = "maxSession", propertyValue = "10") -}) -public class QpidHelloSubscriberBean implements MessageListener -{ - private static final Logger _log = LoggerFactory.getLogger(QpidHelloSubscriberBean.class); - - @Resource(@jndi.scheme@="@qpid.xacf.jndi.name@") - private ConnectionFactory _connectionFactory; - - @Resource(@jndi.scheme@="@qpid.goodbye.topic.jndi.name@") - private Destination _topic; - - @Override - public void onMessage(Message message) - { - Connection connection = null; - Session session = null; - MessageProducer messageProducer = null; - TextMessage response = null; - - try - { - if(message instanceof TextMessage) - { - String content = ((TextMessage)message).getText(); - - _log.info("Received text message with contents: [" + content + "] at " + new Date()); - - StringBuffer temp = new StringBuffer(); - temp.append("QpidHelloSubscriberBean received message with content: [" + content); - temp.append("] at " + new Date()); - - if(message.propertyExists("say.goodbye") && message.getBooleanProperty("say.goodbye")) - { - connection = _connectionFactory.createConnection(); - session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE); - messageProducer = session.createProducer(_topic); - response = session.createTextMessage(temp.toString()); - messageProducer.send(response); - } - } - } - catch(Exception e) - { - _log.error(e.getMessage(), e); - } - finally - { - QpidUtil.closeResources(session, connection); - } - } -} diff --git a/qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/ejb/QpidJMSResponderBean.java b/qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/ejb/QpidJMSResponderBean.java deleted file mode 100644 index 6e99d4fe7f..0000000000 --- a/qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/ejb/QpidJMSResponderBean.java +++ /dev/null @@ -1,104 +0,0 @@ -/* - * - * 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. - * - */ -package org.apache.qpid.jca.example.ejb; - -import java.util.Date; - -import javax.annotation.Resource; -import javax.ejb.ActivationConfigProperty; -import javax.ejb.MessageDriven; -import javax.jms.Connection; -import javax.jms.ConnectionFactory; -import javax.jms.Destination; -import javax.jms.Message; -import javax.jms.MessageListener; -import javax.jms.MessageProducer; -import javax.jms.Session; -import javax.jms.TextMessage; -import javax.naming.InitialContext; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@MessageDriven(activationConfig = { - @ActivationConfigProperty(propertyName = "acknowledgeMode", propertyValue = "Auto-acknowledge"), - @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue"), - @ActivationConfigProperty(propertyName = "destination", propertyValue = "@jndi.prefix@@qpid.request.queue.jndi.name@"), - @ActivationConfigProperty(propertyName = "connectionURL", propertyValue = "@broker.url@"), - @ActivationConfigProperty(propertyName = "maxSession", propertyValue = "10") -}) -public class QpidJMSResponderBean implements MessageListener -{ - - private static final Logger _log = LoggerFactory.getLogger(QpidJMSResponderBean.class); - - @Resource(@jndi.scheme@="@qpid.xacf.jndi.name@") - private ConnectionFactory _connectionFactory; - - @Override - public void onMessage(Message message) - { - Connection connection = null; - Session session = null; - MessageProducer messageProducer = null; - TextMessage response = null; - - try - { - if(message instanceof TextMessage) - { - String content = ((TextMessage)message).getText(); - - _log.info("Received text message with contents: [" + content + "] at " + new Date()); - - StringBuffer temp = new StringBuffer(); - temp.append("QpidJMSResponderBean received message with content: [" + content); - temp.append("] at " + new Date()); - - connection = _connectionFactory.createConnection(); - session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE); - - if(message.getJMSReplyTo() != null) - { - _log.info("Sending response via JMSReplyTo"); - messageProducer = session.createProducer(message.getJMSReplyTo()); - response = session.createTextMessage(); - response.setText(temp.toString()); - messageProducer.send(response); - } - else - { - _log.info("JMSReplyTo is null. Will not respond to message."); - } - - - } - } - catch(Exception e) - { - _log.error(e.getMessage(), e); - } - finally - { - QpidUtil.closeResources(session, connection); - } - } -} diff --git a/qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/ejb/QpidTest.java b/qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/ejb/QpidTest.java deleted file mode 100644 index 14488fda53..0000000000 --- a/qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/ejb/QpidTest.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * - * 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. - * - */ - -package org.apache.qpid.jca.example.ejb; - -public interface QpidTest -{ - public void testQpidAdapter(String content) throws Exception; - public void testQpidAdapter(String content, int count) throws Exception; - public void testQpidAdapter(String content, int count, boolean useTopic) throws Exception; - public void testQpidAdapter(String content, int count, boolean useTopic, boolean respond, boolean sayGoodbye) throws Exception; -} diff --git a/qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/ejb/QpidTestBean.java b/qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/ejb/QpidTestBean.java deleted file mode 100644 index a5f4770257..0000000000 --- a/qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/ejb/QpidTestBean.java +++ /dev/null @@ -1,104 +0,0 @@ -/* - * - * 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. - * - */ -package org.apache.qpid.jca.example.ejb; - -import javax.annotation.PostConstruct; -import javax.annotation.Resource; -import javax.ejb.Stateless; -import javax.jms.Connection; -import javax.jms.ConnectionFactory; -import javax.jms.Destination; -import javax.jms.MessageProducer; -import javax.jms.Session; -import javax.jms.TextMessage; -import javax.naming.InitialContext; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@Stateless -public class QpidTestBean implements QpidTestRemote, QpidTestLocal -{ - - private static final Logger _log = LoggerFactory.getLogger(QpidTestBean.class); - - @Resource(@jndi.scheme@="@qpid.xacf.jndi.name@") - private ConnectionFactory _connectionFactory; - - @Resource(@jndi.scheme@="@qpid.hello.queue.jndi.name@") - private Destination _queue; - - @Resource(@jndi.scheme@="@qpid.hello.topic.jndi.name@") - private Destination _topic; - - @Override - public void testQpidAdapter(String content) throws Exception - { - testQpidAdapter(content, 1); - } - - @Override - public void testQpidAdapter(String content, int count) throws Exception - { - testQpidAdapter(content, count, false); - } - - public void testQpidAdapter(final String content, int count, boolean useTopic) throws Exception - { - testQpidAdapter(content, count, useTopic, false, false); - } - - @Override - public void testQpidAdapter(String content, int count, boolean useTopic, - boolean respond, boolean sayGoodbye) throws Exception - { - Connection connection = null; - Session session = null; - MessageProducer messageProducer = null; - - _log.info("Sending " + count + " message(s) to MDB with content " + content); - - try - { - connection = _connectionFactory.createConnection(); - session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE); - messageProducer = (useTopic) ? session.createProducer(_topic) : session.createProducer(_queue); - - for(int i = 0; i < count; i++) - { - TextMessage message = session.createTextMessage(content); - message.setBooleanProperty("say.goodbye", sayGoodbye); - messageProducer.send(message); - } - - } - catch(Exception e) - { - _log.error(e.getMessage(), e); - throw e; - } - finally - { - QpidUtil.closeResources(messageProducer, session, connection); - } - } - -} diff --git a/qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/ejb/QpidTestLocal.java b/qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/ejb/QpidTestLocal.java deleted file mode 100644 index 73a0de08c2..0000000000 --- a/qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/ejb/QpidTestLocal.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * - * 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. - * - */ - -package org.apache.qpid.jca.example.ejb; - -import javax.ejb.Local; - -@Local -public interface QpidTestLocal extends QpidTest -{ -} diff --git a/qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/ejb/QpidTestRemote.java b/qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/ejb/QpidTestRemote.java deleted file mode 100644 index 2abb4d71f5..0000000000 --- a/qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/ejb/QpidTestRemote.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * - * 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. - * - */ - -package org.apache.qpid.jca.example.ejb; - -import javax.ejb.Remote; - -@Remote -public interface QpidTestRemote extends QpidTest -{ -} diff --git a/qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/ejb/QpidUtil.java b/qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/ejb/QpidUtil.java deleted file mode 100644 index d96a4e8163..0000000000 --- a/qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/ejb/QpidUtil.java +++ /dev/null @@ -1,90 +0,0 @@ -/* - * - * 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. - * - */ -package org.apache.qpid.jca.example.ejb; - -import java.lang.reflect.Method; -import java.util.Enumeration; - -import javax.jms.Message; -import javax.jms.TextMessage; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class QpidUtil -{ - private static final Logger _log = LoggerFactory.getLogger(QpidTestBean.class); - - public static void handleMessage(String beanName, final Message message) throws Exception - { - if(message instanceof TextMessage) - { - String content = ((TextMessage)message).getText(); - _log.debug(beanName + ": Received text message with contents " + content); - - if(content.contains("PrintEnv")) - { - printJMSHeaders(message); - printProperties(message); - } - } - } - - @SuppressWarnings("rawtypes") - public static void printProperties(final Message message) throws Exception - { - _log.debug("Priting Message Properties:"); - - Enumeration e = message.getPropertyNames(); - - while(e.hasMoreElements()) - { - _log.debug(e + ":" + message.getObjectProperty(e.toString())); - } - } - - public static void printJMSHeaders(final Message message) throws Exception - { - _log.debug("JMSCorrelationID:" + message.getJMSCorrelationID()); - _log.debug("JMSDeliveryMode:" + message.getJMSDeliveryMode()); - _log.debug("JMSExpires:" + message.getJMSExpiration()); - _log.debug("JMSMessageID:" + message.getJMSMessageID()); - _log.debug("JMSPriority:" + message.getJMSPriority()); - _log.debug("JMSTimestamp:" + message.getJMSTimestamp()); - _log.debug("JMSType:" + message.getJMSType()); - _log.debug("JMSReplyTo:" + message.getJMSReplyTo()); - } - - public static void closeResources(Object...objects) - { - try - { - for(Object object: objects) - { - Method close = object.getClass().getMethod("close", new Class[]{}); - close.invoke(object, new Object[]{}); - } - } - catch(Exception ignore) - { - } - } -} diff --git a/qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/web/QpidRequestResponseServlet.java b/qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/web/QpidRequestResponseServlet.java deleted file mode 100644 index d069a0c943..0000000000 --- a/qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/web/QpidRequestResponseServlet.java +++ /dev/null @@ -1,283 +0,0 @@ -/* - * - * 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. - * - */ - -package org.apache.qpid.jca.example.web; -import java.io.IOException; -import java.lang.Thread; - -import javax.annotation.Resource; -import javax.jms.Connection; -import javax.jms.ConnectionFactory; -import javax.jms.Destination; -import javax.jms.Message; -import javax.jms.MessageConsumer; -import javax.jms.MessageProducer; -import javax.jms.Session; -import javax.jms.TextMessage; -import javax.naming.InitialContext; -import javax.servlet.ServletConfig; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.transaction.UserTransaction; - -import org.apache.qpid.jca.example.ejb.QpidTest; -import org.apache.qpid.jca.example.ejb.QpidUtil; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings("serial") -public class QpidRequestResponseServlet extends HttpServlet -{ - private static final Logger _log = LoggerFactory.getLogger(QpidTestServlet.class); - - private static final String DEFAULT_MESSAGE = "Hello, World!"; - private static final int DEFAULT_COUNT = 1; - private static final boolean DEFAULT_XA = false; - private static final boolean DEFAULT_TX = false; - private static final boolean USE_TMP_QUEUE = false; - - @Resource(@jndi.scheme@="@qpid.xacf.jndi.name@") - private ConnectionFactory _connectionFactory; - - @Resource(@jndi.scheme@="@qpid.request.queue.jndi.name@") - private Destination _queue; - - @Resource(@jndi.scheme@="@qpid.response.queue.jndi.name@") - private Destination _responseQueue; - - - @Override - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException - { - doPost(req, resp); - } - - @Override - protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException - { - InitialContext ctx = null; - Connection connection = null; - Session session = null; - MessageProducer messageProducer = null; - UserTransaction ut = null; - boolean useXA = false; - boolean rollback = false; - boolean useTx = false; - MessageConsumer messageConsumer = null; - long startTime = 0; - - try - { - String content = (req.getParameter("message") == null) ? DEFAULT_MESSAGE : req.getParameter("message"); - int count = (req.getParameter("count") == null) ? DEFAULT_COUNT : Integer.valueOf(req.getParameter("count")); - useXA = (req.getParameter("useXA") == null) ? DEFAULT_XA : Boolean.valueOf(req.getParameter("useXA")); - useTx = (req.getParameter("useTx") == null) ? DEFAULT_TX : Boolean.valueOf(req.getParameter("useTx")); - - ctx = new InitialContext(); - - _log.debug("Environment: "); - _log.debug("Message content: " + content); - _log.debug("Message count:" + count); - _log.debug("Using XA: " + useXA); - - resp.getOutputStream().println("Environment: "); - resp.getOutputStream().println("Message content: " + content); - resp.getOutputStream().println("Message count:" + count); - resp.getOutputStream().println("Using XA: " + useXA); - - try - { - - connection = _connectionFactory.createConnection(); - - if(useXA) - { - ut = (UserTransaction)ctx.lookup("java:comp/UserTransaction"); - ut.begin(); - useTx = false; - } - - session = (useXA) ? connection.createSession(false, Session.AUTO_ACKNOWLEDGE) : connection.createSession(useTx, Session.AUTO_ACKNOWLEDGE); - messageProducer = session.createProducer(_queue); - - startTime = System.currentTimeMillis(); - - for(int i = 0; i < count; i++) - { - TextMessage message = session.createTextMessage(content); - message.setJMSReplyTo(_responseQueue); - messageProducer.send(message); - } - - } - catch(Exception e) - { - rollback = true; - - if(useXA && ut != null) - { - try - { - ut.setRollbackOnly(); - } - catch(Exception ex) - { - _log.error(ex.getMessage(), ex); - throw new ServletException(ex.getMessage(), ex); - } - } - } - finally - { - try - { - if(useXA && ut != null) - { - if(rollback) - { - ut.rollback(); - } - else - { - ut.commit(); - } - } - if(useTx && !useXA) - { - if(rollback) - { - session.rollback(); - } - else - { - session.commit(); - } - } - } - catch(Exception e) - { - _log.error(e.getMessage(), e); - throw new ServletException(e.getMessage(), e); - } - - QpidUtil.closeResources(messageProducer, session); - } - - resp.getOutputStream().println("Sent " + count + " messages with content '" + content + "'"); - resp.getOutputStream().flush(); - - int ackMode = Session.AUTO_ACKNOWLEDGE; - rollback = false; - - if(useXA) - { - ut.begin(); - } - - session = (useXA) ? connection.createSession(false, Session.AUTO_ACKNOWLEDGE) : connection.createSession(useTx, Session.AUTO_ACKNOWLEDGE); - messageConsumer = session.createConsumer(_responseQueue); - connection.start(); - - for(int i = 0; i < count; i++) - { - TextMessage message = (TextMessage)messageConsumer.receive(5000); - - if(message != null) - { - message.acknowledge(); - content = message.getText(); - - } - } - - startTime = System.currentTimeMillis() - startTime; - resp.getOutputStream().println("Received " + count + " messages with content '" + content + "'"); - resp.getOutputStream().println("Total process time " + startTime); - } - catch(Exception e) - { - rollback = true; - - if(useXA && ut != null) - { - try - { - ut.setRollbackOnly(); - } - catch(Exception ex) - { - _log.error(ex.getMessage(), ex); - throw new ServletException(ex.getMessage(), ex); - } - } - } - finally - { - if(useXA && ut != null) - { - try - { - if(rollback) - { - ut.rollback(); - } - else - { - ut.commit(); - } - } - catch(Exception e) - { - _log.error(e.getMessage(), e); - throw new ServletException(e.getMessage(), e); - - } - } - - if(useTx && !useXA) - { - try - { - if(rollback) - { - session.rollback(); - } - else - { - session.commit(); - } - } - catch(Exception e) - { - _log.error(e.getMessage(), e); - throw new ServletException(e.getMessage(), e); - } - } - - QpidUtil.closeResources(messageProducer, session); - } - } - -} - - diff --git a/qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/web/QpidTestServlet.java b/qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/web/QpidTestServlet.java deleted file mode 100644 index 7526daa83d..0000000000 --- a/qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/web/QpidTestServlet.java +++ /dev/null @@ -1,229 +0,0 @@ -/* - * - * 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. - * - */ - -package org.apache.qpid.jca.example.web; -import java.io.IOException; - -import javax.annotation.Resource; -import javax.ejb.EJB; -import javax.jms.Connection; -import javax.jms.ConnectionFactory; -import javax.jms.Destination; -import javax.jms.MessageProducer; -import javax.jms.Session; -import javax.jms.TextMessage; -import javax.naming.InitialContext; -import javax.servlet.ServletConfig; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.transaction.UserTransaction; - -import org.apache.qpid.jca.example.ejb.QpidTestLocal; -import org.apache.qpid.jca.example.ejb.QpidUtil; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings("serial") -public class QpidTestServlet extends HttpServlet -{ - private static final Logger _log = LoggerFactory.getLogger(QpidTestServlet.class); - - private static final String DEFAULT_MESSAGE = "Hello, World!"; - private static final int DEFAULT_COUNT = 1; - private static final boolean DEFAULT_TOPIC = false; - private static final boolean DEFAULT_XA = false; - private static final boolean DEFAULT_TX = false; - private static final boolean DEFAULT_SAY_GOODBYE = true; - - @Resource(@jndi.scheme@="@qpid.xacf.jndi.name@") - private ConnectionFactory _connectionFactory; - - @Resource(@jndi.scheme@="@qpid.hello.queue.jndi.name@") - private Destination _queue; - - @Resource(@jndi.scheme@="@qpid.hello.topic.jndi.name@") - private Destination _topic; - - @EJB - private QpidTestLocal ejb; - - @Override - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException - { - doPost(req, resp); - } - - @Override - protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException - { - InitialContext ctx = null; - Connection connection = null; - Session session = null; - MessageProducer messageProducer = null; - UserTransaction ut = null; - boolean useXA = false; - boolean rollback = false; - boolean useTX = false; - - try - { - String content = (req.getParameter("message") == null) ? DEFAULT_MESSAGE : req.getParameter("message"); - boolean useEJB = (req.getParameter("useEJB") == null) ? false : Boolean.valueOf(req.getParameter("useEJB")); - int count = (req.getParameter("count") == null) ? DEFAULT_COUNT : Integer.valueOf(req.getParameter("count")); - boolean useTopic = (req.getParameter("useTopic") == null) ? DEFAULT_TOPIC : Boolean.valueOf(req.getParameter("useTopic")); - useXA = (req.getParameter("useXA") == null) ? DEFAULT_XA : Boolean.valueOf(req.getParameter("useXA")); - useTX = (req.getParameter("useTX") == null) ? DEFAULT_TX : Boolean.valueOf(req.getParameter("useTX")); - ctx = new InitialContext(); - boolean sayGoodBye = (req.getParameter("sayGoodBye") == null) ? DEFAULT_SAY_GOODBYE : Boolean.valueOf(req.getParameter("sayGoodBye")); - useTX = (req.getParameter("useTX") == null) ? DEFAULT_TOPIC : Boolean.valueOf(req.getParameter("DEFAULT_TX")); - - _log.debug("Environment: "); - _log.debug("Message content: " + content); - _log.debug("Message count:" + count); - _log.debug("Protocol: " + ((useEJB) ? "EJB" : "JMS")); - _log.debug("Destination Type: " + ((useTopic) ? "Topic" : "Queue")); - _log.debug("Using XA: " + useXA); - _log.debug("Say GoodBye: ", sayGoodBye); - - resp.getOutputStream().println("Environment: "); - resp.getOutputStream().println("Message content: " + content); - resp.getOutputStream().println("Message count:" + count); - resp.getOutputStream().println("Protocol: " + ((useEJB) ? "EJB" : "JMS")); - resp.getOutputStream().println("Destination Type: " + ((useTopic) ? "Topic" : "Queue")); - resp.getOutputStream().println("Using XA: " + useXA); - resp.getOutputStream().println("Say GoodBye: " + sayGoodBye); - - if(useEJB) - { - ejb.testQpidAdapter(content, count, useTopic, false, sayGoodBye); - } - else - { - if(useXA) - { - ut = (UserTransaction)ctx.lookup("java:comp/UserTransaction"); - ut.begin(); - } - - connection = _connectionFactory.createConnection(); - session = connection.createSession(useTX, Session.AUTO_ACKNOWLEDGE); - messageProducer = (useTopic) ? session.createProducer(_topic) : session.createProducer(_queue); - - for(int i = 0; i < count; i++) - { - TextMessage message = session.createTextMessage(content); - message.setBooleanProperty("say.goodbye", sayGoodBye); - messageProducer.send(message); - } - - } - - resp.getOutputStream().println("Sent " + count + " messages with content '" + content + "'"); - resp.getOutputStream().flush(); - - } - catch(Exception e) - { - - if(useXA && ut != null) - { - try - { - rollback = true; - ut.setRollbackOnly(); - } - catch(Exception ex) - { - _log.error(ex.getMessage(), ex); - throw new ServletException(ex.getMessage(), ex); - } - } - - if(useTX) - { - try - { - session.rollback(); - } - catch(Exception ex) - { - _log.error(ex.getMessage(), ex); - throw new ServletException(ex.getMessage(), ex); - } - } - - _log.error(e.getMessage(), e); - throw new ServletException(e.getMessage(), e); - } - finally - { - if(useXA && ut != null) - { - try - { - if(rollback) - { - ut.rollback(); - } - else - { - ut.commit(); - } - } - catch(Exception e) - { - _log.error(e.getMessage(), e); - throw new ServletException(e.getMessage(), e); - - } - } - - if(useTX && !useXA) - { - try - { - - if(rollback) - { - session.rollback(); - } - else - { - session.commit(); - } - } - catch(Exception e) - { - - _log.error(e.getMessage(), e); - throw new ServletException(e.getMessage(), e); - } - } - - QpidUtil.closeResources(session, connection, ctx); - } - } - -} - - -- cgit v1.2.1