[jboss-svn-commits] JBL Code SVN: r20251 - in labs/jbossesb/workspace/jimma/product: rosetta/src/org/jboss/soa/esb/listeners/config and 12 other directories.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Mon Jun 2 03:47:49 EDT 2008


Author: jim.ma
Date: 2008-06-02 03:47:49 -0400 (Mon, 02 Jun 2008)
New Revision: 20251

Added:
   labs/jbossesb/workspace/jimma/product/rosetta/src/org/jboss/internal/soa/esb/publish/ServiceContractPublisher.java
   labs/jbossesb/workspace/jimma/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/request.xsd
   labs/jbossesb/workspace/jimma/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/response.xsd
   labs/jbossesb/workspace/jimma/product/samples/quickstarts/helloworld_pub_service/
   labs/jbossesb/workspace/jimma/product/samples/quickstarts/helloworld_pub_service/build.xml
   labs/jbossesb/workspace/jimma/product/samples/quickstarts/helloworld_pub_service/deployment.xml
   labs/jbossesb/workspace/jimma/product/samples/quickstarts/helloworld_pub_service/jbm-queue-service.xml
   labs/jbossesb/workspace/jimma/product/samples/quickstarts/helloworld_pub_service/jbmq-queue-service.xml
   labs/jbossesb/workspace/jimma/product/samples/quickstarts/helloworld_pub_service/jboss-esb.xml
   labs/jbossesb/workspace/jimma/product/samples/quickstarts/helloworld_pub_service/jbossesb-properties.xml
   labs/jbossesb/workspace/jimma/product/samples/quickstarts/helloworld_pub_service/jndi.properties
   labs/jbossesb/workspace/jimma/product/samples/quickstarts/helloworld_pub_service/juddi.properties
   labs/jbossesb/workspace/jimma/product/samples/quickstarts/helloworld_pub_service/lib/
   labs/jbossesb/workspace/jimma/product/samples/quickstarts/helloworld_pub_service/log4j.xml
   labs/jbossesb/workspace/jimma/product/samples/quickstarts/helloworld_pub_service/readme.txt
   labs/jbossesb/workspace/jimma/product/samples/quickstarts/helloworld_pub_service/request.xsd
   labs/jbossesb/workspace/jimma/product/samples/quickstarts/helloworld_pub_service/response.xsd
   labs/jbossesb/workspace/jimma/product/samples/quickstarts/helloworld_pub_service/src/
   labs/jbossesb/workspace/jimma/product/samples/quickstarts/helloworld_pub_service/src/org/
   labs/jbossesb/workspace/jimma/product/samples/quickstarts/helloworld_pub_service/src/org/jboss/
   labs/jbossesb/workspace/jimma/product/samples/quickstarts/helloworld_pub_service/src/org/jboss/soa/
   labs/jbossesb/workspace/jimma/product/samples/quickstarts/helloworld_pub_service/src/org/jboss/soa/esb/
   labs/jbossesb/workspace/jimma/product/samples/quickstarts/helloworld_pub_service/src/org/jboss/soa/esb/samples/
   labs/jbossesb/workspace/jimma/product/samples/quickstarts/helloworld_pub_service/src/org/jboss/soa/esb/samples/quickstart/
   labs/jbossesb/workspace/jimma/product/samples/quickstarts/helloworld_pub_service/src/org/jboss/soa/esb/samples/quickstart/helloworld/
   labs/jbossesb/workspace/jimma/product/samples/quickstarts/helloworld_pub_service/src/org/jboss/soa/esb/samples/quickstart/helloworld/MyJMSListenerAction.java
   labs/jbossesb/workspace/jimma/product/samples/quickstarts/helloworld_pub_service/src/org/jboss/soa/esb/samples/quickstart/helloworld/test/
   labs/jbossesb/workspace/jimma/product/samples/quickstarts/helloworld_pub_service/src/org/jboss/soa/esb/samples/quickstart/helloworld/test/SendEsbMessage.java
   labs/jbossesb/workspace/jimma/product/samples/quickstarts/helloworld_pub_service/src/org/jboss/soa/esb/samples/quickstart/helloworld/test/SendJMSMessage.java
Removed:
   labs/jbossesb/workspace/jimma/product/rosetta/src/org/jboss/internal/soa/esb/publish/SerivceContractPublisher.java
Modified:
   labs/jbossesb/workspace/jimma/product/rosetta/src/org/jboss/soa/esb/listeners/config/ServicePublisher.java
   labs/jbossesb/workspace/jimma/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/ServicePublisherUnitTest.java
   labs/jbossesb/workspace/jimma/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/jbossesb_config_06.xml
Log:
* Add sample to demonstrate how to generate wsdl from a esb service.
* Modified the ServicePublisherUnitTest



Deleted: labs/jbossesb/workspace/jimma/product/rosetta/src/org/jboss/internal/soa/esb/publish/SerivceContractPublisher.java
===================================================================
--- labs/jbossesb/workspace/jimma/product/rosetta/src/org/jboss/internal/soa/esb/publish/SerivceContractPublisher.java	2008-06-02 02:44:41 UTC (rev 20250)
+++ labs/jbossesb/workspace/jimma/product/rosetta/src/org/jboss/internal/soa/esb/publish/SerivceContractPublisher.java	2008-06-02 07:47:49 UTC (rev 20251)
@@ -1,37 +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, JBoss Inc.
- */
-package org.jboss.internal.soa.esb.publish;
-
-import org.jboss.soa.esb.ConfigurationException;
-import org.jboss.soa.esb.addressing.EPR;
-import org.jboss.soa.esb.listeners.config.xbeanmodel.ActionsDocument.Actions;
-
-public class SerivceContractPublisher implements ContractPublisher {
-	String wsdl;
-
-	public void setActionConfig(Actions actionsConfig)
-			throws ConfigurationException {
-		wsdl = "esb_service.wsdl";
-	}
-
-	public ContractInfo getContractInfo(EPR epr) {
-		return new ContractInfo("text/xml", wsdl);
-	}
-}

Added: labs/jbossesb/workspace/jimma/product/rosetta/src/org/jboss/internal/soa/esb/publish/ServiceContractPublisher.java
===================================================================
--- labs/jbossesb/workspace/jimma/product/rosetta/src/org/jboss/internal/soa/esb/publish/ServiceContractPublisher.java	                        (rev 0)
+++ labs/jbossesb/workspace/jimma/product/rosetta/src/org/jboss/internal/soa/esb/publish/ServiceContractPublisher.java	2008-06-02 07:47:49 UTC (rev 20251)
@@ -0,0 +1,262 @@
+/*
+ * 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, JBoss Inc.
+ */
+package org.jboss.internal.soa.esb.publish;
+
+import java.io.StringWriter;
+
+import javax.wsdl.Binding;
+import javax.wsdl.BindingFault;
+import javax.wsdl.BindingInput;
+import javax.wsdl.BindingOperation;
+import javax.wsdl.BindingOutput;
+import javax.wsdl.Definition;
+import javax.wsdl.Fault;
+import javax.wsdl.Input;
+import javax.wsdl.Message;
+import javax.wsdl.Operation;
+import javax.wsdl.Output;
+import javax.wsdl.Part;
+import javax.wsdl.PortType;
+import javax.wsdl.Types;
+import javax.wsdl.WSDLException;
+import javax.wsdl.factory.WSDLFactory;
+import javax.xml.namespace.QName;
+
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.addressing.EPR;
+import org.jboss.soa.esb.dom.YADOMUtil;
+import org.jboss.soa.esb.listeners.config.xbeanmodel.ServiceDocument.Service;
+import org.jboss.soa.esb.util.ClassUtil;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+import com.ibm.wsdl.extensions.schema.SchemaImpl;
+import com.ibm.wsdl.extensions.soap.SOAPAddressImpl;
+import com.ibm.wsdl.extensions.soap.SOAPBindingImpl;
+
+public class ServiceContractPublisher implements ContractPublisher {
+	final QName XSD_QN = new QName("http://www.w3.org/2001/XMLSchema", "schema");
+	String wsdl;
+	Definition def = null;
+	int nsSuffixCounter = 1;
+
+	public void setServiceConfig(Service serviceConfig)
+			throws ConfigurationException {
+
+		String targetNamespace = "http://" + serviceConfig.getCategory() + "/"
+				+ serviceConfig.getName();
+		String serviceName = serviceConfig.getCategory();
+
+		try {
+			def = WSDLFactory.newInstance().newDefinition();
+		} catch (WSDLException e1) {
+			throw new ConfigurationException(e1);
+		}
+		def.setTargetNamespace(targetNamespace);
+		def.addNamespace("tns", targetNamespace);
+		def.addNamespace("soap", "http://schemas.xmlsoap.org/wsdl/soap/");
+		// add types
+		Types types = def.createTypes();
+		def.setTypes(types);
+
+		Message reqMessage = null;
+		Message resMessage = null;
+		Message faultMessage = null;
+
+		String inXsd = serviceConfig.getActions().getInXsd();
+		String outXsd = serviceConfig.getActions().getOutXsd();
+		String faultXsd = serviceConfig.getActions().getFaultXsd();
+
+		if (inXsd != null) {
+			try {
+				Document doc = YADOMUtil.parseStream(ClassUtil
+						.getResourceAsStream(inXsd, getClass()), false, false);
+				if (doc != null) {
+					reqMessage = addMessage(doc.getDocumentElement(),
+							serviceName + "Req", "in");
+				}
+			} catch (Exception e) {
+				throw new ConfigurationException(e);
+			}
+
+		}
+
+		if (outXsd != null) {
+			try {
+				Document doc = YADOMUtil.parseStream(ClassUtil
+						.getResourceAsStream(outXsd, getClass()), false, false);
+				if (doc != null) {
+					resMessage = addMessage(doc.getDocumentElement(),
+							serviceName + "Res", "out");
+				}
+			} catch (Exception e) {
+				throw new ConfigurationException(e);
+			}
+
+		}
+
+		if (faultXsd != null) {
+			try {
+				Document doc = YADOMUtil.parseStream(ClassUtil
+						.getResourceAsStream(faultXsd, getClass()), false, false);
+				if (doc != null) {
+					faultMessage = addMessage(doc.getDocumentElement(),
+							serviceName + "fault", "fault");
+				}
+			} catch (Exception e) {
+				throw new ConfigurationException(e);
+			}
+
+		}
+
+		PortType portType = addPortType(serviceName, reqMessage, resMessage,
+				faultMessage);
+		Binding binding = addBinding(serviceName, portType);
+        addService(serviceName, binding);
+		StringWriter sw = new java.io.StringWriter();
+		try {
+			WSDLFactory.newInstance().newWSDLWriter().writeWSDL(def, sw);
+		} catch (WSDLException e) {
+		}
+		wsdl = sw.toString();
+
+	}
+
+	public ContractInfo getContractInfo(EPR epr) {
+		return new ContractInfo("text/xml", wsdl);
+	}
+
+	private void addSchema(Types types, Element xsdElement) {
+		SchemaImpl schemaImpl = new SchemaImpl();
+		schemaImpl.setElement(xsdElement);
+		schemaImpl.setElementType(XSD_QN);
+		types.addExtensibilityElement(schemaImpl);
+
+	}
+
+	private Message addMessage(Element element, String msgName, String partName) {
+		String schemaNs = YADOMUtil
+				.getAttribute(element, "targetNamespace", "");
+		addSchema(def.getTypes(), element);
+		if (def.getNamespace(schemaNs) == null) {
+			def.addNamespace("ns" + nsSuffixCounter, schemaNs);
+			nsSuffixCounter++;
+		}
+		// add request message
+		Node node = YADOMUtil.getNode(element, "/schema/element");
+		Message msg = def.createMessage();
+		msg.setQName(new QName(def.getTargetNamespace(), msgName));
+		msg.setUndefined(false);
+		Part part = def.createPart();
+		part.setName(partName);
+		part.setElementName(new QName(schemaNs, YADOMUtil.getAttribute(
+				(Element) node, "name", "")));
+		msg.addPart(part);
+		def.addMessage(msg);
+		return msg;
+	}
+
+	private PortType addPortType(String serviceName, Message inMessage,
+			Message outMessage, Message faultMessage) {
+		// add port type
+		PortType portType = def.createPortType();
+		portType.setQName(new QName(def.getTargetNamespace(), serviceName
+				+ "PortType"));
+		Operation op = def.createOperation();
+		op.setUndefined(false);
+		op.setName(serviceName);
+		if (inMessage != null) {
+			Input in = def.createInput();
+			in.setMessage(inMessage);
+			in.setName(inMessage.getQName().getLocalPart());
+			op.setInput(in);
+		}
+		if (outMessage != null) {
+			Output out = def.createOutput();
+			out.setMessage(outMessage);
+			out.setName(outMessage.getQName().getLocalPart());
+			op.setOutput(out);
+		}
+
+		if (faultMessage != null) {
+			Fault fault = def.createFault();
+			fault.setMessage(faultMessage);
+			fault.setName(faultMessage.getQName().getLocalPart());
+			op.addFault(fault);
+		}
+		portType.addOperation(op);
+		portType.setUndefined(false);
+		def.addPortType(portType);
+		return portType;
+	}
+
+	private Binding addBinding(String serviceName, PortType portType) {
+		// add binding
+		Binding binding = def.createBinding();
+		binding.setUndefined(false);
+		binding.setPortType(portType);
+		binding.setQName(new QName(def.getTargetNamespace(), serviceName
+				+ "Binding"));
+		SOAPBindingImpl soapBinding = new SOAPBindingImpl();
+		soapBinding.setStyle("document");
+		soapBinding.setTransportURI("http://schemas.xmlsoap.org/soap/http");
+		binding.addExtensibilityElement(soapBinding);
+
+		BindingOperation bop = def.createBindingOperation();
+
+		bop.setName(serviceName);
+		Operation op = (Operation) portType.getOperations().get(0);
+		bop.setOperation(op);
+		if (op.getInput() != null) {
+		BindingInput binput = def.createBindingInput();
+		bop.setBindingInput(binput);
+		} 
+		if (op.getOutput() != null) {
+			BindingOutput boutput = def.createBindingOutput();
+			bop.setBindingOutput(boutput);
+		}
+		if (op.getFaults().size() != 0 ) {
+			BindingFault bfault = def.createBindingFault();
+			Fault fault = (Fault)op.getFaults().values().iterator().next();
+			bfault.setName(fault.getName());
+			bop.addBindingFault(bfault);
+		}
+		binding.addBindingOperation(bop);
+		def.addBinding(binding);
+		return binding;
+
+	}
+
+	private void addService(String serviceName, Binding binding) {
+		// create service
+		javax.wsdl.Service service = def.createService();
+		service.setQName(new QName(def.getTargetNamespace(), serviceName
+				+ "Service"));
+		javax.wsdl.Port port = def.createPort();
+		port.setBinding(binding);
+		port.setName(serviceName + "Port");
+		SOAPAddressImpl soapAddress = new SOAPAddressImpl();
+		soapAddress.setLocationURI("http://change_this_URI");
+		port.addExtensibilityElement(soapAddress);
+		service.addPort(port);
+		def.addService(service);
+	}
+}

Modified: labs/jbossesb/workspace/jimma/product/rosetta/src/org/jboss/soa/esb/listeners/config/ServicePublisher.java
===================================================================
--- labs/jbossesb/workspace/jimma/product/rosetta/src/org/jboss/soa/esb/listeners/config/ServicePublisher.java	2008-06-02 02:44:41 UTC (rev 20250)
+++ labs/jbossesb/workspace/jimma/product/rosetta/src/org/jboss/soa/esb/listeners/config/ServicePublisher.java	2008-06-02 07:47:49 UTC (rev 20251)
@@ -10,7 +10,7 @@
 import org.jboss.internal.soa.esb.publish.ActionContractPublisher;
 import org.jboss.internal.soa.esb.publish.ContractPublisher;
 import org.jboss.internal.soa.esb.publish.Publish;
-import org.jboss.internal.soa.esb.publish.SerivceContractPublisher;
+import org.jboss.internal.soa.esb.publish.ServiceContractPublisher;
 import org.jboss.soa.esb.ConfigurationException;
 import org.jboss.soa.esb.listeners.config.xbeanmodel.ActionDocument.Action;
 import org.jboss.soa.esb.listeners.config.Generator.XMLBeansModel;
@@ -174,9 +174,9 @@
         }
         if (service.getActions().getInXsd() != null) 
         {
-           SerivceContractPublisher  publisher = new SerivceContractPublisher();
+           ServiceContractPublisher  publisher = new ServiceContractPublisher();
            try {
-        	     publisher.setActionConfig(service.getActions());
+        	     publisher.setServiceConfig(service);
            } catch (ConfigurationException e) {
         	     throw new RuntimeException("Failed to instantiate Service Contract Publisher '" + publisher.getClass().getName() + "'. Class must implement a public default constructor.", e);
            }

Modified: labs/jbossesb/workspace/jimma/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/ServicePublisherUnitTest.java
===================================================================
--- labs/jbossesb/workspace/jimma/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/ServicePublisherUnitTest.java	2008-06-02 02:44:41 UTC (rev 20250)
+++ labs/jbossesb/workspace/jimma/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/ServicePublisherUnitTest.java	2008-06-02 07:47:49 UTC (rev 20251)
@@ -5,7 +5,7 @@
 
 import junit.framework.TestCase;
 
-import org.jboss.internal.soa.esb.publish.SerivceContractPublisher;
+import org.jboss.internal.soa.esb.publish.ServiceContractPublisher;
 import org.jboss.soa.esb.ConfigurationException;
 import org.jboss.soa.esb.addressing.EPR;
 import org.jboss.soa.esb.listeners.lifecycle.ManagedLifecycleController;
@@ -97,19 +97,17 @@
 			
 			assertTrue(
 					"ServiceContractPublisher should be added to service publishers",
-					(publishers.get(2).getContractPublisher() instanceof SerivceContractPublisher));
+					(publishers.get(2).getContractPublisher() instanceof ServiceContractPublisher));
 			Registry registry;
 
 			registry = RegistryFactory.getRegistry();
 			EPR epr = registry.findEPR(publishers.get(2).getCategory(),
 					publishers.get(2).getServiceName());
-			assertEquals("esb_service.wsdl", 
-					publishers.get(2).getContractPublisher().getContractInfo(epr).getData());
+			assertNotNull(publishers.get(2).getContractPublisher().getContractInfo(epr).getData());
 
 			configUtil.stopController();
 
 		} catch (Exception e) {
-			// TODO Auto-generated catch block
 			e.printStackTrace();
 		}
 

Modified: labs/jbossesb/workspace/jimma/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/jbossesb_config_06.xml
===================================================================
--- labs/jbossesb/workspace/jimma/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/jbossesb_config_06.xml	2008-06-02 02:44:41 UTC (rev 20250)
+++ labs/jbossesb/workspace/jimma/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/jbossesb_config_06.xml	2008-06-02 07:47:49 UTC (rev 20251)
@@ -2,9 +2,9 @@
 <jbossesb xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd">
 	<services>
         <service category="C" name="3" description="A1" invmScope="GLOBAL">			  
-			<actions inXsd="request.xsd" outXsd="response.xsd" faultXsd="fault.xsd">    	    
+			<actions inXsd="/org/jboss/soa/esb/listeners/config/request.xsd" outXsd="/org/jboss/soa/esb/listeners/config/response.xsd">    	    
 				<action name="a1" class="org.jboss.soa.esb.actions.converters.ByteArrayToString" />
 			</actions>
 		</service>
     </services>	
-</jbossesb>
\ No newline at end of file
+</jbossesb>

Added: labs/jbossesb/workspace/jimma/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/request.xsd
===================================================================
--- labs/jbossesb/workspace/jimma/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/request.xsd	                        (rev 0)
+++ labs/jbossesb/workspace/jimma/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/request.xsd	2008-06-02 07:47:49 UTC (rev 20251)
@@ -0,0 +1,8 @@
+<xs:schema version="1.0" targetNamespace="http://www.jboss.org/sayHi" xmlns:x1="http://www.jboss.org/sayHi"  xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
+  <xs:element name="sayHi" type="x1:sayHi"/>
+  <xs:complexType name="sayHi">
+    <xs:sequence>
+      <xs:element name="arg0" type="xs:string" minOccurs="0"/>
+    </xs:sequence>
+  </xs:complexType>
+</xs:schema>

Added: labs/jbossesb/workspace/jimma/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/response.xsd
===================================================================
--- labs/jbossesb/workspace/jimma/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/response.xsd	                        (rev 0)
+++ labs/jbossesb/workspace/jimma/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/response.xsd	2008-06-02 07:47:49 UTC (rev 20251)
@@ -0,0 +1,8 @@
+<xs:schema version="1.0" targetNamespace="http://www.jboss.org/sayHi" xmlns:x1="http://www.jboss.org/sayHi"  xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
+  <xs:element name="sayHiReponse" type="x1:sayHiReponse"/>
+  <xs:complexType name="sayHiReponse">
+    <xs:sequence>
+      <xs:element name="arg0" type="xs:string" minOccurs="0"/>
+    </xs:sequence>
+  </xs:complexType>
+</xs:schema>

Added: labs/jbossesb/workspace/jimma/product/samples/quickstarts/helloworld_pub_service/build.xml
===================================================================
--- labs/jbossesb/workspace/jimma/product/samples/quickstarts/helloworld_pub_service/build.xml	                        (rev 0)
+++ labs/jbossesb/workspace/jimma/product/samples/quickstarts/helloworld_pub_service/build.xml	2008-06-02 07:47:49 UTC (rev 20251)
@@ -0,0 +1,57 @@
+<project name="Quickstart_helloworld_pub_service" default="run" basedir=".">
+	
+	<description> 
+		${ant.project.name}
+		${line.separator}
+	</description>
+	
+	<!-- Import the base Ant build script... -->
+	<import file="../conf/base-build.xml"/>
+	
+	<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="org.jboss.soa.esb.samples.quickstart.helloworld.test.SendJMSMessage" failonerror="true">
+			<arg value="Hello World"/>
+			<classpath refid="exec-classpath"/>
+		</java>
+	</target>  
+	
+	<target name="sendesb" depends="compile"
+		description="Will send an esb Message">
+		<echo>Runs Test ESB Message Sender</echo>
+		<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 -->
+			<classpath refid="exec-classpath"/>
+		</java>
+	</target>
+    
+    <target name="copy-metainf">
+        <mkdir dir="${build.dir}/META-INF" />
+        <copy todir="${build.dir}/META-INF">
+            <fileset dir="${basedir}" includes="jboss-esb.xml" />
+            <fileset dir="${basedir}" includes="deployment.xml" />
+        </copy>
+        <copy todir="${build.dir}">
+            <fileset dir="${basedir}" includes="request.xsd" />
+        </copy>
+    </target>
+
+    <target name="package-deployment">
+	<mkdir dir="lib"/>
+        <jar destfile="${build.dir}/${ant.project.name}.esb">
+                   <fileset dir="${build.dir}/classes" />
+                   <fileset dir="${build.dir}" includes="*.xsd"/>
+                   <fileset dir="${build.dir}" includes="*.jar,*.war"/>
+                   <fileset dir="${build.dir}" includes="deployment.xml"/>
+                   <fileset dir="${build.dir}" includes="META-INF/**" />
+                   <fileset dir="${basedir}/src" excludes="**/*.java" /> <!-- Please leave the src dir in here! -->
+                   <fileset dir="${basedir}" includes="${jms.service.file} ${additional.deploys}" excludes="build/**" />
+                   <fileset dir="${basedir}/lib" includes="*.jar"/>
+        </jar>
+    </target>
+       
+	
+</project>

Added: labs/jbossesb/workspace/jimma/product/samples/quickstarts/helloworld_pub_service/deployment.xml
===================================================================
--- labs/jbossesb/workspace/jimma/product/samples/quickstarts/helloworld_pub_service/deployment.xml	                        (rev 0)
+++ labs/jbossesb/workspace/jimma/product/samples/quickstarts/helloworld_pub_service/deployment.xml	2008-06-02 07:47:49 UTC (rev 20251)
@@ -0,0 +1,4 @@
+<jbossesb-deployment>
+  <depends>jboss.esb.quickstart.destination:service=Queue,name=quickstart_helloworld_Request_esb</depends>
+  <depends>jboss.esb.quickstart.destination:service=Queue,name=quickstart_helloworld_Request_gw</depends>
+</jbossesb-deployment>

Added: labs/jbossesb/workspace/jimma/product/samples/quickstarts/helloworld_pub_service/jbm-queue-service.xml
===================================================================
--- labs/jbossesb/workspace/jimma/product/samples/quickstarts/helloworld_pub_service/jbm-queue-service.xml	                        (rev 0)
+++ labs/jbossesb/workspace/jimma/product/samples/quickstarts/helloworld_pub_service/jbm-queue-service.xml	2008-06-02 07:47:49 UTC (rev 20251)
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<server>
+  <mbean code="org.jboss.jms.server.destination.QueueService"
+    name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_helloworld_Request_esb"
+    xmbean-dd="xmdesc/Queue-xmbean.xml">
+	<depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+	<depends>jboss.messaging:service=PostOffice</depends>
+  </mbean>
+  <mbean code="org.jboss.jms.server.destination.QueueService"
+    name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_helloworld_Request_gw"
+    xmbean-dd="xmdesc/Queue-xmbean.xml">
+    <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+	<depends>jboss.messaging:service=PostOffice</depends>
+  </mbean>
+</server>

Added: labs/jbossesb/workspace/jimma/product/samples/quickstarts/helloworld_pub_service/jbmq-queue-service.xml
===================================================================
--- labs/jbossesb/workspace/jimma/product/samples/quickstarts/helloworld_pub_service/jbmq-queue-service.xml	                        (rev 0)
+++ labs/jbossesb/workspace/jimma/product/samples/quickstarts/helloworld_pub_service/jbmq-queue-service.xml	2008-06-02 07:47:49 UTC (rev 20251)
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<server>
+  <mbean code="org.jboss.mq.server.jmx.Queue"
+    name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_helloworld_Request_esb">
+    <depends optional-attribute-name="DestinationManager">
+      jboss.mq:service=DestinationManager
+    </depends>
+  </mbean>
+  <mbean code="org.jboss.mq.server.jmx.Queue"
+    name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_helloworld_Request_gw">
+    <depends optional-attribute-name="DestinationManager">
+      jboss.mq:service=DestinationManager
+    </depends>
+  </mbean>
+</server>

Added: labs/jbossesb/workspace/jimma/product/samples/quickstarts/helloworld_pub_service/jboss-esb.xml
===================================================================
--- labs/jbossesb/workspace/jimma/product/samples/quickstarts/helloworld_pub_service/jboss-esb.xml	                        (rev 0)
+++ labs/jbossesb/workspace/jimma/product/samples/quickstarts/helloworld_pub_service/jboss-esb.xml	2008-06-02 07:47:49 UTC (rev 20251)
@@ -0,0 +1,52 @@
+<?xml version = "1.0" encoding = "UTF-8"?>
+<jbossesb xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd" parameterReloadSecs="5">
+
+    <providers>
+          <jms-provider name="JBossMQ" connection-factory="ConnectionFactory">
+              <jms-bus busid="quickstartGwChannel">
+                  <jms-message-filter
+                      dest-type="QUEUE"
+                      dest-name="queue/quickstart_helloworld_Request_gw"
+                   />
+              </jms-bus>
+              <jms-bus busid="quickstartEsbChannel">
+                  <jms-message-filter
+                      dest-type="QUEUE"
+                      dest-name="queue/quickstart_helloworld_Request_esb"
+                  />
+              </jms-bus>
+
+          </jms-provider>
+      </providers>
+      
+      <services>
+        <service 
+        	category="FirstServiceESB" 
+        	name="SimpleListener" 
+        	description="Hello World">
+            <listeners>
+                <jms-listener name="JMS-Gateway"
+                    busidref="quickstartGwChannel"
+                    maxThreads="1"
+                    is-gateway="true"
+                />
+                <jms-listener name="helloWorld"
+                              busidref="quickstartEsbChannel"
+                              maxThreads="1"
+                />
+            </listeners>
+            <actions mep="OneWay" inXsd="/request.xsd">
+                   <action name="action1" 
+                   	class="org.jboss.soa.esb.samples.quickstart.helloworld.MyJMSListenerAction" 
+                   	process="displayMessage" 
+                   	/>      
+                    <action name="action2" class="org.jboss.soa.esb.actions.SystemPrintln">
+                      <property name="printfull" value="true"/>
+                    </action>
+                    <!-- The next action is for Continuous Integration testing -->
+                    <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
+            </actions>
+        </service>
+      </services>
+     
+</jbossesb>

Added: labs/jbossesb/workspace/jimma/product/samples/quickstarts/helloworld_pub_service/jbossesb-properties.xml
===================================================================
--- labs/jbossesb/workspace/jimma/product/samples/quickstarts/helloworld_pub_service/jbossesb-properties.xml	                        (rev 0)
+++ labs/jbossesb/workspace/jimma/product/samples/quickstarts/helloworld_pub_service/jbossesb-properties.xml	2008-06-02 07:47:49 UTC (rev 20251)
@@ -0,0 +1,86 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+  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.
+-->
+<!-- $Id: jbossesb-unittest-properties.xml $ -->
+<!--
+  These options are described in the JBossESB manual.
+  Defaults are provided here for convenience only.
+ 
+  Please read through this file prior to using the system, and consider
+  updating the specified entries.
+-->
+<esb
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:noNamespaceSchemaLocation="jbossesb-1_0.xsd">
+    <properties name="core">
+		<property name="org.jboss.soa.esb.jndi.server.type" value="jboss"/>
+		<property name="org.jboss.soa.esb.jndi.server.url" value="localhost"/>
+		<property name="org.jboss.soa.esb.persistence.connection.factory" 	value="org.jboss.internal.soa.esb.persistence.format.MessageStoreFactoryImpl"/>
+        <property name="jboss.esb.invm.scope.default" value="NONE"/>
+    </properties>
+    <properties name="registry">      
+    	<property name="org.jboss.soa.esb.registry.queryManagerURI"     		
+    		value="jnp://localhost:1099/InquiryService?org.apache.juddi.registry.rmi.Inquiry#inquire"/>    		
+    	<property name="org.jboss.soa.esb.registry.lifeCycleManagerURI"     		
+    		value="jnp://localhost:1099/PublishService?org.apache.juddi.registry.rmi.Publish#publish" />
+    	<property name="org.jboss.soa.esb.registry.implementationClass" 
+    		value="org.jboss.internal.soa.esb.services.registry.JAXRRegistryImpl"/>
+    	<property name="org.jboss.soa.esb.registry.factoryClass" 
+    		value="org.apache.ws.scout.registry.ConnectionFactoryImpl"/>
+    	<property name="org.jboss.soa.esb.registry.user" 
+    		value="jbossesb"/>
+    	<property name="org.jboss.soa.esb.registry.password" 
+    	  value="password"/>
+    	<!-- the following parameter is scout specific to set the type of communication between scout and the UDDI (embedded, rmi, soap) -->
+    	<property name="org.jboss.soa.esb.scout.proxy.transportClass" 
+    		value="org.apache.ws.scout.transport.RMITransport"/>
+    </properties>
+    <properties name="transports" depends="core">
+    	<property name="org.jboss.soa.esb.mail.smtp.host" value="localhost"/>
+    	<property name="org.jboss.soa.esb.mail.smtp.user" value="jbossesb"/>
+    	<property name="org.jboss.soa.esb.mail.smtp.password" value=""/>
+    	<property name="org.jboss.soa.esb.mail.smtp.port" value="25"/>
+    </properties>
+    <properties name="connection">
+    	<property name="min-pool-size" value="5"/>
+    	<property name="max-pool=size" value="10"/>
+    	<property name="blocking-timeout-millis" value="5000"/>
+    	<property name="abandoned-connection-timeout" value="10000"/>
+    	<property name="abandoned-connection-time-interval" value="30000"/>
+    </properties>
+    <properties name="dbstore">
+		<property name="org.jboss.soa.esb.persistence.db.connection.url" 	value="jdbc:hsqldb:hsql://localhost:9001/"/>
+		<property name="org.jboss.soa.esb.persistence.db.jdbc.driver" 		value="org.hsqldb.jdbcDriver"/>
+		<property name="org.jboss.soa.esb.persistence.db.user" 			value="sa"/>
+		<property name="org.jboss.soa.esb.persistence.db.pwd" 			value=""/>		
+		<property name="org.jboss.soa.esb.persistence.db.pool.initial.size"	value="2"/>
+		<property name="org.jboss.soa.esb.persistence.db.pool.min.size"	value="2"/>
+		<property name="org.jboss.soa.esb.persistence.db.pool.max.size"	value="5"/>
+		<!--table managed by pool to test for valid connections - created by pool automatically -->
+		<property name="org.jboss.soa.esb.persistence.db.pool.test.table"	value="pooltest"/>
+		<!-- # of milliseconds to timeout waiting for a connection from pool -->
+		<property name="org.jboss.soa.esb.persistence.db.pool.timeout.millis"	value="5000"/> 
+                <property name="org.jboss.soa.esb.persistence.db.conn.manager" value="org.jboss.internal.soa.esb.persistence.manager.StandaloneConnectionManager"/>
+    </properties>
+    <properties name="messagerouting">
+    	<property name="org.jboss.soa.esb.routing.cbrClass" value="org.jboss.internal.soa.esb.services.routing.cbr.JBossRulesRouter"/>
+    </properties>
+</esb>

Added: labs/jbossesb/workspace/jimma/product/samples/quickstarts/helloworld_pub_service/jndi.properties
===================================================================
--- labs/jbossesb/workspace/jimma/product/samples/quickstarts/helloworld_pub_service/jndi.properties	                        (rev 0)
+++ labs/jbossesb/workspace/jimma/product/samples/quickstarts/helloworld_pub_service/jndi.properties	2008-06-02 07:47:49 UTC (rev 20251)
@@ -0,0 +1,5 @@
+java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
+java.naming.provider.url=jnp://localhost:1099
+java.naming.factory.url.pkgs=org.jboss.naming
+java.naming.factory.url.pkgs=org.jnp.interfaces
+

Added: labs/jbossesb/workspace/jimma/product/samples/quickstarts/helloworld_pub_service/juddi.properties
===================================================================
--- labs/jbossesb/workspace/jimma/product/samples/quickstarts/helloworld_pub_service/juddi.properties	                        (rev 0)
+++ labs/jbossesb/workspace/jimma/product/samples/quickstarts/helloworld_pub_service/juddi.properties	2008-06-02 07:47:49 UTC (rev 20251)
@@ -0,0 +1,69 @@
+# jUDDI Registry Properties (used by RegistryServer)
+# see http://www.juddi.org for more information
+
+# The UDDI Operator Name
+juddi.operatorName = jUDDI.org
+
+# The i18n locale default codes
+juddi.i18n.languageCode = en
+juddi.i18n.countryCode = US
+
+# The UDDI DiscoveryURL Prefix
+juddi.discoveryURL = http://localhost:8080/juddi/uddiget.jsp?
+
+# The UDDI Operator Contact Email Address
+juddi.operatorEmailAddress = admin at juddi.org
+
+# The maximum name size and maximum number
+# of name elements allows in several of the
+# FindXxxx and SaveXxxx UDDI functions.
+juddi.maxNameLength=255
+juddi.maxNameElementsAllowed=5
+
+# The maximum number of UDDI artifacts allowed
+# per publisher. A value of '-1' indicates any 
+# number of artifacts is valid (These values can be
+# overridden at the individual publisher level).
+juddi.maxBusinessesPerPublisher=25
+juddi.maxServicesPerBusiness=20
+juddi.maxBindingsPerService=10
+juddi.maxTModelsPerPublisher=100
+
+# jUDDI Authentication module to use
+juddi.auth = org.apache.juddi.auth.DefaultAuthenticator
+
+# jUDDI DataStore module currently to use
+juddi.dataStore = org.apache.juddi.datastore.jdbc.JDBCDataStore
+
+# use a dataSource (if set to false a direct 
+# jdbc connection will be used.
+juddi.isUseDataSource=false
+juddi.jdbcDriver=com.mysql.jdbc.Driver
+juddi.jdbcUrl=jdbc:mysql://localhost:3306/juddi
+juddi.jdbcUsername=root
+juddi.jdbcPassword=admin
+# jUDDI DataSource to use
+# juddi.dataSource=java:comp/env/jdbc/MySqlDS
+
+# jUDDI UUIDGen implementation to use
+juddi.uuidgen = org.apache.juddi.uuidgen.DefaultUUIDGen
+
+# jUDDI Cryptor implementation to use
+juddi.cryptor = org.apache.juddi.cryptor.DefaultCryptor
+ 
+# jUDDI Validator to use
+juddi.validator=org.apache.juddi.validator.DefaultValidator
+
+# jUDDI Proxy Properties (used by RegistryProxy)
+juddi.proxy.adminURL = http://localhost:8080/juddi/admin
+juddi.proxy.inquiryURL = http://localhost:8080/juddi/inquiry
+juddi.proxy.publishURL = http://localhost:8080/juddi/publish
+juddi.proxy.transportClass = org.apache.juddi.proxy.AxisTransport
+juddi.proxy.securityProvider = com.sun.net.ssl.internal.ssl.Provider
+juddi.proxy.protocolHandler = com.sun.net.ssl.internal.www.protocol
+
+# JNDI settings (used by RMITransport)
+java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
+java.naming.provider.url=jnp://localhost:1099
+java.naming.factory.url.pkgs=org.jboss.naming
+  

Added: labs/jbossesb/workspace/jimma/product/samples/quickstarts/helloworld_pub_service/log4j.xml
===================================================================
--- labs/jbossesb/workspace/jimma/product/samples/quickstarts/helloworld_pub_service/log4j.xml	                        (rev 0)
+++ labs/jbossesb/workspace/jimma/product/samples/quickstarts/helloworld_pub_service/log4j.xml	2008-06-02 07:47:49 UTC (rev 20251)
@@ -0,0 +1,79 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+
+<!-- ===================================================================== -->
+<!--                                                                       -->
+<!--  Log4j Configuration                                                  -->
+<!--                                                                       -->
+<!-- ===================================================================== -->
+
+<!-- $Id: log4j.xml,v 1.26.2.5 2005/09/15 09:31:02 dimitris Exp $ -->
+
+<!--
+   | For more configuration infromation and examples see the Jakarta Log4j
+   | owebsite: http://jakarta.apache.org/log4j
+ -->
+
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
+
+   <!-- ============================== -->
+   <!-- Append messages to the console -->
+   <!-- ============================== -->
+
+   <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
+      <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
+      <param name="Target" value="System.out"/>
+      <param name="Threshold" value="INFO"/>
+
+      <layout class="org.apache.log4j.PatternLayout">
+         <!-- The default pattern: Date Priority [Category] Message\n -->
+         <param name="ConversionPattern" value="%d{ABSOLUTE} %-5p [%t][%c{1}] %m%n"/>
+      </layout>
+   </appender>
+
+   <!-- ================================= -->
+   <!-- Preserve messages in a local file -->
+   <!-- ================================= -->
+
+   <!-- A size based file rolling appender -->
+   <appender name="FILE" class="org.jboss.logging.appender.RollingFileAppender">
+     <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
+     <param name="File" value="./listener.log"/>
+     <param name="Append" value="false"/>
+     <param name="MaxFileSize" value="500KB"/>
+     <param name="MaxBackupIndex" value="1"/>
+
+     <layout class="org.apache.log4j.PatternLayout">
+       <param name="ConversionPattern" value="%d %-5p [%t][%c] %m%n"/>
+     </layout>	    
+   </appender>
+
+   <!-- ================ -->
+   <!-- Limit categories -->
+   <!-- ================ -->
+
+   <category name="org.jboss">
+      <priority value="WARN"/>
+   </category>
+   <category name="org.jboss.soa.esb">
+      <priority value="ERROR"/>
+   </category>
+   <category name="org.jboss.internal.soa.esb">
+      <priority value="ERROR"/>
+   </category>
+   <category name="org.apache">
+      <priority value="ERROR"/>
+   </category>
+   <category name="quickstart">
+      <priority value="DEBUG"/>
+   </category>
+   <!-- ======================= -->
+   <!-- Setup the Root category -->
+   <!-- ======================= -->
+
+   <root>
+      <appender-ref ref="CONSOLE"/>
+      <appender-ref ref="FILE"/>
+   </root>
+
+</log4j:configuration>

Added: labs/jbossesb/workspace/jimma/product/samples/quickstarts/helloworld_pub_service/readme.txt
===================================================================
--- labs/jbossesb/workspace/jimma/product/samples/quickstarts/helloworld_pub_service/readme.txt	                        (rev 0)
+++ labs/jbossesb/workspace/jimma/product/samples/quickstarts/helloworld_pub_service/readme.txt	2008-06-02 07:47:49 UTC (rev 20251)
@@ -0,0 +1,29 @@
+Overview:
+=========
+  The purpose of the helloworld quickstart sample is to prove that the ESB is
+  is properly configured and happy.  As well as to demonstrate the needed
+  minimal files to make a basic ESB component execute.
+
+Running this quickstart:
+========================
+  Please refer to 'ant help-quickstarts' for prerequisites about the quickstarts
+  and a more detailed descripton of the different ways to run the quickstarts.
+
+To Run standalone mode:
+=======================
+  1. In a command terminal window in the quickstart folder type
+     'ant deploy-jms-dests'.
+  2. In a command terminal window in this folder ("Window1"), type 'ant run'.
+  3. Open another command terminal window in this folder ("Window2"), type
+     'ant runtest'.
+  4. Switch back to "Window1" to see the output from the ESB
+  5. When finished, interrupt the ESB using Ctrl-C and, in this folder
+     ("Window1"), type 'ant undeploy-jms-dests'.
+
+To Run '.esb' archive mode:
+===========================
+  1. In a command terminal window in this folder ("Window1"), type 'ant deploy'.
+  2. Open another command terminal window in this folder ("Window2"), type
+     'ant runtest'.
+  3. Switch back to Application Server console to see the output from the ESB
+  4. In this folder ("Window1"), type 'ant undeploy'.

Added: labs/jbossesb/workspace/jimma/product/samples/quickstarts/helloworld_pub_service/request.xsd
===================================================================
--- labs/jbossesb/workspace/jimma/product/samples/quickstarts/helloworld_pub_service/request.xsd	                        (rev 0)
+++ labs/jbossesb/workspace/jimma/product/samples/quickstarts/helloworld_pub_service/request.xsd	2008-06-02 07:47:49 UTC (rev 20251)
@@ -0,0 +1,8 @@
+<xs:schema version="1.0" targetNamespace="http://www.jboss.org/sayHi" xmlns:x1="http://www.jboss.org/sayHi"  xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
+  <xs:element name="sayHi" type="x1:sayHi"/>
+  <xs:complexType name="sayHi">
+    <xs:sequence>
+      <xs:element name="arg0" type="xs:string" minOccurs="0"/>
+    </xs:sequence>
+  </xs:complexType>
+</xs:schema>

Added: labs/jbossesb/workspace/jimma/product/samples/quickstarts/helloworld_pub_service/response.xsd
===================================================================
--- labs/jbossesb/workspace/jimma/product/samples/quickstarts/helloworld_pub_service/response.xsd	                        (rev 0)
+++ labs/jbossesb/workspace/jimma/product/samples/quickstarts/helloworld_pub_service/response.xsd	2008-06-02 07:47:49 UTC (rev 20251)
@@ -0,0 +1,8 @@
+<xs:schema version="1.0" targetNamespace="http://www.jboss.org/sayHi" xmlns:x1="http://www.jboss.org/sayHi"  xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
+  <xs:element name="sayHiReponse" type="x1:sayHiReponse"/>
+  <xs:complexType name="sayHiReponse">
+    <xs:sequence>
+      <xs:element name="arg0" type="xs:string" minOccurs="0"/>
+    </xs:sequence>
+  </xs:complexType>
+</xs:schema>

Added: labs/jbossesb/workspace/jimma/product/samples/quickstarts/helloworld_pub_service/src/org/jboss/soa/esb/samples/quickstart/helloworld/MyJMSListenerAction.java
===================================================================
--- labs/jbossesb/workspace/jimma/product/samples/quickstarts/helloworld_pub_service/src/org/jboss/soa/esb/samples/quickstart/helloworld/MyJMSListenerAction.java	                        (rev 0)
+++ labs/jbossesb/workspace/jimma/product/samples/quickstarts/helloworld_pub_service/src/org/jboss/soa/esb/samples/quickstart/helloworld/MyJMSListenerAction.java	2008-06-02 07:47:49 UTC (rev 20251)
@@ -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: " + message.getBody().get()) ;
+		  System.out.println("&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&");
+		  return message; 
+        		
+	}
+    
+	
+}
\ No newline at end of file

Added: labs/jbossesb/workspace/jimma/product/samples/quickstarts/helloworld_pub_service/src/org/jboss/soa/esb/samples/quickstart/helloworld/test/SendEsbMessage.java
===================================================================
--- labs/jbossesb/workspace/jimma/product/samples/quickstarts/helloworld_pub_service/src/org/jboss/soa/esb/samples/quickstart/helloworld/test/SendEsbMessage.java	                        (rev 0)
+++ labs/jbossesb/workspace/jimma/product/samples/quickstarts/helloworld_pub_service/src/org/jboss/soa/esb/samples/quickstart/helloworld/test/SendEsbMessage.java	2008-06-02 07:47:49 UTC (rev 20251)
@@ -0,0 +1,59 @@
+/*
+ * 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 org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.message.format.MessageFactory;
+import org.jboss.soa.esb.client.ServiceInvoker;
+
+/**
+ * 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
+    {
+//      Setting the ConnectionFactory such that it will use scout
+        System.setProperty("javax.xml.registry.ConnectionFactoryClass","org.apache.ws.scout.registry.ConnectionFactoryImpl");
+        
+    	if (args.length < 3)
+    	{
+    		System.out.println("Usage SendEsbMessage <category> <name> <text to send>");
+    	}
+    	
+    	Message esbMessage = MessageFactory.getInstance().getMessage();
+
+    	esbMessage.getBody().add(args[2]);
+    	
+        new ServiceInvoker(args[0], args[1]).deliverAsync(esbMessage);
+    	
+    }
+    
+}

Added: labs/jbossesb/workspace/jimma/product/samples/quickstarts/helloworld_pub_service/src/org/jboss/soa/esb/samples/quickstart/helloworld/test/SendJMSMessage.java
===================================================================
--- labs/jbossesb/workspace/jimma/product/samples/quickstarts/helloworld_pub_service/src/org/jboss/soa/esb/samples/quickstart/helloworld/test/SendJMSMessage.java	                        (rev 0)
+++ labs/jbossesb/workspace/jimma/product/samples/quickstarts/helloworld_pub_service/src/org/jboss/soa/esb/samples/quickstart/helloworld/test/SendJMSMessage.java	2008-06-02 07:47:49 UTC (rev 20251)
@@ -0,0 +1,87 @@
+/*
+ * 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.Properties;
+
+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
+    {
+        Properties properties1 = new Properties();
+		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