Author: alessio.soldano(a)jboss.com
Date: 2008-02-01 11:58:45 -0500 (Fri, 01 Feb 2008)
New Revision: 5558
Added:
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/samples/dar/DarResponseMessageBean.java
stack/native/trunk/src/test/resources/jaxws/samples/dar/META-INF/
stack/native/trunk/src/test/resources/jaxws/samples/dar/META-INF/jboss-service.xml
Modified:
stack/native/trunk/ant-import-tests/build-samples-jaxws.xml
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/samples/dar/JMSClient.java
Log:
[JBWS-1895] Some improvements to show async
Modified: stack/native/trunk/ant-import-tests/build-samples-jaxws.xml
===================================================================
--- stack/native/trunk/ant-import-tests/build-samples-jaxws.xml 2008-02-01 15:11:30 UTC
(rev 5557)
+++ stack/native/trunk/ant-import-tests/build-samples-jaxws.xml 2008-02-01 16:58:45 UTC
(rev 5558)
@@ -94,6 +94,20 @@
<include name="jboss-web.xml"/>
</webinf>
</war>
+ <jar
jarfile="${tests.output.dir}/libs/jaxws-samples-dar-jms-client.jar">
+ <fileset dir="${tests.output.dir}/classes">
+ <include
name="org/jboss/test/ws/jaxws/samples/dar/DarResponseMessageBean.class"/>
+ </fileset>
+ </jar>
+ <jar
jarfile="${tests.output.dir}/libs/jaxws-samples-dar-jms-client.sar">
+ <fileset dir="${tests.output.dir}/libs">
+ <include name="jaxws-samples-dar-jms-client.war"/>
+ <include name="jaxws-samples-dar-jms-client.jar"/>
+ </fileset>
+ <metainf
dir="${tests.output.dir}/resources/jaxws/samples/dar/META-INF">
+ <include name="jboss-service.xml"/>
+ </metainf>
+ </jar>
<!-- jaxws-samples-jmstransport -->
Added:
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/samples/dar/DarResponseMessageBean.java
===================================================================
---
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/samples/dar/DarResponseMessageBean.java
(rev 0)
+++
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/samples/dar/DarResponseMessageBean.java 2008-02-01
16:58:45 UTC (rev 5558)
@@ -0,0 +1,63 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.samples.dar;
+
+//$Id:$
+
+import javax.ejb.ActivationConfigProperty;
+import javax.ejb.MessageDriven;
+import javax.jms.Message;
+import javax.jms.TextMessage;
+
+import org.jboss.logging.Logger;
+
+/**
+ * Receives DAR responses through JMS
+ *
+ * @author alessio.soldano(a)jboss.org
+ * @since 31-Jan-2008
+ */
+@MessageDriven(activationConfig = {
+ @ActivationConfigProperty(propertyName = "destinationType", propertyValue
= "javax.jms.Queue"),
+ @ActivationConfigProperty(propertyName = "destination", propertyValue =
"queue/DarResponseQueue")
+ },
+ messageListenerInterface = javax.jms.MessageListener.class
+)
+public class DarResponseMessageBean
+{
+ private Logger log = Logger.getLogger(DarResponseMessageBean.class);
+
+ public void onMessage(Message arg0)
+ {
+ try
+ {
+ TextMessage textMessage = (TextMessage)arg0;
+ String result = textMessage.getText();
+ log.info("DAR response received: " + result);
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+ }
+
+}
Property changes on:
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/samples/dar/DarResponseMessageBean.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified:
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/samples/dar/JMSClient.java
===================================================================
---
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/samples/dar/JMSClient.java 2008-02-01
15:11:30 UTC (rev 5557)
+++
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/samples/dar/JMSClient.java 2008-02-01
16:58:45 UTC (rev 5558)
@@ -29,7 +29,6 @@
import javax.jms.Queue;
import javax.jms.QueueConnection;
import javax.jms.QueueConnectionFactory;
-import javax.jms.QueueReceiver;
import javax.jms.QueueSender;
import javax.jms.QueueSession;
import javax.jms.Session;
@@ -116,24 +115,15 @@
Queue reqQueue = (Queue)context.lookup("queue/DarRequestQueue");
con = connectionFactory.createQueueConnection();
session = con.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
- Queue resQueue = session.createTemporaryQueue();
- QueueReceiver receiver = session.createReceiver(resQueue);
+ Queue resQueue = (Queue)context.lookup("queue/DarResponseQueue");
con.start();
TextMessage message = session.createTextMessage(reqMessage);
message.setJMSReplyTo(resQueue);
QueueSender sender = session.createSender(reqQueue);
sender.send(message);
sender.close();
-
- log.info("Request message sent, doing something interesting in the mean
time... ;-) ");
-
- TextMessage textMessage = (TextMessage)receiver.receive();
- String result = textMessage.getText();
- log.info("DAR response received: " + result);
+ ps.println("Request message sent, doing something interesting in the mean
time... ;-) ");
con.stop();
- session.close();
- con.close();
- ps.println(result);
}
catch (Exception e)
{
@@ -153,6 +143,7 @@
catch(Exception e1) {}
}
}
+
protected void doPost(HttpServletRequest httpServletRequest, HttpServletResponse
httpServletResponse) throws ServletException, IOException {
doGet(httpServletRequest,httpServletResponse);
Added: stack/native/trunk/src/test/resources/jaxws/samples/dar/META-INF/jboss-service.xml
===================================================================
--- stack/native/trunk/src/test/resources/jaxws/samples/dar/META-INF/jboss-service.xml
(rev 0)
+++
stack/native/trunk/src/test/resources/jaxws/samples/dar/META-INF/jboss-service.xml 2008-02-01
16:58:45 UTC (rev 5558)
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<server>
+</server>
\ No newline at end of file
Property changes on:
stack/native/trunk/src/test/resources/jaxws/samples/dar/META-INF/jboss-service.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF