diff options
author | Weston M. Price <wprice@apache.org> | 2012-04-18 05:34:59 +0000 |
---|---|---|
committer | Weston M. Price <wprice@apache.org> | 2012-04-18 05:34:59 +0000 |
commit | fc0839f84efc550451a98a26696d153e71d883e5 (patch) | |
tree | 24a53e5ed0ba81215748d77eecde4cda48ce1d8d | |
parent | 472e67bf5e30b7a14e5d58bae312c12d766a6144 (diff) | |
download | qpid-python-fc0839f84efc550451a98a26696d153e71d883e5.tar.gz |
QPID-3776: Add support for JBoss7 Application Server
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1327380 13f79535-47bb-0310-9956-ffa450edef68
5 files changed, 70 insertions, 34 deletions
diff --git a/qpid/java/jca/example/build-jboss7-properties.xml b/qpid/java/jca/example/build-jboss7-properties.xml index cfbaa9b473..68ecd8a4f4 100644 --- a/qpid/java/jca/example/build-jboss7-properties.xml +++ b/qpid/java/jca/example/build-jboss7-properties.xml @@ -21,20 +21,25 @@ <project name="qpid-jca-example-jboss7-properties" basedir="." default=""> <property name="jndi.scheme" value="name"/> + <property name="jndi.prefix" value=""/> <property name="qpid.xacf.jndi.name" value="java:/QpidJMSXA"/> <property name="qpid.cf.jndi.name" value="QpidConnectionFactory"/> - <property name="qpid.hello.topic.jndi.name" value="java:/HelloTopic"/> - <property name="qpid.goodbye.topic.jndi.name" value="java:/GoodByeTopic"/> - <property name="qpid.hello.queue.jndi.name" value="java:/HelloQueue"/> - <property name="qpid.goodbye.queue.jndi.name" value="java:/GoodByeQueue"/> - <property name="qpid.responder.queue.jndi.name" value="java:/QpidResponderQueue"/> + <property name="qpid.hello.topic.jndi.name" value="java:jboss/exported/HelloTopic"/> + <property name="qpid.goodbye.topic.jndi.name" value="java:jboss/exported/GoodByeTopic"/> + <property name="qpid.hello.queue.jndi.name" value="java:jboss/exported/HelloQueue"/> + <property name="qpid.goodbye.queue.jndi.name" value="java:jboss/exported/GoodByeQueue"/> + <property name="qpid.request.queue.jndi.name" value="java:jboss/exported/QpidRequestQueue"/> + <property name="qpid.response.queue.jndi.name" value="java:jboss/exported/QpidResponseQueue"/> + <property name="qpid.ejb.jndi.name" value="mappedName="QpidTestEJB""/> <property name="qpid.ejb.ref.name" value="QpidTestBean/local"/> - <property name="qpid.ejb.name" value="qpid-jcaex/QpidTestBean/remote"/> + <property name="qpid.ejb.name" value="ejb:qpid-jcaex/qpid-jcaex-ejb/QpidTestBean!org.apache.qpid.jca.example.ejb.QpidTestRemote"/> - <property name="jndi.context" value="org.jnp.interfaces.NamingContextFactory"/> - <property name="server.host" value="jnp://localhost:1099"/> + <property name="qpid.client.cf.jndi.name" value="${jndi.prefix}/QpidConnectionFactory"/> + <property name="qpid.client.dest.jndi.name" value="${jndi.prefix}/HelloQueue"/> + <property name="jndi.context" value="org.jboss.naming.remote.client.InitialContextFactory"/> + <property name="server.host" value="remote://localhost:4447"/> <property name="jboss.server.config" value="standalone"/> @@ -44,19 +49,20 @@ <property name="jboss.deploy" location="${jboss.home}/${jboss.server}/deployments"/> <property name="jboss.modules" location="${jboss.home}/modules"/> <property name="jboss.config.dir" location="${jboss.home}/${jboss.server}/configuration/"/> + <property name="jboss.client" location="${jboss.home}/bin/client"/> <path id="compile.classpath"> <fileset dir="${jboss.modules}/javax/jms/api/main"> - <include name="jboss-jms-api_1.1_spec-1.0.0.Final.jar"/> + <include name="jboss-jms-api_1.1_spec-1.0.1.Final.jar"/> </fileset> <fileset dir="${jboss.modules}/javax/ejb/api/main"> - <include name="jboss-ejb-api_3.1_spec-1.0.1.Final.jar"/> + <include name="jboss-ejb-api_3.1_spec-1.0.2.Final.jar"/> </fileset> <fileset dir="${jboss.modules}/javax/servlet/api/main"> - <include name="jboss-servlet-api_3.0_spec-1.0.0.Final.jar"/> + <include name="jboss-servlet-api_3.0_spec-1.0.1.Final.jar"/> </fileset> <fileset dir="${jboss.modules}/javax/transaction/api/main"> - <include name="jboss-transaction-api_1.1_spec-1.0.0.Final.jar"/> + <include name="jboss-transaction-api_1.1_spec-1.0.1.Final.jar"/> </fileset> <fileset dir="${jboss.modules}/org/slf4j/main"> <include name="slf4j-api-1.6.1.jar"/> @@ -64,15 +70,25 @@ </path> <path id="run.classpath"> + <fileset dir="${jboss.client}"> + <include name="jboss-client.jar"/> + </fileset> <fileset dir="${lib.dir}"> <include name="qpid-ra-*.jar"/> <include name="qpid-client-*.jar"/> <include name="qpid-common-*.jar"/> </fileset> - <fileset dir="${jboss.client}"> - <!-- Shortcut to get it working!--> - <include name="jbossall-client.jar"/> + <fileset dir="${jboss.modules}/org/slf4j/main"> + <include name="slf4j-api-1.6.1.jar"/> + </fileset> + <fileset dir="../../build/lib"> + <include name="slf4j*.jar"/> + <include name="log4j*.jar"/> </fileset> + <fileset dir="${jboss.modules}/org/jboss/ejb-client/main/"> + <include name="jboss-ejb-client-1.0.6.CR1.jar"/> + </fileset> + </path> <filterset id="extra.filterset"/> diff --git a/qpid/java/jca/example/build.xml b/qpid/java/jca/example/build.xml index 60b7f7a0d1..64d70d3499 100644 --- a/qpid/java/jca/example/build.xml +++ b/qpid/java/jca/example/build.xml @@ -27,7 +27,7 @@ <property name="qpid.dest_syntax" value="ADDR"/> <!-- Properties controlling running sample standalone client --> - <property name="client.use.ejb" value="false"/> <!-- uses JNDI/JMS or JNDI/RMI --> + <property name="client.use.ejb" value="true"/> <!-- uses JNDI/JMS or JNDI/RMI --> <property name="client.message" value="Hello Qpid World"/> <property name="client.message.count" value="1"/> <property name="client.use.topic" value="false"/> <!-- Use topic/queue --> @@ -147,6 +147,9 @@ </classpath> <sysproperty key="java.naming.factory.initial" value="${jndi.context}"/> <sysproperty key="java.naming.provider.url" value="${server.host}"/> + <sysproperty key="java.naming.factory.url.pkgs" value="org.jboss.ejb.client.naming"/> + <sysproperty key="jboss.ejb.client.properties.file.path" value="${conf.dir}/jboss-ejb-client.properties"/> + <sysproperty key="qpid.ejb.name" value="${qpid.ejb.name}"/> <sysproperty key="qpid.cf.name" value="${qpid.client.cf.jndi.name}"/> <sysproperty key="qpid.dest.name" value="${qpid.client.dest.jndi.name}"/> diff --git a/qpid/java/jca/example/conf/jboss-ejb-client.properties b/qpid/java/jca/example/conf/jboss-ejb-client.properties new file mode 100644 index 0000000000..8bf1075c14 --- /dev/null +++ b/qpid/java/jca/example/conf/jboss-ejb-client.properties @@ -0,0 +1,12 @@ +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=wmprice +remote.connection.default.password=72whtu78 + diff --git a/qpid/java/jca/example/conf/standalone.xml b/qpid/java/jca/example/conf/standalone.xml index 5d4256f8e7..8d6137aea7 100644 --- a/qpid/java/jca/example/conf/standalone.xml +++ b/qpid/java/jca/example/conf/standalone.xml @@ -279,34 +279,39 @@ </connection-definition> </connection-definitions> <admin-objects> - <admin-object class-name="org.apache.qpid.ra.admin.QpidConnectionFactoryProxy" jndi-name="QpidJMS" use-java-context="false"> + <admin-object class-name="org.apache.qpid.ra.admin.QpidConnectionFactoryProxy" jndi-name="java:jboss/exported/QpidConnectionFactory" use-java-context="false"> <config-property name="ConnectionURL"> @broker.url@ </config-property> </admin-object> - <admin-object class-name="org.apache.qpid.ra.admin.QpidTopicImpl" jndi-name="GoodByeTopic" use-java-context="false" pool-name="GoodByeTopic"> - <config-property name="destinationAddress"> + <admin-object class-name="org.apache.qpid.ra.admin.QpidTopicImpl" jndi-name="java:jboss/exported/GoodByeTopic" use-java-context="false" pool-name="GoodByeTopic"> + <config-property name="DestinationAddress"> @qpid.hello.topic.dest.address@ </config-property> </admin-object> - <admin-object class-name="org.apache.qpid.ra.admin.QpidTopicImpl" jndi-name="HelloTopic" use-java-context="false" pool-name="HelloTopic"> - <config-property name="destinationAddress"> + <admin-object class-name="org.apache.qpid.ra.admin.QpidTopicImpl" jndi-name="java:jboss/exported/HelloTopic" use-java-context="false" pool-name="HelloTopic"> + <config-property name="DestinationAddress"> @qpid.goodbye.topic.dest.address@ </config-property> </admin-object> - <admin-object class-name="org.apache.qpid.ra.admin.QpidQueueImpl" jndi-name="GoodByeQueue" use-java-context="false" pool-name="GoodByeQueue"> - <config-property name="destinationAddress"> + <admin-object class-name="org.apache.qpid.ra.admin.QpidQueueImpl" jndi-name="java:jboss/exported/GoodByeQueue" use-java-context="false" pool-name="GoodByeQueue"> + <config-property name="DestinationAddress"> @qpid.goodbye.queue.dest.address@ </config-property> </admin-object> - <admin-object class-name="org.apache.qpid.ra.admin.QpidQueueImpl" jndi-name="HelloQueue" use-java-context="false" pool-name="HelloQueue"> - <config-property name="destinationAddress"> + <admin-object class-name="org.apache.qpid.ra.admin.QpidQueueImpl" jndi-name="java:jboss/exported/HelloQueue" use-java-context="false" pool-name="HelloQueue"> + <config-property name="DestinationAddress"> @qpid.hello.queue.dest.address@ </config-property> </admin-object> - <admin-object class-name="org.apache.qpid.ra.admin.QpidQueueImpl" jndi-name="QpidResponderQueue" use-java-context="false" pool-name="QpidResponderQueue"> - <config-property name="destinationAddress"> - @qpid.responder.queue.dest.address@ + <admin-object class-name="org.apache.qpid.ra.admin.QpidQueueImpl" jndi-name="java:jboss/exported/QpidRequestQueue" use-java-context="false" pool-name="QpidRequestQueue"> + <config-property name="DestinationAddress"> + @qpid.request.queue.dest.address@ + </config-property> + </admin-object> + <admin-object class-name="org.apache.qpid.ra.admin.QpidQueueImpl" jndi-name="java:jboss/exported/QpidResponseQueue" use-java-context="false" pool-name="QpidResponseQueue"> + <config-property name="DestinationAddress"> + @qpid.response.queue.dest.address@ </config-property> </admin-object> </admin-objects> diff --git a/qpid/java/jca/src/main/java/org/apache/qpid/ra/admin/QpidConnectionFactoryProxy.java b/qpid/java/jca/src/main/java/org/apache/qpid/ra/admin/QpidConnectionFactoryProxy.java index 7f2bee079f..a948948d6a 100644 --- a/qpid/java/jca/src/main/java/org/apache/qpid/ra/admin/QpidConnectionFactoryProxy.java +++ b/qpid/java/jca/src/main/java/org/apache/qpid/ra/admin/QpidConnectionFactoryProxy.java @@ -77,17 +77,17 @@ public class QpidConnectionFactoryProxy implements Externalizable, Referenceable public void writeExternal(ObjectOutput out) throws IOException { - if (_delegate == null) - { - _log.error("Null Destination "); - throw new IOException("Null ConnectionFactory!"); - } try { + if(_delegate == null) + { + getReference(); + } + out.writeObject(((Referenceable) _delegate).getReference()); } - catch (NamingException e) + catch (Exception e) { _log.error("Failed to dereference ConnectionFactory " + e.getMessage(), e); throw new IOException("Failed to dereference ConnectionFactory: " + e.getMessage()); |