[jboss-svn-commits] JBL Code SVN: r8685 - in labs/jbossesb/trunk/product/samples/quickstarts/helloworld_file_action: . src/quickstart/hw_file_action

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Thu Jan 4 09:42:09 EST 2007


Author: kevin.conner at jboss.com
Date: 2007-01-04 09:42:07 -0500 (Thu, 04 Jan 2007)
New Revision: 8685

Modified:
   labs/jbossesb/trunk/product/samples/quickstarts/helloworld_file_action/build.xml
   labs/jbossesb/trunk/product/samples/quickstarts/helloworld_file_action/src/quickstart/hw_file_action/MyAction.java
Log:
Changes to run standalone and in sar

Modified: labs/jbossesb/trunk/product/samples/quickstarts/helloworld_file_action/build.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/helloworld_file_action/build.xml	2007-01-04 13:44:06 UTC (rev 8684)
+++ labs/jbossesb/trunk/product/samples/quickstarts/helloworld_file_action/build.xml	2007-01-04 14:42:07 UTC (rev 8685)
@@ -5,9 +5,12 @@
   <property name="build.dir" value="${basedir}/build"/>
   <property name="src.dir" value="${basedir}/src"/>
 		
-  <property name="esb-config" value="${basedir}/esb-config.xml"/>
-  <property name="esb-config-gateway" value="${basedir}/esb-config-gateway.xml"/>
+  <property name="jbossesb-config" value="${basedir}/jbossesb.xml"/>
 
+  <property name="jboss.server.dir" location="${jbosshome.dir}/server/default"/>
+  <property name="jboss.deploy.dir" location="${jboss.server.dir}/deploy/jbossesb.sar"/>
+  <property name="jboss.conf.dir" location="${jboss.server.dir}/conf"/>
+
   <path id="classpath">
     <!-- fileset dir="${basedir}" includes="jbossesb-properties.xml" -->
     <!-- fileset dir="${basedir}" includes="juddi.properties" -->
@@ -56,21 +59,27 @@
 
   <target name="run" depends="jars">
      <echo>Basic File 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 fork="yes" classname="org.jboss.soa.esb.listeners.StandAloneBootStrapper" failonerror="true">
+     	<arg value="${jbossesb-config}"/>
+	<classpath refid="classpath"/>
      </java>     
   </target>	
 
+  <target name="deployToSAR" depends="jars">
+    <echo message="Deploying to ${jboss.deploy.dir}"/>
+    <copy file="${build.dir}/${ant.project.name}.jar"
+          todir="${jboss.deploy.dir}" overwrite="true"/>
+    <copy file="jbossesb.xml" todir="${jboss.conf.dir}" overwrite="true"/>
+    <touch file="${jboss.deploy.dir}/META-INF/jboss-service.xml"/>
+  </target>
+
   <target name="runtest">
      <echo>Runs Test File Creator</echo>
-     <java fork="yes" classname="quickstart.test.CreateTestFile" failonerror="true">
+     <java fork="yes" classname="quickstart.hw_file_action.test.CreateTestFile" failonerror="true">
      	<arg value="/tmp/ESBInput"/>
      	<arg value="MyInput.dat"/> <!-- the directory the file should be created in -->
      	<arg value="Hello World In A File"/> <!-- the file contents -->
 		<classpath refid="classpath"/>
      </java>
   </target>  
-</project>
\ No newline at end of file
+</project>

Modified: labs/jbossesb/trunk/product/samples/quickstarts/helloworld_file_action/src/quickstart/hw_file_action/MyAction.java
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/helloworld_file_action/src/quickstart/hw_file_action/MyAction.java	2007-01-04 13:44:06 UTC (rev 8684)
+++ labs/jbossesb/trunk/product/samples/quickstarts/helloworld_file_action/src/quickstart/hw_file_action/MyAction.java	2007-01-04 14:42:07 UTC (rev 8685)
@@ -1,13 +1,8 @@
 package quickstart.hw_file_action;
 
 import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.message.Header;
 import org.jboss.soa.esb.message.Body;
-import org.jboss.soa.esb.addressing.Call;
-import org.jboss.soa.esb.addressing.EPR;
-import org.apache.log4j.Logger;
+import org.jboss.soa.esb.message.Message;
 
 public class MyAction
 {
@@ -26,10 +21,7 @@
 	}
   
    public Message playWithMessage(Message message) throws Exception {
-	   Header msgHeader = message.getHeader();
 	   Body msgBody = message.getBody();
-	   Call theCall = msgHeader.getCall();
-	   EPR theEpr = theCall.getFrom();
 	   String contents = new String(msgBody.getContents());
 	   StringBuffer sb = new StringBuffer();
 	   sb.append("\nBEFORE\n");
@@ -38,15 +30,6 @@
 	   msgBody.setContents(sb.toString().getBytes());
 	   return message;
    }
-   
-   public void exceptionHandler(Message message, Throwable exception) {
-	   logHeader();
-	   System.out.println("!ERROR!");
-	   System.out.println(exception.getMessage());
-	   System.out.println("For Message: ");
-	   System.out.println(message.getBody().getContents());
-	   logFooter();
-   }
 	
    // This makes it easier to read on the console
    private void logHeader() {




More information about the jboss-svn-commits mailing list