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

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Wed Dec 27 22:37:57 EST 2006


Author: estebanschifman
Date: 2006-12-27 22:37:53 -0500 (Wed, 27 Dec 2006)
New Revision: 8596

Added:
   labs/jbossesb/trunk/product/samples/quickstarts/static_router/
   labs/jbossesb/trunk/product/samples/quickstarts/static_router/build.xml
   labs/jbossesb/trunk/product/samples/quickstarts/static_router/jbossesb-properties.xml
   labs/jbossesb/trunk/product/samples/quickstarts/static_router/jbossesb.xml
   labs/jbossesb/trunk/product/samples/quickstarts/static_router/jndi.properties
   labs/jbossesb/trunk/product/samples/quickstarts/static_router/juddi.properties
   labs/jbossesb/trunk/product/samples/quickstarts/static_router/log4j.xml
   labs/jbossesb/trunk/product/samples/quickstarts/static_router/readme.txt
   labs/jbossesb/trunk/product/samples/quickstarts/static_router/src/
   labs/jbossesb/trunk/product/samples/quickstarts/static_router/src/quickstart/
   labs/jbossesb/trunk/product/samples/quickstarts/static_router/src/quickstart/static_router/
   labs/jbossesb/trunk/product/samples/quickstarts/static_router/src/quickstart/static_router/SimpleFileAction.java
   labs/jbossesb/trunk/product/samples/quickstarts/static_router/src/quickstart/static_router/test/
   labs/jbossesb/trunk/product/samples/quickstarts/static_router/src/quickstart/static_router/test/CreateTestFile.java
Log:
New quickstart (no AS required): ftp gateway + file transport + StaticRouter action class

Added: labs/jbossesb/trunk/product/samples/quickstarts/static_router/build.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/static_router/build.xml	2006-12-26 17:38:57 UTC (rev 8595)
+++ labs/jbossesb/trunk/product/samples/quickstarts/static_router/build.xml	2006-12-28 03:37:53 UTC (rev 8596)
@@ -0,0 +1,69 @@
+<project name="Quickstart_static_router" default="run" basedir=".">
+  
+  <property file="../quickstarts.properties" />
+  
+  <property name="build.dir" value="${basedir}/build"/>
+  <property name="src.dir" value="${basedir}/src"/>
+		
+  <property name="esb-config" value="${basedir}/jbossesb.xml"/>
+
+	<path id="classpath">
+    <!-- fileset dir="${basedir}" includes="jbossesb-properties.xml" -->
+    <!-- fileset dir="${basedir}" includes="juddi.properties" -->
+    <fileset dir="${basedir}/lib" includes="*jar"/>    
+	<fileset dir="${esb.product.lib.dir}" includes="*jar"/>
+	<fileset dir="${esb.product.lib.dir}" includes="*xml"/>
+	<fileset dir="${esb.product.lib.dir}/ext" includes="*jar"/>
+  <fileset dir="${basedir}" includes="build/**/*.jar"/>
+  <fileset dir="${basedir}" includes="build/**/*.xml"/>
+  <pathelement location="." />
+  
+  </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}">
+	  <classpath refid="classpath"/>
+ 	</javac>
+  </target>
+
+  <target name="jars" depends="compile">
+	<delete file="${build.dir}/${ant.project.name}.jar"/>
+        <jar destfile="${build.dir}/${ant.project.name}.jar"
+		basedir="${build.dir}"
+		includes="**/*.class"/>
+  </target>
+
+  <target name="run" depends="jars">
+	     <echo>FTP Gateway file Listener and static router to file destination</echo>
+	     <java fork="yes" classname="org.jboss.soa.esb.listeners.StandAloneBootStrapper" failonerror="true">  
+	     	<arg value="${esb-config}"/>
+			<classpath refid="classpath"/>
+	     </java>     
+  </target>	
+
+  <target name="runtest">
+     <echo>Runs Test File creator (local filesystem)</echo>
+     <java fork="yes" classname="quickstart.hw_ftp_action.test.CreateTestFile" failonerror="true">
+     	<arg value="/home/ftpuser/tmp/esbInput"/> <!--  Directory -->
+     	<arg value="MyInput.dat"/> <!--  File name -->
+     	<arg value="Hello World In A File (for static router test)"/> <!--  File Contnets -->
+		<classpath refid="classpath"/>
+     </java>
+  </target>  
+
+</project>
\ No newline at end of file

Added: labs/jbossesb/trunk/product/samples/quickstarts/static_router/jbossesb-properties.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/static_router/jbossesb-properties.xml	2006-12-26 17:38:57 UTC (rev 8595)
+++ labs/jbossesb/trunk/product/samples/quickstarts/static_router/jbossesb-properties.xml	2006-12-28 03:37:53 UTC (rev 8596)
@@ -0,0 +1,84 @@
+<?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/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/static_router/jbossesb.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/static_router/jbossesb.xml	2006-12-26 17:38:57 UTC (rev 8595)
+++ labs/jbossesb/trunk/product/samples/quickstarts/static_router/jbossesb.xml	2006-12-28 03:37:53 UTC (rev 8596)
@@ -0,0 +1,136 @@
+<?xml version = "1.0" encoding = "UTF-8"?>
+<jbossesb xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.xsd" >
+
+    <providers>
+          <ftp-provider name="FTPprovider" hostname="localhost" >
+          	<ftp-bus busid="StaticRouterFtpGW" >
+          		<ftp-message-filter
+          			username="ftpuser"
+          			password="ftppassword"
+          			passive="false"
+          			directory="/tmp/esbInput"
+          			input-suffix=".dat"
+          		/>
+          	</ftp-bus>
+          </ftp-provider>
+
+          <fs-provider name="LocalFsProvider">
+          	<fs-bus busid="staticRouter" >
+          		<fs-message-filter
+          			directory="home/ftpuser/tmp"
+          			input-suffix=".esbMessage"
+          		/>
+          	</fs-bus>
+          	<fs-bus busid="fileMessageDestination_01" >
+          		<fs-message-filter
+          			directory="home/ftpuser/tmp"
+          			input-suffix=".toRoute01"
+          			post-delete="false"
+          			post-directory="/home/ftpuser/tmp"
+          		/>
+          	</fs-bus>
+          	<fs-bus busid="fileMessageDestination_02" >
+          		<fs-message-filter
+          			directory="home/ftpuser/tmp"
+          			input-suffix=".toRoute02"
+          			post-delete="false"
+          			post-directory="/home/ftpuser/tmp"
+          		/>
+          	</fs-bus>
+          	<fs-bus busid="fileMessageDestination_03" >
+          		<fs-message-filter
+          			directory="home/ftpuser/tmp"
+          			input-suffix=".toRoute03"
+          			post-delete="false"
+          			post-directory="/home/ftpuser/tmp"
+          		/>
+          	</fs-bus>
+          </fs-provider>
+          
+      </providers>
+      
+      <services>
+          <service category="StaticRouterCategoryGW" 
+                   name="Gateway" 
+          		   description="Static router(gateway)" 
+          		   is-gateway="true"
+          		   target-service-category="StaticRouterCategoryEsb1"
+          		   target-service-name="fileListener"
+          		   >
+              <listeners>        
+                  <ftp-listener name="Ftp-Gateway"
+                              busidref="StaticRouterFtpGW"
+                              maxThreads="1"
+                  />
+              </listeners>    
+          </service>
+          
+        <service 
+          		 category="StaticRouterCategoryEsb1"
+          		 name="fileListener"
+          		 description="Static router(listener)" 
+                 is-gateway="false">
+            <listeners>
+                <fs-listener name="StaticRouter"
+                              busidref="staticRouter"
+                              maxThreads="1"
+                />                
+            </listeners>
+            <actions>
+               <action name="routeAction"  class="org.jboss.soa.esb.actions.StaticRouter">
+               		<property name="destinations">
+   	 				   <route-to service-category="category01" service-name="service01" postSuffix=".toRoute01" /> 
+   	 				   <route-to service-category="category02" service-name="service02" postSuffix=".toRoute02" /> 
+   	 				   <route-to service-category="category03" service-name="service03" postSuffix=".toRoute03" /> 
+	    		   </property>
+   	   			</action>    
+            </actions>
+        </service>
+
+        <service 
+          		 category="category01"
+          		 name="service01"
+          		 description="Static route destination 1" 
+                 is-gateway="false">
+            <listeners>
+                <fs-listener name="fileDest01" busidref="fileMessageDestination_01" maxThreads="1" />                
+            </listeners>
+            <actions>
+               <action name="doThis"  class="quickstart.static_router.SimpleFileAction">
+               		<property name="msgSuffix" value=".01FromRouter" />
+               </action>
+            </actions>
+        </service>
+
+        <service 
+          		 category="category02"
+          		 name="service02"
+          		 description="Static route destination 2" 
+                 is-gateway="false">
+            <listeners>
+                <fs-listener name="fileDest02" busidref="fileMessageDestination_02" maxThreads="1" />                
+            </listeners>
+            <actions>
+               <action name="doThis"  class="quickstart.static_router.SimpleFileAction">
+               		<property name="msgSuffix" value=".02FromRouter" />
+               </action>
+            </actions>
+        </service>
+
+        <service 
+          		 category="category03"
+          		 name="service03"
+          		 description="Static route destination 3" 
+                 is-gateway="false">
+            <listeners>
+                <fs-listener name="fileDest03" busidref="fileMessageDestination_03" maxThreads="1" />                
+            </listeners>
+            <actions>
+               <action name="doThis"  class="quickstart.static_router.SimpleFileAction">
+               		<property name="msgSuffix" value=".03FromRouter" />
+               </action>
+            </actions>
+        </service>
+      </services>
+     
+</jbossesb>

Added: labs/jbossesb/trunk/product/samples/quickstarts/static_router/jndi.properties
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/static_router/jndi.properties	2006-12-26 17:38:57 UTC (rev 8595)
+++ labs/jbossesb/trunk/product/samples/quickstarts/static_router/jndi.properties	2006-12-28 03:37:53 UTC (rev 8596)
@@ -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/static_router/juddi.properties
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/static_router/juddi.properties	2006-12-26 17:38:57 UTC (rev 8595)
+++ labs/jbossesb/trunk/product/samples/quickstarts/static_router/juddi.properties	2006-12-28 03:37:53 UTC (rev 8596)
@@ -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/trunk/product/samples/quickstarts/static_router/log4j.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/static_router/log4j.xml	2006-12-26 17:38:57 UTC (rev 8595)
+++ labs/jbossesb/trunk/product/samples/quickstarts/static_router/log4j.xml	2006-12-28 03:37:53 UTC (rev 8596)
@@ -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/static_router/readme.txt
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/static_router/readme.txt	2006-12-26 17:38:57 UTC (rev 8595)
+++ labs/jbossesb/trunk/product/samples/quickstarts/static_router/readme.txt	2006-12-28 03:37:53 UTC (rev 8596)
@@ -0,0 +1,17 @@
+This test assumes:
+
+1) There is an FTP server running (port 21) in the host specified in jbossesb.xml:
+	<ftp-provider name="FTPprovider" hostname="localhost" >
+2) That ftp server will take a user 'ftpuser' with password 'ftppasssword' (see jbossesb.xml)
+          		<ftp-message-filter
+          			username="ftpuser"
+          			password="ftppassword"
+          			passive="false"
+          			directory="/tmp/esbInput"
+					...
+
+3) there is a directory tmp/esbInput relative to the home directory of ftpuser
+	(e.g. /home/ftpuser/tmp/esbInput)
+
+4) /home/ftpuser/tmp and child directories are readable-writeable- for everybody
+				

Added: labs/jbossesb/trunk/product/samples/quickstarts/static_router/src/quickstart/static_router/SimpleFileAction.java
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/static_router/src/quickstart/static_router/SimpleFileAction.java	2006-12-26 17:38:57 UTC (rev 8595)
+++ labs/jbossesb/trunk/product/samples/quickstarts/static_router/src/quickstart/static_router/SimpleFileAction.java	2006-12-28 03:37:53 UTC (rev 8596)
@@ -0,0 +1,26 @@
+package quickstart.static_router;
+
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.message.Message;
+
+public class SimpleFileAction 
+{
+	protected ConfigTree _config;
+	private SimpleFileAction() {}
+	public SimpleFileAction (ConfigTree tree) { _config = tree; }
+
+	public Message process(Message message) throws Exception
+	{
+
+		String sMsg = new String(message.getBody().getContents());
+		sMsg = sMsg + " - to file with suffix="+_config.getAttribute("msgSuffix");
+		message.getBody().setContents(sMsg.getBytes());
+		
+	  System.out.println("&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&");		  		  
+	  System.out.println("\nBody: " + sMsg);
+	  System.out.println("\n&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&");
+
+		
+		return message;
+	}
+}

Added: labs/jbossesb/trunk/product/samples/quickstarts/static_router/src/quickstart/static_router/test/CreateTestFile.java
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/static_router/src/quickstart/static_router/test/CreateTestFile.java	2006-12-26 17:38:57 UTC (rev 8595)
+++ labs/jbossesb/trunk/product/samples/quickstarts/static_router/src/quickstart/static_router/test/CreateTestFile.java	2006-12-28 03:37:53 UTC (rev 8596)
@@ -0,0 +1,26 @@
+package quickstart.static_router.test;
+
+import java.io.BufferedWriter;
+import java.io.File;
+import java.io.FileWriter;
+
+public class CreateTestFile {
+           
+    
+    public static void main(String args[]) throws Exception
+    {        	    	
+    	String inputDirectory = args[0];
+    	String fileName = args[1];
+    	String fileContents = args[2];
+    	File x = new File(inputDirectory + "/" + fileName);
+    	try {
+    		BufferedWriter out = new BufferedWriter(new FileWriter(x));
+    		out.write(fileContents.toCharArray());
+    		out.close();
+    	} catch (Exception e) {
+    		System.out.println("Error while writing the file: " + inputDirectory + "/" + fileName);
+    		System.out.println(e.getMessage());
+    	}
+    }
+    
+}




More information about the jboss-svn-commits mailing list