Overlord SVN: r27 - trunk/samples/esb/purchasing/system.
by overlord-commits@lists.jboss.org
Author: jeff.yuchang
Date: 2008-06-13 00:38:08 -0400 (Fri, 13 Jun 2008)
New Revision: 27
Modified:
trunk/samples/esb/purchasing/system/build.xml
Log:
[SOAG-11]
* Test to see if it has shown in JIRA
Modified: trunk/samples/esb/purchasing/system/build.xml
===================================================================
--- trunk/samples/esb/purchasing/system/build.xml 2008-06-13 03:19:36 UTC (rev 26)
+++ trunk/samples/esb/purchasing/system/build.xml 2008-06-13 04:38:08 UTC (rev 27)
@@ -61,7 +61,6 @@
</classpath>
<annotationconfiguration configurationfile="${classes.dir}/hibernate.cfg.xml" />
<hbm2ddl
- drop="false"
create="true"
export="true"
outputfilename="purchasing-ddl.sql"
15 years, 10 months
Overlord SVN: r27 - trunk/samples/esb/purchasing/system.
by overlord-commits@lists.jboss.org
Author: jeff.yuchang
Date: 2008-06-13 00:38:08 -0400 (Fri, 13 Jun 2008)
New Revision: 27
Modified:
trunk/samples/esb/purchasing/system/build.xml
Log:
[SOAG-11]
* Test to see if it has shown in JIRA
Modified: trunk/samples/esb/purchasing/system/build.xml
===================================================================
--- trunk/samples/esb/purchasing/system/build.xml 2008-06-13 03:19:36 UTC (rev 26)
+++ trunk/samples/esb/purchasing/system/build.xml 2008-06-13 04:38:08 UTC (rev 27)
@@ -61,7 +61,6 @@
</classpath>
<annotationconfiguration configurationfile="${classes.dir}/hibernate.cfg.xml" />
<hbm2ddl
- drop="false"
create="true"
export="true"
outputfilename="purchasing-ddl.sql"
15 years, 10 months
Overlord SVN: r28 - in trunk/samples/esb/purchasing/system: conf and 4 other directories.
by overlord-commits@lists.jboss.org
Author: jeff.yuchang
Date: 2008-06-14 01:27:44 -0400 (Sat, 14 Jun 2008)
New Revision: 28
Added:
trunk/samples/esb/purchasing/system/src/org/jboss/soa/overlord/conversation/EPRWrapper.java
trunk/samples/esb/purchasing/system/src/org/jboss/soa/overlord/conversation/JoinState.java
Modified:
trunk/samples/esb/purchasing/system/build.xml
trunk/samples/esb/purchasing/system/conf/hibernate.cfg.xml
trunk/samples/esb/purchasing/system/conf/jboss-esb.xml
trunk/samples/esb/purchasing/system/src/com/acme/services/broker/SetBuyFailedMessageAction.java
trunk/samples/esb/purchasing/system/src/com/acme/services/broker/SetBuyResponseMessageAction.java
trunk/samples/esb/purchasing/system/src/com/acme/services/broker/SetCreditCheckRequestMessageAction.java
trunk/samples/esb/purchasing/system/src/com/acme/services/creditAgency/SetCreditCheckInvalidMessageAction.java
trunk/samples/esb/purchasing/system/src/com/acme/services/creditAgency/SetCreditCheckResponseMessageAction.java
trunk/samples/esb/purchasing/system/src/org/jboss/soa/overlord/conversation/Identity.java
trunk/samples/esb/purchasing/system/src/org/jboss/soa/overlord/conversation/PersistentTest.java
trunk/samples/esb/purchasing/system/src/org/jboss/soa/overlord/conversation/ScheduleItem.java
trunk/samples/esb/purchasing/system/src/org/jboss/soa/overlord/conversation/Session.java
trunk/samples/esb/purchasing/system/src/org/jboss/soa/overlord/conversation/SessionManager.java
trunk/samples/esb/purchasing/system/src/org/jboss/soa/overlord/jbossesb/actions/ActionProperties.java
trunk/samples/esb/purchasing/system/src/org/jboss/soa/overlord/jbossesb/actions/ConversationAction.java
trunk/samples/esb/purchasing/system/src/org/jboss/soa/overlord/jbossesb/actions/ParallelAction.java
trunk/samples/esb/purchasing/system/src/org/jboss/soa/overlord/jbossesb/actions/ReceiveMessageAction.java
trunk/samples/esb/purchasing/system/src/org/jboss/soa/overlord/jbossesb/actions/ScheduleStateAction.java
trunk/samples/esb/purchasing/system/src/org/jboss/soa/overlord/jbossesb/actions/SendMessageAction.java
trunk/samples/esb/purchasing/system/src/org/jboss/soa/overlord/jbossesb/actions/SwitchAction.java
Log:
[SOAG-11]
* Finish the jboss-esb.xml updating.
Modified: trunk/samples/esb/purchasing/system/build.xml
===================================================================
--- trunk/samples/esb/purchasing/system/build.xml 2008-06-13 04:38:08 UTC (rev 27)
+++ trunk/samples/esb/purchasing/system/build.xml 2008-06-14 05:27:44 UTC (rev 28)
@@ -62,6 +62,7 @@
<annotationconfiguration configurationfile="${classes.dir}/hibernate.cfg.xml" />
<hbm2ddl
create="true"
+ drop="true"
export="true"
outputfilename="purchasing-ddl.sql"
delimiter=";"
Modified: trunk/samples/esb/purchasing/system/conf/hibernate.cfg.xml
===================================================================
--- trunk/samples/esb/purchasing/system/conf/hibernate.cfg.xml 2008-06-13 04:38:08 UTC (rev 27)
+++ trunk/samples/esb/purchasing/system/conf/hibernate.cfg.xml 2008-06-14 05:27:44 UTC (rev 28)
@@ -1,5 +1,25 @@
<!DOCTYPE hibernate-configuration SYSTEM
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
+<!--
+ JBoss, Home of Professional Open Source
+ Copyright 2008, 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) 2008,
+ @author JBoss Inc.
+-->
<hibernate-configuration>
<session-factory>
<property name="hibernate.connection.driver_class">
@@ -23,13 +43,17 @@
<property name="hibernate.c3p0.idle_test_period">3000</property>
<!-- Show and print nice SQL on stdout -->
- <property name="show_sql">true</property>
+ <property name="show_sql">false</property>
<property name="format_sql">true</property>
- <!-- List of annotationed classes -->
+ <!-- List of annotationed classes (Internal conversation class)-->
<mapping class="org.jboss.soa.overlord.conversation.Session" />
<mapping class="org.jboss.soa.overlord.conversation.ScheduleItem"/>
+ <mapping class="org.jboss.soa.overlord.conversation.JoinState"/>
<mapping class="org.jboss.soa.overlord.conversation.Identity"/>
+ <mapping class="org.jboss.soa.overlord.conversation.EPRWrapper"/>
+
+ <!-- List of Business State class -->
<mapping class="com.acme.services.broker.PurchaseGoods" />
<mapping class="com.acme.services.creditAgency.CreditAgencyPurchase" />
Modified: trunk/samples/esb/purchasing/system/conf/jboss-esb.xml
===================================================================
--- trunk/samples/esb/purchasing/system/conf/jboss-esb.xml 2008-06-13 04:38:08 UTC (rev 27)
+++ trunk/samples/esb/purchasing/system/conf/jboss-esb.xml 2008-06-14 05:27:44 UTC (rev 28)
@@ -1,4 +1,23 @@
<?xml version = "1.0" encoding = "UTF-8"?>
+<!--
+ JBoss, Home of Professional Open Source
+ Copyright 2008, 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) 2008,
+-->
<jbossesb xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml..."
parameterReloadSecs="5000">
@@ -167,7 +186,7 @@
<property name="session" value="com.acme.services.broker.PurchaseGoods" />
<property name="serviceName" value="ReturnBuyerResponse" />
<property name="serviceCategory" value="PurchaseGoods.Broker" />
- <property name="immediate" value="value" />
+ <property name="immediate" value="false" />
</action>
</actions>
</service>
@@ -184,7 +203,7 @@
<property name="session" value="com.acme.services.broker.PurchaseGoods" />
<property name="serviceName" value="ReturnBuyerResponse" />
<property name="serviceCategory" value="PurchaseGoods.Broker" />
- <property name="immediate" value="value" />
+ <property name="immediate" value="false" />
</action>
</actions>
</service>
@@ -300,9 +319,7 @@
process="process" name="d3">
<property name="operation" value="checkCredit" />
<property name="messageType" value="CreditCheckResponse" />
- <!--property name="clientEPR" value="broker" /-->
- <property name="serviceName" value="CreditResponse" />
- <property name="serviceCategory" value="PurchaseGoods.Broker" />
+ <property name="clientEPR" value="broker" />
<property name="identities" >
<identity type="primary" >
<token name="id" locator="//@id" />
Modified: trunk/samples/esb/purchasing/system/src/com/acme/services/broker/SetBuyFailedMessageAction.java
===================================================================
--- trunk/samples/esb/purchasing/system/src/com/acme/services/broker/SetBuyFailedMessageAction.java 2008-06-13 04:38:08 UTC (rev 27)
+++ trunk/samples/esb/purchasing/system/src/com/acme/services/broker/SetBuyFailedMessageAction.java 2008-06-14 05:27:44 UTC (rev 28)
@@ -23,28 +23,34 @@
import org.jboss.soa.esb.actions.AbstractActionLifecycle;
import org.jboss.soa.esb.helpers.ConfigTree;
import org.jboss.soa.esb.message.Message;
+import org.pi4soa.common.xml.XMLUtils;
+import org.w3c.dom.Node;
/*
* @author gary
*/
public class SetBuyFailedMessageAction extends AbstractActionLifecycle {
+ private static Logger logger = Logger.getLogger(SetBuyFailedMessageAction.class);
+
+ private ConfigTree config=null;
+
public SetBuyFailedMessageAction(ConfigTree config) {
- m_config = config;
+ this.config = config;
}
public Message process(Message message) throws Exception{
- message.getBody().add("<BuyFailed id=\"5\" ></BuyFailed>");
+ Node node = XMLUtils.getNode((String)message.getBody().get());
+ String idValue = node.getAttributes().getNamedItem("id").getNodeValue();
+
+ message.getBody().add("<BuyFailed id=\"" + idValue +"\"></BuyFailed>");
logger.info("Updated buy message: "+message);
return(message);
}
-
- private static Logger logger = Logger.getLogger(SetBuyFailedMessageAction.class);
-
- private ConfigTree m_config=null;
+
}
Modified: trunk/samples/esb/purchasing/system/src/com/acme/services/broker/SetBuyResponseMessageAction.java
===================================================================
--- trunk/samples/esb/purchasing/system/src/com/acme/services/broker/SetBuyResponseMessageAction.java 2008-06-13 04:38:08 UTC (rev 27)
+++ trunk/samples/esb/purchasing/system/src/com/acme/services/broker/SetBuyResponseMessageAction.java 2008-06-14 05:27:44 UTC (rev 28)
@@ -23,25 +23,31 @@
import org.jboss.soa.esb.actions.AbstractActionLifecycle;
import org.jboss.soa.esb.helpers.ConfigTree;
import org.jboss.soa.esb.message.Message;
+import org.pi4soa.common.xml.XMLUtils;
+import org.w3c.dom.Node;
public class SetBuyResponseMessageAction extends AbstractActionLifecycle {
+ private static Logger logger = Logger.getLogger(SetBuyResponseMessageAction.class);
+
+ private ConfigTree config;
+
public SetBuyResponseMessageAction(ConfigTree config) {
- m_config = config;
+ this.config = config;
}
public Message process(Message message) throws Exception{
- message.getBody().add("<BuyResponse id=\"5\"></BuyResponse>");
+ Node node = XMLUtils.getNode((String)message.getBody().get());
+ String idValue = node.getAttributes().getNamedItem("id").getNodeValue();
+ message.getBody().add("<BuyResponse id=\"" + idValue +"\"></BuyResponse>");
logger.info("Updated buy message: "+message);
return(message);
}
- private static Logger logger = Logger.getLogger(SetBuyResponseMessageAction.class);
- private ConfigTree m_config=null;
}
Modified: trunk/samples/esb/purchasing/system/src/com/acme/services/broker/SetCreditCheckRequestMessageAction.java
===================================================================
--- trunk/samples/esb/purchasing/system/src/com/acme/services/broker/SetCreditCheckRequestMessageAction.java 2008-06-13 04:38:08 UTC (rev 27)
+++ trunk/samples/esb/purchasing/system/src/com/acme/services/broker/SetCreditCheckRequestMessageAction.java 2008-06-14 05:27:44 UTC (rev 28)
@@ -23,25 +23,30 @@
import org.jboss.soa.esb.actions.AbstractActionLifecycle;
import org.jboss.soa.esb.helpers.ConfigTree;
import org.jboss.soa.esb.message.Message;
+import org.pi4soa.common.xml.XMLUtils;
+import org.w3c.dom.Node;
public class SetCreditCheckRequestMessageAction extends AbstractActionLifecycle {
+ private static Logger logger = Logger.getLogger(SetCreditCheckRequestMessageAction.class);
+
+ private ConfigTree config;
+
public SetCreditCheckRequestMessageAction(ConfigTree config) {
- m_config = config;
+ this.config = config;
}
public Message process(Message message) throws Exception{
- message.getBody().add("<CreditCheckRequest id=\"5\"></CreditCheckRequest>");
+ Node node = XMLUtils.getNode((String)message.getBody().get());
+ String idValue = node.getAttributes().getNamedItem("id").getNodeValue();
+ message.getBody().add("<CreditCheckRequest id=\"" + idValue +"\"></CreditCheckRequest>");
logger.info("Updated credit check request message: "+message);
return(message);
}
- private static Logger logger = Logger.getLogger(SetCreditCheckRequestMessageAction.class);
-
- private ConfigTree m_config=null;
}
Modified: trunk/samples/esb/purchasing/system/src/com/acme/services/creditAgency/SetCreditCheckInvalidMessageAction.java
===================================================================
--- trunk/samples/esb/purchasing/system/src/com/acme/services/creditAgency/SetCreditCheckInvalidMessageAction.java 2008-06-13 04:38:08 UTC (rev 27)
+++ trunk/samples/esb/purchasing/system/src/com/acme/services/creditAgency/SetCreditCheckInvalidMessageAction.java 2008-06-14 05:27:44 UTC (rev 28)
@@ -23,25 +23,30 @@
import org.jboss.soa.esb.actions.AbstractActionLifecycle;
import org.jboss.soa.esb.helpers.ConfigTree;
import org.jboss.soa.esb.message.Message;
+import org.pi4soa.common.xml.XMLUtils;
+import org.w3c.dom.Node;
public class SetCreditCheckInvalidMessageAction extends AbstractActionLifecycle {
+ private static Logger logger = Logger.getLogger(SetCreditCheckInvalidMessageAction.class);
+
+ private ConfigTree config;
+
public SetCreditCheckInvalidMessageAction(ConfigTree config) {
- m_config = config;
+ this.config = config;
}
public Message process(Message message) throws Exception{
- message.getBody().add("<CreditCheckInvalid id=\"5\"></CreditCheckInvalid>");
-
+ Node node = XMLUtils.getNode((String)message.getBody().get());
+ String idValue = node.getAttributes().getNamedItem("id").getNodeValue();
+ message.getBody().add("<CreditCheckInvalid id=\"" + idValue +"\"></CreditCheckInvalid>");
+
logger.info("Updated credit message: "+message);
return(message);
}
- private static Logger logger = Logger.getLogger(SetCreditCheckInvalidMessageAction.class);
-
- private ConfigTree m_config=null;
}
Modified: trunk/samples/esb/purchasing/system/src/com/acme/services/creditAgency/SetCreditCheckResponseMessageAction.java
===================================================================
--- trunk/samples/esb/purchasing/system/src/com/acme/services/creditAgency/SetCreditCheckResponseMessageAction.java 2008-06-13 04:38:08 UTC (rev 27)
+++ trunk/samples/esb/purchasing/system/src/com/acme/services/creditAgency/SetCreditCheckResponseMessageAction.java 2008-06-14 05:27:44 UTC (rev 28)
@@ -23,25 +23,31 @@
import org.jboss.soa.esb.actions.AbstractActionLifecycle;
import org.jboss.soa.esb.helpers.ConfigTree;
import org.jboss.soa.esb.message.Message;
+import org.pi4soa.common.xml.XMLUtils;
+import org.w3c.dom.Node;
public class SetCreditCheckResponseMessageAction extends AbstractActionLifecycle {
+ private static Logger logger = Logger.getLogger(SetCreditCheckResponseMessageAction.class);
+
+ private ConfigTree config;
+
public SetCreditCheckResponseMessageAction(ConfigTree config) {
- m_config = config;
+ this.config = config;
}
public Message process(Message message) throws Exception{
- message.getBody().add("<CreditCheckResponse id=\"5\"></CreditCheckResponse>");
+ Node node = XMLUtils.getNode((String)message.getBody().get());
+ String idValue = node.getAttributes().getNamedItem("id").getNodeValue();
+ message.getBody().add("<CreditCheckResponse id=\"" + idValue +"\"></CreditCheckResponse>");
logger.info("Updated credit message: "+message);
return(message);
}
- private static Logger logger = Logger.getLogger(SetCreditCheckResponseMessageAction.class);
-
- private ConfigTree m_config=null;
+
}
Added: trunk/samples/esb/purchasing/system/src/org/jboss/soa/overlord/conversation/EPRWrapper.java
===================================================================
--- trunk/samples/esb/purchasing/system/src/org/jboss/soa/overlord/conversation/EPRWrapper.java (rev 0)
+++ trunk/samples/esb/purchasing/system/src/org/jboss/soa/overlord/conversation/EPRWrapper.java 2008-06-14 05:27:44 UTC (rev 28)
@@ -0,0 +1,95 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, 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) 2008,
+ */
+package org.jboss.soa.overlord.conversation;
+
+import java.io.Serializable;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.Id;
+import javax.persistence.JoinColumn;
+import javax.persistence.Lob;
+import javax.persistence.ManyToOne;
+import javax.persistence.Table;
+
+/**
+ * @author jeffyu
+ *
+ */
+@Entity
+@Table(name="T_EPRS")
+public class EPRWrapper implements Serializable{
+
+ private static final long serialVersionUID = 1111L;
+
+ @Id
+ @GeneratedValue
+ @Column(name="ID")
+ private long id;
+
+ @ManyToOne
+ @JoinColumn(name="SESSION_ID")
+ private Session session;
+
+ @Column(name="name")
+ private String name;
+
+ @Column(name="EPR")
+ @Lob
+ private String value;
+
+ public EPRWrapper() {
+
+ }
+
+ public Session getSession() {
+ return session;
+ }
+
+ public void setSession(Session session) {
+ this.session = session;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getValue() {
+ return value;
+ }
+
+ public void setValue(String value) {
+ this.value = value;
+ }
+
+ public long getId() {
+ return id;
+ }
+
+ public void setId(long id) {
+ this.id = id;
+ }
+
+}
Modified: trunk/samples/esb/purchasing/system/src/org/jboss/soa/overlord/conversation/Identity.java
===================================================================
--- trunk/samples/esb/purchasing/system/src/org/jboss/soa/overlord/conversation/Identity.java 2008-06-13 04:38:08 UTC (rev 27)
+++ trunk/samples/esb/purchasing/system/src/org/jboss/soa/overlord/conversation/Identity.java 2008-06-14 05:27:44 UTC (rev 28)
@@ -45,6 +45,8 @@
@Table(name="T_IDENTITY")
public class Identity implements Serializable {
+ private static final long serialVersionUID = 1112L;
+
@Id @GeneratedValue
@Column(name="ID")
private long id;
Added: trunk/samples/esb/purchasing/system/src/org/jboss/soa/overlord/conversation/JoinState.java
===================================================================
--- trunk/samples/esb/purchasing/system/src/org/jboss/soa/overlord/conversation/JoinState.java (rev 0)
+++ trunk/samples/esb/purchasing/system/src/org/jboss/soa/overlord/conversation/JoinState.java 2008-06-14 05:27:44 UTC (rev 28)
@@ -0,0 +1,117 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, 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) 2008,
+ */
+package org.jboss.soa.overlord.conversation;
+
+import java.io.Serializable;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.Id;
+import javax.persistence.JoinColumn;
+import javax.persistence.ManyToOne;
+import javax.persistence.Table;
+
+/**
+ * @author jeffyu
+ *
+ */
+@Entity
+@Table(name="T_JOIN_STATES")
+public class JoinState implements Serializable {
+
+ private static final long serialVersionUID = 1113L;
+
+ @Id @GeneratedValue
+ @Column(name="ID")
+ private long id;
+
+ @ManyToOne
+ @JoinColumn(name="SESSION_ID")
+ private Session session;
+
+ @Column(name="CATEGORY", nullable = false)
+ private String category ;
+
+ @Column(name="NAME", nullable = false)
+ private String name ;
+
+ @Column(name="ITEM_COUNT")
+ private int spawnPath= 0 ;
+
+ public JoinState() {
+
+ }
+
+ public JoinState(String category, String name, int count) {
+ this.category = category;
+ this.name = name;
+ this.spawnPath = count;
+ }
+
+ public long getId() {
+ return id;
+ }
+
+ public void setId(long id) {
+ this.id = id;
+ }
+
+ public Session getSession() {
+ return session;
+ }
+
+ public void setSession(Session session) {
+ this.session = session;
+ }
+
+ public String getCategory() {
+ return category;
+ }
+
+ public void setCategory(String category) {
+ this.category = category;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public int getSpawnPath() {
+ return spawnPath;
+ }
+
+ public void setSpawnPath(int spawnPath) {
+ this.spawnPath = spawnPath;
+ }
+
+ public synchronized void join() {
+ this.spawnPath--;
+ }
+
+ public String toString() {
+ return (category+"/"+name + ": spawned path count is [" + this.spawnPath + "]");
+ }
+
+}
Modified: trunk/samples/esb/purchasing/system/src/org/jboss/soa/overlord/conversation/PersistentTest.java
===================================================================
--- trunk/samples/esb/purchasing/system/src/org/jboss/soa/overlord/conversation/PersistentTest.java 2008-06-13 04:38:08 UTC (rev 27)
+++ trunk/samples/esb/purchasing/system/src/org/jboss/soa/overlord/conversation/PersistentTest.java 2008-06-14 05:27:44 UTC (rev 28)
@@ -60,7 +60,7 @@
Transaction transaction= session.getTransaction();
transaction.begin();
- ScheduleItem si = new ScheduleItem("PurchasingBroker", "creditagency", 1);
+ ScheduleItem si = new ScheduleItem("PurchasingBroker", "creditagency");
session.save(si);
transaction.commit();
session.close();
Modified: trunk/samples/esb/purchasing/system/src/org/jboss/soa/overlord/conversation/ScheduleItem.java
===================================================================
--- trunk/samples/esb/purchasing/system/src/org/jboss/soa/overlord/conversation/ScheduleItem.java 2008-06-13 04:38:08 UTC (rev 27)
+++ trunk/samples/esb/purchasing/system/src/org/jboss/soa/overlord/conversation/ScheduleItem.java 2008-06-14 05:27:44 UTC (rev 28)
@@ -34,6 +34,8 @@
@Table(name="T_SCHEDULE_ITEM")
public class ScheduleItem implements Serializable {
+ private static final long serialVersionUID = 1114L;
+
@Id @GeneratedValue
@Column(name="ID")
private long id;
@@ -48,17 +50,13 @@
@Column(name="NAME", nullable = false)
private String name ;
- @Column(name="ITEM_COUNT")
- private int count= 1 ;
-
public ScheduleItem() {
}
- public ScheduleItem(String category, String name, int count) {
+ public ScheduleItem(String category, String name) {
this.category = category;
this.name = name;
- this.count = count;
}
public String getCategory() {
@@ -69,11 +67,7 @@
return(name);
}
- public int getCount() {
- return(count);
- }
-
public void setCategory(String category) {
this.category = category;
}
@@ -82,43 +76,19 @@
this.name = name;
}
- public void setCount(int count) {
- this.count = count;
- }
-
- public synchronized boolean join() {
-
- this.count--;
-
- if (this.count <= 0) {
- return true;
- }
-
- return false;
- }
-
- public boolean equals(Object other) {
- boolean ret=false;
-
+ public boolean equals(Object other) {
if (other instanceof ScheduleItem) {
ScheduleItem si=(ScheduleItem)other;
-
- if (si.category.equals(category) &&
- si.name.equals(name)) {
- ret = true;
+ if (si.category.equals(category) && si.name.equals(name)) {
+ return true;
}
}
-
- return(ret);
+ return false;
}
public String toString() {
- return (category+"/"+name+"["+count+"]");
+ return (category+"/"+name);
}
-
- public int hashCode() {
- return (category.hashCode() + name.hashCode());
- }
public long getId() {
return id;
Modified: trunk/samples/esb/purchasing/system/src/org/jboss/soa/overlord/conversation/Session.java
===================================================================
--- trunk/samples/esb/purchasing/system/src/org/jboss/soa/overlord/conversation/Session.java 2008-06-13 04:38:08 UTC (rev 27)
+++ trunk/samples/esb/purchasing/system/src/org/jboss/soa/overlord/conversation/Session.java 2008-06-14 05:27:44 UTC (rev 28)
@@ -37,16 +37,17 @@
import javax.persistence.Transient;
import org.apache.log4j.Logger;
+import org.jboss.internal.soa.esb.addressing.helpers.EPRHelper;
import org.jboss.soa.esb.addressing.EPR;
import org.jboss.soa.esb.client.ServiceInvoker;
import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.overlord.jbossesb.actions.MessageProperties;
-import org.pi4soa.jbossesb.container.EPRWrapper;
@Entity
@Table(name="T_SESSION")
public class Session implements Serializable {
+ private static final long serialVersionUID = 1115L;
+
private static Logger logger = Logger.getLogger(Session.class);
@Id @GeneratedValue
@@ -61,15 +62,17 @@
@Column(name = "STATUS")
private SessionStatus status=SessionStatus.Initialized;
- @Transient
- private java.util.Hashtable<String,EPRWrapper> m_eprs=new java.util.Hashtable<String,EPRWrapper>();
+ @OneToMany(fetch = FetchType.LAZY)
+ @JoinColumn(name="SESSION_ID")
+ private List<EPRWrapper> eprWrappers = new ArrayList<EPRWrapper>();
@OneToMany(fetch = FetchType.LAZY)
@JoinColumn(name="SESSION_ID")
private List<ScheduleItem> scheduleItems=new ArrayList<ScheduleItem>();
- @Transient
- private java.util.List<ScheduleItem> m_joinStates=new java.util.Vector<ScheduleItem>();
+ @OneToMany(fetch = FetchType.LAZY)
+ @JoinColumn(name = "SESSION_ID")
+ private List<JoinState> joinStates=new ArrayList<JoinState>();
@OneToMany(fetch = FetchType.LAZY)
@JoinColumn(name="SESSION_ID")
@@ -106,20 +109,41 @@
}
public void setEPR(String name, EPR epr) {
- m_eprs.put(name, new EPRWrapper(epr));
+ try {
+ EPRWrapper theEPRWrapper = null;
+ for(EPRWrapper eprWrapper : eprWrappers) {
+ if (name.equals(eprWrapper.getName())) {
+ theEPRWrapper = eprWrapper;
+ }
+ }
+
+ if (theEPRWrapper != null) {
+ eprWrappers.remove(theEPRWrapper);
+ SessionManager.removeObject(theEPRWrapper);
+ }
+
+ EPRWrapper eprWrapper = new EPRWrapper();
+ eprWrapper.setSession(this);
+ eprWrapper.setName(name);
+ eprWrapper.setValue(EPRHelper.toXMLString(epr));
+ eprWrappers.add(eprWrapper);
+ SessionManager.saveObject(eprWrapper);
+ } catch (Exception e) {
+ e.printStackTrace();
+ throw new RuntimeException("Error in storing EPR!!");
+ }
}
-
- public EPR getEPR(String name) {
- EPR ret=null;
- EPRWrapper wrapper=m_eprs.get(name);
+
+ public EPR getEPR(String name) throws Exception{
- if (wrapper != null) {
- ret = wrapper.getEPR();
+ for(EPRWrapper epr : eprWrappers) {
+ if (name.equals(epr.getName()))
+ {
+ return EPRHelper.fromXMLString(epr.getValue());
+ }
}
-
- logger.info("Returning EPR '"+name+"': "+ret);
- return(ret);
+ return null;
}
public void schedule(String category, String name, boolean immediate,
@@ -127,103 +151,108 @@
logger.info("Schedule '"+category+"/"+name+"' immediate="+immediate);
- // TODO: GPB: Note we don't ideally want to pass the session property
- // to the invoked services, as this may mean unnecessary serialization
- // but at the same time the message may be passed to other paths, and
- // subsequent actions, so cannot just be cleared. Making a message
- // copy may be appropriate?
+ ScheduleItem si=new ScheduleItem(category, name);
+ si.setSession(this);
- ScheduleItem si=new ScheduleItem(category, name, 0);
- Session session =(Session)message.getProperties().getProperty(MessageProperties.SESSION);
- si.setSession(session);
-
- synchronized(m_joinStates) {
-
- // Check if pending join
- int index=m_joinStates.indexOf(si);
-
- if (index != -1) {
- ScheduleItem joinItem=m_joinStates.get(index);
-
- logger.info("Check if should join: "+si);
-
- if (joinItem.join()) {
- m_joinStates.remove(joinItem);
- logger.info("About to schedule join: "+si);
-
+ synchronized(joinStates) {
+ JoinState joinState = getJoinStateByScheduleItem(si);
+ if (joinState != null) {
+ joinState.join();
+ SessionManager.updateObject(joinState);
+ System.out.println("---<><><>----" + getJoinStateByScheduleItem(si).getSpawnPath());
+ if (joinState.getSpawnPath() <= 0) {
+ joinStates.remove(joinState);
+ SessionManager.removeObject(joinState);
+ logger.info("About to schedule joined state: "+joinState);
ServiceInvoker invoker= new ServiceInvoker(category, name);
invoker.deliverAsync(message);
} else {
-
logger.info("Don't join yet: "+si);
-
- // Nothing to schedule
- si = null;
+ return;
}
}
}
- if (si != null) {
- synchronized(scheduleItems) {
- // Check if already exists
- if (scheduleItems.contains(si)) {
- logger.error("Schedule already contains item for '"+category+
- "/"+name+"'");
- }
-
- scheduleItems.add(si);
- SessionManager.saveObject(si);
- logger.info("Scheduled: "+si);
+ synchronized(scheduleItems) {
+ // Check if already exists
+ if (scheduleItems.contains(si)) {
+ logger.error("Schedule already contains item for " + si);
+ }
+
+ scheduleItems.add(si);
+ SessionManager.saveObject(si);
+ logger.info("Scheduled: "+si);
- // Need to determine whether the scheduled
- // state needs to be automatically triggered
- if (immediate) {
- ServiceInvoker invoker= new ServiceInvoker(category, name);
- invoker.deliverAsync(message);
- }
+ if (immediate) {
+ ServiceInvoker invoker= new ServiceInvoker(category, name);
+ invoker.deliverAsync(message);
}
}
+
}
public void unschedule(String category, String name) throws Exception {
+
logger.info("Unschedule '"+category+"/"+name+"'");
-
- ScheduleItem si=new ScheduleItem(category, name, 0);
- synchronized(m_joinStates) {
- if (m_joinStates.contains(si)) {
+ synchronized(joinStates) {
+ if (isScheduleItemInJoinState(category, name)) {
throw new Exception("Unable to enact join state, converging paths have still not completed");
}
}
synchronized(scheduleItems) {
-
+ ScheduleItem si = getScheduleItem(category, name);
if (scheduleItems.remove(si) == false) {
- logger.error("Unable to unschedule: "+si);
- //throw new Exception("Unable to unschedule: "+si);
+ logger.error("Unable to unschedule: "+si);
+ throw new Exception("Unable to unschedule item : "+si);
} else {
SessionManager.removeObject(si);
- logger.info("Unscheduled: "+si);
+ logger.info("Successfully Unscheduled: "+si);
}
}
}
-
- public void join(String category, String name, int count) {
- logger.info("Join '"+category+"/"+name+"' count="+count);
-
- ScheduleItem si=new ScheduleItem(category, name, count);
-
- // Check if already exists
- if (m_joinStates.contains(si)) {
- logger.error("Join already exists for '"+category+
- "/"+name+"'");
+
+ protected boolean isScheduleItemInJoinState(String category, String name) {
+ for(JoinState joinState : joinStates) {
+ if (name.equals(joinState.getName()) && category.equals(joinState.getCategory())) {
+ return true;
+ }
}
-
- m_joinStates.add(si);
-
- logger.info("Added join: "+si);
+ return false;
}
+
+ protected JoinState getJoinStateByScheduleItem(ScheduleItem si) {
+ for(JoinState joinState : joinStates) {
+ if (si.getName().equals(joinState.getName()) && si.getCategory().equals(joinState.getCategory())) {
+ return joinState;
+ }
+ }
+ return null;
+ }
+
+ protected ScheduleItem getScheduleItem(String category, String name) {
+ for(ScheduleItem si : scheduleItems) {
+ if (category.equals(si.getCategory()) && name.equals(si.getName())) {
+ si.setSession(this);
+ return si;
+ }
+ }
+ return new ScheduleItem(category, name);
+ }
+
+ public void join(String category, String name, int count) throws Exception {
+ JoinState joinState=new JoinState(category, name, count);
+ joinState.setSession(this);
+ if (joinStates.contains(joinState)) {
+ logger.error("Join already exists for '"+category+ "/"+name+"'");
+ }
+ joinStates.add(joinState);
+ SessionManager.saveObject(joinState);
+ logger.info("Added Join State: " + joinState);
+ }
+
public void assimulateIdentities(java.util.List<Identity> ids) throws Exception {
List<Identity> newIds = new ArrayList<Identity>();
@@ -328,6 +357,22 @@
public void setConversationType(String conversationType) {
this.conversationType = conversationType;
}
+
+ public List<EPRWrapper> getEprWrappers() {
+ return eprWrappers;
+ }
+
+ public void setEprWrappers(List<EPRWrapper> eprWrappers) {
+ this.eprWrappers = eprWrappers;
+ }
+
+ public List<JoinState> getJoinStates() {
+ return joinStates;
+ }
+
+ public void setJoinStates(List<JoinState> joinStates) {
+ this.joinStates = joinStates;
+ }
}
Modified: trunk/samples/esb/purchasing/system/src/org/jboss/soa/overlord/conversation/SessionManager.java
===================================================================
--- trunk/samples/esb/purchasing/system/src/org/jboss/soa/overlord/conversation/SessionManager.java 2008-06-13 04:38:08 UTC (rev 27)
+++ trunk/samples/esb/purchasing/system/src/org/jboss/soa/overlord/conversation/SessionManager.java 2008-06-14 05:27:44 UTC (rev 28)
@@ -20,10 +20,8 @@
package org.jboss.soa.overlord.conversation;
import java.util.Collection;
-import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
-import java.util.Map;
import org.apache.log4j.Logger;
import org.hibernate.Transaction;
@@ -45,7 +43,7 @@
return (Session) hibernateSession.load(Session.class, Long.valueOf(sessionKey));
}
- Class<?> pojoclass=Thread.currentThread().getContextClassLoader().loadClass(sessionName);
+ Class<?> pojoclass= ClassLoaderUtil.loadClass(sessionName);
Object businessState = pojoclass.newInstance();
transaction = hibernateSession.beginTransaction();
@@ -55,7 +53,9 @@
conversationSession.setPojoClass(sessionName);
conversationSession.setStatus(SessionStatus.Active);
if (businessState instanceof HibernateObject) {
- conversationSession.setPojoID(((HibernateObject)businessState).getId());
+ HibernateObject ho = (HibernateObject) businessState;
+ conversationSession.setPojoID(ho.getId());
+ logger.debug("Set Business State Object ID : " + ho.getId());
}
conversationSession.setBusinessObject(businessState);
@@ -68,7 +68,6 @@
hibernateSession.save(conversationSession);
transaction.commit();
- hibernateSession.close();
return conversationSession;
@@ -77,6 +76,8 @@
transaction.rollback();
}
throw new Exception (e);
+ } finally {
+ hibernateSession.close();
}
}
@@ -89,11 +90,13 @@
if (sessionKey != null) {
org.hibernate.Session hibernateSession = HibernateUtil.getSessionFactory().openSession();
Session session = (Session) hibernateSession.load(Session.class, Long.valueOf(sessionKey));
- Class<?> pojoClass = Thread.currentThread().getContextClassLoader().loadClass(session.getPojoClass());
+ Class<?> pojoClass = ClassLoaderUtil.loadClass(session.getPojoClass());
Object pojo = hibernateSession.load(pojoClass, Long.valueOf(session.getPojoID()));
session.setBusinessObject(pojo);
session.getScheduleItems().size();
session.getIdentities().size();
+ session.getJoinStates().size();
+ session.getEprWrappers().size();
hibernateSession.close();
return session;
}
@@ -131,6 +134,14 @@
return col;
}
+ public static void updateObject(Object obj) throws Exception {
+ org.hibernate.Session hibernateSession = HibernateUtil.getSessionFactory().openSession();
+ Transaction transaction = hibernateSession.beginTransaction();
+ hibernateSession.update(obj);
+ transaction.commit();
+ hibernateSession.close();
+ }
+
public static void removeObject(Object obj) throws Exception {
org.hibernate.Session hibernateSession = HibernateUtil.getSessionFactory().openSession();
Transaction transaction = hibernateSession.beginTransaction();
@@ -143,7 +154,7 @@
public static Session getSession(Identity id) throws Exception {
org.hibernate.Session hibernateSession = HibernateUtil.getSessionFactory().openSession();
String query = "select b from Identity b where b.type =:type and b.propertyValues =:propertyValues and b.serviceName =:serviceName";
- List results = hibernateSession.createQuery(query)
+ List<?> results = hibernateSession.createQuery(query)
.setParameter("type", id.getType())
.setParameter("propertyValues", id.getPropertyValues())
.setParameter("serviceName", id.getServiceName())
@@ -156,6 +167,8 @@
Session session = theID.getSession();
session.getScheduleItems().size();
session.getIdentities().size();
+ session.getJoinStates().size();
+ session.getEprWrappers().size();
hibernateSession.close();
return session;
}
Modified: trunk/samples/esb/purchasing/system/src/org/jboss/soa/overlord/jbossesb/actions/ActionProperties.java
===================================================================
--- trunk/samples/esb/purchasing/system/src/org/jboss/soa/overlord/jbossesb/actions/ActionProperties.java 2008-06-13 04:38:08 UTC (rev 27)
+++ trunk/samples/esb/purchasing/system/src/org/jboss/soa/overlord/jbossesb/actions/ActionProperties.java 2008-06-14 05:27:44 UTC (rev 28)
@@ -24,6 +24,7 @@
public static final String SESSION_NAME="session";
public static final String ACTION_NAME = "action";
public static final String ACTION_NODE = "action";
+ public static final String CLASS_NAME = "class";
public static final String SERVICE_CATEGORY = "service-category";
public static final String SERVICE_NAME = "service-name";
Modified: trunk/samples/esb/purchasing/system/src/org/jboss/soa/overlord/jbossesb/actions/ConversationAction.java
===================================================================
--- trunk/samples/esb/purchasing/system/src/org/jboss/soa/overlord/jbossesb/actions/ConversationAction.java 2008-06-13 04:38:08 UTC (rev 27)
+++ trunk/samples/esb/purchasing/system/src/org/jboss/soa/overlord/jbossesb/actions/ConversationAction.java 2008-06-14 05:27:44 UTC (rev 28)
@@ -19,7 +19,6 @@
*/
package org.jboss.soa.overlord.jbossesb.actions;
-import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -28,6 +27,7 @@
import org.jboss.soa.esb.actions.AbstractActionLifecycle;
import org.jboss.soa.esb.helpers.ConfigTree;
import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.overlord.conversation.ClassLoaderUtil;
import org.jboss.soa.overlord.conversation.Identity;
import org.jboss.soa.overlord.conversation.IdentityType;
import org.jboss.soa.overlord.conversation.Session;
@@ -97,6 +97,7 @@
} catch(Exception e) {
logger.error("Failed to evaluate registry query '" + locator+"': "+e);
+ throw new Exception(e);
}
}
}
@@ -147,13 +148,10 @@
if (ret == null) {
ret = SessionManager.retrieveSession(sessionKey, ids);
if (ret != null) {
- message.getProperties().setProperty(MessageProperties.SESSION, ret);
+ //message.getProperties().setProperty(MessageProperties.SESSION, ret);
message.getProperties().setProperty(MessageProperties.SESSION_KEY, String.valueOf(ret.getId()));
}
}
- System.out.println("=============================================");
- logger.info("Returning session="+ret+" for sessionKey=" + sessionKey);
- System.out.println("=============================================");
return(ret);
}
@@ -165,9 +163,7 @@
*/
public Message process(Message message) throws Exception {
String sessionKey=(String)message.getProperties().getProperty(MessageProperties.SESSION_KEY);
- System.out.println("=============================================");
- logger.info("Session Key is " + sessionKey + " Body is: " + message.getBody());
- System.out.println("=============================================");
+ logger.info("Session Key is [" + sessionKey + "] Body is: [" + message.getBody() + "]");
Session session = getSession(message);
if (session != null && isFirstConversationAction(message)) {
unschedule(message);
@@ -177,28 +173,42 @@
}
- private boolean isFirstConversationAction(Message message) {
+ private boolean isFirstConversationAction(Message message) throws ClassNotFoundException{
String sessionKey=(String)message.getProperties().getProperty(MessageProperties.SESSION_KEY);
if (sessionKey != null) {
- String actionName = config.getAttribute(ActionProperties.ACTION_NAME);
- ConfigTree ct = config.getParent().getFirstChild(ActionProperties.ACTION_NODE);
- if (actionName.equals(ct.getAttribute(ActionProperties.ACTION_NAME))) {
- return true;
+ ConfigTree theCT = getFirstConversationAction();
+ if (theCT != null) {
+ String actionName = config.getAttribute(ActionProperties.ACTION_NAME);
+ if (actionName.equals(theCT.getAttribute(ActionProperties.ACTION_NAME))) {
+ return true;
+ }
}
}
return false;
}
+
+ private ConfigTree getFirstConversationAction() throws ClassNotFoundException {
+ ConfigTree[] cts = config.getParent().getChildren(ActionProperties.ACTION_NODE);
+ for (ConfigTree ct : cts) {
+ String className = ct.getAttribute(ActionProperties.CLASS_NAME);
+ Class<?> action = ClassLoaderUtil.loadClass(className);
+ if (ConversationAction.class.isAssignableFrom(action)) {
+ return ct;
+ }
+ }
+ return null;
+ }
private void unschedule(Message message) throws Exception {
- String serviceName=getConfig().getParent().getAttribute(ActionProperties.SERVICE_CATEGORY);
- String serviceCategory=getConfig().getParent().getAttribute(ActionProperties.SERVICE_NAME);
+ String serviceCategory=getConfig().getParent().getAttribute(ActionProperties.SERVICE_CATEGORY);
+ String serviceName=getConfig().getParent().getAttribute(ActionProperties.SERVICE_NAME);
Session session = getSession(message);
session.unschedule(serviceCategory, serviceName);
}
/**
- * This is the method that deals with business logic.
+ * This is the method that deals with business logic for derived conversation actions.
* @param message
* @return
* @throws Exception
Modified: trunk/samples/esb/purchasing/system/src/org/jboss/soa/overlord/jbossesb/actions/ParallelAction.java
===================================================================
--- trunk/samples/esb/purchasing/system/src/org/jboss/soa/overlord/jbossesb/actions/ParallelAction.java 2008-06-13 04:38:08 UTC (rev 27)
+++ trunk/samples/esb/purchasing/system/src/org/jboss/soa/overlord/jbossesb/actions/ParallelAction.java 2008-06-14 05:27:44 UTC (rev 28)
@@ -29,6 +29,8 @@
*/
public class ParallelAction extends ConversationAction {
+ private static Logger logger = Logger.getLogger(ParallelAction.class);
+
public ParallelAction(ConfigTree config) {
super(config);
}
@@ -47,17 +49,13 @@
// this might indicate incorrect projection
// so should check that message has been cleared?
if (message.getBody().get() != null) {
- logger.error("Message has not been received prior " +
- "to parallel construct");
+ logger.error("Message has not been received prior to parallel construct");
}
for (int i=0; i < children.length; i++) {
if (children[i].getName().equals("path")) {
- String category=children[i].getAttribute("service-category");
- String name=children[i].getAttribute("service-name");
- String immediate=children[i].getAttribute("immediate","false");
-
+
// Increment the path count, but don't schedule
// until after the optional join has been scheduled
@@ -93,17 +91,19 @@
String name=children[i].getAttribute("service-name");
String immediate=children[i].getAttribute("immediate","false");
+ logger.info("SESSION is stale?" + session.getJoinStates().get(0).getSpawnPath());
// Schedule service
session.schedule(category, name,
immediate.equalsIgnoreCase("true"),
message);
+
}
}
return(message);
}
- private static Logger logger = Logger.getLogger(ParallelAction.class);
+
}
Modified: trunk/samples/esb/purchasing/system/src/org/jboss/soa/overlord/jbossesb/actions/ReceiveMessageAction.java
===================================================================
--- trunk/samples/esb/purchasing/system/src/org/jboss/soa/overlord/jbossesb/actions/ReceiveMessageAction.java 2008-06-13 04:38:08 UTC (rev 27)
+++ trunk/samples/esb/purchasing/system/src/org/jboss/soa/overlord/jbossesb/actions/ReceiveMessageAction.java 2008-06-14 05:27:44 UTC (rev 28)
@@ -20,6 +20,7 @@
package org.jboss.soa.overlord.jbossesb.actions;
import org.apache.log4j.Logger;
+import org.jboss.soa.esb.addressing.EPR;
import org.jboss.soa.esb.helpers.ConfigTree;
import org.jboss.soa.esb.message.Body;
import org.jboss.soa.esb.message.Message;
@@ -40,7 +41,6 @@
public Message handle(Message message) throws Exception {
String requiredOp=getConfig().getAttribute(ActionProperties.OPERATION);
String requiredMType=getConfig().getAttribute(ActionProperties.MESSAGE_TYPE);
- String category=getConfig().getAttribute(ActionProperties.CATEGORY);
String clientEPR=getConfig().getAttribute(ActionProperties.CLIENT_EPR);
String serviceName = getConfig().getAttribute(ActionProperties.SERVICE_DESCRIPTION_NAME);
@@ -64,16 +64,12 @@
logger.info("MESSAGE TYPE '"+mesgMType+"' RECEIVED");
+ EPR replyTo = message.getHeader().getCall().getReplyTo();
// Store any response EPR
- if (clientEPR != null &&
- message.getHeader().getCall().getReplyTo() != null) {
- session.setEPR(clientEPR, message.getHeader().getCall().getReplyTo());
+ if (clientEPR != null && replyTo != null) {
+ session.setEPR(clientEPR, replyTo);
}
- // Clear the message contents
- message.getBody().remove(Body.DEFAULT_LOCATION);
-
- logger.info("Cleared message body: "+message);
} else {
// Unexpected message
Modified: trunk/samples/esb/purchasing/system/src/org/jboss/soa/overlord/jbossesb/actions/ScheduleStateAction.java
===================================================================
--- trunk/samples/esb/purchasing/system/src/org/jboss/soa/overlord/jbossesb/actions/ScheduleStateAction.java 2008-06-13 04:38:08 UTC (rev 27)
+++ trunk/samples/esb/purchasing/system/src/org/jboss/soa/overlord/jbossesb/actions/ScheduleStateAction.java 2008-06-14 05:27:44 UTC (rev 28)
@@ -29,6 +29,8 @@
*/
public class ScheduleStateAction extends ConversationAction {
+ private static Logger logger = Logger.getLogger(ScheduleStateAction.class);
+
public ScheduleStateAction(ConfigTree config) {
super(config);
}
@@ -41,15 +43,13 @@
// Schedule action pipeline
Session session=getSession(message);
- session.schedule(serviceCategory, serviceName,
- immediate.equalsIgnoreCase("true"), message);
+ session.schedule(serviceCategory, serviceName,immediate.equalsIgnoreCase("true"), message);
logger.info("Scheduled '"+serviceCategory+"/"+serviceName+"'");
return(message);
}
- private static Logger logger = Logger.getLogger(ScheduleStateAction.class);
}
Modified: trunk/samples/esb/purchasing/system/src/org/jboss/soa/overlord/jbossesb/actions/SendMessageAction.java
===================================================================
--- trunk/samples/esb/purchasing/system/src/org/jboss/soa/overlord/jbossesb/actions/SendMessageAction.java 2008-06-13 04:38:08 UTC (rev 27)
+++ trunk/samples/esb/purchasing/system/src/org/jboss/soa/overlord/jbossesb/actions/SendMessageAction.java 2008-06-14 05:27:44 UTC (rev 28)
@@ -69,8 +69,6 @@
// TODO: Need to deal with identity???
java.util.List<Identity> ids=getIdentities(message, null);
session.assimulateIdentities(ids);
-
- // TODO: May need to store state
// Send message
Modified: trunk/samples/esb/purchasing/system/src/org/jboss/soa/overlord/jbossesb/actions/SwitchAction.java
===================================================================
--- trunk/samples/esb/purchasing/system/src/org/jboss/soa/overlord/jbossesb/actions/SwitchAction.java 2008-06-13 04:38:08 UTC (rev 27)
+++ trunk/samples/esb/purchasing/system/src/org/jboss/soa/overlord/jbossesb/actions/SwitchAction.java 2008-06-14 05:27:44 UTC (rev 28)
@@ -30,6 +30,8 @@
*/
public class SwitchAction extends ConversationAction {
+ private static Logger logger = Logger.getLogger(SwitchAction.class);
+
public SwitchAction(ConfigTree config) {
super(config);
}
@@ -63,10 +65,8 @@
}
if (selected) {
-
- // Schedule service and then invoke immediately
- session.schedule(category, name, true,
- message);
+ session.schedule(category, name, true, message);
+ logger.info("Schedule service of [" + category + "/" + name + "] immediately");
}
}
}
@@ -81,7 +81,7 @@
return(message);
}
- private static Logger logger = Logger.getLogger(SwitchAction.class);
+
}
15 years, 10 months
Overlord SVN: r29 - in trunk/samples/esb/purchasing: system/src/org/jboss/soa/overlord/conversation and 1 other directory.
by overlord-commits@lists.jboss.org
Author: jeff.yuchang
Date: 2008-06-16 06:21:52 -0400 (Mon, 16 Jun 2008)
New Revision: 29
Added:
trunk/samples/esb/purchasing/system/src/org/jboss/soa/overlord/conversation/ClassLoaderUtil.java
Modified:
trunk/samples/esb/purchasing/client/src/com/acme/services/buyer/BuyerClient.java
Log:
[SOAG-11]
* Add the missing file in last commit.
Modified: trunk/samples/esb/purchasing/client/src/com/acme/services/buyer/BuyerClient.java
===================================================================
--- trunk/samples/esb/purchasing/client/src/com/acme/services/buyer/BuyerClient.java 2008-06-14 05:27:44 UTC (rev 28)
+++ trunk/samples/esb/purchasing/client/src/com/acme/services/buyer/BuyerClient.java 2008-06-16 10:21:52 UTC (rev 29)
@@ -5,20 +5,17 @@
import org.jboss.soa.esb.message.format.MessageFactory;
import org.jboss.soa.esb.message.format.MessageType;
import org.jboss.soa.esb.client.ServiceInvoker;
+import org.jboss.soa.esb.common.Configuration;
public class BuyerClient {
-
- public static void main(String[] args) {
- BuyerClient client=new BuyerClient();
-
- client.run();
- }
+ private static Logger logger = Logger.getLogger(BuyerClient.class);
+
+ private ServiceInvoker brokerInvoker;
+
public BuyerClient() {
- String regClass =
- org.jboss.soa.esb.common.Configuration.getRegistryFactoryClass();
-
+ String regClass = Configuration.getRegistryFactoryClass();
System.setProperty("javax.xml.registry.ConnectionFactoryClass",
regClass);
@@ -50,7 +47,10 @@
}
}
- private static Logger logger = Logger.getLogger(BuyerClient.class);
-
- private ServiceInvoker brokerInvoker;
+ public static void main(String[] args) {
+ BuyerClient client=new BuyerClient();
+
+ client.run();
+ }
+
}
Added: trunk/samples/esb/purchasing/system/src/org/jboss/soa/overlord/conversation/ClassLoaderUtil.java
===================================================================
--- trunk/samples/esb/purchasing/system/src/org/jboss/soa/overlord/conversation/ClassLoaderUtil.java (rev 0)
+++ trunk/samples/esb/purchasing/system/src/org/jboss/soa/overlord/conversation/ClassLoaderUtil.java 2008-06-16 10:21:52 UTC (rev 29)
@@ -0,0 +1,32 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, 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) 2008,
+ */
+package org.jboss.soa.overlord.conversation;
+
+/**
+ * @author jeffyu
+ *
+ */
+public class ClassLoaderUtil {
+
+ public static Class<?> loadClass(String className) throws ClassNotFoundException {
+ return Thread.currentThread().getContextClassLoader().loadClass(className);
+ }
+
+}
15 years, 10 months
Overlord SVN: r29 - in trunk/samples/esb/purchasing: system/src/org/jboss/soa/overlord/conversation and 1 other directory.
by overlord-commits@lists.jboss.org
Author: jeff.yuchang
Date: 2008-06-16 06:21:52 -0400 (Mon, 16 Jun 2008)
New Revision: 29
Added:
trunk/samples/esb/purchasing/system/src/org/jboss/soa/overlord/conversation/ClassLoaderUtil.java
Modified:
trunk/samples/esb/purchasing/client/src/com/acme/services/buyer/BuyerClient.java
Log:
[SOAG-11]
* Add the missing file in last commit.
Modified: trunk/samples/esb/purchasing/client/src/com/acme/services/buyer/BuyerClient.java
===================================================================
--- trunk/samples/esb/purchasing/client/src/com/acme/services/buyer/BuyerClient.java 2008-06-14 05:27:44 UTC (rev 28)
+++ trunk/samples/esb/purchasing/client/src/com/acme/services/buyer/BuyerClient.java 2008-06-16 10:21:52 UTC (rev 29)
@@ -5,20 +5,17 @@
import org.jboss.soa.esb.message.format.MessageFactory;
import org.jboss.soa.esb.message.format.MessageType;
import org.jboss.soa.esb.client.ServiceInvoker;
+import org.jboss.soa.esb.common.Configuration;
public class BuyerClient {
-
- public static void main(String[] args) {
- BuyerClient client=new BuyerClient();
-
- client.run();
- }
+ private static Logger logger = Logger.getLogger(BuyerClient.class);
+
+ private ServiceInvoker brokerInvoker;
+
public BuyerClient() {
- String regClass =
- org.jboss.soa.esb.common.Configuration.getRegistryFactoryClass();
-
+ String regClass = Configuration.getRegistryFactoryClass();
System.setProperty("javax.xml.registry.ConnectionFactoryClass",
regClass);
@@ -50,7 +47,10 @@
}
}
- private static Logger logger = Logger.getLogger(BuyerClient.class);
-
- private ServiceInvoker brokerInvoker;
+ public static void main(String[] args) {
+ BuyerClient client=new BuyerClient();
+
+ client.run();
+ }
+
}
Added: trunk/samples/esb/purchasing/system/src/org/jboss/soa/overlord/conversation/ClassLoaderUtil.java
===================================================================
--- trunk/samples/esb/purchasing/system/src/org/jboss/soa/overlord/conversation/ClassLoaderUtil.java (rev 0)
+++ trunk/samples/esb/purchasing/system/src/org/jboss/soa/overlord/conversation/ClassLoaderUtil.java 2008-06-16 10:21:52 UTC (rev 29)
@@ -0,0 +1,32 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, 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) 2008,
+ */
+package org.jboss.soa.overlord.conversation;
+
+/**
+ * @author jeffyu
+ *
+ */
+public class ClassLoaderUtil {
+
+ public static Class<?> loadClass(String className) throws ClassNotFoundException {
+ return Thread.currentThread().getContextClassLoader().loadClass(className);
+ }
+
+}
15 years, 10 months