[jboss-svn-commits] JBL Code SVN: r17425 - in labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts: helloworld_tx_sql_action and 9 other directories.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Fri Dec 28 20:36:36 EST 2007


Author: mark.little at jboss.com
Date: 2007-12-28 20:36:35 -0500 (Fri, 28 Dec 2007)
New Revision: 17425

Added:
   labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/helloworld_tx_sql_action/
   labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/helloworld_tx_sql_action/build.xml
   labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/helloworld_tx_sql_action/jboss-esb.xml
   labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/helloworld_tx_sql_action/jbossesb-properties.xml
   labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/helloworld_tx_sql_action/jbossesb-service.xml
   labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/helloworld_tx_sql_action/jndi.properties
   labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/helloworld_tx_sql_action/juddi.properties
   labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/helloworld_tx_sql_action/lib/
   labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/helloworld_tx_sql_action/log4j.xml
   labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/helloworld_tx_sql_action/populate.sql
   labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/helloworld_tx_sql_action/quickstart-ds.xml
   labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/helloworld_tx_sql_action/readme.txt
   labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/helloworld_tx_sql_action/src/
   labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/helloworld_tx_sql_action/src/hsqldb/
   labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/helloworld_tx_sql_action/src/hsqldb/create.sql
   labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/helloworld_tx_sql_action/src/org/
   labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/helloworld_tx_sql_action/src/org/jboss/
   labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/helloworld_tx_sql_action/src/org/jboss/soa/
   labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/helloworld_tx_sql_action/src/org/jboss/soa/esb/
   labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/helloworld_tx_sql_action/src/org/jboss/soa/esb/samples/
   labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/helloworld_tx_sql_action/src/org/jboss/soa/esb/samples/quickstart/
   labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/helloworld_tx_sql_action/src/org/jboss/soa/esb/samples/quickstart/helloworldsqlaction/
   labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/helloworld_tx_sql_action/src/org/jboss/soa/esb/samples/quickstart/helloworldtxsqlaction/
   labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/helloworld_tx_sql_action/src/org/jboss/soa/esb/samples/quickstart/helloworldtxsqlaction/MyAction.java
Log:
http://jira.jboss.com/jira/browse/JBESB-1283

Added: labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/helloworld_tx_sql_action/build.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/helloworld_tx_sql_action/build.xml	                        (rev 0)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/helloworld_tx_sql_action/build.xml	2007-12-29 01:36:35 UTC (rev 17425)
@@ -0,0 +1,145 @@
+<project name="Quickstart_helloworld_TX_SQL_action" default="run" basedir=".">
+	
+	<description> 
+		${ant.project.name}
+		${line.separator}
+	</description>
+	
+	<property name="additional.deploys" value="jbossesb-service.xml" />
+	
+	<!-- Import the base Ant build script... -->
+	<import file="../conf/base-build.xml"/>
+
+	<target name="quickstart-specific-assemblies" description="Quickstart specific assemblies">
+	</target>
+
+	<target name="quickstart-specific-deploys" description="Quickstart specific deploys">
+		<copy file="quickstart-ds.xml" 
+			todir="${org.jboss.esb.server.deploy.dir}"
+			overwrite="false"/>
+	</target>
+  
+	<target name="runtest" depends="dependencies" description="Insert row data into sql table polled by gateway">
+                <property name="hsqldb.jar"
+                        value="${org.jboss.esb.server.home}/server/${org.jboss.esb.server.config}/lib/hsqldb.jar"/>	
+				<echo>Insert row data into sql table polled by gateway</echo>
+                <sql
+                        driver="org.hsqldb.jdbcDriver"
+						url="jdbc:hsqldb:hsql://localhost:1703"
+                        userid="sa"	
+						autocommit="true"
+						password="">
+                        <classpath>
+				<pathelement path="${hsqldb.jar}"/>
+                        </classpath>
+			<transaction src="populate.sql"/>
+			</sql>
+	</target>  
+
+	<target name="create" depends="dependencies" description="create table tx_esb_messages">
+		<property name="hsqldb.jar" 
+			value="${org.jboss.esb.server.home}/server/${org.jboss.esb.server.config}/lib/hsqldb.jar"/>
+		<echo>create table tx_esb_messages</echo>
+		<sql	
+			print="true"
+			driver="org.hsqldb.jdbcDriver"
+			url="jdbc:hsqldb:hsql://localhost:1703"
+			userid="sa"
+			autocommit="true"
+			password="">
+			<classpath>
+				<pathelement path="${hsqldb.jar}"/>
+			</classpath>
+			<transaction>
+			create table tx_esb_messages(MESSAGE_ID varchar, STATUS_COL varchar NOT NULL, TIMESTAMP_COL bigint, DATA_COL varchar NOT NULL);
+			</transaction>
+			</sql>
+
+	</target>  
+
+	<target name="drop" depends="dependencies" description="drop table tx_esb_messages">
+		<property name="hsqldb.jar" 
+			value="${org.jboss.esb.server.home}/server/${org.jboss.esb.server.config}/lib/hsqldb.jar"/>
+		<echo>drop table tx_esb_messages</echo>
+		<sql	
+			print="true"
+			driver="org.hsqldb.jdbcDriver"
+			url="jdbc:hsqldb:hsql://localhost:1703"
+			userid="sa"
+			autocommit="true"
+			password="">
+			<classpath>
+				<pathelement path="${hsqldb.jar}"/>
+			</classpath>
+			<transaction>
+			drop table tx_esb_messages
+			</transaction>
+			</sql>
+
+	</target>
+
+	<target name="drop2" depends="dependencies" description="drop table gateway_table">
+		<property name="hsqldb.jar" 
+			value="${org.jboss.esb.server.home}/server/${org.jboss.esb.server.config}/lib/hsqldb.jar"/>
+		<echo>drop table gateway_table</echo>
+		<sql	
+			print="true"
+			driver="org.hsqldb.jdbcDriver"
+			url="jdbc:hsqldb:hsql://localhost:1703"
+			userid="sa"
+			autocommit="true"
+			password="">
+			<classpath>
+				<pathelement path="${hsqldb.jar}"/>
+			</classpath>
+			<transaction>
+			drop table gateway_table
+			</transaction>
+			</sql>
+
+	</target>  
+
+	<target name="select" depends="dependencies" description="select * from gateway_table">
+		<property name="hsqldb.jar" 
+			value="${org.jboss.esb.server.home}/server/${org.jboss.esb.server.config}/lib/hsqldb.jar"/>
+		<echo>Select * from gateway_table</echo>
+		<sql	
+			print="true"
+			driver="org.hsqldb.jdbcDriver"
+			url="jdbc:hsqldb:hsql://localhost:1703"
+			userid="sa"
+			autocommit="true"
+			password="">
+			<classpath>
+				<pathelement path="${hsqldb.jar}"/>
+			</classpath>
+			<transaction>
+			select * from tx_esb_messages
+			</transaction>
+			</sql>
+		<sql	
+			print="true"
+			driver="org.hsqldb.jdbcDriver"
+			url="jdbc:hsqldb:hsql://localhost:1703"
+			userid="sa"
+			autocommit="true"
+			password="">
+			<classpath>
+				<pathelement path="${hsqldb.jar}"/>
+			</classpath>
+			<transaction>
+			select * from gateway_table
+			</transaction>
+			</sql>
+
+	</target>  
+
+	<target name="deploy-jms-dests">
+		<echo message="This quickstart doesn't use any JMS Destinations.  No JMS deployments required." />
+    </target>
+	
+    <target name="undeploy-jms-dests">
+        <echo message="This quickstart doesn't use any JMS Destinations.  No JMS undeployments required." />
+    </target>
+
+</project>

Added: labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/helloworld_tx_sql_action/jboss-esb.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/helloworld_tx_sql_action/jboss-esb.xml	                        (rev 0)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/helloworld_tx_sql_action/jboss-esb.xml	2007-12-29 01:36:35 UTC (rev 17425)
@@ -0,0 +1,66 @@
+<?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>
+          <sql-provider name="GatewaySQLprovider" 
+          			url="jdbc:hsqldb:hsql://localhost:1703"
+          			driver="org.hsqldb.jdbcDriver"
+          			username="sa"
+          			password="">
+          	<sql-bus busid="helloSQLChannel" >
+          		<sql-message-filter
+          			tablename="GATEWAY_TABLE"
+          			status-column="STATUS_COL"
+				order-by="DATA_COLUMN"	
+				where-condition="DATA_COLUMN like 'data%'"
+
+          			message-id-column="UNIQUE_ID"
+          		/>
+          	</sql-bus>
+          </sql-provider>
+
+          <sql-provider name="SQLprovider" 
+          			url="jdbc:hsqldb:hsql://localhost:1703"
+          			datasource="java:/QuickstartDB">
+          	<sql-bus busid="TxHelloSQLChannel" >
+          		<sql-message-filter
+          			tablename="TX_ESB_MESSAGES"
+				message-id-column="MESSAGE_ID"
+          			status-column="STATUS_COL"
+				insert-timestamp-column="TIMESTAMP_COL"
+				message-column="DATA_COL"
+          		/>
+          	</sql-bus>
+          </sql-provider>
+
+      </providers>
+      
+      <services>
+        <service 
+			category="myCategory"
+			name="myTxListener"
+        	description="Hello World TX SQL Action (esb jdbc listener)">
+            <listeners>
+            	<sql-listener name="SqlGateway"
+            		busidref="helloSQLChannel"
+            		maxThreads="1"
+            		is-gateway="true"/>
+            	<sql-listener name="TxSqlListener"
+            		busidref="TxHelloSQLChannel"
+            		maxThreads="1">
+			<property name="transacted" value="true"/>
+                </sql-listener>
+            </listeners>
+            <actions mep="OneWay">
+		       <action name="action1" 
+                   	class="org.jboss.soa.esb.samples.quickstart.helloworldtxsqlaction.MyAction" 
+                   	process="displayMessage" 
+                   	/> 
+	               <action name="action2" class="org.jboss.soa.esb.actions.SystemPrintln" />    
+            </actions>
+
+        </service>
+      </services>
+     
+</jbossesb>
+

Added: labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/helloworld_tx_sql_action/jbossesb-properties.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/helloworld_tx_sql_action/jbossesb-properties.xml	                        (rev 0)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/helloworld_tx_sql_action/jbossesb-properties.xml	2007-12-29 01:36:35 UTC (rev 17425)
@@ -0,0 +1,85 @@
+<?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="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/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/helloworld_tx_sql_action/jbossesb-service.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/helloworld_tx_sql_action/jbossesb-service.xml	                        (rev 0)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/helloworld_tx_sql_action/jbossesb-service.xml	2007-12-29 01:36:35 UTC (rev 17425)
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<server>
+   <mbean code="org.jboss.internal.soa.esb.dependencies.DatabaseInitializer"
+       name="jboss.esb:service=QuickstartDatabaseInitializer">
+      <attribute name="Datasource">java:/QuickstartDB</attribute>
+      <attribute name="ExistsSql">select * from gateway_table</attribute>
+      <attribute name="SqlFiles">
+	hsqldb/create.sql
+      </attribute>
+      <depends>jboss.jca:name=QuickstartDB,service=DataSourceBinding</depends>
+   </mbean>
+</server>

Added: labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/helloworld_tx_sql_action/jndi.properties
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/helloworld_tx_sql_action/jndi.properties	                        (rev 0)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/helloworld_tx_sql_action/jndi.properties	2007-12-29 01:36:35 UTC (rev 17425)
@@ -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/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/helloworld_tx_sql_action/juddi.properties
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/helloworld_tx_sql_action/juddi.properties	                        (rev 0)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/helloworld_tx_sql_action/juddi.properties	2007-12-29 01:36:35 UTC (rev 17425)
@@ -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/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/helloworld_tx_sql_action/log4j.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/helloworld_tx_sql_action/log4j.xml	                        (rev 0)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/helloworld_tx_sql_action/log4j.xml	2007-12-29 01:36:35 UTC (rev 17425)
@@ -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/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/helloworld_tx_sql_action/populate.sql
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/helloworld_tx_sql_action/populate.sql	                        (rev 0)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/helloworld_tx_sql_action/populate.sql	2007-12-29 01:36:35 UTC (rev 17425)
@@ -0,0 +1,6 @@
+insert into gateway_table(data_column, status_col) values('data 111111','P');
+insert into gateway_table(data_column, status_col) values('data 22','P');
+insert into gateway_table(data_column, status_col) values('data 333333333333111111','P');
+insert into gateway_table(data_column, status_col) values('data d d d d','P');
+insert into gateway_table(data_column, status_col) values('do not consume', 'P');
+insert into gateway_table(data_column, status_col) values('data last record','P');

Added: labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/helloworld_tx_sql_action/quickstart-ds.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/helloworld_tx_sql_action/quickstart-ds.xml	                        (rev 0)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/helloworld_tx_sql_action/quickstart-ds.xml	2007-12-29 01:36:35 UTC (rev 17425)
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<datasources>
+   <local-tx-datasource>
+      <jndi-name>QuickstartDB</jndi-name>
+      <connection-url>jdbc:hsqldb:hsql://${jboss.bind.address}:1703</connection-url>
+      <driver-class>org.hsqldb.jdbcDriver</driver-class>
+      <user-name>sa</user-name>
+      <password></password>
+      <min-pool-size>5</min-pool-size>
+      <max-pool-size>20</max-pool-size>
+      <idle-timeout-minutes>0</idle-timeout-minutes>
+      <depends>jboss:service=Hypersonic</depends>	
+      <prepared-statement-cache-size>32</prepared-statement-cache-size>
+   </local-tx-datasource>
+
+   <!-- For hsqldb accessed from jboss only, in-process (standalone) mode -->
+   <mbean code="org.jboss.jdbc.HypersonicDatabase"
+     name="jboss:service=Hypersonic">
+     <attribute name="Port">1703</attribute>
+     <attribute name="BindAddress">${jboss.bind.address}</attribute> 
+     <attribute name="Database">QuickstartDB</attribute>
+     <attribute name="Silent">true</attribute>
+     <attribute name="Trace">false</attribute>
+     <attribute name="No_system_exit">true</attribute>
+   </mbean>
+</datasources>

Added: labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/helloworld_tx_sql_action/readme.txt
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/helloworld_tx_sql_action/readme.txt	                        (rev 0)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/helloworld_tx_sql_action/readme.txt	2007-12-29 01:36:35 UTC (rev 17425)
@@ -0,0 +1,33 @@
+Overview:
+=========
+  This quickstart demonstrates an SQL listener.
+
+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.
+
+  NOTE:
+  1. This quickstart uses hsqldb so that it can be deployed without any 
+	setup required.   
+  2. "ant select" will show you the contents of the database table.   The
+	<sql-message-filter> defined has a where-condition, so one of the rows
+	that the table is populated with will never be processed.    There
+	should be one remaining row for each time the table is populated.
+  3. run 'ant create' after deploying.
+
+To Run standalone mode:
+=======================
+  1. In a command terminal window in this folder ("Window1"), type 'ant run'.
+  2. Open another command terminal window in this folder ("Window2"), type
+     'ant runtest'.
+  3. Switch back to "Window1" to see the output from the ESB
+  4. When finished, interrupt the ESB using Ctrl-C.
+
+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/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/helloworld_tx_sql_action/src/hsqldb/create.sql
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/helloworld_tx_sql_action/src/hsqldb/create.sql	                        (rev 0)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/helloworld_tx_sql_action/src/hsqldb/create.sql	2007-12-29 01:36:35 UTC (rev 17425)
@@ -0,0 +1,6 @@
+create table gateway_table
+(
+unique_id INTEGER GENERATED BY DEFAULT AS IDENTITY(START WITH 1) NOT NULL PRIMARY KEY,
+data_column VARCHAR(255) NOT NULL,
+status_col VARCHAR(255) NOT NULL
+);

Added: labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/helloworld_tx_sql_action/src/org/jboss/soa/esb/samples/quickstart/helloworldtxsqlaction/MyAction.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/helloworld_tx_sql_action/src/org/jboss/soa/esb/samples/quickstart/helloworldtxsqlaction/MyAction.java	                        (rev 0)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/helloworld_tx_sql_action/src/org/jboss/soa/esb/samples/quickstart/helloworldtxsqlaction/MyAction.java	2007-12-29 01:36:35 UTC (rev 17425)
@@ -0,0 +1,89 @@
+/*
+ * 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.helloworldtxsqlaction;
+
+import java.util.Map;
+
+import org.jboss.soa.esb.actions.AbstractActionLifecycle;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.listeners.ListenerTagNames;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.message.body.content.BytesBody;
+
+public class MyAction extends AbstractActionLifecycle
+{
+    private static int checkIter = 0;
+    
+  protected ConfigTree	_config;
+	  
+  public MyAction(ConfigTree config) { _config = config; } 
+  
+  public Message noOperation(Message message) { return message; } 
+
+  @SuppressWarnings("unchecked")
+ public Message displayMessage(Message message) throws Exception{	
+		  boolean problem = false;
+		  
+		  logHeader();
+		  Map<String,Object> rowData =(Map)message.getBody().get();
+		 StringBuffer results = new StringBuffer();	 
+		 for (Map.Entry<String,Object> curr : rowData.entrySet()) {
+			  results.append("column "+curr.getKey()+" = <" + curr.getValue()+">");
+			  
+			  if (curr.getValue().equals("data 22"))
+			  {
+				  System.out.println("DATA READ: "+curr.getValue());
+				  
+				  if (checkIter++ < 2)
+					  problem = true;
+			  }
+		  }
+		 System.out.println(results.toString());
+		  logFooter();
+		  
+		  // Set message properties and message body so that SystemPrintln will display message 
+		  message.getProperties().setProperty("jbesbfilename", "helloworldTxSQlAction.log");
+		  message.getBody().add(results.toString());
+		 
+		  if (problem)
+			  System.out.println("Will rollback transaction. Expect to see record again!");
+		  else
+			  System.out.println("Will commit transaction. Will not see record again!");
+		  
+		  if (!problem)
+			  return message;
+		  else
+		  {
+			  System.out.println("BAD READ ON DATA!");
+		  
+			  throw new RuntimeException();
+		  }
+	}
+  
+   // This makes it easier to read on the console
+   private void logHeader() {
+	   System.out.println("\n&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&");
+   }
+   private void logFooter() {
+	   System.out.println("&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&\n");
+   }  
+	
+}
\ No newline at end of file




More information about the jboss-svn-commits mailing list