Author: jeff.yuchang
Date: 2008-08-20 06:17:16 -0400 (Wed, 20 Aug 2008)
New Revision: 255
Added:
cdl/trunk/assembly/jbossesb/src/main/resources/overlord-cdl-jbossesb.cfg.xml
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/EPRWrapper.java
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/HibernateObject.java
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/Identity.java
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/IdentityType.java
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/JoinState.java
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/LogicalCourier.java
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/ScheduleItem.java
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/Session.java
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/SessionManager.java
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/SessionStatus.java
Removed:
cdl/trunk/assembly/jbossesb/src/main/resources/hibernate.cfg.xml
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/conversation/
Modified:
cdl/trunk/assembly/jbossesb/pom.xml
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/CreateSessionAction.java
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/actions/IfAction.java
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/actions/MessageRouterAction.java
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/actions/ParallelAction.java
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/actions/PerformAction.java
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/actions/ReceiveMessageAction.java
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/actions/RetrieveSessionAction.java
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/actions/ScheduleStateAction.java
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/actions/SendMessageAction.java
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/actions/SetMessageAction.java
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/actions/SetStateAction.java
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/actions/SwitchAction.java
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/actions/WhenAction.java
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/actions/WhileAction.java
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/util/HibernateUtil.java
cdl/trunk/samples/jbossesb/broker/src/main/resources/META-INF/deployment.xml
cdl/trunk/samples/jbossesb/broker/src/main/resources/META-INF/jboss-esb.xml
cdl/trunk/samples/jbossesb/creditAgency/src/main/resources/META-INF/deployment.xml
cdl/trunk/samples/jbossesb/purchasing/src/main/resources/META-INF/deployment.xml
cdl/trunk/samples/jbossesb/supplier/src/main/resources/META-INF/deployment.xml
cdl/trunk/samples/jbossesb/supplier/src/main/resources/META-INF/jboss-esb.xml
Log:
* SOAG-45.
* Update the default hibernate.cfg.xml to overlord-cdl-jbossesb.cfg.xml.
* Update the package name for Session and other classes.
Modified: cdl/trunk/assembly/jbossesb/pom.xml
===================================================================
--- cdl/trunk/assembly/jbossesb/pom.xml 2008-08-19 16:23:55 UTC (rev 254)
+++ cdl/trunk/assembly/jbossesb/pom.xml 2008-08-20 10:17:16 UTC (rev 255)
@@ -50,7 +50,7 @@
</dependencies>
<build>
- <finalName>cdl-jbossesb</finalName>
+ <finalName>overlord-cdl-jbossesb</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Deleted: cdl/trunk/assembly/jbossesb/src/main/resources/hibernate.cfg.xml
===================================================================
--- cdl/trunk/assembly/jbossesb/src/main/resources/hibernate.cfg.xml 2008-08-19 16:23:55
UTC (rev 254)
+++ cdl/trunk/assembly/jbossesb/src/main/resources/hibernate.cfg.xml 2008-08-20 10:17:16
UTC (rev 255)
@@ -1,64 +0,0 @@
-<!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">
- org.hsqldb.jdbcDriver
- </property>
- <property name="hibernate.connection.url">
- jdbc:hsqldb:hsql://localhost
- </property>
- <property name="hibernate.connection.username">
- sa
- </property-->
-
- <property
name="hibernate.dialect">org.hibernate.dialect.HSQLDialect</property>
-
- <!-- DataSource properties (begin) === -->
- <property
name="hibernate.connection.datasource">java:/cdlDS</property>
- <!-- ==== DataSource properties (end) -->
-
-
- <!-- Use the C3P0 connection pool provider -->
- <property name="hibernate.c3p0.min_size">5</property>
- <property name="hibernate.c3p0.max_size">20</property>
- <property name="hibernate.c3p0.timeout">300</property>
- <property name="hibernate.c3p0.max_statements">50</property>
- <property name="hibernate.c3p0.idle_test_period">3000</property>
-
- <property name="current_session_context_class">thread</property>
- <property name="hibernate.connection.isolation">4</property>
-
- <!-- Show and print nice SQL on stdout -->
- <property name="show_sql">false</property>
- <property name="format_sql">true</property>
-
- <!-- 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"/>
-
- </session-factory>
-</hibernate-configuration>
Added: cdl/trunk/assembly/jbossesb/src/main/resources/overlord-cdl-jbossesb.cfg.xml
===================================================================
--- cdl/trunk/assembly/jbossesb/src/main/resources/overlord-cdl-jbossesb.cfg.xml
(rev 0)
+++
cdl/trunk/assembly/jbossesb/src/main/resources/overlord-cdl-jbossesb.cfg.xml 2008-08-20
10:17:16 UTC (rev 255)
@@ -0,0 +1,64 @@
+<!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">
+ org.hsqldb.jdbcDriver
+ </property>
+ <property name="hibernate.connection.url">
+ jdbc:hsqldb:hsql://localhost
+ </property>
+ <property name="hibernate.connection.username">
+ sa
+ </property-->
+
+ <property
name="hibernate.dialect">org.hibernate.dialect.HSQLDialect</property>
+
+ <!-- DataSource properties (begin) === -->
+ <property
name="hibernate.connection.datasource">java:/cdlDS</property>
+ <!-- ==== DataSource properties (end) -->
+
+
+ <!-- Use the C3P0 connection pool provider -->
+ <property name="hibernate.c3p0.min_size">5</property>
+ <property name="hibernate.c3p0.max_size">20</property>
+ <property name="hibernate.c3p0.timeout">300</property>
+ <property name="hibernate.c3p0.max_statements">50</property>
+ <property name="hibernate.c3p0.idle_test_period">3000</property>
+
+ <property name="current_session_context_class">thread</property>
+ <property name="hibernate.connection.isolation">4</property>
+
+ <!-- Show and print nice SQL on stdout -->
+ <property name="show_sql">false</property>
+ <property name="format_sql">true</property>
+
+ <!-- List of annotationed classes (Internal conversation class)-->
+ <mapping class="org.jboss.soa.overlord.jbossesb.Session" />
+ <mapping class="org.jboss.soa.overlord.jbossesb.ScheduleItem"/>
+ <mapping class="org.jboss.soa.overlord.jbossesb.JoinState"/>
+ <mapping class="org.jboss.soa.overlord.jbossesb.Identity"/>
+ <mapping class="org.jboss.soa.overlord.jbossesb.EPRWrapper"/>
+
+ </session-factory>
+</hibernate-configuration>
Added:
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/EPRWrapper.java
===================================================================
---
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/EPRWrapper.java
(rev 0)
+++
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/EPRWrapper.java 2008-08-20
10:17:16 UTC (rev 255)
@@ -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.jbossesb;
+
+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="CDL_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;
+ }
+
+}
Added:
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/HibernateObject.java
===================================================================
---
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/HibernateObject.java
(rev 0)
+++
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/HibernateObject.java 2008-08-20
10:17:16 UTC (rev 255)
@@ -0,0 +1,33 @@
+/*
+ * 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.jbossesb;
+
+import java.io.Serializable;
+
+/**
+ * @author jeffyu
+ */
+public interface HibernateObject extends Serializable {
+
+ public long getId();
+
+ public void setId(long id);
+
+}
Added:
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/Identity.java
===================================================================
---
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/Identity.java
(rev 0)
+++
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/Identity.java 2008-08-20
10:17:16 UTC (rev 255)
@@ -0,0 +1,156 @@
+/*
+ * 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.jbossesb;
+
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.StringTokenizer;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.EnumType;
+import javax.persistence.Enumerated;
+import javax.persistence.GeneratedValue;
+import javax.persistence.Id;
+import javax.persistence.JoinColumn;
+import javax.persistence.ManyToOne;
+import javax.persistence.Table;
+
+/**
+ * @author gary
+ * @author jeffyu
+ */
+
+
+@Entity
+@Table(name="CDL_IDENTITY")
+public class Identity implements HibernateObject {
+
+ private static final long serialVersionUID = 1112L;
+
+ @Id @GeneratedValue
+ @Column(name="ID")
+ private long id;
+
+ @ManyToOne
+ @JoinColumn(name="SESSION_ID", nullable = false)
+ private Session session;
+
+ @Column(name="TYPE")
+ @Enumerated(EnumType.STRING)
+ private IdentityType type;
+
+ @Column(name="PROPERTY_VALUE")
+ private String propertyValues;
+
+ @Column(name="SERVICE_NAME")
+ private String serviceName;
+
+ public Identity() {
+
+ }
+
+ public IdentityType getType() {
+ return type;
+ }
+
+ public void setType(IdentityType type) {
+ this.type = type;
+ }
+
+ public Map<String, String> getProperties() {
+ Map<String, String> properties = new HashMap<String, String>();
+ StringTokenizer st = new StringTokenizer(propertyValues, ",");
+ for(String value = st.nextToken(); st.hasMoreTokens();) {
+ int equalIndex = value.indexOf("=");
+ String key = value.substring(0, equalIndex);
+ String thevalue = value.substring(equalIndex);
+ properties.put(key, thevalue);
+ }
+ return properties;
+ }
+
+ public void setProperties(Map<String, String> properties) {
+ StringBuffer sbuffer = new StringBuffer();
+ Iterator<String> keys = properties.keySet().iterator();
+
+ while(keys.hasNext()) {
+ String key = keys.next();
+ String value = properties.get(key);
+ sbuffer.append(key);
+ sbuffer.append("=");
+ sbuffer.append(value);
+ if (keys.hasNext()) {
+ sbuffer.append(",");
+ }
+ }
+
+ this.propertyValues = sbuffer.toString();
+ }
+
+ 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 boolean equals(Object o) {
+ if (o instanceof Identity) {
+ Identity id = (Identity) o;
+ if (this.getType().equals(id.getType()) &&
this.propertyValues.equalsIgnoreCase(id.getPropertyValues())) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public String toString() {
+ return "Type is: " + this.type + ": Properties :" +
this.propertyValues;
+ }
+
+ public String getPropertyValues() {
+ return propertyValues;
+ }
+
+ public void setPropertyValues(String propertyValues) {
+ this.propertyValues = propertyValues;
+ }
+
+ public String getServiceName() {
+ return serviceName;
+ }
+
+ public void setServiceName(String serviceName) {
+ this.serviceName = serviceName;
+ }
+
+
+}
Added:
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/IdentityType.java
===================================================================
---
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/IdentityType.java
(rev 0)
+++
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/IdentityType.java 2008-08-20
10:17:16 UTC (rev 255)
@@ -0,0 +1,40 @@
+/*
+ * 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.jbossesb;
+
+public enum IdentityType {
+ Primary,
+ Association,
+ Alternate,
+ Derived;
+
+ public static IdentityType toIdentityType(String string) {
+ if ("Primary".equalsIgnoreCase(string)) {
+ return Primary;
+ } else if ("Association".equalsIgnoreCase(string)) {
+ return Association;
+ } else if ("Alternate".equalsIgnoreCase(string)) {
+ return Alternate;
+ } else if ("Derived".equalsIgnoreCase(string)) {
+ return Derived;
+ }
+ return null;
+ }
+}
Added:
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/JoinState.java
===================================================================
---
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/JoinState.java
(rev 0)
+++
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/JoinState.java 2008-08-20
10:17:16 UTC (rev 255)
@@ -0,0 +1,115 @@
+/*
+ * 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.jbossesb;
+
+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="CDL_JOIN_STATES")
+public class JoinState implements HibernateObject {
+
+ 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 + "]");
+ }
+
+}
Added:
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/LogicalCourier.java
===================================================================
---
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/LogicalCourier.java
(rev 0)
+++
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/LogicalCourier.java 2008-08-20
10:17:16 UTC (rev 255)
@@ -0,0 +1,75 @@
+/*
+ * 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.jbossesb;
+
+import org.jboss.soa.esb.addressing.MalformedEPRException;
+import org.jboss.soa.esb.couriers.CourierException;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.addressing.eprs.*;
+import org.jboss.soa.esb.client.ServiceInvoker;
+import org.jboss.soa.esb.listeners.message.MessageDeliverException;
+
+/**
+ * This class providers the courier implementation associated
+ * with a LogicalEPR.
+ */
+public class LogicalCourier implements org.jboss.soa.esb.couriers.Courier {
+
+ private ServiceInvoker serviceInvoker=null;
+
+ /**
+ * The constructor, supplied the logical EPR represented
+ * by the courier.
+ *
+ * @param epr The logical EPR
+ * @throws MessageDeliverException
+ */
+ public LogicalCourier(LogicalEPR epr)
+ throws MessageDeliverException {
+ serviceInvoker = epr.getServiceInvoker();
+ }
+
+ /**
+ * This method delivers the supplied message to the EPR
+ * associated with the logical courier.
+ *
+ * @param mesg The message
+ */
+ public boolean deliver(Message mesg) throws CourierException,
+ MalformedEPRException {
+
+ try {
+ serviceInvoker.deliverAsync(mesg);
+ } catch(MessageDeliverException e) {
+ throw new CourierException("Failed to deliver message", e);
+ }
+
+ return(true);
+ }
+
+ /**
+ * This method cleans up after the courier implementation
+ * is no longer required.
+ */
+ public void cleanup() {
+ serviceInvoker = null;
+ }
+
+}
Added:
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/ScheduleItem.java
===================================================================
---
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/ScheduleItem.java
(rev 0)
+++
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/ScheduleItem.java 2008-08-20
10:17:16 UTC (rev 255)
@@ -0,0 +1,113 @@
+/*
+ * 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.jbossesb;
+
+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;
+
+
+@Entity
+@Table(name="CDL_SCHEDULE_ITEM")
+public class ScheduleItem implements HibernateObject {
+
+ private static final long serialVersionUID = 1114L;
+
+ @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 ;
+
+ public ScheduleItem() {
+
+ }
+
+ public ScheduleItem(String category, String name) {
+ this.category = category;
+ this.name = name;
+ }
+
+ public String getCategory() {
+ return(category);
+ }
+
+ public String getName() {
+ return(name);
+ }
+
+
+ public void setCategory(String category) {
+ this.category = category;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public boolean equals(Object other) {
+ if (other instanceof ScheduleItem) {
+ ScheduleItem si=(ScheduleItem)other;
+ if (si.category.equals(category) && si.name.equals(name)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public String toString() {
+ StringBuffer sbuffer = new StringBuffer();
+ sbuffer.append("id=" + id +",");
+ sbuffer.append("category=" + category + ",");
+ sbuffer.append("name=" + name + ",");
+ sbuffer.append("session=" + session);
+ return sbuffer.toString();
+ }
+
+ 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;
+ }
+
+
+}
Added:
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/Session.java
===================================================================
--- cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/Session.java
(rev 0)
+++
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/Session.java 2008-08-20
10:17:16 UTC (rev 255)
@@ -0,0 +1,409 @@
+/*
+ * 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.jbossesb;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.EnumType;
+import javax.persistence.Enumerated;
+import javax.persistence.FetchType;
+import javax.persistence.GeneratedValue;
+import javax.persistence.Id;
+import javax.persistence.JoinColumn;
+import javax.persistence.Lob;
+import javax.persistence.ManyToOne;
+import javax.persistence.OneToMany;
+import javax.persistence.Table;
+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;
+
+@Entity
+@Table(name="CDL_SESSION")
+public class Session implements HibernateObject {
+
+ private static final long serialVersionUID = 1115L;
+
+ private static Logger logger = Logger.getLogger(Session.class);
+
+ @Id @GeneratedValue
+ @Column(name="SESSION_ID")
+ private long id;
+
+ @ManyToOne(fetch = FetchType.LAZY)
+ @JoinColumn(name="PARENT_ID", nullable=true)
+ private Session parent;
+
+ @Enumerated(value = EnumType.STRING)
+ @Column(name = "STATUS")
+ private SessionStatus status=SessionStatus.Initialized;
+
+ @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>();
+
+ @OneToMany(fetch = FetchType.LAZY)
+ @JoinColumn(name = "SESSION_ID")
+ private List<JoinState> joinStates=new ArrayList<JoinState>();
+
+ @OneToMany(fetch = FetchType.LAZY)
+ @JoinColumn(name="SESSION_ID")
+ private List<Identity> identities=new ArrayList<Identity>();
+
+ @Column(name = "POJO_CLASS")
+ private String pojoClass;
+
+ @Column(name="SERVICE_NAME")
+ private String serviceName;
+
+ @Column(name="CONVERSATION_TYPE")
+ private String conversationType;
+
+ @Transient
+ private Object businessObject;
+
+ @Lob
+ @Column(name="Business_OBJECT")
+ private byte[] serializedObject;
+
+ public Session() {
+ }
+
+ public Session(Session parent) {
+ this.parent = parent;
+ }
+
+ public void setStatus(SessionStatus status) {
+ this.status = status;
+ }
+
+ public SessionStatus getStatus() {
+ return this.status;
+ }
+
+ public void setEPR(String name, EPR epr) throws Exception{
+ 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) {
+ throw new Exception("Error in storing EPR!!" + e, e);
+ }
+ }
+
+ public EPR getEPR(String name) throws Exception{
+
+ for(EPRWrapper epr : eprWrappers) {
+ if (name.equals(epr.getName()))
+ {
+ return EPRHelper.fromXMLString(epr.getValue());
+ }
+ }
+
+ return null;
+ }
+
+ public void schedule(String category, String name, Message message) throws Exception {
+
+ ScheduleItem si=new ScheduleItem(category, name);
+ si.setSession(this);
+
+ logger.debug("Scheduling: " + si + " by thread of " +
Thread.currentThread().getName());
+
+ synchronized(joinStates) {
+ JoinState joinState = getJoinStateByScheduleItem(si);
+ if (joinState != null) {
+ joinState.join();
+ SessionManager.updateObject(joinState);
+ logger.debug("Join State is: " + joinState);
+ if (joinState.getSpawnPath() <= 0) {
+ joinStates.remove(joinState);
+ SessionManager.removeObject(joinState);
+
+ logger.info("Deliver the Join State of: " + joinState);
+
+ ServiceInvoker invoker= new ServiceInvoker(category, name);
+ invoker.deliverAsync(message);
+ } else {
+ logger.info("Don't join yet: "+ joinState);
+ return;
+ }
+ }
+ }
+
+ synchronized(scheduleItems) {
+ // Check if already exists
+ if (scheduleItems.contains(si)) {
+ throw new Exception("Schedule already contains item for " + si);
+ }
+
+ scheduleItems.add(si);
+ SessionManager.saveObject(si);
+
+ logger.debug("Finished scheduling "+si +"' by thread of " +
Thread.currentThread().getName());
+ }
+
+ }
+
+ public void unschedule(String category, String name) throws Exception {
+
+ logger.debug("Unscheduling: '"+category+"/"+name+"' by
thread of " + Thread.currentThread().getName() );
+
+ 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 (si.getId() == 0) {
+ throw new Exception("The scheduleItem of " + si + " is not existed
!");
+ }
+
+ scheduleItems.remove(si);
+ SessionManager.removeObject(si);
+ logger.debug("Finished unscheduling: " + si +"' by thread of "
+ Thread.currentThread().getName());
+ }
+ }
+
+ protected boolean isScheduleItemInJoinState(String category, String name) {
+ for(JoinState joinState : joinStates) {
+ if (name.equals(joinState.getName()) &&
category.equals(joinState.getCategory())) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+
+ protected synchronized 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;
+ }
+ }
+ ScheduleItem item = new ScheduleItem(category, name);
+ item.setSession(this);
+ return item;
+ }
+
+ 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)) {
+ throw new Exception("The '"+category+ "/"+name+"' of
JoinState is already existed.");
+ }
+ joinStates.add(joinState);
+ SessionManager.saveObject(joinState);
+ logger.debug("Added Join State: " + joinState);
+ }
+
+ public void assimulateIdentities(java.util.List<Identity> ids) throws Exception {
+
+ List<Identity> newIds = new ArrayList<Identity>();
+
+ if (identities.size() == 0) {
+ newIds.addAll(ids);
+ } else {
+ for(int i =0; i< ids.size(); i++) {
+ Identity theID = ids.get(i);
+ if (theID.getType() == IdentityType.Primary ||
+ theID.getType() == IdentityType.Association) {
+ if (!identities.contains(theID)) {
+ newIds.add(theID);
+ } else {
+ logger.debug("IDENTITY CONFIRMED:" + theID);
+ }
+ } else {
+ newIds.add(theID);
+ }
+ }
+ }
+
+ List<Identity> result = new ArrayList<Identity>();
+ for(Identity id : newIds) {
+ id.setSession(this);
+ id.setServiceName(this.serviceName);
+ result.add(id);
+ }
+
+ SessionManager.saveCollection(result);
+ identities.addAll(result);
+ }
+
+ public long getId() {
+ return id;
+ }
+
+ public void setId(long id) {
+ this.id = id;
+ }
+
+ public Session getParent() {
+ return parent;
+ }
+
+ public void setParent(Session parent) {
+ this.parent = parent;
+ }
+
+ public List<ScheduleItem> getScheduleItems() {
+ return scheduleItems;
+ }
+
+ public void setScheduleItems(List<ScheduleItem> scheduleItems) {
+ this.scheduleItems = scheduleItems;
+ }
+
+ public List<Identity> getIdentities() {
+ return identities;
+ }
+
+ public void setIdentities(List<Identity> identities) {
+ this.identities = identities;
+ }
+
+ public String getPojoClass() {
+ return pojoClass;
+ }
+
+ public void setPojoClass(String pojoClass) {
+ this.pojoClass = pojoClass;
+ }
+
+ public Object getBusinessObject() {
+ ByteArrayInputStream bais = new ByteArrayInputStream(serializedObject);
+ try {
+ ObjectInputStream in = new ObjectInputStream(bais);
+ businessObject = in.readObject();
+ in.close();
+ } catch (Exception e) {
+ throw new RuntimeException("Error in reading Object", e);
+ }
+ return businessObject;
+ }
+
+ public void setBusinessObject(Object businessObject) {
+ this.businessObject = businessObject;
+
+ ByteArrayOutputStream bos = new ByteArrayOutputStream();
+ ObjectOutputStream out;
+
+ try {
+ out = new ObjectOutputStream(bos);
+ out.writeObject(this.businessObject);
+ out.close();
+ } catch (Exception e) {
+ throw new RuntimeException("Error in setting business object of " +
businessObject, e);
+ }
+ this.serializedObject = bos.toByteArray();
+ }
+
+ public String getServiceName() {
+ return serviceName;
+ }
+
+ public void setServiceName(String serviceName) {
+ this.serviceName = serviceName;
+ }
+
+ public String getConversationType() {
+ return conversationType;
+ }
+
+ 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;
+ }
+
+ public byte[] getSerializedObject() {
+ return serializedObject;
+ }
+
+ public void setSerializedObject(byte[] serializedObject) {
+ this.serializedObject = serializedObject;
+ }
+
+ public String toString() {
+ StringBuffer sbuffer = new StringBuffer();
+ sbuffer.append("[ Session id: " + id);
+ sbuffer.append(" serviceName: " + serviceName);
+ sbuffer.append(" business state object: " + businessObject);
+ sbuffer.append("]");
+ return sbuffer.toString();
+ }
+
+}
Added:
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/SessionManager.java
===================================================================
---
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/SessionManager.java
(rev 0)
+++
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/SessionManager.java 2008-08-20
10:17:16 UTC (rev 255)
@@ -0,0 +1,188 @@
+/*
+ * 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.jbossesb;
+
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.log4j.Logger;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.overlord.jbossesb.actions.MessageProperties;
+import org.jboss.soa.overlord.jbossesb.actions.Service;
+import org.jboss.soa.overlord.jbossesb.util.ClassLoaderUtil;
+import org.jboss.soa.overlord.jbossesb.util.HibernateUtil;
+import org.mvel.MVEL;
+
+/**
+ * This component is responsible for managing the persistence and retrieval
+ * of sessions.
+ */
+public class SessionManager {
+
+ private static Logger logger = Logger.getLogger(SessionManager.class);
+
+ public static Session createSession(String sessionName) throws Exception {
+
+ org.hibernate.Session hibernateSession = HibernateUtil.currentSession();
+ Class<?> pojoclass= ClassLoaderUtil.loadClass(sessionName);
+ Object businessState = pojoclass.newInstance();
+
+ Session conversationSession = new Session();
+ conversationSession.setPojoClass(sessionName);
+ conversationSession.setStatus(SessionStatus.Active);
+ conversationSession.setBusinessObject(businessState);
+
+ Service service = pojoclass.getAnnotation(Service.class);
+ if (service != null) {
+ conversationSession.setServiceName(service.name());
+ conversationSession.setConversationType(service.conversationType());
+ }
+
+ hibernateSession.save(conversationSession);
+
+ return conversationSession;
+ }
+
+ @SuppressWarnings("unchecked")
+ public static Session createSubSession(String sessionName, String sessionKey, Message
message) throws Exception {
+
+ org.hibernate.Session hibernateSession = HibernateUtil.currentSession();
+ Session parentSession = (Session)hibernateSession.load(Session.class,
Long.valueOf(sessionKey));
+ Class<?> pojoclass= ClassLoaderUtil.loadClass(sessionName);
+ Object businessState = pojoclass.newInstance();
+
+ Map<String, Object> boundVariables = (Map<String,
Object>)message.getProperties().
+ getProperty(MessageProperties.BOUND_VARIABLE_KEY);
+ for(String key : boundVariables.keySet()) {
+ MVEL.setProperty(businessState, key, boundVariables.get(key));
+ logger.info("bound to " + key);
+ }
+
+ Session conversationSession = new Session();
+ conversationSession.setPojoClass(sessionName);
+ conversationSession.setStatus(SessionStatus.Active);
+ conversationSession.setBusinessObject(businessState);
+ conversationSession.setParent(parentSession);
+
+ Service service = pojoclass.getAnnotation(Service.class);
+ if (service != null) {
+ conversationSession.setServiceName(service.name());
+ conversationSession.setConversationType(service.conversationType());
+ } else {
+ conversationSession.setServiceName(parentSession.getServiceName());
+ conversationSession.setConversationType(parentSession.getConversationType());
+ }
+
+ hibernateSession.save(conversationSession);
+
+ return conversationSession;
+ }
+
+ public static Session retrieveSession(String sessionKey, java.util.List<Identity>
ids) throws Exception {
+
+ if (sessionKey == null && ids == null) {
+ return null;
+ }
+
+ if (sessionKey != null) {
+ org.hibernate.Session hibernateSession = HibernateUtil.currentSession();
+ Session session = (Session) hibernateSession.load(Session.class,
Long.valueOf(sessionKey));
+ return session;
+ }
+
+ for (Identity id : ids) {
+ if (IdentityType.Primary.equals(id.getType())) {
+ return getSessionByIdentity(id);
+ }
+ }
+
+ return null;
+ }
+
+ public static Object saveObject(Object obj) throws Exception {
+ org.hibernate.Session hibernateSession = HibernateUtil.currentSession();
+ hibernateSession.save(obj);
+ return obj;
+ }
+
+
+ public static Object getObject(long id, Class<?> cls) throws Exception {
+ org.hibernate.Session hibernateSession = HibernateUtil.currentSession();
+ return hibernateSession.load(cls, id);
+ }
+
+ @SuppressWarnings("unchecked")
+ public static Collection saveCollection(Collection col) throws Exception {
+ org.hibernate.Session hibernateSession = HibernateUtil.currentSession();
+
+ for(Iterator it = col.iterator(); it.hasNext();) {
+ Object o = it.next();
+ hibernateSession.save(o);
+ }
+
+ return col;
+ }
+
+ public static void updateObject(Object obj) {
+ org.hibernate.Session hibernateSession = HibernateUtil.currentSession();
+ hibernateSession.update(obj);
+ }
+
+ public static void removeObject(Object obj) {
+ org.hibernate.Session hibernateSession = HibernateUtil.currentSession();
+ hibernateSession.delete(obj);
+ }
+
+
+ public static Session getSessionByIdentity(Identity id) throws Exception{
+ org.hibernate.Session hibernateSession = HibernateUtil.currentSession();
+ String query = "select b from Identity b where b.type =:type and b.propertyValues
=:propertyValues and b.serviceName =:serviceName";
+ List<?> results = hibernateSession.createQuery(query)
+ .setParameter("type", id.getType())
+ .setParameter("propertyValues", id.getPropertyValues())
+ .setParameter("serviceName", id.getServiceName())
+ .list();
+ if (results.size() < 1) {
+ return null;
+ }
+
+ Identity theID = null;
+ for (int i=0; i< results.size(); i++) {
+ Identity identity = (Identity)results.get(i);
+ if (SessionStatus.Active.equals(identity.getSession().getStatus())) {
+ theID = identity;
+ break;
+ }
+ }
+
+ if (theID == null) {
+ return null;
+ }
+
+ Session session = theID.getSession();
+ logger.debug("Get Session of " + session + " by using identity of "
+ id);
+
+ return session;
+ }
+
+
+}
Added:
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/SessionStatus.java
===================================================================
---
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/SessionStatus.java
(rev 0)
+++
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/SessionStatus.java 2008-08-20
10:17:16 UTC (rev 255)
@@ -0,0 +1,28 @@
+/*
+ * 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.jbossesb;
+
+public enum SessionStatus {
+
+ Initialized,
+ Active,
+ Completed,
+ CLOSED
+}
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-08-19
16:23:55 UTC (rev 254)
+++
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/actions/ConversationAction.java 2008-08-20
10:17:16 UTC (rev 255)
@@ -31,12 +31,12 @@
import org.jboss.soa.esb.client.ServiceInvoker;
import org.jboss.soa.esb.helpers.ConfigTree;
import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.overlord.conversation.Identity;
-import org.jboss.soa.overlord.conversation.IdentityType;
-import org.jboss.soa.overlord.conversation.ScheduleItem;
-import org.jboss.soa.overlord.conversation.Session;
-import org.jboss.soa.overlord.conversation.SessionManager;
-import org.jboss.soa.overlord.conversation.SessionStatus;
+import org.jboss.soa.overlord.jbossesb.Identity;
+import org.jboss.soa.overlord.jbossesb.IdentityType;
+import org.jboss.soa.overlord.jbossesb.ScheduleItem;
+import org.jboss.soa.overlord.jbossesb.Session;
+import org.jboss.soa.overlord.jbossesb.SessionManager;
+import org.jboss.soa.overlord.jbossesb.SessionStatus;
import org.jboss.soa.overlord.jbossesb.util.ClassLoaderUtil;
import org.jboss.soa.overlord.jbossesb.util.HibernateUtil;
import org.jboss.soa.overlord.jbossesb.util.MessageUtil;
@@ -73,6 +73,14 @@
return(ret);
}
+ /**
+ *
+ * @param message
+ * @param serviceDescriptionName
+ * @param ct
+ * @return
+ * @throws Exception
+ */
protected List<Identity> getIdentities(Message message, String
serviceDescriptionName, ConfigTree ct) throws Exception {
ConfigTree[] children=ct.getAllChildren();
Modified:
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/actions/CreateSessionAction.java
===================================================================
---
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/actions/CreateSessionAction.java 2008-08-19
16:23:55 UTC (rev 254)
+++
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/actions/CreateSessionAction.java 2008-08-20
10:17:16 UTC (rev 255)
@@ -22,8 +22,8 @@
import org.apache.log4j.Logger;
import org.jboss.soa.esb.helpers.ConfigTree;
import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.overlord.conversation.Session;
-import org.jboss.soa.overlord.conversation.SessionManager;
+import org.jboss.soa.overlord.jbossesb.Session;
+import org.jboss.soa.overlord.jbossesb.SessionManager;
/**
* @author gary
Modified:
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/actions/IfAction.java
===================================================================
---
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/actions/IfAction.java 2008-08-19
16:23:55 UTC (rev 254)
+++
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/actions/IfAction.java 2008-08-20
10:17:16 UTC (rev 255)
@@ -22,7 +22,7 @@
import org.apache.log4j.Logger;
import org.jboss.soa.esb.helpers.ConfigTree;
import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.overlord.conversation.Session;
+import org.jboss.soa.overlord.jbossesb.Session;
import org.mvel.MVEL;
/**
Modified:
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/actions/MessageRouterAction.java
===================================================================
---
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/actions/MessageRouterAction.java 2008-08-19
16:23:55 UTC (rev 254)
+++
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/actions/MessageRouterAction.java 2008-08-20
10:17:16 UTC (rev 255)
@@ -26,9 +26,9 @@
import org.jboss.soa.esb.helpers.ConfigTree;
import org.jboss.soa.esb.listeners.message.MessageDeliverException;
import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.overlord.conversation.Identity;
-import org.jboss.soa.overlord.conversation.ScheduleItem;
-import org.jboss.soa.overlord.conversation.Session;
+import org.jboss.soa.overlord.jbossesb.Identity;
+import org.jboss.soa.overlord.jbossesb.ScheduleItem;
+import org.jboss.soa.overlord.jbossesb.Session;
/**
* @author jeffyu
@@ -49,13 +49,20 @@
logger.info("The received message type is [" + messageType + "]");
boolean routerFlag = false;
+ String svcDesc = getConfig().getAttribute(ActionProperties.SERVICE_DESCRIPTION_NAME);
for (ConfigTree ct : children) {
ConfigTree[] msgNodes = ct.getChildren("message");
- String msgType = msgNodes[0].getAttribute("type");
- if (routerFlag == false && messageType.equals(msgType)) {
- String svcDesc = ct.getAttribute(ActionProperties.SERVICE_DESCRIPTION_NAME);
- List<Identity> ids = getIdentities(message, svcDesc, ct);
+
+ ConfigTree selectedMsgConfig = null;
+ for (ConfigTree msgConfig : msgNodes) {
+ if (messageType.equals(msgConfig.getAttribute("type"))) {
+ selectedMsgConfig = msgConfig;
+ }
+ }
+
+ if (routerFlag == false && (selectedMsgConfig != null)) {
+ List<Identity> ids = getIdentities(message, svcDesc, selectedMsgConfig);
Session session = getSession(message, ids);
String serviceCategory = ct.getAttribute(ActionProperties.SERVICE_CATEGORY);
String serviceName = ct.getAttribute(ActionProperties.SERVICE_NAME);
Modified:
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/actions/ParallelAction.java
===================================================================
---
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/actions/ParallelAction.java 2008-08-19
16:23:55 UTC (rev 254)
+++
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/actions/ParallelAction.java 2008-08-20
10:17:16 UTC (rev 255)
@@ -22,7 +22,7 @@
import org.apache.log4j.Logger;
import org.jboss.soa.esb.helpers.ConfigTree;
import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.overlord.conversation.Session;
+import org.jboss.soa.overlord.jbossesb.Session;
/**
* This action represents a parallel construct.
Modified:
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/actions/PerformAction.java
===================================================================
---
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/actions/PerformAction.java 2008-08-19
16:23:55 UTC (rev 254)
+++
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/actions/PerformAction.java 2008-08-20
10:17:16 UTC (rev 255)
@@ -25,7 +25,7 @@
import org.apache.log4j.Logger;
import org.jboss.soa.esb.helpers.ConfigTree;
import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.overlord.conversation.Session;
+import org.jboss.soa.overlord.jbossesb.Session;
import org.mvel.MVEL;
/**
Modified:
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/actions/ReceiveMessageAction.java
===================================================================
---
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/actions/ReceiveMessageAction.java 2008-08-19
16:23:55 UTC (rev 254)
+++
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/actions/ReceiveMessageAction.java 2008-08-20
10:17:16 UTC (rev 255)
@@ -23,8 +23,8 @@
import org.jboss.soa.esb.addressing.EPR;
import org.jboss.soa.esb.helpers.ConfigTree;
import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.overlord.conversation.Identity;
-import org.jboss.soa.overlord.conversation.Session;
+import org.jboss.soa.overlord.jbossesb.Identity;
+import org.jboss.soa.overlord.jbossesb.Session;
/**
* Receive activity.
Modified:
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/actions/RetrieveSessionAction.java
===================================================================
---
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/actions/RetrieveSessionAction.java 2008-08-19
16:23:55 UTC (rev 254)
+++
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/actions/RetrieveSessionAction.java 2008-08-20
10:17:16 UTC (rev 255)
@@ -24,8 +24,8 @@
import org.apache.log4j.Logger;
import org.jboss.soa.esb.helpers.ConfigTree;
import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.overlord.conversation.Identity;
-import org.jboss.soa.overlord.conversation.Session;
+import org.jboss.soa.overlord.jbossesb.Identity;
+import org.jboss.soa.overlord.jbossesb.Session;
/**
* This action creates a new session.
Modified:
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/actions/ScheduleStateAction.java
===================================================================
---
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/actions/ScheduleStateAction.java 2008-08-19
16:23:55 UTC (rev 254)
+++
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/actions/ScheduleStateAction.java 2008-08-20
10:17:16 UTC (rev 255)
@@ -22,7 +22,7 @@
import org.apache.log4j.Logger;
import org.jboss.soa.esb.helpers.ConfigTree;
import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.overlord.conversation.Session;
+import org.jboss.soa.overlord.jbossesb.Session;
/**
* Schedule state activity.
Modified:
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/actions/SendMessageAction.java
===================================================================
---
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/actions/SendMessageAction.java 2008-08-19
16:23:55 UTC (rev 254)
+++
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/actions/SendMessageAction.java 2008-08-20
10:17:16 UTC (rev 255)
@@ -31,9 +31,9 @@
import org.jboss.soa.esb.message.Message;
import org.jboss.soa.esb.message.format.MessageFactory;
import org.jboss.soa.esb.message.format.MessageType;
-import org.jboss.soa.overlord.conversation.Identity;
-import org.jboss.soa.overlord.conversation.LogicalCourier;
-import org.jboss.soa.overlord.conversation.Session;
+import org.jboss.soa.overlord.jbossesb.Identity;
+import org.jboss.soa.overlord.jbossesb.LogicalCourier;
+import org.jboss.soa.overlord.jbossesb.Session;
import org.mvel.MVEL;
Modified:
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/actions/SetMessageAction.java
===================================================================
---
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/actions/SetMessageAction.java 2008-08-19
16:23:55 UTC (rev 254)
+++
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/actions/SetMessageAction.java 2008-08-20
10:17:16 UTC (rev 255)
@@ -22,7 +22,7 @@
import org.apache.log4j.Logger;
import org.jboss.soa.esb.helpers.ConfigTree;
import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.overlord.conversation.Session;
+import org.jboss.soa.overlord.jbossesb.Session;
import org.mvel.MVEL;
/**
Modified:
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/actions/SetStateAction.java
===================================================================
---
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/actions/SetStateAction.java 2008-08-19
16:23:55 UTC (rev 254)
+++
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/actions/SetStateAction.java 2008-08-20
10:17:16 UTC (rev 255)
@@ -22,8 +22,8 @@
import org.apache.log4j.Logger;
import org.jboss.soa.esb.helpers.ConfigTree;
import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.overlord.conversation.Session;
-import org.jboss.soa.overlord.conversation.SessionManager;
+import org.jboss.soa.overlord.jbossesb.Session;
+import org.jboss.soa.overlord.jbossesb.SessionManager;
import org.jboss.soa.overlord.jbossesb.util.XMLUtils;
import org.mvel.MVEL;
import org.w3c.dom.Element;
Modified:
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/actions/SwitchAction.java
===================================================================
---
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/actions/SwitchAction.java 2008-08-19
16:23:55 UTC (rev 254)
+++
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/actions/SwitchAction.java 2008-08-20
10:17:16 UTC (rev 255)
@@ -22,7 +22,7 @@
import org.apache.log4j.Logger;
import org.jboss.soa.esb.helpers.ConfigTree;
import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.overlord.conversation.Session;
+import org.jboss.soa.overlord.jbossesb.Session;
/**
* This action represents a choice between a set of specified paths
Modified:
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/actions/WhenAction.java
===================================================================
---
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/actions/WhenAction.java 2008-08-19
16:23:55 UTC (rev 254)
+++
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/actions/WhenAction.java 2008-08-20
10:17:16 UTC (rev 255)
@@ -22,7 +22,7 @@
import org.apache.log4j.Logger;
import org.jboss.soa.esb.helpers.ConfigTree;
import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.overlord.conversation.Session;
+import org.jboss.soa.overlord.jbossesb.Session;
import org.mvel.MVEL;
/**
Modified:
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/actions/WhileAction.java
===================================================================
---
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/actions/WhileAction.java 2008-08-19
16:23:55 UTC (rev 254)
+++
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/actions/WhileAction.java 2008-08-20
10:17:16 UTC (rev 255)
@@ -22,7 +22,7 @@
import org.apache.log4j.Logger;
import org.jboss.soa.esb.helpers.ConfigTree;
import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.overlord.conversation.Session;
+import org.jboss.soa.overlord.jbossesb.Session;
import org.mvel.MVEL;
/**
Modified:
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/util/HibernateUtil.java
===================================================================
---
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/util/HibernateUtil.java 2008-08-19
16:23:55 UTC (rev 254)
+++
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/util/HibernateUtil.java 2008-08-20
10:17:16 UTC (rev 255)
@@ -36,7 +36,7 @@
static {
try {
- sessionFactory = new AnnotationConfiguration().configure().buildSessionFactory();
+ sessionFactory = new
AnnotationConfiguration().configure("/overlord-cdl-jbossesb.cfg.xml").buildSessionFactory();
} catch (Throwable t) {
throw new ExceptionInInitializerError(t);
}
Modified: cdl/trunk/samples/jbossesb/broker/src/main/resources/META-INF/deployment.xml
===================================================================
---
cdl/trunk/samples/jbossesb/broker/src/main/resources/META-INF/deployment.xml 2008-08-19
16:23:55 UTC (rev 254)
+++
cdl/trunk/samples/jbossesb/broker/src/main/resources/META-INF/deployment.xml 2008-08-20
10:17:16 UTC (rev 255)
@@ -1,5 +1,5 @@
<jbossesb-deployment>
- <depends>jboss.esb:deployment=cdl-jbossesb.esb</depends>
+ <depends>jboss.esb:deployment=overlord-cdl-jbossesb.esb</depends>
<depends>jboss.esb.sample.broker.destination:service=Queue,name=esb-loan-broker</depends>
<depends>jboss.esb.sample.broker.destination:service=Queue,name=esb-loan-broker_reply</depends>
<depends>jboss.esb.sample.broker.destination:service=Queue,name=esb-loan-broker1</depends>
Modified: cdl/trunk/samples/jbossesb/broker/src/main/resources/META-INF/jboss-esb.xml
===================================================================
--- cdl/trunk/samples/jbossesb/broker/src/main/resources/META-INF/jboss-esb.xml 2008-08-19
16:23:55 UTC (rev 254)
+++ cdl/trunk/samples/jbossesb/broker/src/main/resources/META-INF/jboss-esb.xml 2008-08-20
10:17:16 UTC (rev 255)
@@ -75,23 +75,29 @@
<actions mep="OneWay">
<action
class="org.jboss.soa.overlord.jbossesb.actions.MessageRouterAction"
process="process" name="s0-1">
+ <property name="serviceDescriptionName"
value="{http://www.jboss.org/overlord/loanBroker}Broker" />
<property name="paths">
<route service-category="ESBBroker.BrokerParticipant"
service-name="ESBBrokerProcess.main"
initiate="true">
- <identity type="primary" >
- <token name="id" locator="//@id" />
- </identity>
- <message type="enquiry" />
+ <message type="enquiry">
+ <identity type="primary" >
+ <token name="id" locator="//@id" />
+ </identity>
+ </message>
</route>
<route service-category="ESBBroker.BrokerParticipant"
- service-name="ESBBrokerProcess.main.5"
-
serviceDescriptionName="{http://www.jboss.org/overlord/loanBroker}Br... >
- <identity type="primary" >
- <token name="id" locator="//@id" />
- </identity>
- <message type="buy" />
- <message type="cancel" />
+ service-name="ESBBrokerProcess.main.5">
+ <message type="buy">
+ <identity type="primary" >
+ <token name="id" locator="//@id" />
+ </identity>
+ </message>
+ <message type="cancel" >
+ <identity type="primary" >
+ <token name="id" locator="//@id" />
+ </identity>
+ </message>
</route>
</property>
</action>
Modified:
cdl/trunk/samples/jbossesb/creditAgency/src/main/resources/META-INF/deployment.xml
===================================================================
---
cdl/trunk/samples/jbossesb/creditAgency/src/main/resources/META-INF/deployment.xml 2008-08-19
16:23:55 UTC (rev 254)
+++
cdl/trunk/samples/jbossesb/creditAgency/src/main/resources/META-INF/deployment.xml 2008-08-20
10:17:16 UTC (rev 255)
@@ -1,5 +1,5 @@
<jbossesb-deployment>
- <depends>jboss.esb:deployment=cdl-jbossesb.esb</depends>
+ <depends>jboss.esb:deployment=overlord-cdl-jbossesb.esb</depends>
<depends>jboss.esb.gen.destination:service=Queue,name=esb-creditAgency</depends>
<depends>jboss.esb.gen.destination:service=Queue,name=esb-creditAgency1</depends>
<depends>jboss.esb.gen.destination:service=Queue,name=esb-creditAgency2</depends>
Modified:
cdl/trunk/samples/jbossesb/purchasing/src/main/resources/META-INF/deployment.xml
===================================================================
---
cdl/trunk/samples/jbossesb/purchasing/src/main/resources/META-INF/deployment.xml 2008-08-19
16:23:55 UTC (rev 254)
+++
cdl/trunk/samples/jbossesb/purchasing/src/main/resources/META-INF/deployment.xml 2008-08-20
10:17:16 UTC (rev 255)
@@ -1,5 +1,5 @@
<jbossesb-deployment>
- <depends>jboss.esb:deployment=cdl-jbossesb.esb</depends>
+ <depends>jboss.esb:deployment=overlord-cdl-jbossesb.esb</depends>
<depends>jboss.esb.gen.destination:service=Queue,name=esb-broker</depends>
<depends>jboss.esb.gen.destination:service=Queue,name=esb-broker_reply</depends>
<depends>jboss.esb.gen.destination:service=Queue,name=esb-broker1</depends>
Modified: cdl/trunk/samples/jbossesb/supplier/src/main/resources/META-INF/deployment.xml
===================================================================
---
cdl/trunk/samples/jbossesb/supplier/src/main/resources/META-INF/deployment.xml 2008-08-19
16:23:55 UTC (rev 254)
+++
cdl/trunk/samples/jbossesb/supplier/src/main/resources/META-INF/deployment.xml 2008-08-20
10:17:16 UTC (rev 255)
@@ -1,5 +1,5 @@
<jbossesb-deployment>
- <depends>jboss.esb:deployment=cdl-jbossesb.esb</depends>
+ <depends>jboss.esb:deployment=overlord-cdl-jbossesb.esb</depends>
<depends>jboss.esb.sample.broker.destination:service=Queue,name=esb-loan-supplier1</depends>
<depends>jboss.esb.sample.broker.destination:service=Queue,name=esb-loan-supplier11</depends>
<depends>jboss.esb.sample.broker.destination:service=Queue,name=esb-loan-supplier12</depends>
Modified: cdl/trunk/samples/jbossesb/supplier/src/main/resources/META-INF/jboss-esb.xml
===================================================================
---
cdl/trunk/samples/jbossesb/supplier/src/main/resources/META-INF/jboss-esb.xml 2008-08-19
16:23:55 UTC (rev 254)
+++
cdl/trunk/samples/jbossesb/supplier/src/main/resources/META-INF/jboss-esb.xml 2008-08-20
10:17:16 UTC (rev 255)
@@ -33,20 +33,22 @@
<route service-category="ESBBroker.Suppliers"
service-name="Supplier1.main.1"
initiate="true">
- <identity type="primary" >
- <token name="id" locator="//@id" />
- <token name="supplierDesc" locator="//@supplierDesc"
/>
- </identity>
- <message type="requestForQuote" />
+ <message type="requestForQuote">
+ <identity type="primary" >
+ <token name="id" locator="//@id" />
+ <token name="supplierDesc" locator="//@supplierDesc"
/>
+ </identity>
+ </message>
</route>
<route service-category="ESBBroker.Suppliers"
service-name="Supplier1.main.2"
initiate="true">
- <identity type="primary" >
- <token name="id" locator="//@id" />
- <token name="supplierDesc" locator="//@supplierDesc"
/>
- </identity>
- <message type="orderConfirmed" />
+ <message type="orderConfirmed">
+ <identity type="primary" >
+ <token name="id" locator="//@id" />
+ <token name="supplierDesc" locator="//@supplierDesc"
/>
+ </identity>
+ </message>
</route>
</property>
</action>