[jboss-svn-commits] JBL Code SVN: r7996 - in labs/jbossesb/trunk/product/samples/quickstarts: . helloworld_embedded_reg helloworld_embedded_reg/lib helloworld_embedded_reg/src helloworld_embedded_reg/src/quickstart helloworld_embedded_reg/src/quickstart/test

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Thu Nov 30 16:13:32 EST 2006


Author: tfennelly
Date: 2006-11-30 16:06:45 -0500 (Thu, 30 Nov 2006)
New Revision: 7996

Added:
   labs/jbossesb/trunk/product/samples/quickstarts/helloworld_embedded_reg/
   labs/jbossesb/trunk/product/samples/quickstarts/helloworld_embedded_reg/build.xml
   labs/jbossesb/trunk/product/samples/quickstarts/helloworld_embedded_reg/esb-config-gateway.xml
   labs/jbossesb/trunk/product/samples/quickstarts/helloworld_embedded_reg/esb-config.xml
   labs/jbossesb/trunk/product/samples/quickstarts/helloworld_embedded_reg/jbossesb-properties.xml
   labs/jbossesb/trunk/product/samples/quickstarts/helloworld_embedded_reg/jndi.properties
   labs/jbossesb/trunk/product/samples/quickstarts/helloworld_embedded_reg/juddi.properties
   labs/jbossesb/trunk/product/samples/quickstarts/helloworld_embedded_reg/lib/
   labs/jbossesb/trunk/product/samples/quickstarts/helloworld_embedded_reg/lib/c3p0-0.9.1-pre9.jar
   labs/jbossesb/trunk/product/samples/quickstarts/helloworld_embedded_reg/lib/hsqldb.jar
   labs/jbossesb/trunk/product/samples/quickstarts/helloworld_embedded_reg/lib/jaxr-api-1.0.jar
   labs/jbossesb/trunk/product/samples/quickstarts/helloworld_embedded_reg/lib/jbossts-common.jar
   labs/jbossesb/trunk/product/samples/quickstarts/helloworld_embedded_reg/lib/juddi-embedded.jar
   labs/jbossesb/trunk/product/samples/quickstarts/helloworld_embedded_reg/lib/scout-0.7rc2-embedded.jar
   labs/jbossesb/trunk/product/samples/quickstarts/helloworld_embedded_reg/lib/test-util.jar
   labs/jbossesb/trunk/product/samples/quickstarts/helloworld_embedded_reg/lib/xbean-1.0.4.jar
   labs/jbossesb/trunk/product/samples/quickstarts/helloworld_embedded_reg/lib/xercesImpl-2.7.1.jar
   labs/jbossesb/trunk/product/samples/quickstarts/helloworld_embedded_reg/log4j.xml
   labs/jbossesb/trunk/product/samples/quickstarts/helloworld_embedded_reg/readme.txt
   labs/jbossesb/trunk/product/samples/quickstarts/helloworld_embedded_reg/src/
   labs/jbossesb/trunk/product/samples/quickstarts/helloworld_embedded_reg/src/quickstart/
   labs/jbossesb/trunk/product/samples/quickstarts/helloworld_embedded_reg/src/quickstart/HsqldbUtil.java
   labs/jbossesb/trunk/product/samples/quickstarts/helloworld_embedded_reg/src/quickstart/Launcher.java
   labs/jbossesb/trunk/product/samples/quickstarts/helloworld_embedded_reg/src/quickstart/MyJMSListenerAction.java
   labs/jbossesb/trunk/product/samples/quickstarts/helloworld_embedded_reg/src/quickstart/test/
   labs/jbossesb/trunk/product/samples/quickstarts/helloworld_embedded_reg/src/quickstart/test/SendJMSMessage.java
   labs/jbossesb/trunk/product/samples/quickstarts/quickstarts.properties
Log:
added

Added: labs/jbossesb/trunk/product/samples/quickstarts/helloworld_embedded_reg/build.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/helloworld_embedded_reg/build.xml	2006-11-30 20:48:14 UTC (rev 7995)
+++ labs/jbossesb/trunk/product/samples/quickstarts/helloworld_embedded_reg/build.xml	2006-11-30 21:06:45 UTC (rev 7996)
@@ -0,0 +1,64 @@
+<project name="Quickstart_helloworld" default="run" basedir=".">
+  
+  <property file="../quickstarts.properties" />
+	
+  <property name="build.dir" value="${basedir}/build"/>
+  <property name="src.dir" value="${basedir}/src"/>
+	
+  <property name="quickstart.dir" value="${basedir}/.."/>		
+  <property name="esb-config"
+	value="${quickstart.dir}/helloworld/esb-config.xml"/>
+  <property name="esb-config-gateway"
+	value="${quickstart.dir}/helloworld/esb-config-gateway.xml"/>
+
+	<path id="classpath">
+	    <fileset dir="${basedir}/lib" includes="*.jar"/>    
+		<pathelement location="./" />
+		<pathelement location="../../../" /> <!-- The root dir - access to the install dir etc. -->
+		<pathelement location="${build.dir}"/>
+		<fileset dir="${product.lib.dir}" includes="*jar"/>
+		<fileset dir="${jbosshome.dir}/client" includes="*jar"/>
+		<fileset dir="${jbosshome.dir}/server/default/lib">
+				<include name="jboss-j2ee.jar"/> <!-- added this for the JMS client -->
+		</fileset>		
+  
+  </path>
+ 
+  <property name="cp" refid="classpath"/>
+  
+  <target name="echoCP">    
+  	<echo message="Classpath is ${cp}"/>
+  </target>
+  
+  <target name="prepare">
+	<mkdir dir="${build.dir}" />
+  </target>
+
+  <target name="clean">
+	<delete dir="${build.dir}" />
+  </target>
+
+  <target name="compile" depends="prepare">
+	<javac srcdir="${src.dir}" destdir="${build.dir}" debug="true">
+	  <classpath refid="classpath"/>
+ 	</javac>
+  </target>
+
+  <target name="run" depends="compile">
+     <echo>Basic JMS Gateway and Listener</echo>
+     <java fork="yes" classname="quickstart.Launcher" failonerror="true">
+     	<arg value="0"/>
+     	<arg value="${esb-config}"/>
+     	<arg value="${esb-config-gateway}"/>
+		<classpath refid="classpath"/>
+     </java>     
+  </target>	
+
+  <target name="runtest">
+     <echo>Runs Test JMS Sender</echo>
+     <java fork="yes" classname="quickstart.test.SendJMSMessage" failonerror="true">
+     	<arg value="Hello World"/>
+		<classpath refid="classpath"/>
+     </java>
+  </target>  
+</project>
\ No newline at end of file

Added: labs/jbossesb/trunk/product/samples/quickstarts/helloworld_embedded_reg/esb-config-gateway.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/helloworld_embedded_reg/esb-config-gateway.xml	2006-11-30 20:48:14 UTC (rev 7995)
+++ labs/jbossesb/trunk/product/samples/quickstarts/helloworld_embedded_reg/esb-config-gateway.xml	2006-11-30 21:06:45 UTC (rev 7996)
@@ -0,0 +1,15 @@
+<esb-config-gateway parameterReloadSecs="180">
+   <esb-jms-gateway
+    target-service-category="FirstServices"
+	target-service-name="SimpleJMSService"	  
+   	gatewayClass="org.jboss.soa.esb.listeners.gateway.JmsGatewayListener"
+	connection-factory="ConnectionFactory"
+   	destination-type="queue"
+   	destination-name="queue/quickstart_helloworld_Request"
+	jndi-type="jboss"
+    jndi-URL="localhost"
+   >
+   <!-- no action needed as the inbound message is automatically converted
+     and sent to the queue for the target service -->  
+   </esb-jms-gateway>   
+</esb-config-gateway>
\ No newline at end of file

Added: labs/jbossesb/trunk/product/samples/quickstarts/helloworld_embedded_reg/esb-config.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/helloworld_embedded_reg/esb-config.xml	2006-11-30 20:48:14 UTC (rev 7995)
+++ labs/jbossesb/trunk/product/samples/quickstarts/helloworld_embedded_reg/esb-config.xml	2006-11-30 21:06:45 UTC (rev 7996)
@@ -0,0 +1,16 @@
+<esb-config parameterReloadSecs="180">
+   <esb-listener
+    service-category="FirstServices"
+  	service-name="SimpleJMSService"
+    service-description="Simply listens for ESB Messages"
+	epr-description="Hello World"
+   	listenerClass="org.jboss.soa.esb.listeners.message.JmsQueueListener"
+	connection-factory="ConnectionFactory"
+	destination-type="queue"
+   	destination-name="queue/B"
+    jndi-type="jboss"
+    jndi-URL="localhost"   
+   >
+	   <action class="quickstart.MyJMSListenerAction" process="displayMessage" />	  
+   </esb-listener>   
+</esb-config>
\ No newline at end of file

Added: labs/jbossesb/trunk/product/samples/quickstarts/helloworld_embedded_reg/jbossesb-properties.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/helloworld_embedded_reg/jbossesb-properties.xml	2006-11-30 20:48:14 UTC (rev 7995)
+++ labs/jbossesb/trunk/product/samples/quickstarts/helloworld_embedded_reg/jbossesb-properties.xml	2006-11-30 21:06:45 UTC (rev 7996)
@@ -0,0 +1,77 @@
+<?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"/>
+    </properties>
+    <properties name="registry">
+    	<property name="org.jboss.soa.esb.registry.queryManagerURI" value="org.apache.juddi.registry.local.InquiryService#inquire"/>
+    	<property name="org.jboss.soa.esb.registry.lifeCycleManagerURI" value="org.apache.juddi.registry.local.PublishService#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.LocalTransport"/>
+    </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/jbossesb"/>
+		<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"/> 
+    </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/trunk/product/samples/quickstarts/helloworld_embedded_reg/jndi.properties
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/helloworld_embedded_reg/jndi.properties	2006-11-30 20:48:14 UTC (rev 7995)
+++ labs/jbossesb/trunk/product/samples/quickstarts/helloworld_embedded_reg/jndi.properties	2006-11-30 21:06:45 UTC (rev 7996)
@@ -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/trunk/product/samples/quickstarts/helloworld_embedded_reg/juddi.properties
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/helloworld_embedded_reg/juddi.properties	2006-11-30 20:48:14 UTC (rev 7995)
+++ labs/jbossesb/trunk/product/samples/quickstarts/helloworld_embedded_reg/juddi.properties	2006-11-30 21:06:45 UTC (rev 7996)
@@ -0,0 +1,70 @@
+# 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=org.hsqldb.jdbcDriver
+#juddi.jdbcUrl=jdbc:hsqldb:hsql://localhost/jbossesb
+juddi.jdbcUrl=jdbc:hsqldb:hsql://localhost:9001/jbossesb
+juddi.jdbcUsername=sa
+juddi.jdbcPassword=
+# jUDDI DataSource to use
+juddi.dataSource=java:comp/env/jdbc/juddiDB
+
+# 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/trunk/product/samples/quickstarts/helloworld_embedded_reg/lib/c3p0-0.9.1-pre9.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossesb/trunk/product/samples/quickstarts/helloworld_embedded_reg/lib/c3p0-0.9.1-pre9.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossesb/trunk/product/samples/quickstarts/helloworld_embedded_reg/lib/hsqldb.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossesb/trunk/product/samples/quickstarts/helloworld_embedded_reg/lib/hsqldb.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossesb/trunk/product/samples/quickstarts/helloworld_embedded_reg/lib/jaxr-api-1.0.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossesb/trunk/product/samples/quickstarts/helloworld_embedded_reg/lib/jaxr-api-1.0.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossesb/trunk/product/samples/quickstarts/helloworld_embedded_reg/lib/jbossts-common.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossesb/trunk/product/samples/quickstarts/helloworld_embedded_reg/lib/jbossts-common.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossesb/trunk/product/samples/quickstarts/helloworld_embedded_reg/lib/juddi-embedded.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossesb/trunk/product/samples/quickstarts/helloworld_embedded_reg/lib/juddi-embedded.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossesb/trunk/product/samples/quickstarts/helloworld_embedded_reg/lib/scout-0.7rc2-embedded.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossesb/trunk/product/samples/quickstarts/helloworld_embedded_reg/lib/scout-0.7rc2-embedded.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossesb/trunk/product/samples/quickstarts/helloworld_embedded_reg/lib/test-util.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossesb/trunk/product/samples/quickstarts/helloworld_embedded_reg/lib/test-util.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossesb/trunk/product/samples/quickstarts/helloworld_embedded_reg/lib/xbean-1.0.4.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossesb/trunk/product/samples/quickstarts/helloworld_embedded_reg/lib/xbean-1.0.4.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossesb/trunk/product/samples/quickstarts/helloworld_embedded_reg/lib/xercesImpl-2.7.1.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossesb/trunk/product/samples/quickstarts/helloworld_embedded_reg/lib/xercesImpl-2.7.1.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossesb/trunk/product/samples/quickstarts/helloworld_embedded_reg/log4j.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/helloworld_embedded_reg/log4j.xml	2006-11-30 20:48:14 UTC (rev 7995)
+++ labs/jbossesb/trunk/product/samples/quickstarts/helloworld_embedded_reg/log4j.xml	2006-11-30 21:06:45 UTC (rev 7996)
@@ -0,0 +1,78 @@
+<?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"/>
+
+      <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="INFO"/>
+   </category>
+   <!-- ======================= -->
+   <!-- Setup the Root category -->
+   <!-- ======================= -->
+
+   <root>
+      <appender-ref ref="CONSOLE"/>
+      <appender-ref ref="FILE"/>
+   </root>
+
+</log4j:configuration>

Added: labs/jbossesb/trunk/product/samples/quickstarts/helloworld_embedded_reg/readme.txt
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/helloworld_embedded_reg/readme.txt	2006-11-30 20:48:14 UTC (rev 7995)
+++ labs/jbossesb/trunk/product/samples/quickstarts/helloworld_embedded_reg/readme.txt	2006-11-30 21:06:45 UTC (rev 7996)
@@ -0,0 +1,60 @@
+The purpose of the helloworld quickstart sample is to prove that the ESB is 
+properly configured and happy.  As well as to demonstrate the needed minimal
+files to make a basic ESB component execute.  The only difference between
+this quickstart and the "helloworld" quickstart is that you don't need to install
+a database for the registry.  It uses an embedded registry via Hypersonic,
+eliminating the registry setup overhead.
+
+In a command prmompt window, start the listeners by simply running "ant" 
+in this directory.  You might review the build.xml file to see how it is setup. 
+More details on the build.xml can be found later in this document.  Shutdown
+the listener by simply using Ctrl-C in that window.
+
+In a separate command prompt window, run "ant runtest" to shoot a JMS message
+into the listener which will then invoke the MyJMSListenerAction and display
+it to the console.  You can modify the build.xml to change the phrase 
+"Hello World" to something else and re-run "ant runtest".
+
+Project file descriptions:
+* build.xml - the ant build script. 
+* esb-config.xml - the ESB listener configuration file
+* esb-config-gateway.xml - the JMS gateway configuration file. It is listening
+for JMS ObjectMessages or TextMessages at "queue/quickstart_helloworld_Request"
+* juddi.properties - configures jUDDI, needs to be at the head of the classpath
+* jbossesb-properties.xml - also needed by jUDDI and needs to be at the 
+head of the classpath.  Both juddi.properties and jbossesb-properties.xml are
+used when the service first boots up for 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.
+* log4j.xml - needed to configure log4J used by both the quickstart and the ESB
+itself.  A listener needs a place to log.
+* src\quickstart\Launcher.java - called by ant "run" target with 3 arguments.
+The most important arguments being the locations of the esb-config.xml and
+esb-config-gateway.xml files.  The Launcher starts the gateway and esb listener
+threads and then waits indefinitely.  
+* src\quickstart\MyJMSListenerAction.java - the action class that is identified
+in the esb-config.xml file and is called whenever a message is received.  
+* src\quickstart\test\SendJMSMessage.java - shoots in the string passed in via
+the command line or in this case the arg attribute in the ant runtest task.
+* lib\mysql-connector-java-3.1.12-bin.jar - the listener must register itself
+when it boots up therefore it needs access to the MySQL environment where 
+jUDDI is living.  This works in conjunction with juddi.properties.
+
+NOTE:  	Be sure to update the quickstarts.properties file with the location of
+	your JBoss Application install.  This file is located in the
+	"samples/quickstarts" folder.
+
+build.xml task and structure description:
+* the classpath property pulls the jbossesb-properties.xml file and the juddi.properties file to the
+front of the list
+* the echoCP task is useful for making sure what you think is in your classpath is actually in your classpath
+Usage is: ant echoCP > myclasspath.txt 
+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 string-based message to be pused into the queue the gateway is listening on.  Note: SendJMSMessage 
+contains a hard-coded queue name.
+
+

Added: labs/jbossesb/trunk/product/samples/quickstarts/helloworld_embedded_reg/src/quickstart/HsqldbUtil.java
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/helloworld_embedded_reg/src/quickstart/HsqldbUtil.java	2006-11-30 20:48:14 UTC (rev 7995)
+++ labs/jbossesb/trunk/product/samples/quickstarts/helloworld_embedded_reg/src/quickstart/HsqldbUtil.java	2006-11-30 21:06:45 UTC (rev 7996)
@@ -0,0 +1,105 @@
+package quickstart;
+
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.Statement;
+
+import org.apache.log4j.Logger;
+import org.hsqldb.Server;
+import org.jboss.internal.soa.esb.persistence.format.db.DBConnectionManager;
+import org.jboss.soa.esb.common.Configuration;
+import org.jboss.soa.esb.testutils.FileUtil;
+
+/**
+ * Utility to start and stop a hsql Database.
+ * 
+ * @author <a href="mailto:kurt.stam at jboss.com">Kurt Stam</a>
+ *
+ */
+public class HsqldbUtil 
+{
+	final private static String THREAD_NAME = "hypersonic-unittest";
+	
+	private static Logger _logger = Logger.getLogger(HsqldbUtil.class);
+	/**
+	 * Starts the hsql database in it's own thread. 
+	 * Don't forget to shut it down when you're done.
+	 * 
+	 * @param databaseFile - i.e. build/hsqltestdb
+	 * @param databaseName - i.e. jbossesb
+	 * @throws Exception
+	 */
+	public static void startHsqldb() throws Exception 
+	{
+		// Start DB in new thread, or else it will block us
+		Thread serverThread = new Thread(THREAD_NAME) {
+			public void run() {
+				try {
+					// Create startup arguments
+					String[] args = new String[4];
+					args[0] = "-database.0";
+					args[1] = "build/hsqldb";
+					args[2] = "-dbname.0";
+					args[3] = "jbossesb";
+					
+					_logger.info("creating db from this script: " + args[1]);
+
+					// Start server
+					Server.main(args);
+				} catch (Exception e) {
+					e.printStackTrace();
+				}
+//				log.error("Failed to start database", e);
+			}
+		};
+		serverThread.run();
+		
+		createDatabase();
+	}
+	/**
+	 * 
+	 * @param url
+	 * @param username
+	 * @param password
+	 * @throws Exception
+	 */
+	public static void stopHsqldb() throws Exception {
+		String url = Configuration.getStoreUrl();
+		String username = Configuration.getStoreUser();
+		String password = Configuration.getStorePwd();
+		
+		java.sql.Connection connection = DriverManager.getConnection(
+				url, username, password);
+		Statement statement = connection.createStatement();
+		String shutdownCommand = "SHUTDOWN COMPACT";
+		statement.executeQuery(shutdownCommand);
+	}
+
+	private static void createDatabase() throws Exception{	
+		//message store db
+		String sqlCreateCmd    = FileUtil.readStream(HsqldbUtil.class.getResourceAsStream("/install/message-store/sql/hsqldb/create_database.sql"));
+		String sqlDropCmd      = FileUtil.readStream(HsqldbUtil.class.getResourceAsStream("/install/message-store/sql/hsqldb/drop_database.sql"));		
+		
+		DBConnectionManager mgr = DBConnectionManager.getInstance();
+		Connection con = mgr.getConnection();
+		
+		Statement stmnt = con.createStatement();
+		System.out.println("Dropping the message store schema if exists...");
+		stmnt.execute(sqlDropCmd);
+		System.out.println("Creating the message store schema...");
+		stmnt.execute(sqlCreateCmd);
+		
+		//registry DB
+		System.out.println("Dropping the registry schema if exists...");
+		sqlDropCmd      = FileUtil.readStream(HsqldbUtil.class.getResourceAsStream("/install/jUDDI-registry/sql/hsqldb/drop_database.sql"));
+		stmnt.execute(sqlDropCmd);
+		System.out.println("creating the registry schema...");
+		sqlCreateCmd    = FileUtil.readStream(HsqldbUtil.class.getResourceAsStream("/install/jUDDI-registry/sql/hsqldb/create_database.sql"));
+		stmnt.execute(sqlCreateCmd);
+		System.out.println("inserting registry publishers...");
+		String sqlInsertPubCmd = FileUtil.readStream(HsqldbUtil.class.getResourceAsStream("/install/jUDDI-registry/sql/hsqldb/insert_publishers.sql"));
+		stmnt.execute(sqlInsertPubCmd);
+		stmnt.close();
+		con.close();
+	}
+}

Added: labs/jbossesb/trunk/product/samples/quickstarts/helloworld_embedded_reg/src/quickstart/Launcher.java
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/helloworld_embedded_reg/src/quickstart/Launcher.java	2006-11-30 20:48:14 UTC (rev 7995)
+++ labs/jbossesb/trunk/product/samples/quickstarts/helloworld_embedded_reg/src/quickstart/Launcher.java	2006-11-30 21:06:45 UTC (rev 7996)
@@ -0,0 +1,97 @@
+package quickstart;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.log4j.Logger;
+import org.jboss.soa.esb.common.Configuration;
+import org.jboss.soa.esb.listeners.gateway.GatewayListenerController;
+import org.jboss.soa.esb.listeners.message.EsbListenerController;
+
+
+public class Launcher {	
+	private static Log log = LogFactory.getLog(Launcher.class);
+	
+	private EsbListenerController	_esbListController;
+	private GatewayListenerController _gatewayController;
+	
+	private Logger _logger = Logger.getLogger(Launcher.class);
+	
+	public static void main (String args[]) throws Exception {
+		
+		log.info("args passed into Launcher: " + args.length);
+		for (int x=0; x<args.length; x++)
+			log.info("arg[" + x + "]=" + args[x]);
+		
+		
+		Launcher launcher = new Launcher();
+		
+		if (Configuration.getStoreDriver().equals("org.hsqldb.jdbcDriver")) {
+			HsqldbUtil.startHsqldb();
+		}
+		
+		try {
+			launcher.triggerListener(Long.valueOf(args[0]).longValue(), args[1], args[2]);
+		} finally {
+			if (Configuration.getStoreDriver().equals("org.hsqldb.jdbcDriver")) {
+				HsqldbUtil.stopHsqldb();
+			}
+		}
+	}
+	
+	private void triggerListener(long runTime, String messageAwareConfigFile, 
+		String gatewayConfigFile) throws Exception{
+		try 
+        {
+								
+    		if (null != messageAwareConfigFile) {
+    			_logger.info("starting message aware listener with config file - " + 
+    					messageAwareConfigFile);
+    			_esbListController = new EsbListenerController(messageAwareConfigFile);
+
+    			new Thread(_esbListController).start();
+    			
+    			Thread.sleep(10000);
+
+    		}
+    		if (null != gatewayConfigFile) {
+    			_logger.info("starting gateway listener with config file - " + 
+    					gatewayConfigFile);
+    			_gatewayController = new GatewayListenerController(gatewayConfigFile);
+    			new Thread(_gatewayController).start();
+    		}
+    		
+    		System.out.println("**Listener Ready**");
+    		
+    		
+    		while(true) {
+    			Thread.sleep(1000);
+    		}
+    		
+    		
+//    		This code is used to automatically shutdown the listeners which
+//    		might be useful for automated testing purposes. It is not needed
+//    		in the quickstart samples.
+//    		_logger.info("going to sleep now for " + runTime + " milliseconds...");    		
+//    		Thread.sleep(runTime);
+//    		if (null != messageAwareConfigFile) {
+//    			_logger.info("shutting down message aware listener...");
+//    			_esbListController.requestEnd();
+//    		}
+//    		
+//    		if (null != gatewayConfigFile) {
+//    			_logger.info("shutting down gateway listener...");
+//    			_gatewayController.requestEnd();
+//    		}
+    		
+    	
+        }
+        catch (Exception e) { 
+        	_logger.error(e);
+        	throw(e);
+        }
+        
+	
+	}		
+	
+
+}
\ No newline at end of file

Added: labs/jbossesb/trunk/product/samples/quickstarts/helloworld_embedded_reg/src/quickstart/MyJMSListenerAction.java
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/helloworld_embedded_reg/src/quickstart/MyJMSListenerAction.java	2006-11-30 20:48:14 UTC (rev 7995)
+++ labs/jbossesb/trunk/product/samples/quickstarts/helloworld_embedded_reg/src/quickstart/MyJMSListenerAction.java	2006-11-30 21:06:45 UTC (rev 7996)
@@ -0,0 +1,24 @@
+package quickstart;
+
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.message.Message;
+
+public class MyJMSListenerAction
+{
+    
+  protected ConfigTree	_config;
+	  
+  public MyJMSListenerAction(ConfigTree config) { _config = config; } 
+
+  
+  public Message displayMessage(Message message) throws Exception{
+		
+		  System.out.println("&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&");		  		  
+		  System.out.println("\nBody: " + new String(message.getBody().getContents()));
+		  System.out.println("\n&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&");
+		  return message; 
+        		
+	}
+    
+	
+}
\ No newline at end of file

Added: labs/jbossesb/trunk/product/samples/quickstarts/helloworld_embedded_reg/src/quickstart/test/SendJMSMessage.java
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/helloworld_embedded_reg/src/quickstart/test/SendJMSMessage.java	2006-11-30 20:48:14 UTC (rev 7995)
+++ labs/jbossesb/trunk/product/samples/quickstarts/helloworld_embedded_reg/src/quickstart/test/SendJMSMessage.java	2006-11-30 21:06:45 UTC (rev 7996)
@@ -0,0 +1,60 @@
+package quickstart.test;
+
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+import javax.jms.JMSException;
+import javax.jms.QueueConnectionFactory;
+import javax.jms.Queue;
+import javax.jms.QueueConnection;
+import javax.jms.QueueSession;
+import javax.jms.QueueSender;
+import javax.jms.ObjectMessage;
+
+import java.io.File;
+import java.io.FileReader;
+import java.io.IOException;
+
+public class SendJMSMessage {
+    QueueConnection conn;
+    QueueSession session;
+    Queue que;
+    
+    
+    public void setupConnection() throws JMSException, NamingException
+    {
+    	InitialContext iniCtx = new InitialContext();
+    	Object tmp = iniCtx.lookup("ConnectionFactory");
+    	QueueConnectionFactory qcf = (QueueConnectionFactory) tmp;
+    	conn = qcf.createQueueConnection();
+    	que = (Queue) iniCtx.lookup("queue/quickstart_helloworld_Request");
+    	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();
+    	
+    }
+    
+}
\ No newline at end of file

Added: labs/jbossesb/trunk/product/samples/quickstarts/quickstarts.properties
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/quickstarts.properties	2006-11-30 20:48:14 UTC (rev 7995)
+++ labs/jbossesb/trunk/product/samples/quickstarts/quickstarts.properties	2006-11-30 21:06:45 UTC (rev 7996)
@@ -0,0 +1,8 @@
+##############################################################################################
+# Environment specific properties for executing the quickstarts.
+##############################################################################################
+product.lib.dir=../../../lib
+
+# Location of your JBoss Application Server installation.
+# NB: Avoid using back slashes '\' in the path - '/' works on all platforms.
+jbosshome.dir=




More information about the jboss-svn-commits mailing list