[overlord-commits] Overlord SVN: r378 - in cdl/trunk: samples/jbossesb/brokerage/broker/src/main/resources/META-INF and 1 other directories.

overlord-commits at lists.jboss.org overlord-commits at lists.jboss.org
Tue Oct 14 12:33:23 EDT 2008


Author: jeff.yuchang
Date: 2008-10-14 12:33:23 -0400 (Tue, 14 Oct 2008)
New Revision: 378

Modified:
   cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/actions/ConversationAction.java
   cdl/trunk/samples/jbossesb/brokerage/broker/src/main/resources/META-INF/jboss-esb.xml
   cdl/trunk/samples/jbossesb/client/build.xml
Log:
* Fix the brokerage example, it won't have any errors in running multiple times.


Modified: cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/actions/ConversationAction.java
===================================================================
--- cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/actions/ConversationAction.java	2008-10-11 23:44:14 UTC (rev 377)
+++ cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/actions/ConversationAction.java	2008-10-14 16:33:23 UTC (rev 378)
@@ -120,7 +120,7 @@
 		try {
 			session = getSession(message);
 			if (session != null && isFirstOrLastConversationAction(message, true)) {
-				logger.debug("This is first conversation action to unschedule the item.");
+				logger.debug("This is first conversation action of message: [" + message.getBody().get() + "].");
 				unschedule(message);
 				unscheduledServiceItem = true;
 			}
@@ -139,7 +139,12 @@
 					SessionManager.updateObject(session);
 					logger.debug("Completed the session of " + session);
 					if (session.getParent() != null) {
-						invokeSubsessionExitService(message, session);
+						if (session.getParent().getScheduleItems().size() == 0){
+							session.getParent().setStatus(SessionStatus.Completed);
+							SessionManager.updateObject(session.getParent());
+						} else {
+						    invokeSubsessionExitService(message, session);
+						}
 					}
 				}
 			}
@@ -259,8 +264,10 @@
 	protected void sendAsyncMessage(Message message) throws Exception {
 		for(ScheduleItem si : scheduleItems) {
 			ServiceInvoker invoker = new ServiceInvoker(si.getCategory(), si.getName());
+			logger.debug("Deliver message [" + message.getBody() + "] to [" + si.getCategory() + "/" + si.getName() + "]");
 			invoker.deliverAsync(message);
 		}
+		scheduleItems.clear();
 	}
 	
 	/**
@@ -348,9 +355,6 @@
 	private void invokeSubsessionExitService(Message message, Session session)
 			throws Exception {
 		List<ScheduleItem> items = session.getParent().getScheduleItems();
-		if (items.size() <= 0) {
-			throw new Exception("Completed sub-session, but haven't found any schedule items to run.");
-		}
 		if (items.size() > 1) {
 			throw new Exception("Should be only one schedule item waiting for sub-session.");
 		}

Modified: cdl/trunk/samples/jbossesb/brokerage/broker/src/main/resources/META-INF/jboss-esb.xml
===================================================================
--- cdl/trunk/samples/jbossesb/brokerage/broker/src/main/resources/META-INF/jboss-esb.xml	2008-10-11 23:44:14 UTC (rev 377)
+++ cdl/trunk/samples/jbossesb/brokerage/broker/src/main/resources/META-INF/jboss-esb.xml	2008-10-14 16:33:23 UTC (rev 378)
@@ -1,7 +1,7 @@
 <?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="5000">
-
+	
 	<providers>
 		<jms-provider name="JBossMQ" connection-factory="ConnectionFactory" 
 					jndi-context-factory="org.jnp.interfaces.NamingContextFactory"
@@ -303,8 +303,6 @@
 							process="process" name="s7-3">
 					<property name="serviceCategory" value="ESBBroker.BrokerParticipant" />
 					<property name="serviceName" value="CompleteTransaction.main" />
-					<property name="returnServiceCategory" value="ESBBroker.BrokerParticipant" />
-                    <property name="returnServiceName" value="ESBBrokerProcess.main.8" />
 					<property name="bindDetails" >
 						<bind from-expression="getSelectedQuote()"
 									to-variable="quote" />
@@ -418,10 +416,10 @@
 					<property name="operation" value="getQuote" />
 					<property name="messageType" value="quote" />
 					<property name="serviceDescriptionName" value="{http://www.jboss.org/overlord/loanBroker}Broker"/>
-					<property name="identities" >
-						<identity type="primary" >
-							<token name="id" locator="//@id" />
-							<token name="supplierDesc" locator="//@supplierDesc" />
+					<property name="identities">
+						<identity type="primary">
+							<token name="id" locator="//@id"/>
+							<token name="supplierDesc" locator="//@supplierDesc"/>
 						</identity>
 					</property>
 				</action>

Modified: cdl/trunk/samples/jbossesb/client/build.xml
===================================================================
--- cdl/trunk/samples/jbossesb/client/build.xml	2008-10-11 23:44:14 UTC (rev 377)
+++ cdl/trunk/samples/jbossesb/client/build.xml	2008-10-14 16:33:23 UTC (rev 378)
@@ -1,4 +1,4 @@
-<project name="client" default="runClient" basedir=".">
+<project name="client" default="runPurchasingClient" basedir=".">
 	
 	<property name="lib.dir" value="${basedir}/lib" />
 	<property name="classes.dir" value="${basedir}/target/classes" />




More information about the overlord-commits mailing list