[jboss-svn-commits] JBL Code SVN: r11450 - in labs/jbossesb/trunk/product/samples/quickstarts/helloworld: src and 8 other directories.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Sun Apr 29 13:48:17 EDT 2007
Author: sebcao
Date: 2007-04-29 13:48:17 -0400 (Sun, 29 Apr 2007)
New Revision: 11450
Added:
labs/jbossesb/trunk/product/samples/quickstarts/helloworld/src/org/
labs/jbossesb/trunk/product/samples/quickstarts/helloworld/src/org/jboss/
labs/jbossesb/trunk/product/samples/quickstarts/helloworld/src/org/jboss/soa/
labs/jbossesb/trunk/product/samples/quickstarts/helloworld/src/org/jboss/soa/esb/
labs/jbossesb/trunk/product/samples/quickstarts/helloworld/src/org/jboss/soa/esb/samples/
labs/jbossesb/trunk/product/samples/quickstarts/helloworld/src/org/jboss/soa/esb/samples/quickstart/
labs/jbossesb/trunk/product/samples/quickstarts/helloworld/src/org/jboss/soa/esb/samples/quickstart/helloworld/
labs/jbossesb/trunk/product/samples/quickstarts/helloworld/src/org/jboss/soa/esb/samples/quickstart/helloworld/MyJMSListenerAction.java
labs/jbossesb/trunk/product/samples/quickstarts/helloworld/src/org/jboss/soa/esb/samples/quickstart/helloworld/test/
labs/jbossesb/trunk/product/samples/quickstarts/helloworld/src/org/jboss/soa/esb/samples/quickstart/helloworld/test/SendEsbMessage.java
labs/jbossesb/trunk/product/samples/quickstarts/helloworld/src/org/jboss/soa/esb/samples/quickstart/helloworld/test/SendJMSMessage.java
Removed:
labs/jbossesb/trunk/product/samples/quickstarts/helloworld/src/org/jboss/soa/esb/samples/quickstart/helloworld/test/SendEsbMessage.java
labs/jbossesb/trunk/product/samples/quickstarts/helloworld/src/org/jboss/soa/esb/samples/quickstart/helloworld/test/SendJMSMessage.java
Modified:
labs/jbossesb/trunk/product/samples/quickstarts/helloworld/build.xml
labs/jbossesb/trunk/product/samples/quickstarts/helloworld/jboss-esb.xml
labs/jbossesb/trunk/product/samples/quickstarts/helloworld/readme.txt
Log:
JBESB-403
Modified: labs/jbossesb/trunk/product/samples/quickstarts/helloworld/build.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/helloworld/build.xml 2007-04-29 17:44:22 UTC (rev 11449)
+++ labs/jbossesb/trunk/product/samples/quickstarts/helloworld/build.xml 2007-04-29 17:48:17 UTC (rev 11450)
@@ -11,7 +11,7 @@
<target name="runtest" depends="compile"
description="sends a JMS message to queue/quickstart_helloworld_Request_gw">
<echo>Runs Test JMS Sender</echo>
- <java fork="yes" classname="quickstart.helloworld.test.SendJMSMessage" failonerror="true">
+ <java fork="yes" classname="org.jboss.soa.esb.samples.quickstart.helloworld.test.SendJMSMessage" failonerror="true">
<arg value="Hello World"/>
<classpath refid="exec-classpath"/>
</java>
@@ -20,7 +20,7 @@
<target name="sendesb" depends="compile"
description="Will send an esb Message">
<echo>Runs Test ESB Message Sender</echo>
- <java fork="yes" classname="quickstart.helloworld.test.SendEsbMessage" failonerror="true">
+ <java fork="yes" classname="org.jboss.soa.esb.samples.quickstart.helloworld.test.SendEsbMessage" failonerror="true">
<arg value="FirstServiceESB"/> <!-- service category -->
<arg value="SimpleListener"/> <!-- service name -->
<arg value="Hello World - Straight to ESB listener - no Gateway"/> <!-- Message text -->
Modified: labs/jbossesb/trunk/product/samples/quickstarts/helloworld/jboss-esb.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/helloworld/jboss-esb.xml 2007-04-29 17:44:22 UTC (rev 11449)
+++ labs/jbossesb/trunk/product/samples/quickstarts/helloworld/jboss-esb.xml 2007-04-29 17:48:17 UTC (rev 11450)
@@ -40,7 +40,7 @@
</listeners>
<actions>
<action name="action1"
- class="quickstart.helloworld.MyJMSListenerAction"
+ class="org.jboss.soa.esb.samples.quickstart.helloworld.MyJMSListenerAction"
process="displayMessage"
/>
</actions>
Modified: labs/jbossesb/trunk/product/samples/quickstarts/helloworld/readme.txt
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/helloworld/readme.txt 2007-04-29 17:44:22 UTC (rev 11449)
+++ labs/jbossesb/trunk/product/samples/quickstarts/helloworld/readme.txt 2007-04-29 17:48:17 UTC (rev 11450)
@@ -46,7 +46,7 @@
self-registration based upon the service-category and service-name found in the esb-config.xml file.
jndi.properties:
- Needed primarily for quickstart.test.SendJMSMessage that is fired by ant runtest.
+ Needed primarily for org.jboss.soa.esb.samples.quickstart.helloworld.test.SendJMSMessage that is fired by ant runtest.
log4j.xml:
Needed to configure log4J used by both the quickstart and the ESB itself. A listener needs a place to log.
@@ -70,7 +70,7 @@
This generates a file called myclasspath.txt which can be reviewed in a text editor
* the run task calls the Launcher passing in 3 arguments the most important are the esb-config.xml and
esb-config-gateway.xml files
- * the runtest task calls the quickstart.test.SendJMSMessage class and passes in an argument representing
+ * the runtest task calls the org.jboss.soa.esb.samples.quickstart.helloworld.test.SendJMSMessage class and passes in an argument representing
the string-based message to be pused into the queue the gateway is listening on. Note: SendJMSMessage
contains a hard-coded queue name.
Copied: labs/jbossesb/trunk/product/samples/quickstarts/helloworld/src/org/jboss/soa/esb/samples/quickstart/helloworld/MyJMSListenerAction.java (from rev 11423, labs/jbossesb/trunk/product/samples/quickstarts/helloworld/src/quickstart/helloworld/MyJMSListenerAction.java)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/helloworld/src/org/jboss/soa/esb/samples/quickstart/helloworld/MyJMSListenerAction.java (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/helloworld/src/org/jboss/soa/esb/samples/quickstart/helloworld/MyJMSListenerAction.java 2007-04-29 17:48:17 UTC (rev 11450)
@@ -0,0 +1,45 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * 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,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+package org.jboss.soa.esb.samples.quickstart.helloworld;
+
+import org.jboss.soa.esb.actions.AbstractActionLifecycle;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.message.Message;
+
+public class MyJMSListenerAction extends AbstractActionLifecycle
+{
+
+ protected ConfigTree _config;
+
+ public MyJMSListenerAction(ConfigTree config) { _config = config; }
+
+
+ public Message displayMessage(Message message) throws Exception{
+
+ System.out.println("&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&");
+ System.out.println("Body: " + new String(message.getBody().getContents()));
+ System.out.println("&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&");
+ return message;
+
+ }
+
+
+}
\ No newline at end of file
Copied: labs/jbossesb/trunk/product/samples/quickstarts/helloworld/src/org/jboss/soa/esb/samples/quickstart/helloworld/test (from rev 11423, labs/jbossesb/trunk/product/samples/quickstarts/helloworld/src/quickstart/helloworld/test)
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/helloworld/src/org/jboss/soa/esb/samples/quickstart/helloworld/test/SendEsbMessage.java
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/helloworld/src/quickstart/helloworld/test/SendEsbMessage.java 2007-04-27 19:24:49 UTC (rev 11423)
+++ labs/jbossesb/trunk/product/samples/quickstarts/helloworld/src/org/jboss/soa/esb/samples/quickstart/helloworld/test/SendEsbMessage.java 2007-04-29 17:48:17 UTC (rev 11450)
@@ -1,64 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, 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 quickstart.helloworld.test;
-
-import java.net.URI;
-import java.util.UUID;
-
-import org.jboss.soa.esb.addressing.Call;
-import org.jboss.soa.esb.listeners.ListenerUtil;
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.message.format.MessageFactory;
-
-/**
- * Standalone class with to send ESB messages to a 'known' [category,name].
- * <p/> arg0 - service category
- * <br/>arg1 - service name
- * <br/>arg2 - Text of message to send
- *
- * @author <a href="mailto:schifest at heuristica.com.ar">schifest at heuristica.com.ar</a>
- * @since Version 4.0
- *
- */
-public class SendEsbMessage
-{
- public static void main(String args[]) throws Exception
- {
- if (args.length < 3)
- {
- System.out.println("Usage SendEsbMessage <category> <name> <text to send>");
- }
- // Create a message, assign it a UID, and fill in call information
- Message esbMessage = MessageFactory.getInstance().getMessage();
- Call call = new Call();
- call.setMessageID(new URI(UUID.randomUUID().toString()));
- esbMessage.getHeader().setCall(call);
-
- // set body contents with args[2], and send
- esbMessage.getBody().setContents(args[2].getBytes());
-
- ListenerUtil.tryToDeliver(esbMessage, args[0], args[1]);
-
- }
-
-}
\ No newline at end of file
Copied: labs/jbossesb/trunk/product/samples/quickstarts/helloworld/src/org/jboss/soa/esb/samples/quickstart/helloworld/test/SendEsbMessage.java (from rev 11439, labs/jbossesb/trunk/product/samples/quickstarts/helloworld/src/quickstart/helloworld/test/SendEsbMessage.java)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/helloworld/src/org/jboss/soa/esb/samples/quickstart/helloworld/test/SendEsbMessage.java (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/helloworld/src/org/jboss/soa/esb/samples/quickstart/helloworld/test/SendEsbMessage.java 2007-04-29 17:48:17 UTC (rev 11450)
@@ -0,0 +1,64 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, 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.soa.esb.samples.quickstart.helloworld.test;
+
+import java.net.URI;
+import java.util.UUID;
+
+import org.jboss.soa.esb.addressing.Call;
+import org.jboss.soa.esb.listeners.ListenerUtil;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.message.format.MessageFactory;
+
+/**
+ * Standalone class with to send ESB messages to a 'known' [category,name].
+ * <p/> arg0 - service category
+ * <br/>arg1 - service name
+ * <br/>arg2 - Text of message to send
+ *
+ * @author <a href="mailto:schifest at heuristica.com.ar">schifest at heuristica.com.ar</a>
+ * @since Version 4.0
+ *
+ */
+public class SendEsbMessage
+{
+ public static void main(String args[]) throws Exception
+ {
+ if (args.length < 3)
+ {
+ System.out.println("Usage SendEsbMessage <category> <name> <text to send>");
+ }
+ // Create a message, assign it a UID, and fill in call information
+ Message esbMessage = MessageFactory.getInstance().getMessage();
+ Call call = new Call();
+ call.setMessageID(new URI(UUID.randomUUID().toString()));
+ esbMessage.getHeader().setCall(call);
+
+ // set body contents with args[2], and send
+ esbMessage.getBody().setContents(args[2].getBytes());
+
+ ListenerUtil.tryToDeliver(esbMessage, args[0], args[1]);
+
+ }
+
+}
\ No newline at end of file
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/helloworld/src/org/jboss/soa/esb/samples/quickstart/helloworld/test/SendJMSMessage.java
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/helloworld/src/quickstart/helloworld/test/SendJMSMessage.java 2007-04-27 19:24:49 UTC (rev 11423)
+++ labs/jbossesb/trunk/product/samples/quickstarts/helloworld/src/org/jboss/soa/esb/samples/quickstart/helloworld/test/SendJMSMessage.java 2007-04-29 17:48:17 UTC (rev 11450)
@@ -1,86 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, JBoss Inc., and others contributors as indicated
- * by the @authors tag. All rights reserved.
- * See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A
- * 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,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301, USA.
- *
- * (C) 2005-2006,
- * @author JBoss Inc.
- */
-package quickstart.helloworld.test;
-
-import java.util.Hashtable;
-
-import javax.jms.JMSException;
-import javax.jms.ObjectMessage;
-import javax.jms.Queue;
-import javax.jms.QueueConnection;
-import javax.jms.QueueConnectionFactory;
-import javax.jms.QueueSender;
-import javax.jms.QueueSession;
-import javax.naming.Context;
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-
-public class SendJMSMessage {
- QueueConnection conn;
- QueueSession session;
- Queue que;
-
-
- public void setupConnection() throws JMSException, NamingException
- {
- Hashtable properties1 = new Hashtable();
- properties1.put(Context.INITIAL_CONTEXT_FACTORY,
- "org.jnp.interfaces.NamingContextFactory");
- properties1.put(Context.URL_PKG_PREFIXES,
- "org.jboss.naming:org.jnp.interfaces");
- properties1.put(Context.PROVIDER_URL, "jnp://127.0.0.1:1099");
- InitialContext iniCtx = new InitialContext(properties1);
-
- Object tmp = iniCtx.lookup("ConnectionFactory");
- QueueConnectionFactory qcf = (QueueConnectionFactory) tmp;
- conn = qcf.createQueueConnection();
- que = (Queue) iniCtx.lookup("queue/quickstart_helloworld_Request_gw");
- session = conn.createQueueSession(false, QueueSession.AUTO_ACKNOWLEDGE);
- conn.start();
- System.out.println("Connection Started");
- }
-
- public void stop() throws JMSException
- {
- conn.stop();
- session.close();
- conn.close();
- }
-
- public void sendAMessage(String msg) throws JMSException {
-
- QueueSender send = session.createSender(que);
- ObjectMessage tm = session.createObjectMessage(msg);
- send.send(tm);
- send.close();
- }
-
-
- public static void main(String args[]) throws Exception
- {
- SendJMSMessage sm = new SendJMSMessage();
- sm.setupConnection();
- sm.sendAMessage(args[0]);
- sm.stop();
-
- }
-
-}
Copied: labs/jbossesb/trunk/product/samples/quickstarts/helloworld/src/org/jboss/soa/esb/samples/quickstart/helloworld/test/SendJMSMessage.java (from rev 11439, labs/jbossesb/trunk/product/samples/quickstarts/helloworld/src/quickstart/helloworld/test/SendJMSMessage.java)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/helloworld/src/org/jboss/soa/esb/samples/quickstart/helloworld/test/SendJMSMessage.java (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/helloworld/src/org/jboss/soa/esb/samples/quickstart/helloworld/test/SendJMSMessage.java 2007-04-29 17:48:17 UTC (rev 11450)
@@ -0,0 +1,86 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * 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,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+package org.jboss.soa.esb.samples.quickstart.helloworld.test;
+
+import java.util.Hashtable;
+
+import javax.jms.JMSException;
+import javax.jms.ObjectMessage;
+import javax.jms.Queue;
+import javax.jms.QueueConnection;
+import javax.jms.QueueConnectionFactory;
+import javax.jms.QueueSender;
+import javax.jms.QueueSession;
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+
+public class SendJMSMessage {
+ QueueConnection conn;
+ QueueSession session;
+ Queue que;
+
+
+ public void setupConnection() throws JMSException, NamingException
+ {
+ Hashtable properties1 = new Hashtable();
+ properties1.put(Context.INITIAL_CONTEXT_FACTORY,
+ "org.jnp.interfaces.NamingContextFactory");
+ properties1.put(Context.URL_PKG_PREFIXES,
+ "org.jboss.naming:org.jnp.interfaces");
+ properties1.put(Context.PROVIDER_URL, "jnp://127.0.0.1:1099");
+ InitialContext iniCtx = new InitialContext(properties1);
+
+ Object tmp = iniCtx.lookup("ConnectionFactory");
+ QueueConnectionFactory qcf = (QueueConnectionFactory) tmp;
+ conn = qcf.createQueueConnection();
+ que = (Queue) iniCtx.lookup("queue/quickstart_helloworld_Request_gw");
+ session = conn.createQueueSession(false, QueueSession.AUTO_ACKNOWLEDGE);
+ conn.start();
+ System.out.println("Connection Started");
+ }
+
+ public void stop() throws JMSException
+ {
+ conn.stop();
+ session.close();
+ conn.close();
+ }
+
+ public void sendAMessage(String msg) throws JMSException {
+
+ QueueSender send = session.createSender(que);
+ ObjectMessage tm = session.createObjectMessage(msg);
+ send.send(tm);
+ send.close();
+ }
+
+
+ public static void main(String args[]) throws Exception
+ {
+ SendJMSMessage sm = new SendJMSMessage();
+ sm.setupConnection();
+ sm.sendAMessage(args[0]);
+ sm.stop();
+
+ }
+
+}
More information about the jboss-svn-commits
mailing list