You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicemix.apache.org by gn...@apache.org on 2006/01/25 18:26:10 UTC

svn commit: r372276 - in /incubator/servicemix/trunk/servicemix-assembly/src/main/release/examples/loan-broker: ./ src/ src/client/ src/components/ src/components/loanbroker/ src/loanbroker/ src/sa/ src/sa/META-INF/ src/su/

Author: gnodet
Date: Wed Jan 25 09:25:52 2006
New Revision: 372276

URL: http://svn.apache.org/viewcvs?rev=372276&view=rev
Log:
Use lwcontainer for the loanbroker demo and show how to build a service unit / service assembly containing components

Added:
    incubator/servicemix/trunk/servicemix-assembly/src/main/release/examples/loan-broker/src/client/
    incubator/servicemix/trunk/servicemix-assembly/src/main/release/examples/loan-broker/src/client/JMSClient.java
      - copied unchanged from r372199, incubator/servicemix/trunk/servicemix-assembly/src/main/release/examples/loan-broker/src/JMSClient.java
    incubator/servicemix/trunk/servicemix-assembly/src/main/release/examples/loan-broker/src/components/
    incubator/servicemix/trunk/servicemix-assembly/src/main/release/examples/loan-broker/src/components/loanbroker/
      - copied from r372199, incubator/servicemix/trunk/servicemix-assembly/src/main/release/examples/loan-broker/src/loanbroker/
    incubator/servicemix/trunk/servicemix-assembly/src/main/release/examples/loan-broker/src/sa/
    incubator/servicemix/trunk/servicemix-assembly/src/main/release/examples/loan-broker/src/sa/META-INF/
    incubator/servicemix/trunk/servicemix-assembly/src/main/release/examples/loan-broker/src/sa/META-INF/jbi.xml
    incubator/servicemix/trunk/servicemix-assembly/src/main/release/examples/loan-broker/src/su/
    incubator/servicemix/trunk/servicemix-assembly/src/main/release/examples/loan-broker/src/su/servicemix.xml
      - copied, changed from r372199, incubator/servicemix/trunk/servicemix-assembly/src/main/release/examples/loan-broker/servicemix.xml
Removed:
    incubator/servicemix/trunk/servicemix-assembly/src/main/release/examples/loan-broker/activemq-broker.xml
    incubator/servicemix/trunk/servicemix-assembly/src/main/release/examples/loan-broker/servicemix-alone.xml
    incubator/servicemix/trunk/servicemix-assembly/src/main/release/examples/loan-broker/src/JMSClient.java
    incubator/servicemix/trunk/servicemix-assembly/src/main/release/examples/loan-broker/src/loanbroker/
Modified:
    incubator/servicemix/trunk/servicemix-assembly/src/main/release/examples/loan-broker/README.txt
    incubator/servicemix/trunk/servicemix-assembly/src/main/release/examples/loan-broker/build.xml
    incubator/servicemix/trunk/servicemix-assembly/src/main/release/examples/loan-broker/servicemix.xml

Modified: incubator/servicemix/trunk/servicemix-assembly/src/main/release/examples/loan-broker/README.txt
URL: http://svn.apache.org/viewcvs/incubator/servicemix/trunk/servicemix-assembly/src/main/release/examples/loan-broker/README.txt?rev=372276&r1=372275&r2=372276&view=diff
==============================================================================
--- incubator/servicemix/trunk/servicemix-assembly/src/main/release/examples/loan-broker/README.txt (original)
+++ incubator/servicemix/trunk/servicemix-assembly/src/main/release/examples/loan-broker/README.txt Wed Jan 25 09:25:52 2006
@@ -6,8 +6,7 @@
 
 To start the servicemix server using the sample configuration, you must enter the following commands:
 
-ant compile
-set CLASSPATH=classes
+ant setup
 ../../bin/servicemix servicemix.xml
 
 This will start the loan broker component.

Modified: incubator/servicemix/trunk/servicemix-assembly/src/main/release/examples/loan-broker/build.xml
URL: http://svn.apache.org/viewcvs/incubator/servicemix/trunk/servicemix-assembly/src/main/release/examples/loan-broker/build.xml?rev=372276&r1=372275&r2=372276&view=diff
==============================================================================
--- incubator/servicemix/trunk/servicemix-assembly/src/main/release/examples/loan-broker/build.xml (original)
+++ incubator/servicemix/trunk/servicemix-assembly/src/main/release/examples/loan-broker/build.xml Wed Jan 25 09:25:52 2006
@@ -1,18 +1,28 @@
 <project name="jms-binding" default="run" basedir=".">
 
-  <property name="class.dir" value="classes"/>
+  <property name="build.dir" value="build"/>
+  <property name="comp.build.dir" value="${build.dir}/components"/>
+  <property name="client.build.dir" value="${build.dir}/client"/>
+  
+  <property name="src.dir" value="src"/>
+  <property name="comp.src.dir" value="${src.dir}/components"/>
+  <property name="client.src.dir" value="${src.dir}/client"/>
+  <property name="su.src.dir" value="${src.dir}/su"/>
+  <property name="sa.src.dir" value="${src.dir}/sa"/>
 
   <target name="clean">
     <delete dir="target" quiet="true"/>
-    <delete dir="${class.dir}" quiet="true"/>
+    <delete dir="${build.dir}" quiet="true"/>
   </target>
 
   <target name="init">
-    <mkdir dir="${class.dir}"/>
-    <mkdir dir="src/ddl"/>
+    <mkdir dir="${build.dir}"/>
+    <mkdir dir="${comp.build.dir}"/>
+    <mkdir dir="${client.build.dir}"/>
 
     <path id="javac.classpath">
-      <pathelement path="${class.dir}"/>
+      <pathelement path="${comp.build.dir}"/>
+      <pathelement path="${client.build.dir}"/>
       <pathelement path="../../conf"/>
       <fileset dir="../../lib">
         <include name="**/*.jar"/>
@@ -23,20 +33,49 @@
     </path>
   </target>
 
-  <target name="compile" depends="init" description="Compile all Java">
-    <javac srcdir="src" destdir="${class.dir}" debug="on" source="1.4" target="1.4">
+  <target name="build-components" depends="init" description="Build components">
+    <javac srcdir="${comp.src.dir}" destdir="${comp.build.dir}" debug="on" source="1.4" target="1.4">
       <classpath refid="javac.classpath"/>
     </javac>
   </target>
+  
+  <target name="build-su" depends="build-components" description="Build the service unit">
+    <zip destfile="${build.dir}/loanbroker-su.zip">
+      <fileset dir="${comp.build.dir}"/>
+      <fileset dir="${su.src.dir}"/>
+    </zip>
+  </target>
+
+  <target name="build-sa" depends="build-su" description="Build the service assembly">
+    <zip destfile="${build.dir}/loanbroker-sa.zip">
+      <fileset dir="${build.dir}" includes="loanbroker-su.zip"/>
+      <fileset dir="${sa.src.dir}"/>
+    </zip>
+  </target>
+  
+  <target name="setup" depends="build-sa" description="Setup servicemix">
+    <mkdir dir="install"/>
+    <mkdir dir="deploy"/>
+    <copy todir="install">
+      <fileset dir="../../components" includes="*lwcontainer*"/>
+    </copy>
+    <copy file="${build.dir}/loanbroker-sa.zip" todir="deploy"/>
+  </target>
 
-  <target name="run" depends="compile" description="Runs the example client">
+  <target name="build-client" depends="init" description="Build components">
+    <javac srcdir="${client.src.dir}" destdir="${client.build.dir}" debug="on" source="1.4" target="1.4">
+      <classpath refid="javac.classpath"/>
+    </javac>
+  </target>
+  
+  <target name="run" depends="build-client" description="Runs the example client">
     <echo>Running exsample client</echo>
     <java classname="JMSClient" fork="yes" maxmemory="100M">
       <classpath refid="javac.classpath"/>
     </java>
   </target>
 	
-  <target name="run-loop" depends="compile" description="Runs the example client">
+  <target name="run-loop" depends="build-client" description="Runs the example client">
     <echo>Running exsample client</echo>
     <java classname="JMSClient" fork="yes" maxmemory="100M">
       <classpath refid="javac.classpath"/>

Modified: incubator/servicemix/trunk/servicemix-assembly/src/main/release/examples/loan-broker/servicemix.xml
URL: http://svn.apache.org/viewcvs/incubator/servicemix/trunk/servicemix-assembly/src/main/release/examples/loan-broker/servicemix.xml?rev=372276&r1=372275&r2=372276&view=diff
==============================================================================
--- incubator/servicemix/trunk/servicemix-assembly/src/main/release/examples/loan-broker/servicemix.xml (original)
+++ incubator/servicemix/trunk/servicemix-assembly/src/main/release/examples/loan-broker/servicemix.xml Wed Jan 25 09:25:52 2006
@@ -3,86 +3,19 @@
 	     xmlns:lb="http://servicemix.org/demos/loan-broker">
 	                       
 	<sm:container id="jbi"
-	              monitorInstallationDirectory="false"
+	              monitorInstallationDirectory="true"
+	              monitorDeploymentDirectory="true"
+		            installationDirPath="./install"
+		            deploymentDirPath="./deploy"
 	              createMBeanServer="true"
-	              useMBeanServer="true">
-		<sm:activationSpecs>
-		
-		  <!-- In/out binding -->
-		  <sm:activationSpec componentName="loanBrokerJmsBinding"
-		                     destinationService="lb:loan-broker">
-		    <sm:component>
-		      <bean class="org.apache.servicemix.components.jms.JmsServiceComponent"
-		            depends-on="broker">
-		        <property name="template">
-		          <bean class="org.springframework.jms.core.JmsTemplate">
-		            <property name="connectionFactory" ref="jmsFactory" />
-					<property name="defaultDestinationName" value="demo.org.servicemix.source" />
-					<property name="pubSubDomain" value="false" />
-		          </bean>
-		        </property>
-		      </bean>
-		    </sm:component>
-		  </sm:activationSpec>
-		
-		  <!-- Loan broker component -->
-		  <sm:activationSpec componentName="loanBroker" 
-                             service="lb:loan-broker">
-		    <sm:component>
-		      <bean class="loanbroker.LoanBroker" />
-		    </sm:component>
-		  </sm:activationSpec>
-		  
-		  <!-- Credit Agency -->
-		  <sm:activationSpec componentName="creditAgency"
-		                     service="lb:credit-agency">
-		    <sm:component>
-		      <bean class="loanbroker.CreditAgency" />
-		    </sm:component>
-		  </sm:activationSpec>
-		  
-		  <!-- Lender Gateway -->
-		  <sm:activationSpec componentName="lenderGateway"
-		                     service="lb:lender-gateway">
-		    <sm:component>
-		      <bean class="loanbroker.LenderGateway" />
-		    </sm:component>
-		  </sm:activationSpec>
-		  
-		  <!-- Banks -->
-		  <sm:activationSpec componentName="bank1" service="lb:bank1">
-		    <sm:component><bean class="loanbroker.Bank" /></sm:component>
-		  </sm:activationSpec>
-		  <sm:activationSpec componentName="bank2" service="lb:bank2">
-		    <sm:component><bean class="loanbroker.Bank" /></sm:component>
-		  </sm:activationSpec>
-		  <sm:activationSpec componentName="bank3" service="lb:bank3">
-		    <sm:component><bean class="loanbroker.Bank" /></sm:component>
-		  </sm:activationSpec>
-		  <sm:activationSpec componentName="bank4" service="lb:bank4">
-		    <sm:component><bean class="loanbroker.Bank" /></sm:component>
-		  </sm:activationSpec>
-		  <sm:activationSpec componentName="bank5" service="lb:bank5">
-		    <sm:component><bean class="loanbroker.Bank" /></sm:component>
-		  </sm:activationSpec>
-		  
-		</sm:activationSpecs>
-	</sm:container>                
+	              useMBeanServer="true" />                
 	                       
 	<!-- message broker -->
-	<bean id="broker" class="org.apache.activemq.spring.BrokerFactoryBean">
+	<bean id="broker" class="org.apache.activemq.xbean.BrokerFactoryBean">
         <property name="config" value="classpath:activemq.xml" />
 	</bean>
 
 	<bean id="transactionContextManager" class="org.jencks.factory.TransactionContextManagerFactoryBean"/>
 	<bean id="transactionManager" class="org.jencks.factory.GeronimoTransactionManagerFactoryBean" />
-
-	<bean id="jmsFactory" class="org.apache.activemq.pool.PooledConnectionFactory">
-		<property name="connectionFactory">
-			<bean class="org.apache.activemq.ActiveMQConnectionFactory">
-				<property name="brokerURL" value="tcp://localhost:61616" />
-			</bean>
-		</property>
-	</bean>
 
 </beans>

Added: incubator/servicemix/trunk/servicemix-assembly/src/main/release/examples/loan-broker/src/sa/META-INF/jbi.xml
URL: http://svn.apache.org/viewcvs/incubator/servicemix/trunk/servicemix-assembly/src/main/release/examples/loan-broker/src/sa/META-INF/jbi.xml?rev=372276&view=auto
==============================================================================
--- incubator/servicemix/trunk/servicemix-assembly/src/main/release/examples/loan-broker/src/sa/META-INF/jbi.xml (added)
+++ incubator/servicemix/trunk/servicemix-assembly/src/main/release/examples/loan-broker/src/sa/META-INF/jbi.xml Wed Jan 25 09:25:52 2006
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<jbi xmlns="http://java.sun.com/xml/ns/jbi" version="1.0">
+     
+   <service-assembly>
+     <identification>
+       <name>loanbroker</name>
+       <description>LoanBroker Service Assembly</description>
+     </identification>
+     <service-unit>
+       <identification>
+         <name>loanbroker</name>
+         <description>LoanBroker Service Unit</description>
+       </identification>
+       <target>
+         <artifacts-zip>loanbroker-su.zip</artifacts-zip>
+         <component-name>servicemix-lwcontainer</component-name>
+       </target>
+     </service-unit>
+    </service-assembly>
+    
+</jbi>

Copied: incubator/servicemix/trunk/servicemix-assembly/src/main/release/examples/loan-broker/src/su/servicemix.xml (from r372199, incubator/servicemix/trunk/servicemix-assembly/src/main/release/examples/loan-broker/servicemix.xml)
URL: http://svn.apache.org/viewcvs/incubator/servicemix/trunk/servicemix-assembly/src/main/release/examples/loan-broker/src/su/servicemix.xml?p2=incubator/servicemix/trunk/servicemix-assembly/src/main/release/examples/loan-broker/src/su/servicemix.xml&p1=incubator/servicemix/trunk/servicemix-assembly/src/main/release/examples/loan-broker/servicemix.xml&r1=372199&r2=372276&rev=372276&view=diff
==============================================================================
--- incubator/servicemix/trunk/servicemix-assembly/src/main/release/examples/loan-broker/servicemix.xml (original)
+++ incubator/servicemix/trunk/servicemix-assembly/src/main/release/examples/loan-broker/src/su/servicemix.xml Wed Jan 25 09:25:52 2006
@@ -1,19 +1,19 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <beans xmlns:sm="http://servicemix.apache.org/config/1.0"
 	     xmlns:lb="http://servicemix.org/demos/loan-broker">
-	                       
-	<sm:container id="jbi"
-	              monitorInstallationDirectory="false"
-	              createMBeanServer="true"
-	              useMBeanServer="true">
+	                     
+  <classpath>
+    <location>.</location>
+  </classpath>
+                         
+	<sm:serviceunit id="jbi">
 		<sm:activationSpecs>
 		
 		  <!-- In/out binding -->
 		  <sm:activationSpec componentName="loanBrokerJmsBinding"
 		                     destinationService="lb:loan-broker">
 		    <sm:component>
-		      <bean class="org.apache.servicemix.components.jms.JmsServiceComponent"
-		            depends-on="broker">
+		      <bean class="org.apache.servicemix.components.jms.JmsServiceComponent">
 		        <property name="template">
 		          <bean class="org.springframework.jms.core.JmsTemplate">
 		            <property name="connectionFactory" ref="jmsFactory" />
@@ -67,16 +67,8 @@
 		  </sm:activationSpec>
 		  
 		</sm:activationSpecs>
-	</sm:container>                
+	</sm:serviceunit>                
 	                       
-	<!-- message broker -->
-	<bean id="broker" class="org.apache.activemq.spring.BrokerFactoryBean">
-        <property name="config" value="classpath:activemq.xml" />
-	</bean>
-
-	<bean id="transactionContextManager" class="org.jencks.factory.TransactionContextManagerFactoryBean"/>
-	<bean id="transactionManager" class="org.jencks.factory.GeronimoTransactionManagerFactoryBean" />
-
 	<bean id="jmsFactory" class="org.apache.activemq.pool.PooledConnectionFactory">
 		<property name="connectionFactory">
 			<bean class="org.apache.activemq.ActiveMQConnectionFactory">