Author: jeff.yuchang
Date: 2009-02-26 03:08:52 -0500 (Thu, 26 Feb 2009)
New Revision: 523
Added:
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/stateful/
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/stateful/EPRWrapper.java
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/stateful/HibernateObject.java
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/stateful/Identity.java
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/stateful/IdentityType.java
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/stateful/JoinState.java
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/stateful/LogicalCourier.java
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/stateful/ScheduleItem.java
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/stateful/Session.java
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/stateful/SessionManager.java
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/stateful/SessionStatus.java
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/stateful/actions/
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/stateful/util/
cdl/trunk/runtime/jbossesb/src/test/java/org/jboss/soa/overlord/jbossesb/stateful/
cdl/trunk/runtime/jbossesb/src/test/java/org/jboss/soa/overlord/jbossesb/stateful/util/
Removed:
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
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/actions/
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/util/
cdl/trunk/runtime/jbossesb/src/test/java/org/jboss/soa/overlord/jbossesb/util/
Modified:
cdl/trunk/runtime/jbossesb-assembly/src/main/resources/overlord-cdl-jbossesb.cfg.xml
cdl/trunk/runtime/jbossesb-assembly/src/test/java/org/jboss/soa/overlord/jbossesb/HibernateTest.java
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/stateful/actions/ActionProperties.java
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/stateful/actions/ConversationAction.java
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/stateful/actions/CreateSessionAction.java
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/stateful/actions/IfAction.java
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/stateful/actions/MessageProperties.java
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/stateful/actions/MessageRouterAction.java
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/stateful/actions/ParallelAction.java
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/stateful/actions/PerformAction.java
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/stateful/actions/ReceiveMessageAction.java
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/stateful/actions/RetrieveSessionAction.java
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/stateful/actions/ScheduleStateAction.java
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/stateful/actions/SendMessageAction.java
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/stateful/actions/Service.java
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/stateful/actions/SetMessageAction.java
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/stateful/actions/SetStateAction.java
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/stateful/actions/SwitchAction.java
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/stateful/actions/WhenAction.java
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/stateful/actions/WhileAction.java
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/stateful/util/ClassLoaderUtil.java
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/stateful/util/HibernateUtil.java
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/stateful/util/MessageUtil.java
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/stateful/util/NameSpaceUtil.java
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/stateful/util/XMLUtils.java
cdl/trunk/runtime/jbossesb/src/test/java/org/jboss/soa/overlord/jbossesb/stateful/util/MVELUsageTest.java
cdl/trunk/runtime/jbossesb/src/test/java/org/jboss/soa/overlord/jbossesb/stateful/util/XMLUtilsTest.java
cdl/trunk/samples/jbossesb/brokerage/broker/src/main/resources/META-INF/jboss-esb.xml
cdl/trunk/samples/jbossesb/brokerage/supplier/src/main/resources/META-INF/jboss-esb.xml
cdl/trunk/samples/jbossesb/common/creditAgency/src/main/resources/META-INF/jboss-esb.xml
cdl/trunk/samples/jbossesb/purchasing/store/src/main/resources/META-INF/jboss-esb.xml
Log:
[SOAG-81] refactor the stateful pakcage name.
Deleted:
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 2009-02-26
02:02:25 UTC (rev 522)
+++
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/EPRWrapper.java 2009-02-26
08:08:52 UTC (rev 523)
@@ -1,97 +0,0 @@
-/*
- * 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 <a href="mailto:cyu@redhat.com">Jeff Yu</a>
- */
-
-@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;
- }
-
-}
Deleted:
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 2009-02-26
02:02:25 UTC (rev 522)
+++
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/HibernateObject.java 2009-02-26
08:08:52 UTC (rev 523)
@@ -1,37 +0,0 @@
-/*
- * 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;
-
-/**
- * Any object that needs to be stored by using Hibernate,
- * it needs to implement this interface. It is used internally.
- *
- * @author <a href="mailto:cyu@redhat.com">Jeff Yu</a>
- *
- */
-public interface HibernateObject extends Serializable {
-
- public long getId();
-
- public void setId(long id);
-
-}
Deleted:
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 2009-02-26
02:02:25 UTC (rev 522)
+++
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/Identity.java 2009-02-26
08:08:52 UTC (rev 523)
@@ -1,176 +0,0 @@
-/*
- * 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;
-
-/**
- * A 'session' object, whether representing the top level (root) session, or a
child session,
- * should be identified by the following information:
- *
- * <ol>
- * <li>
- * Service description name - this name reflects the participant behaviour within a
choreography,
- * and provides the necessary link to enable conformance checking with the choreography
description
- * </li>
- * <li>
- * POJO class name - Each sub session needs to be distinguished, in case it uses common
identity objects.
- * Using the POJO class name in conjunction with the service description name, provides
a unique way to reference a sub-session.
- * So the POJO class name is effectively in place of the 'choreography unit'
name.
- * Combining it with the service description name, also enables the same POJO to be
used within the behaviour description for different participants -
- * i.e. it does not force the user to declare two separate classes, with the same
properties, just to distinguish the different participants within the choreography.
- * </li>
- * <li>
- * Set of 'primary' or 'alternate' business identities, detail see
{@link IdentityType} - this list will contain identity details extracted from business
messages,
- * to correlate those messages to a particular session (or sub-session).
- * </li>
- * </ol>
- *
- * @author <a href="mailto:gary.brown@hattricksoftware.com">Gary
Brown</a>
- * @author <a href="mailto:cyu@redhat.com">Jeff Yu</a>
- */
-
-@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;
- }
-
-
-}
Deleted:
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 2009-02-26
02:02:25 UTC (rev 522)
+++
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/IdentityType.java 2009-02-26
08:08:52 UTC (rev 523)
@@ -1,58 +0,0 @@
-/*
- * 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;
-
-/**
- * According to WS-CDL specificatio, it has four types of identity.
- *
- * <ul>
- * <li><i>primary</i> - the primary identity field, used to associate a
message with the session. </li>
- * <li><i>alternate</i> - an alternative primary identity. </li>
- * <li><i>associate</i> - link the message to a session based on an
identity previously associated with the session (or parent session).
- * However this identity will not be associated with the current session,
- * it is usually only used to link a child session to a parent session. </li>
- * <li><i>derived</i> - the extracted identity will be placed in
reserve for use as the primary identity for a subsequent session.
- * It is not directly associated with the session in which it is discovered.</li>
- * </ul>
- *
- *
- * @author <a href="mailto:gary.brown@hattricksoftware.com">Gary
Brown</a>
- *
- */
-
-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;
- }
-}
Deleted:
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 2009-02-26
02:02:25 UTC (rev 522)
+++
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/JoinState.java 2009-02-26
08:08:52 UTC (rev 523)
@@ -1,117 +0,0 @@
-/*
- * 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;
-
-/**
- * It represents the forked JBoss ESB service, which waits for other ESB services to
converge.
- *
- * @author <a href="mailto:gary.brown@hattricksoftware.com">Gary
Brown</a>
- * @author <a href="mailto:cyu@redhat.com">Jeff Yu</a>
- */
-@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 + "]");
- }
-
-}
Deleted:
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 2009-02-26
02:02:25 UTC (rev 522)
+++
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/LogicalCourier.java 2009-02-26
08:08:52 UTC (rev 523)
@@ -1,77 +0,0 @@
-/*
- * 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.
- *
- * @author <a href="mailto:gary.brown@hattricksoftware.com">Gary
Brown</a>
- */
-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;
- }
-
-}
Deleted:
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 2009-02-26
02:02:25 UTC (rev 522)
+++
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/ScheduleItem.java 2009-02-26
08:08:52 UTC (rev 523)
@@ -1,120 +0,0 @@
-/*
- * 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;
-
-/**
- * An item represent for JBoss ESB service.
- *
- * @author <a href="mailto:gary.brown@hattricksoftware.com">Gary
Brown</a>
- * @author <a href="mailto:cyu@redhat.com">Jeff Yu</a>
- *
- */
-
-@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;
- }
-
-
-}
Deleted:
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 2009-02-26
02:02:25 UTC (rev 522)
+++
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/Session.java 2009-02-26
08:08:52 UTC (rev 523)
@@ -1,467 +0,0 @@
-/*
- * 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.HashMap;
-import java.util.List;
-import java.util.Map;
-
-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.JoinTable;
-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.hibernate.annotations.CollectionOfElements;
-import org.hibernate.annotations.MapKey;
-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;
-
-/**
- * A Session represents the encapsulation of the current status of execution of an
associated choreography instance,
- * as well as variables containing business information relevant to the choreography.
- *
- * <p>
- * A Session represents a single choreography unit within a WS-CDL package.
- * This means that a single choreography description (or package) will usually have
multiple sessions,
- * one associated with the root choreography unit, and zero or more associated with other
non-root choreography units,
- * that are directly or indirectly performed by the root choreography unit.
- * </p>
-
- * <p>
- * This Session class should not be visible outside the ESB conversational actions.
- * There should be no reason for user custom actions to require access to this
information.
- * The only information they should be able to access is the business state information
associated with the session.
- * </p>
- *
- * <p>
- * Sessions can be organized in a hierarchy, with the top session being associated with a
root choreography unit,
- * and the child sessions being the performed sub-choreographies.
- * </p>
- *
- * <p>
- * The session maintains a schedule of service descriptors to be processed (represented
by the category and name of the service).
- * This schedule indicates which service descriptors are expected to be invoked on behalf
of the session.
- * The execution of a service descriptor's action pipeline on a session will result
in the service descriptor being removed from the schedule,
- * but may result in other service descriptors being added to the schedule, depending
upon the nature of the conversation actions within the pipeline.
- * </p>
- *
- *
- * @author <a href="mailto:gary.brown@hattricksoftware.com">Gary
Brown</a>
- * @author <a href="mailto:cyu@redhat.com">Jeff Yu</a>
- */
-
-@Entity
-@Table(name="CDL_SESSION")
-public class Session implements HibernateObject {
-
- private static final long serialVersionUID = 1115L;
-
- public static final String PARENT_REFERENCE_KEY = "parentReferenceKey";
-
- 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;
-
- @CollectionOfElements(fetch = FetchType.LAZY)
- @JoinTable(name="CDL_SESSION_PROPERTY",
joinColumns=@JoinColumn(name="SESSION_ID"))
- @MapKey(columns={@Column(name="property_key")})
- @Column(name="property_value")
- private Map<String, String> properties = new HashMap<String, String>();
-
- 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)) {
- //FIXME, it should throw exception, but need to use the pemissitic lock in database.
- logger.error("Unable to enact join state, coverging paths have still not
completed");
- //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 Map<String, String> getProperties() {
- return this.properties;
- }
-
- public void setProperties(Map<String, String> properties) {
- this.properties = properties;
- }
-
- 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();
- }
-
-}
Deleted:
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 2009-02-26
02:02:25 UTC (rev 522)
+++
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/SessionManager.java 2009-02-26
08:08:52 UTC (rev 523)
@@ -1,209 +0,0 @@
-/*
- * 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.
- *
- * @author <a href="mailto:gary.brown@hattricksoftware.com">Gary
Brown</a>
- * @author <a href="mailto:cyu@redhat.com">Jeff Yu</a>
- */
-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.debug("bound to " + key);
- }
-
- Session conversationSession = new Session();
- conversationSession.setPojoClass(sessionName);
- conversationSession.setStatus(SessionStatus.Active);
- conversationSession.setBusinessObject(businessState);
- conversationSession.setParent(parentSession);
-
- Map<String, String> properties = (Map<String,
String>)message.getProperties().
- getProperty(MessageProperties.SESSION_PROPERTIES);
- if (properties != null) {
- conversationSession.setProperties(properties);
- logger.debug("Inject properties of " + properties);
- }
-
- 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));
- injectParentReference(session);
- 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();
- injectParentReference(session);
-
- logger.debug("Get Session of " + session + " by using identity of "
+ id);
-
- return session;
- }
-
- private static void injectParentReference(Session session) {
- String parentProperty = session.getProperties().get(Session.PARENT_REFERENCE_KEY);
- if (parentProperty!= null && session.getParent() != null) {
- Object parentBizObj = session.getParent().getBusinessObject();
- Object bizObj = session.getBusinessObject();
- MVEL.setProperty(bizObj, parentProperty, parentBizObj);
- session.setBusinessObject(bizObj);
- }
- }
-}
Deleted:
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 2009-02-26
02:02:25 UTC (rev 522)
+++
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/SessionStatus.java 2009-02-26
08:08:52 UTC (rev 523)
@@ -1,34 +0,0 @@
-/*
- * 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;
-
-
-/**
- *
- * @author <a href="mailto:gary.brown@hattricksoftware.com">Gary
Brown</a>
- */
-
-public enum SessionStatus {
-
- Initialized,
- Active,
- Completed,
- CLOSED
-}
Copied:
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/stateful/EPRWrapper.java
(from rev 522,
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/stateful/EPRWrapper.java
(rev 0)
+++
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/stateful/EPRWrapper.java 2009-02-26
08:08:52 UTC (rev 523)
@@ -0,0 +1,97 @@
+/*
+ * 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.stateful;
+
+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 <a href="mailto:cyu@redhat.com">Jeff Yu</a>
+ */
+
+@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;
+ }
+
+}
Property changes on:
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/stateful/EPRWrapper.java
___________________________________________________________________
Name: svn:mergeinfo
+
Copied:
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/stateful/HibernateObject.java
(from rev 522,
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/stateful/HibernateObject.java
(rev 0)
+++
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/stateful/HibernateObject.java 2009-02-26
08:08:52 UTC (rev 523)
@@ -0,0 +1,37 @@
+/*
+ * 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.stateful;
+
+import java.io.Serializable;
+
+/**
+ * Any object that needs to be stored by using Hibernate,
+ * it needs to implement this interface. It is used internally.
+ *
+ * @author <a href="mailto:cyu@redhat.com">Jeff Yu</a>
+ *
+ */
+public interface HibernateObject extends Serializable {
+
+ public long getId();
+
+ public void setId(long id);
+
+}
Property changes on:
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/stateful/HibernateObject.java
___________________________________________________________________
Name: svn:mergeinfo
+
Copied:
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/stateful/Identity.java
(from rev 522,
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/stateful/Identity.java
(rev 0)
+++
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/stateful/Identity.java 2009-02-26
08:08:52 UTC (rev 523)
@@ -0,0 +1,176 @@
+/*
+ * 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.stateful;
+
+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;
+
+/**
+ * A 'session' object, whether representing the top level (root) session, or a
child session,
+ * should be identified by the following information:
+ *
+ * <ol>
+ * <li>
+ * Service description name - this name reflects the participant behaviour within a
choreography,
+ * and provides the necessary link to enable conformance checking with the choreography
description
+ * </li>
+ * <li>
+ * POJO class name - Each sub session needs to be distinguished, in case it uses common
identity objects.
+ * Using the POJO class name in conjunction with the service description name, provides
a unique way to reference a sub-session.
+ * So the POJO class name is effectively in place of the 'choreography unit'
name.
+ * Combining it with the service description name, also enables the same POJO to be
used within the behaviour description for different participants -
+ * i.e. it does not force the user to declare two separate classes, with the same
properties, just to distinguish the different participants within the choreography.
+ * </li>
+ * <li>
+ * Set of 'primary' or 'alternate' business identities, detail see
{@link IdentityType} - this list will contain identity details extracted from business
messages,
+ * to correlate those messages to a particular session (or sub-session).
+ * </li>
+ * </ol>
+ *
+ * @author <a href="mailto:gary.brown@hattricksoftware.com">Gary
Brown</a>
+ * @author <a href="mailto:cyu@redhat.com">Jeff Yu</a>
+ */
+
+@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;
+ }
+
+
+}
Property changes on:
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/stateful/Identity.java
___________________________________________________________________
Name: svn:mergeinfo
+
Copied:
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/stateful/IdentityType.java
(from rev 522,
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/stateful/IdentityType.java
(rev 0)
+++
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/stateful/IdentityType.java 2009-02-26
08:08:52 UTC (rev 523)
@@ -0,0 +1,58 @@
+/*
+ * 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.stateful;
+
+/**
+ * According to WS-CDL specificatio, it has four types of identity.
+ *
+ * <ul>
+ * <li><i>primary</i> - the primary identity field, used to associate a
message with the session. </li>
+ * <li><i>alternate</i> - an alternative primary identity. </li>
+ * <li><i>associate</i> - link the message to a session based on an
identity previously associated with the session (or parent session).
+ * However this identity will not be associated with the current session,
+ * it is usually only used to link a child session to a parent session. </li>
+ * <li><i>derived</i> - the extracted identity will be placed in
reserve for use as the primary identity for a subsequent session.
+ * It is not directly associated with the session in which it is discovered.</li>
+ * </ul>
+ *
+ *
+ * @author <a href="mailto:gary.brown@hattricksoftware.com">Gary
Brown</a>
+ *
+ */
+
+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;
+ }
+}
Property changes on:
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/stateful/IdentityType.java
___________________________________________________________________
Name: svn:mergeinfo
+
Copied:
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/stateful/JoinState.java
(from rev 522,
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/stateful/JoinState.java
(rev 0)
+++
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/stateful/JoinState.java 2009-02-26
08:08:52 UTC (rev 523)
@@ -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.jbossesb.stateful;
+
+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;
+
+/**
+ * It represents the forked JBoss ESB service, which waits for other ESB services to
converge.
+ *
+ * @author <a href="mailto:gary.brown@hattricksoftware.com">Gary
Brown</a>
+ * @author <a href="mailto:cyu@redhat.com">Jeff Yu</a>
+ */
+@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 + "]");
+ }
+
+}
Property changes on:
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/stateful/JoinState.java
___________________________________________________________________
Name: svn:mergeinfo
+
Copied:
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/stateful/LogicalCourier.java
(from rev 522,
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/stateful/LogicalCourier.java
(rev 0)
+++
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/stateful/LogicalCourier.java 2009-02-26
08:08:52 UTC (rev 523)
@@ -0,0 +1,77 @@
+/*
+ * 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.stateful;
+
+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.
+ *
+ * @author <a href="mailto:gary.brown@hattricksoftware.com">Gary
Brown</a>
+ */
+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;
+ }
+
+}
Property changes on:
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/stateful/LogicalCourier.java
___________________________________________________________________
Name: svn:mergeinfo
+
Copied:
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/stateful/ScheduleItem.java
(from rev 522,
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/stateful/ScheduleItem.java
(rev 0)
+++
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/stateful/ScheduleItem.java 2009-02-26
08:08:52 UTC (rev 523)
@@ -0,0 +1,120 @@
+/*
+ * 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.stateful;
+
+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;
+
+/**
+ * An item represent for JBoss ESB service.
+ *
+ * @author <a href="mailto:gary.brown@hattricksoftware.com">Gary
Brown</a>
+ * @author <a href="mailto:cyu@redhat.com">Jeff Yu</a>
+ *
+ */
+
+@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;
+ }
+
+
+}
Property changes on:
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/stateful/ScheduleItem.java
___________________________________________________________________
Name: svn:mergeinfo
+
Copied:
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/stateful/Session.java
(from rev 522,
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/stateful/Session.java
(rev 0)
+++
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/stateful/Session.java 2009-02-26
08:08:52 UTC (rev 523)
@@ -0,0 +1,467 @@
+/*
+ * 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.stateful;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+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.JoinTable;
+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.hibernate.annotations.CollectionOfElements;
+import org.hibernate.annotations.MapKey;
+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;
+
+/**
+ * A Session represents the encapsulation of the current status of execution of an
associated choreography instance,
+ * as well as variables containing business information relevant to the choreography.
+ *
+ * <p>
+ * A Session represents a single choreography unit within a WS-CDL package.
+ * This means that a single choreography description (or package) will usually have
multiple sessions,
+ * one associated with the root choreography unit, and zero or more associated with other
non-root choreography units,
+ * that are directly or indirectly performed by the root choreography unit.
+ * </p>
+
+ * <p>
+ * This Session class should not be visible outside the ESB conversational actions.
+ * There should be no reason for user custom actions to require access to this
information.
+ * The only information they should be able to access is the business state information
associated with the session.
+ * </p>
+ *
+ * <p>
+ * Sessions can be organized in a hierarchy, with the top session being associated with a
root choreography unit,
+ * and the child sessions being the performed sub-choreographies.
+ * </p>
+ *
+ * <p>
+ * The session maintains a schedule of service descriptors to be processed (represented
by the category and name of the service).
+ * This schedule indicates which service descriptors are expected to be invoked on behalf
of the session.
+ * The execution of a service descriptor's action pipeline on a session will result
in the service descriptor being removed from the schedule,
+ * but may result in other service descriptors being added to the schedule, depending
upon the nature of the conversation actions within the pipeline.
+ * </p>
+ *
+ *
+ * @author <a href="mailto:gary.brown@hattricksoftware.com">Gary
Brown</a>
+ * @author <a href="mailto:cyu@redhat.com">Jeff Yu</a>
+ */
+
+@Entity
+@Table(name="CDL_SESSION")
+public class Session implements HibernateObject {
+
+ private static final long serialVersionUID = 1115L;
+
+ public static final String PARENT_REFERENCE_KEY = "parentReferenceKey";
+
+ 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;
+
+ @CollectionOfElements(fetch = FetchType.LAZY)
+ @JoinTable(name="CDL_SESSION_PROPERTY",
joinColumns=@JoinColumn(name="SESSION_ID"))
+ @MapKey(columns={@Column(name="property_key")})
+ @Column(name="property_value")
+ private Map<String, String> properties = new HashMap<String, String>();
+
+ 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)) {
+ //FIXME, it should throw exception, but need to use the pemissitic lock in database.
+ logger.error("Unable to enact join state, coverging paths have still not
completed");
+ //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 Map<String, String> getProperties() {
+ return this.properties;
+ }
+
+ public void setProperties(Map<String, String> properties) {
+ this.properties = properties;
+ }
+
+ 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();
+ }
+
+}
Property changes on:
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/stateful/Session.java
___________________________________________________________________
Name: svn:mergeinfo
+
Copied:
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/stateful/SessionManager.java
(from rev 522,
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/stateful/SessionManager.java
(rev 0)
+++
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/stateful/SessionManager.java 2009-02-26
08:08:52 UTC (rev 523)
@@ -0,0 +1,209 @@
+/*
+ * 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.stateful;
+
+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.stateful.actions.MessageProperties;
+import org.jboss.soa.overlord.jbossesb.stateful.actions.Service;
+import org.jboss.soa.overlord.jbossesb.stateful.util.ClassLoaderUtil;
+import org.jboss.soa.overlord.jbossesb.stateful.util.HibernateUtil;
+import org.mvel.MVEL;
+
+/**
+ * This component is responsible for managing the persistence and retrieval
+ * of sessions.
+ *
+ * @author <a href="mailto:gary.brown@hattricksoftware.com">Gary
Brown</a>
+ * @author <a href="mailto:cyu@redhat.com">Jeff Yu</a>
+ */
+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.debug("bound to " + key);
+ }
+
+ Session conversationSession = new Session();
+ conversationSession.setPojoClass(sessionName);
+ conversationSession.setStatus(SessionStatus.Active);
+ conversationSession.setBusinessObject(businessState);
+ conversationSession.setParent(parentSession);
+
+ Map<String, String> properties = (Map<String,
String>)message.getProperties().
+ getProperty(MessageProperties.SESSION_PROPERTIES);
+ if (properties != null) {
+ conversationSession.setProperties(properties);
+ logger.debug("Inject properties of " + properties);
+ }
+
+ 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));
+ injectParentReference(session);
+ 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();
+ injectParentReference(session);
+
+ logger.debug("Get Session of " + session + " by using identity of "
+ id);
+
+ return session;
+ }
+
+ private static void injectParentReference(Session session) {
+ String parentProperty = session.getProperties().get(Session.PARENT_REFERENCE_KEY);
+ if (parentProperty!= null && session.getParent() != null) {
+ Object parentBizObj = session.getParent().getBusinessObject();
+ Object bizObj = session.getBusinessObject();
+ MVEL.setProperty(bizObj, parentProperty, parentBizObj);
+ session.setBusinessObject(bizObj);
+ }
+ }
+}
Property changes on:
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/stateful/SessionManager.java
___________________________________________________________________
Name: svn:mergeinfo
+
Copied:
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/stateful/SessionStatus.java
(from rev 522,
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/stateful/SessionStatus.java
(rev 0)
+++
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/stateful/SessionStatus.java 2009-02-26
08:08:52 UTC (rev 523)
@@ -0,0 +1,34 @@
+/*
+ * 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.stateful;
+
+
+/**
+ *
+ * @author <a href="mailto:gary.brown@hattricksoftware.com">Gary
Brown</a>
+ */
+
+public enum SessionStatus {
+
+ Initialized,
+ Active,
+ Completed,
+ CLOSED
+}
Property changes on:
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/stateful/SessionStatus.java
___________________________________________________________________
Name: svn:mergeinfo
+
Copied:
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/stateful/actions
(from rev 522,
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/actions)
Property changes on:
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/stateful/actions
___________________________________________________________________
Name: svn:mergeinfo
+
Modified:
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/stateful/actions/ActionProperties.java
===================================================================
---
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/actions/ActionProperties.java 2009-02-26
02:02:25 UTC (rev 522)
+++
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/stateful/actions/ActionProperties.java 2009-02-26
08:08:52 UTC (rev 523)
@@ -17,7 +17,7 @@
*
* (C) 2008,
*/
-package org.jboss.soa.overlord.jbossesb.actions;
+package org.jboss.soa.overlord.jbossesb.stateful.actions;
/**
*
Modified:
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/stateful/actions/ConversationAction.java
===================================================================
---
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/actions/ConversationAction.java 2009-02-26
02:02:25 UTC (rev 522)
+++
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/stateful/actions/ConversationAction.java 2009-02-26
08:08:52 UTC (rev 523)
@@ -17,7 +17,7 @@
*
* (C) 2008,
*/
-package org.jboss.soa.overlord.jbossesb.actions;
+package org.jboss.soa.overlord.jbossesb.stateful.actions;
import java.util.HashMap;
import java.util.HashSet;
@@ -31,16 +31,16 @@
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.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;
-import org.jboss.soa.overlord.jbossesb.util.XMLUtils;
+import org.jboss.soa.overlord.jbossesb.stateful.Identity;
+import org.jboss.soa.overlord.jbossesb.stateful.IdentityType;
+import org.jboss.soa.overlord.jbossesb.stateful.ScheduleItem;
+import org.jboss.soa.overlord.jbossesb.stateful.Session;
+import org.jboss.soa.overlord.jbossesb.stateful.SessionManager;
+import org.jboss.soa.overlord.jbossesb.stateful.SessionStatus;
+import org.jboss.soa.overlord.jbossesb.stateful.util.ClassLoaderUtil;
+import org.jboss.soa.overlord.jbossesb.stateful.util.HibernateUtil;
+import org.jboss.soa.overlord.jbossesb.stateful.util.MessageUtil;
+import org.jboss.soa.overlord.jbossesb.stateful.util.XMLUtils;
import org.mvel.MVEL;
/**
Modified:
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/stateful/actions/CreateSessionAction.java
===================================================================
---
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/actions/CreateSessionAction.java 2009-02-26
02:02:25 UTC (rev 522)
+++
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/stateful/actions/CreateSessionAction.java 2009-02-26
08:08:52 UTC (rev 523)
@@ -17,13 +17,13 @@
*
* (C) 2008,
*/
-package org.jboss.soa.overlord.jbossesb.actions;
+package org.jboss.soa.overlord.jbossesb.stateful.actions;
import org.apache.log4j.Logger;
import org.jboss.soa.esb.helpers.ConfigTree;
import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.overlord.jbossesb.Session;
-import org.jboss.soa.overlord.jbossesb.SessionManager;
+import org.jboss.soa.overlord.jbossesb.stateful.Session;
+import org.jboss.soa.overlord.jbossesb.stateful.SessionManager;
/**
*
Modified:
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/stateful/actions/IfAction.java
===================================================================
---
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/actions/IfAction.java 2009-02-26
02:02:25 UTC (rev 522)
+++
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/stateful/actions/IfAction.java 2009-02-26
08:08:52 UTC (rev 523)
@@ -17,7 +17,7 @@
*
* (C) 2008,
*/
-package org.jboss.soa.overlord.jbossesb.actions;
+package org.jboss.soa.overlord.jbossesb.stateful.actions;
import org.apache.log4j.Logger;
import org.jboss.soa.esb.helpers.ConfigTree;
Modified:
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/stateful/actions/MessageProperties.java
===================================================================
---
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/actions/MessageProperties.java 2009-02-26
02:02:25 UTC (rev 522)
+++
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/stateful/actions/MessageProperties.java 2009-02-26
08:08:52 UTC (rev 523)
@@ -17,7 +17,7 @@
*
* (C) 2008,
*/
-package org.jboss.soa.overlord.jbossesb.actions;
+package org.jboss.soa.overlord.jbossesb.stateful.actions;
/**
* Define message constants.
Modified:
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/stateful/actions/MessageRouterAction.java
===================================================================
---
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/actions/MessageRouterAction.java 2009-02-26
02:02:25 UTC (rev 522)
+++
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/stateful/actions/MessageRouterAction.java 2009-02-26
08:08:52 UTC (rev 523)
@@ -17,7 +17,7 @@
*
* (C) 2008,
*/
-package org.jboss.soa.overlord.jbossesb.actions;
+package org.jboss.soa.overlord.jbossesb.stateful.actions;
import java.util.List;
@@ -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.jbossesb.Identity;
-import org.jboss.soa.overlord.jbossesb.IdentityType;
-import org.jboss.soa.overlord.jbossesb.ScheduleItem;
+import org.jboss.soa.overlord.jbossesb.stateful.Identity;
+import org.jboss.soa.overlord.jbossesb.stateful.IdentityType;
+import org.jboss.soa.overlord.jbossesb.stateful.ScheduleItem;
/**
* The action is used to perform routing of the inbound requests.
Modified:
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/stateful/actions/ParallelAction.java
===================================================================
---
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/actions/ParallelAction.java 2009-02-26
02:02:25 UTC (rev 522)
+++
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/stateful/actions/ParallelAction.java 2009-02-26
08:08:52 UTC (rev 523)
@@ -17,7 +17,7 @@
*
* (C) 2008,
*/
-package org.jboss.soa.overlord.jbossesb.actions;
+package org.jboss.soa.overlord.jbossesb.stateful.actions;
import org.apache.log4j.Logger;
import org.jboss.soa.esb.helpers.ConfigTree;
Modified:
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/stateful/actions/PerformAction.java
===================================================================
---
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/actions/PerformAction.java 2009-02-26
02:02:25 UTC (rev 522)
+++
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/stateful/actions/PerformAction.java 2009-02-26
08:08:52 UTC (rev 523)
@@ -17,7 +17,7 @@
*
* (C) 2008,
*/
-package org.jboss.soa.overlord.jbossesb.actions;
+package org.jboss.soa.overlord.jbossesb.stateful.actions;
import java.util.HashMap;
import java.util.Map;
@@ -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.jbossesb.Session;
+import org.jboss.soa.overlord.jbossesb.stateful.Session;
import org.mvel.MVEL;
/**
Modified:
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/stateful/actions/ReceiveMessageAction.java
===================================================================
---
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/actions/ReceiveMessageAction.java 2009-02-26
02:02:25 UTC (rev 522)
+++
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/stateful/actions/ReceiveMessageAction.java 2009-02-26
08:08:52 UTC (rev 523)
@@ -17,13 +17,13 @@
*
* (C) 2008,
*/
-package org.jboss.soa.overlord.jbossesb.actions;
+package org.jboss.soa.overlord.jbossesb.stateful.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.Message;
-import org.jboss.soa.overlord.jbossesb.Identity;
+import org.jboss.soa.overlord.jbossesb.stateful.Identity;
/**
* The ReceiveMessageAction is used to explicitly define the message type that should be
received and a set of identities.
Modified:
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/stateful/actions/RetrieveSessionAction.java
===================================================================
---
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/actions/RetrieveSessionAction.java 2009-02-26
02:02:25 UTC (rev 522)
+++
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/stateful/actions/RetrieveSessionAction.java 2009-02-26
08:08:52 UTC (rev 523)
@@ -17,14 +17,14 @@
*
* (C) 2008,
*/
-package org.jboss.soa.overlord.jbossesb.actions;
+package org.jboss.soa.overlord.jbossesb.stateful.actions;
import java.util.List;
import org.apache.log4j.Logger;
import org.jboss.soa.esb.helpers.ConfigTree;
import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.overlord.jbossesb.Identity;
+import org.jboss.soa.overlord.jbossesb.stateful.Identity;
/**
* It retrieves existing sessions instead of creating new sessions.
Modified:
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/stateful/actions/ScheduleStateAction.java
===================================================================
---
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/actions/ScheduleStateAction.java 2009-02-26
02:02:25 UTC (rev 522)
+++
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/stateful/actions/ScheduleStateAction.java 2009-02-26
08:08:52 UTC (rev 523)
@@ -17,7 +17,7 @@
*
* (C) 2008,
*/
-package org.jboss.soa.overlord.jbossesb.actions;
+package org.jboss.soa.overlord.jbossesb.stateful.actions;
import org.apache.log4j.Logger;
import org.jboss.soa.esb.helpers.ConfigTree;
Modified:
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/stateful/actions/SendMessageAction.java
===================================================================
---
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/actions/SendMessageAction.java 2009-02-26
02:02:25 UTC (rev 522)
+++
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/stateful/actions/SendMessageAction.java 2009-02-26
08:08:52 UTC (rev 523)
@@ -17,7 +17,7 @@
*
* (C) 2008,
*/
-package org.jboss.soa.overlord.jbossesb.actions;
+package org.jboss.soa.overlord.jbossesb.stateful.actions;
import java.util.List;
@@ -31,8 +31,8 @@
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.jbossesb.Identity;
-import org.jboss.soa.overlord.jbossesb.LogicalCourier;
+import org.jboss.soa.overlord.jbossesb.stateful.Identity;
+import org.jboss.soa.overlord.jbossesb.stateful.LogicalCourier;
import org.mvel.MVEL;
Modified:
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/stateful/actions/Service.java
===================================================================
---
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/actions/Service.java 2009-02-26
02:02:25 UTC (rev 522)
+++
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/stateful/actions/Service.java 2009-02-26
08:08:52 UTC (rev 523)
@@ -17,7 +17,7 @@
*
* (C) 2008,
*/
-package org.jboss.soa.overlord.jbossesb.actions;
+package org.jboss.soa.overlord.jbossesb.stateful.actions;
/**
*
Modified:
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/stateful/actions/SetMessageAction.java
===================================================================
---
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/actions/SetMessageAction.java 2009-02-26
02:02:25 UTC (rev 522)
+++
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/stateful/actions/SetMessageAction.java 2009-02-26
08:08:52 UTC (rev 523)
@@ -17,7 +17,7 @@
*
* (C) 2008,
*/
-package org.jboss.soa.overlord.jbossesb.actions;
+package org.jboss.soa.overlord.jbossesb.stateful.actions;
import org.apache.log4j.Logger;
import org.jboss.soa.esb.helpers.ConfigTree;
Modified:
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/stateful/actions/SetStateAction.java
===================================================================
---
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/actions/SetStateAction.java 2009-02-26
02:02:25 UTC (rev 522)
+++
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/stateful/actions/SetStateAction.java 2009-02-26
08:08:52 UTC (rev 523)
@@ -17,12 +17,12 @@
*
* (C) 2008,
*/
-package org.jboss.soa.overlord.jbossesb.actions;
+package org.jboss.soa.overlord.jbossesb.stateful.actions;
import org.apache.log4j.Logger;
import org.jboss.soa.esb.helpers.ConfigTree;
import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.overlord.jbossesb.util.XMLUtils;
+import org.jboss.soa.overlord.jbossesb.stateful.util.XMLUtils;
import org.mvel.MVEL;
import org.w3c.dom.Element;
Modified:
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/stateful/actions/SwitchAction.java
===================================================================
---
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/actions/SwitchAction.java 2009-02-26
02:02:25 UTC (rev 522)
+++
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/stateful/actions/SwitchAction.java 2009-02-26
08:08:52 UTC (rev 523)
@@ -17,7 +17,7 @@
*
* (C) 2008,
*/
-package org.jboss.soa.overlord.jbossesb.actions;
+package org.jboss.soa.overlord.jbossesb.stateful.actions;
import org.apache.log4j.Logger;
import org.jboss.soa.esb.helpers.ConfigTree;
Modified:
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/stateful/actions/WhenAction.java
===================================================================
---
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/actions/WhenAction.java 2009-02-26
02:02:25 UTC (rev 522)
+++
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/stateful/actions/WhenAction.java 2009-02-26
08:08:52 UTC (rev 523)
@@ -17,7 +17,7 @@
*
* (C) 2008,
*/
-package org.jboss.soa.overlord.jbossesb.actions;
+package org.jboss.soa.overlord.jbossesb.stateful.actions;
import org.apache.log4j.Logger;
import org.jboss.soa.esb.helpers.ConfigTree;
Modified:
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/stateful/actions/WhileAction.java
===================================================================
---
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/actions/WhileAction.java 2009-02-26
02:02:25 UTC (rev 522)
+++
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/stateful/actions/WhileAction.java 2009-02-26
08:08:52 UTC (rev 523)
@@ -17,7 +17,7 @@
*
* (C) 2008,
*/
-package org.jboss.soa.overlord.jbossesb.actions;
+package org.jboss.soa.overlord.jbossesb.stateful.actions;
import org.apache.log4j.Logger;
import org.jboss.soa.esb.helpers.ConfigTree;
Copied:
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/stateful/util
(from rev 522,
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/util)
Property changes on:
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/stateful/util
___________________________________________________________________
Name: svn:mergeinfo
+
Modified:
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/stateful/util/ClassLoaderUtil.java
===================================================================
---
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/util/ClassLoaderUtil.java 2009-02-26
02:02:25 UTC (rev 522)
+++
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/stateful/util/ClassLoaderUtil.java 2009-02-26
08:08:52 UTC (rev 523)
@@ -17,7 +17,7 @@
*
* (C) 2008,
*/
-package org.jboss.soa.overlord.jbossesb.util;
+package org.jboss.soa.overlord.jbossesb.stateful.util;
/**
*
Modified:
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/stateful/util/HibernateUtil.java
===================================================================
---
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/util/HibernateUtil.java 2009-02-26
02:02:25 UTC (rev 522)
+++
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/stateful/util/HibernateUtil.java 2009-02-26
08:08:52 UTC (rev 523)
@@ -17,7 +17,7 @@
*
* (C) 2008,
*/
-package org.jboss.soa.overlord.jbossesb.util;
+package org.jboss.soa.overlord.jbossesb.stateful.util;
import org.hibernate.HibernateException;
import org.hibernate.Session;
Modified:
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/stateful/util/MessageUtil.java
===================================================================
---
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/util/MessageUtil.java 2009-02-26
02:02:25 UTC (rev 522)
+++
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/stateful/util/MessageUtil.java 2009-02-26
08:08:52 UTC (rev 523)
@@ -17,7 +17,7 @@
* Change History:
* Mar 21, 2006 : Initial version created by gary
*/
-package org.jboss.soa.overlord.jbossesb.util;
+package org.jboss.soa.overlord.jbossesb.stateful.util;
import java.util.logging.Logger;
Modified:
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/stateful/util/NameSpaceUtil.java
===================================================================
---
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/util/NameSpaceUtil.java 2009-02-26
02:02:25 UTC (rev 522)
+++
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/stateful/util/NameSpaceUtil.java 2009-02-26
08:08:52 UTC (rev 523)
@@ -17,7 +17,7 @@
* Change History:
* Jul 28, 2005 : Initial version created by gary
*/
-package org.jboss.soa.overlord.jbossesb.util;
+package org.jboss.soa.overlord.jbossesb.stateful.util;
/**
* This class provides helper functiions for manipulating fully
Modified:
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/stateful/util/XMLUtils.java
===================================================================
---
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/util/XMLUtils.java 2009-02-26
02:02:25 UTC (rev 522)
+++
cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/stateful/util/XMLUtils.java 2009-02-26
08:08:52 UTC (rev 523)
@@ -17,7 +17,7 @@
*
* (C) 2008,
*/
-package org.jboss.soa.overlord.jbossesb.util;
+package org.jboss.soa.overlord.jbossesb.stateful.util;
import java.io.ByteArrayInputStream;
import java.io.InputStream;
Copied:
cdl/trunk/runtime/jbossesb/src/test/java/org/jboss/soa/overlord/jbossesb/stateful/util
(from rev 522,
cdl/trunk/runtime/jbossesb/src/test/java/org/jboss/soa/overlord/jbossesb/util)
Property changes on:
cdl/trunk/runtime/jbossesb/src/test/java/org/jboss/soa/overlord/jbossesb/stateful/util
___________________________________________________________________
Name: svn:mergeinfo
+
Modified:
cdl/trunk/runtime/jbossesb/src/test/java/org/jboss/soa/overlord/jbossesb/stateful/util/MVELUsageTest.java
===================================================================
---
cdl/trunk/runtime/jbossesb/src/test/java/org/jboss/soa/overlord/jbossesb/util/MVELUsageTest.java 2009-02-26
02:02:25 UTC (rev 522)
+++
cdl/trunk/runtime/jbossesb/src/test/java/org/jboss/soa/overlord/jbossesb/stateful/util/MVELUsageTest.java 2009-02-26
08:08:52 UTC (rev 523)
@@ -17,7 +17,7 @@
*
* (C) 2008,
*/
-package org.jboss.soa.overlord.jbossesb.util;
+package org.jboss.soa.overlord.jbossesb.stateful.util;
import org.junit.Before;
import org.junit.Test;
Modified:
cdl/trunk/runtime/jbossesb/src/test/java/org/jboss/soa/overlord/jbossesb/stateful/util/XMLUtilsTest.java
===================================================================
---
cdl/trunk/runtime/jbossesb/src/test/java/org/jboss/soa/overlord/jbossesb/util/XMLUtilsTest.java 2009-02-26
02:02:25 UTC (rev 522)
+++
cdl/trunk/runtime/jbossesb/src/test/java/org/jboss/soa/overlord/jbossesb/stateful/util/XMLUtilsTest.java 2009-02-26
08:08:52 UTC (rev 523)
@@ -17,9 +17,10 @@
*
* (C) 2008,
*/
-package org.jboss.soa.overlord.jbossesb.util;
+package org.jboss.soa.overlord.jbossesb.stateful.util;
import org.w3c.dom.Element;
+import org.jboss.soa.overlord.jbossesb.stateful.util.XMLUtils;
import org.junit.Test;
import junit.framework.Assert;
Modified:
cdl/trunk/runtime/jbossesb-assembly/src/main/resources/overlord-cdl-jbossesb.cfg.xml
===================================================================
---
cdl/trunk/runtime/jbossesb-assembly/src/main/resources/overlord-cdl-jbossesb.cfg.xml 2009-02-26
02:02:25 UTC (rev 522)
+++
cdl/trunk/runtime/jbossesb-assembly/src/main/resources/overlord-cdl-jbossesb.cfg.xml 2009-02-26
08:08:52 UTC (rev 523)
@@ -54,11 +54,11 @@
<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"/>
+ <mapping class="org.jboss.soa.overlord.jbossesb.stateful.Session" />
+ <mapping
class="org.jboss.soa.overlord.jbossesb.stateful.ScheduleItem"/>
+ <mapping class="org.jboss.soa.overlord.jbossesb.stateful.JoinState"/>
+ <mapping class="org.jboss.soa.overlord.jbossesb.stateful.Identity"/>
+ <mapping class="org.jboss.soa.overlord.jbossesb.stateful.EPRWrapper"/>
</session-factory>
</hibernate-configuration>
Modified:
cdl/trunk/runtime/jbossesb-assembly/src/test/java/org/jboss/soa/overlord/jbossesb/HibernateTest.java
===================================================================
---
cdl/trunk/runtime/jbossesb-assembly/src/test/java/org/jboss/soa/overlord/jbossesb/HibernateTest.java 2009-02-26
02:02:25 UTC (rev 522)
+++
cdl/trunk/runtime/jbossesb-assembly/src/test/java/org/jboss/soa/overlord/jbossesb/HibernateTest.java 2009-02-26
08:08:52 UTC (rev 523)
@@ -21,7 +21,8 @@
import junit.framework.Assert;
-import org.jboss.soa.overlord.jbossesb.util.HibernateUtil;
+import org.jboss.soa.overlord.jbossesb.stateful.Session;
+import org.jboss.soa.overlord.jbossesb.stateful.util.HibernateUtil;
import org.junit.Ignore;
import org.junit.Test;
Modified:
cdl/trunk/samples/jbossesb/brokerage/broker/src/main/resources/META-INF/jboss-esb.xml
===================================================================
---
cdl/trunk/samples/jbossesb/brokerage/broker/src/main/resources/META-INF/jboss-esb.xml 2009-02-26
02:02:25 UTC (rev 522)
+++
cdl/trunk/samples/jbossesb/brokerage/broker/src/main/resources/META-INF/jboss-esb.xml 2009-02-26
08:08:52 UTC (rev 523)
@@ -72,7 +72,7 @@
maxThreads="1"/>
</listeners>
<actions mep="OneWay">
- <action
class="org.jboss.soa.overlord.jbossesb.actions.MessageRouterAction"
+ <action
class="org.jboss.soa.overlord.jbossesb.stateful.actions.MessageRouterAction"
process="process" name="s0-1">
<property name="serviceDescriptionName"
value="{http://www.jboss.org/overlord/loanBroker}Broker" />
<property name="paths">
@@ -110,11 +110,11 @@
maxThreads="1"/>
</listeners>
<actions mep="OneWay">
- <action
class="org.jboss.soa.overlord.jbossesb.actions.CreateSessionAction"
+ <action
class="org.jboss.soa.overlord.jbossesb.stateful.actions.CreateSessionAction"
process="process" name="s1-1">
<property name="session"
value="org.jboss.soa.overlord.samples.jbossesb.loan.broker.BrokerMain" />
</action>
- <action
class="org.jboss.soa.overlord.jbossesb.actions.ReceiveMessageAction"
+ <action
class="org.jboss.soa.overlord.jbossesb.stateful.actions.ReceiveMessageAction"
process="process" name="s1-2">
<property name="operation" value="makeEnquiry" />
<property name="messageType" value="enquiry" />
@@ -125,7 +125,7 @@
</identity>
</property>
</action>
- <action
class="org.jboss.soa.overlord.jbossesb.actions.ScheduleStateAction"
+ <action
class="org.jboss.soa.overlord.jbossesb.stateful.actions.ScheduleStateAction"
process="process" name="s1-3">
<property name="serviceCategory"
value="ESBBroker.BrokerParticipant" />
<property name="serviceName" value="ESBBrokerProcess.main.1"
/>
@@ -142,7 +142,7 @@
maxThreads="1"/>
</listeners>
<actions mep="OneWay">
- <action class="org.jboss.soa.overlord.jbossesb.actions.WhileAction"
+ <action
class="org.jboss.soa.overlord.jbossesb.stateful.actions.WhileAction"
process="process" name="s2-1">
<property name="session"
value="org.jboss.soa.overlord.samples.jbossesb.loan.broker.BrokerMain" />
<property name="paths">
@@ -165,7 +165,7 @@
maxThreads="1"/>
</listeners>
<actions mep="OneWay">
- <action class="org.jboss.soa.overlord.jbossesb.actions.PerformAction"
+ <action
class="org.jboss.soa.overlord.jbossesb.stateful.actions.PerformAction"
process="process" name="s3-1">
<property name="session"
value="org.jboss.soa.overlord.samples.jbossesb.loan.broker.BrokerMain" />
<property name="serviceCategory"
value="ESBBroker.BrokerParticipant" />
@@ -188,7 +188,7 @@
maxThreads="1"/>
</listeners>
<actions mep="OneWay">
- <action class="org.jboss.soa.overlord.jbossesb.actions.WhenAction"
+ <action
class="org.jboss.soa.overlord.jbossesb.stateful.actions.WhenAction"
process="process" name="s4-1">
<property name="session"
value="org.jboss.soa.overlord.samples.jbossesb.loan.broker.BrokerMain" />
<property name="paths">
@@ -207,7 +207,7 @@
maxThreads="1"/>
</listeners>
<actions mep="OneWay">
- <action
class="org.jboss.soa.overlord.jbossesb.actions.SetMessageAction"
+ <action
class="org.jboss.soa.overlord.jbossesb.stateful.actions.SetMessageAction"
process="process" name="s4-1">
<property name="session"
value="org.jboss.soa.overlord.samples.jbossesb.loan.broker.BrokerMain" />
<property name="headerProperty" value="quotes" />
@@ -217,7 +217,7 @@
process="process" name="s4-2">
</action>
- <action
class="org.jboss.soa.overlord.jbossesb.actions.SendMessageAction"
+ <action
class="org.jboss.soa.overlord.jbossesb.stateful.actions.SendMessageAction"
process="process" name="s4-3">
<property name="operation" value="makeEnquiry" />
<property name="messageType" value="quoteList" />
@@ -228,7 +228,7 @@
</identity>
</property>
</action>
- <action
class="org.jboss.soa.overlord.jbossesb.actions.ScheduleStateAction"
+ <action
class="org.jboss.soa.overlord.jbossesb.stateful.actions.ScheduleStateAction"
process="process" name="s4-4">
<property name="serviceCategory"
value="ESBBroker.BrokerParticipant" />
<property name="serviceName" value="ESBBrokerProcess.main.5"
/>
@@ -244,7 +244,7 @@
maxThreads="1"/>
</listeners>
<actions mep="OneWay">
- <action class="org.jboss.soa.overlord.jbossesb.actions.SwitchAction"
+ <action
class="org.jboss.soa.overlord.jbossesb.stateful.actions.SwitchAction"
process="process" name="s5-2">
<property name="session"
value="org.jboss.soa.overlord.samples.jbossesb.loan.broker.BrokerMain" />
<property name="paths">
@@ -268,7 +268,7 @@
maxThreads="1"/>
</listeners>
<actions mep="OneWay">
- <action
class="org.jboss.soa.overlord.jbossesb.actions.ReceiveMessageAction"
+ <action
class="org.jboss.soa.overlord.jbossesb.stateful.actions.ReceiveMessageAction"
process="process" name="s6-1">
<property name="session"
value="org.jboss.soa.overlord.samples.jbossesb.loan.broker.BrokerMain" />
<property name="operation" value="cancel" />
@@ -289,16 +289,16 @@
maxThreads="1"/>
</listeners>
<actions mep="OneWay">
- <action class="org.jboss.soa.overlord.jbossesb.actions.SetStateAction"
name="s7-1">
+ <action
class="org.jboss.soa.overlord.jbossesb.stateful.actions.SetStateAction"
name="s7-1">
<property name="session"
value="org.jboss.soa.overlord.samples.jbossesb.loan.broker.BrokerMain" />
<property name="variable" value="selectedSupplierDesc" />
<property name="messageExpression" value="//@supplierDesc"
/>
</action>
- <action class="org.jboss.soa.overlord.jbossesb.actions.SetStateAction"
name="s7-2">
+ <action
class="org.jboss.soa.overlord.jbossesb.stateful.actions.SetStateAction"
name="s7-2">
<property name="variable" value="selectedQuoteValue" />
<property name="messageExpression" value="//@quoteValue"
/>
</action>
- <action class="org.jboss.soa.overlord.jbossesb.actions.PerformAction"
+ <action
class="org.jboss.soa.overlord.jbossesb.stateful.actions.PerformAction"
process="process" name="s7-3">
<property name="serviceCategory"
value="ESBBroker.BrokerParticipant" />
<property name="serviceName" value="CompleteTransaction.main"
/>
@@ -319,7 +319,7 @@
maxThreads="1"/>
</listeners>
<actions mep="OneWay">
- <action
class="org.jboss.soa.overlord.jbossesb.actions.ReceiveMessageAction"
+ <action
class="org.jboss.soa.overlord.jbossesb.stateful.actions.ReceiveMessageAction"
process="process" name="s13-1">
<property name="session"
value="org.jboss.soa.overlord.samples.jbossesb.loan.broker.BrokerMain" />
<property name="operation" value="confirm" />
@@ -340,12 +340,12 @@
maxThreads="1"/>
</listeners>
<actions mep="OneWay">
- <action class="org.jboss.soa.overlord.jbossesb.actions.SetStateAction"
name="s17-2">
+ <action
class="org.jboss.soa.overlord.jbossesb.stateful.actions.SetStateAction"
name="s17-2">
<property name="session"
value="org.jboss.soa.overlord.samples.jbossesb.loan.broker.BrokerMain" />
<property name="variable" value="supplierIndex" />
<property name="stateExpression" value="nextSupplier()"
/>
</action>
- <action
class="org.jboss.soa.overlord.jbossesb.actions.ScheduleStateAction"
+ <action
class="org.jboss.soa.overlord.jbossesb.stateful.actions.ScheduleStateAction"
process="process" name="s17-3">
<property name="serviceCategory"
value="ESBBroker.BrokerParticipant" />
<property name="serviceName" value="ESBBrokerProcess.main.1"
/>
@@ -361,12 +361,12 @@
maxThreads="1"/>
</listeners>
<actions mep="OneWay">
- <action
class="org.jboss.soa.overlord.jbossesb.actions.CreateSessionAction"
+ <action
class="org.jboss.soa.overlord.jbossesb.stateful.actions.CreateSessionAction"
process="process" name="s8-1">
<property name="session"
value="org.jboss.soa.overlord.samples.jbossesb.loan.broker.Request4QuoteMain"
/>
</action>
- <action class="org.jboss.soa.overlord.jbossesb.actions.SetMessageAction"
name="s8-2">
+ <action
class="org.jboss.soa.overlord.jbossesb.stateful.actions.SetMessageAction"
name="s8-2">
<property name="headerProperty"
value="serviceDescriptionName" />
<property name="stateExpression"
value="supplier.serviceDescription" />
</action>
@@ -374,7 +374,7 @@
<action
class="org.jboss.soa.overlord.samples.jbossesb.loan.broker.SetRequestQuoteMessageAction"
name="s8-3">
</action>
- <action
class="org.jboss.soa.overlord.jbossesb.actions.SendMessageAction"
+ <action
class="org.jboss.soa.overlord.jbossesb.stateful.actions.SendMessageAction"
process="process" name="s8-4">
<property name="operation" value="getQuote" />
<property name="messageType" value="requestForQuote" />
@@ -399,7 +399,7 @@
maxThreads="1"/>
</listeners>
<actions mep="OneWay">
- <action
class="org.jboss.soa.overlord.jbossesb.actions.ReceiveMessageAction"
+ <action
class="org.jboss.soa.overlord.jbossesb.stateful.actions.ReceiveMessageAction"
process="process" name="s9-1">
<property name="session"
value="org.jboss.soa.overlord.samples.jbossesb.loan.broker.Request4QuoteMain"
/>
<property name="operation" value="getQuote" />
@@ -412,13 +412,13 @@
</identity>
</property>
</action>
- <action class="org.jboss.soa.overlord.jbossesb.actions.SetStateAction"
+ <action
class="org.jboss.soa.overlord.jbossesb.stateful.actions.SetStateAction"
process="process" name="s9-2">
<property name="variable" value="quote.serviceDescription"
/>
<property name="messageExpression" value="//@supplierDesc"
/>
</action>
- <action class="org.jboss.soa.overlord.jbossesb.actions.SetStateAction"
+ <action
class="org.jboss.soa.overlord.jbossesb.stateful.actions.SetStateAction"
process="process" name="s9-3">
<property name="variable" value="quoteValue" />
<property name="messageExpression" value="/quote" />
@@ -433,11 +433,11 @@
maxThreads="1"/>
</listeners>
<actions mep="OneWay">
- <action
class="org.jboss.soa.overlord.jbossesb.actions.CreateSessionAction"
+ <action
class="org.jboss.soa.overlord.jbossesb.stateful.actions.CreateSessionAction"
process="process" name="s10-1">
<property name="session"
value="org.jboss.soa.overlord.samples.jbossesb.loan.broker.CompleteTransactionMain"
/>
</action>
- <action
class="org.jboss.soa.overlord.jbossesb.actions.ReceiveMessageAction"
+ <action
class="org.jboss.soa.overlord.jbossesb.stateful.actions.ReceiveMessageAction"
process="process" name="s10-2">
<property name="operation" value="buy" />
<property name="messageType" value="buy" />
@@ -451,7 +451,7 @@
<action
class="org.jboss.soa.overlord.samples.jbossesb.loan.broker.SetCreditCheckRequestMessageAction"
process="process" name="s10-3">
</action>
- <action
class="org.jboss.soa.overlord.jbossesb.actions.SendMessageAction"
+ <action
class="org.jboss.soa.overlord.jbossesb.stateful.actions.SendMessageAction"
process="process" name="s10-4">
<property name="operation" value="checkCredit" />
<property name="messageType" value="CreditCheckRequest"
/>
@@ -475,7 +475,7 @@
maxThreads="1"/>
</listeners>
<actions mep="OneWay">
- <action
class="org.jboss.soa.overlord.jbossesb.actions.RetrieveSessionAction"
+ <action
class="org.jboss.soa.overlord.jbossesb.stateful.actions.RetrieveSessionAction"
process="process" name="s11-1">
<property name="session"
value="org.jboss.soa.overlord.samples.jbossesb.loan.broker.CompleteTransactionMain"
/>
<property name="serviceDescriptionName"
value="{http://www.jboss.org/overlord/loanBroker}CompleteTransaction... />
@@ -485,7 +485,7 @@
</identity>
</property>
</action>
- <action class="org.jboss.soa.overlord.jbossesb.actions.SwitchAction"
+ <action
class="org.jboss.soa.overlord.jbossesb.stateful.actions.SwitchAction"
process="process" name="s11-2">
<property name="paths">
<case service-category="ESBBroker.BrokerParticipant"
@@ -508,7 +508,7 @@
maxThreads="1"/>
</listeners>
<actions mep="OneWay">
- <action
class="org.jboss.soa.overlord.jbossesb.actions.ReceiveMessageAction"
+ <action
class="org.jboss.soa.overlord.jbossesb.stateful.actions.ReceiveMessageAction"
process="process" name="s12-1">
<property name="session"
value="org.jboss.soa.overlord.samples.jbossesb.loan.broker.CompleteTransactionMain"
/>
<property name="operation" value="checkCredit" />
@@ -520,13 +520,13 @@
</property>
</action>
- <action
class="org.jboss.soa.overlord.jbossesb.actions.SetMessageAction"
+ <action
class="org.jboss.soa.overlord.jbossesb.stateful.actions.SetMessageAction"
process="process" name="s12-2">
<property name="headerProperty" value="supplierDesc" />
<property name="stateExpression"
value="supplier.serviceDescription" />
</action>
- <action
class="org.jboss.soa.overlord.jbossesb.actions.SetMessageAction"
+ <action
class="org.jboss.soa.overlord.jbossesb.stateful.actions.SetMessageAction"
process="process" name="s12-3">
<property name="headerProperty" value="quoteValue" />
<property name="stateExpression" value="quote.value" />
@@ -536,7 +536,7 @@
process="process" name="s12-4">
</action>
- <action
class="org.jboss.soa.overlord.jbossesb.actions.SendMessageAction"
+ <action
class="org.jboss.soa.overlord.jbossesb.stateful.actions.SendMessageAction"
process="process" name="s12-5">
<property name="operation" value="confirm" />
<property name="messageType" value="orderConfirmed" />
@@ -560,7 +560,7 @@
maxThreads="1"/>
</listeners>
<actions mep="OneWay">
- <action
class="org.jboss.soa.overlord.jbossesb.actions.ReceiveMessageAction"
+ <action
class="org.jboss.soa.overlord.jbossesb.stateful.actions.ReceiveMessageAction"
process="process" name="s13-1">
<property name="session"
value="org.jboss.soa.overlord.samples.jbossesb.loan.broker.CompleteTransactionMain"
/>
<property name="operation" value="confirm" />
@@ -573,13 +573,13 @@
</property>
</action>
- <action class="org.jboss.soa.overlord.jbossesb.actions.SetStateAction"
+ <action
class="org.jboss.soa.overlord.jbossesb.stateful.actions.SetStateAction"
process="process" name="s13-2">
<property name="variable" value="confirmation.detail" />
<property name="messageExpression" value="/bookingReference"
/>
</action>
- <action
class="org.jboss.soa.overlord.jbossesb.actions.SendMessageAction"
+ <action
class="org.jboss.soa.overlord.jbossesb.stateful.actions.SendMessageAction"
process="process" name="s13-3">
<property name="operation" value="buy" />
<property name="messageType" value="bookingReference" />
@@ -600,7 +600,7 @@
maxThreads="1"/>
</listeners>
<actions mep="OneWay">
- <action
class="org.jboss.soa.overlord.jbossesb.actions.ReceiveMessageAction"
+ <action
class="org.jboss.soa.overlord.jbossesb.stateful.actions.ReceiveMessageAction"
process="process" name="s14-1">
<property name="session"
value="org.jboss.soa.overlord.samples.jbossesb.loan.broker.CompleteTransactionMain"
/>
<property name="operation" value="checkCredit" />
@@ -616,7 +616,7 @@
process="process" name="s14-2">
</action>
- <action
class="org.jboss.soa.overlord.jbossesb.actions.SendMessageAction"
+ <action
class="org.jboss.soa.overlord.jbossesb.stateful.actions.SendMessageAction"
process="process" name="s14-3">
<property name="operation" value="buy" />
<property name="messageType" value="orderRejected" />
Modified:
cdl/trunk/samples/jbossesb/brokerage/supplier/src/main/resources/META-INF/jboss-esb.xml
===================================================================
---
cdl/trunk/samples/jbossesb/brokerage/supplier/src/main/resources/META-INF/jboss-esb.xml 2009-02-26
02:02:25 UTC (rev 522)
+++
cdl/trunk/samples/jbossesb/brokerage/supplier/src/main/resources/META-INF/jboss-esb.xml 2009-02-26
08:08:52 UTC (rev 523)
@@ -27,7 +27,7 @@
maxThreads="1"/>
</listeners>
<actions mep="OneWay">
- <action
class="org.jboss.soa.overlord.jbossesb.actions.MessageRouterAction"
+ <action
class="org.jboss.soa.overlord.jbossesb.stateful.actions.MessageRouterAction"
process="process" name="su-1">
<property name="paths">
<route service-category="ESBBroker.Suppliers"
@@ -62,11 +62,11 @@
maxThreads="1"/>
</listeners>
<actions mep="OneWay">
- <action
class="org.jboss.soa.overlord.jbossesb.actions.CreateSessionAction"
+ <action
class="org.jboss.soa.overlord.jbossesb.stateful.actions.CreateSessionAction"
process="process" name="su11-1">
<property name="session"
value="org.jboss.soa.overlord.samples.jbossesb.supplier.SupplierRFQMain" />
</action>
- <action
class="org.jboss.soa.overlord.jbossesb.actions.ReceiveMessageAction"
+ <action
class="org.jboss.soa.overlord.jbossesb.stateful.actions.ReceiveMessageAction"
process="process" name="su11-2">
<property name="messageType" value="requestForQuote" />
<property name="clientEPR" value="broker" />
@@ -79,7 +79,7 @@
</action>
<action
class="org.jboss.soa.overlord.samples.jbossesb.supplier.SetQuoteMessageAction"
name="su11-3">
</action>
- <action
class="org.jboss.soa.overlord.jbossesb.actions.SendMessageAction"
+ <action
class="org.jboss.soa.overlord.jbossesb.stateful.actions.SendMessageAction"
process="process" name="su11-4">
<property name="messageType" value="quote" />
<property name="clientEPR" value="broker" />
@@ -100,11 +100,11 @@
maxThreads="1"/>
</listeners>
<actions mep="OneWay">
- <action
class="org.jboss.soa.overlord.jbossesb.actions.CreateSessionAction"
+ <action
class="org.jboss.soa.overlord.jbossesb.stateful.actions.CreateSessionAction"
process="process" name="su12-1">
<property name="session"
value="org.jboss.soa.overlord.samples.jbossesb.supplier.SupplierTxnMain" />
</action>
- <action
class="org.jboss.soa.overlord.jbossesb.actions.ReceiveMessageAction"
+ <action
class="org.jboss.soa.overlord.jbossesb.stateful.actions.ReceiveMessageAction"
process="process" name="su12-2">
<property name="messageType" value="orderConfirmed" />
<property name="clientEPR" value="broker" />
@@ -117,7 +117,7 @@
</action>
<action
class="org.jboss.soa.overlord.samples.jbossesb.supplier.SetOrderConfirmResponseAction"
name="su12-3">
</action>
- <action
class="org.jboss.soa.overlord.jbossesb.actions.SendMessageAction"
+ <action
class="org.jboss.soa.overlord.jbossesb.stateful.actions.SendMessageAction"
process="process" name="su12-4">
<property name="messageType" value="bookingReference" />
<property name="clientEPR" value="broker" />
Modified:
cdl/trunk/samples/jbossesb/common/creditAgency/src/main/resources/META-INF/jboss-esb.xml
===================================================================
---
cdl/trunk/samples/jbossesb/common/creditAgency/src/main/resources/META-INF/jboss-esb.xml 2009-02-26
02:02:25 UTC (rev 522)
+++
cdl/trunk/samples/jbossesb/common/creditAgency/src/main/resources/META-INF/jboss-esb.xml 2009-02-26
08:08:52 UTC (rev 523)
@@ -18,10 +18,10 @@
<jms-listener busidref="CreditAgencyService"
maxThreads="1" name="CreditAgencyServiceListener"/>
</listeners>
<actions mep="OneWay">
- <action
class="org.jboss.soa.overlord.jbossesb.actions.CreateSessionAction"
name="c1" process="process">
+ <action
class="org.jboss.soa.overlord.jbossesb.stateful.actions.CreateSessionAction"
name="c1" process="process">
<property name="session"
value="com.acme.services.creditAgency.CreditAgencyPurchase"/>
</action>
- <action
class="org.jboss.soa.overlord.jbossesb.actions.ReceiveMessageAction"
name="c2" process="process">
+ <action
class="org.jboss.soa.overlord.jbossesb.stateful.actions.ReceiveMessageAction"
name="c2" process="process">
<property name="operation"
value="checkCredit"/>
<property name="messageType"
value="CreditCheckRequest"/>
<property name="clientEPR"
value="broker"/>
@@ -31,7 +31,7 @@
</identity>
</property>
</action>
- <action
class="org.jboss.soa.overlord.jbossesb.actions.IfAction" name="c3"
process="process">
+ <action
class="org.jboss.soa.overlord.jbossesb.stateful.actions.IfAction"
name="c3" process="process">
<property name="paths">
<if expression="isCreditValid()"
immediate="true" service-category="PurchaseGoods.CreditAgency"
service-name="CreditAgency.decision1"/>
<else immediate="true"
service-category="PurchaseGoods.CreditAgency"
service-name="CreditAgency.decision2"/>
@@ -46,7 +46,7 @@
<actions mep="OneWay">
<action
class="com.acme.services.creditAgency.SetCreditCheckResponseMessageAction"
name="d2" process="process">
</action>
- <action
class="org.jboss.soa.overlord.jbossesb.actions.SendMessageAction"
name="d3" process="process">
+ <action
class="org.jboss.soa.overlord.jbossesb.stateful.actions.SendMessageAction"
name="d3" process="process">
<property name="session"
value="com.acme.services.creditAgency.CreditAgencyPurchase"/>
<property name="operation"
value="checkCredit"/>
<property name="messageType"
value="CreditCheckOk"/>
@@ -66,7 +66,7 @@
<actions mep="OneWay">
<action
class="com.acme.services.creditAgency.SetCreditCheckInvalidMessageAction"
name="e2" process="process">
</action>
- <action
class="org.jboss.soa.overlord.jbossesb.actions.SendMessageAction"
name="e3" process="process">
+ <action
class="org.jboss.soa.overlord.jbossesb.stateful.actions.SendMessageAction"
name="e3" process="process">
<property name="session"
value="com.acme.services.creditAgency.CreditAgencyPurchase"/>
<property name="operation"
value="checkCredit"/>
<property name="messageType"
value="CreditCheckInvalid"/>
Modified:
cdl/trunk/samples/jbossesb/purchasing/store/src/main/resources/META-INF/jboss-esb.xml
===================================================================
---
cdl/trunk/samples/jbossesb/purchasing/store/src/main/resources/META-INF/jboss-esb.xml 2009-02-26
02:02:25 UTC (rev 522)
+++
cdl/trunk/samples/jbossesb/purchasing/store/src/main/resources/META-INF/jboss-esb.xml 2009-02-26
08:08:52 UTC (rev 523)
@@ -33,10 +33,10 @@
<jms-listener busidref="StoreService"
maxThreads="1" name="StoreServiceListener"/>
</listeners>
<actions mep="OneWay">
- <action
class="org.jboss.soa.overlord.jbossesb.actions.CreateSessionAction"
name="a1" process="process">
+ <action
class="org.jboss.soa.overlord.jbossesb.stateful.actions.CreateSessionAction"
name="a1" process="process">
<property name="session"
value="com.acme.services.broker.PurchaseGoods"/>
</action>
- <action
class="org.jboss.soa.overlord.jbossesb.actions.ReceiveMessageAction"
name="a2" process="process">
+ <action
class="org.jboss.soa.overlord.jbossesb.stateful.actions.ReceiveMessageAction"
name="a2" process="process">
<property name="operation" value="buy"/>
<property name="messageType"
value="BuyRequest"/>
<property name="clientEPR"
value="client"/>
@@ -48,7 +48,7 @@
</action>
<action
class="com.acme.services.broker.SetCreditCheckRequestMessageAction"
name="a3" process="process">
</action>
- <action
class="org.jboss.soa.overlord.jbossesb.actions.SendMessageAction"
name="a4" process="process">
+ <action
class="org.jboss.soa.overlord.jbossesb.stateful.actions.SendMessageAction"
name="a4" process="process">
<property name="operation"
value="checkCredit"/>
<property name="messageType"
value="CreditCheckRequest"/>
<property name="serviceName"
value="CreditAgency.main"/>
@@ -68,7 +68,7 @@
<jms-listener busidref="StoreService2"
maxThreads="1" name="StoreServiceListener"/>
</listeners>
<actions mep="OneWay">
- <action
class="org.jboss.soa.overlord.jbossesb.actions.RetrieveSessionAction"
name="b1" process="process">
+ <action
class="org.jboss.soa.overlord.jbossesb.stateful.actions.RetrieveSessionAction"
name="b1" process="process">
<property name="session"
value="com.acme.services.broker.PurchaseGoods"/>
<property name="serviceDescriptionName"
value="{http://www.jboss.org/overlord/purchase}Store"/>
<property name="identities">
@@ -77,7 +77,7 @@
</identity>
</property>
</action>
- <action
class="org.jboss.soa.overlord.jbossesb.actions.SwitchAction" name="b2"
process="process">
+ <action
class="org.jboss.soa.overlord.jbossesb.stateful.actions.SwitchAction"
name="b2" process="process">
<property name="paths">
<case service-category="PurchaseGoods.Store"
service-name="CreditResponse1">
<message type="CreditCheckOk"/>
@@ -94,7 +94,7 @@
<jms-listener busidref="StoreService3"
maxThreads="1" name="StoreServiceListener"/>
</listeners>
<actions mep="OneWay">
- <action
class="org.jboss.soa.overlord.jbossesb.actions.ReceiveMessageAction"
name="b4" process="process">
+ <action
class="org.jboss.soa.overlord.jbossesb.stateful.actions.ReceiveMessageAction"
name="b4" process="process">
<property name="session"
value="com.acme.services.broker.PurchaseGoods"/>
<property name="operation"
value="checkCredit"/>
<property name="messageType"
value="CreditCheckOk"/>
@@ -105,7 +105,7 @@
</identity>
</property>
</action>
- <action
class="org.jboss.soa.overlord.jbossesb.actions.ParallelAction"
name="b5" process="process">
+ <action
class="org.jboss.soa.overlord.jbossesb.stateful.actions.ParallelAction"
name="b5" process="process">
<property name="paths">
<path immediate="true"
service-category="PurchaseGoods.Store"
service-name="StoreBranch1"/>
<path immediate="true"
service-category="PurchaseGoods.Store"
service-name="StoreBranch2"/>
@@ -119,7 +119,7 @@
<jms-listener busidref="StoreService4"
maxThreads="1" name="StoreServiceListener"/>
</listeners>
<actions mep="OneWay">
- <action
class="org.jboss.soa.overlord.jbossesb.actions.ScheduleStateAction"
name="b7" process="process">
+ <action
class="org.jboss.soa.overlord.jbossesb.stateful.actions.ScheduleStateAction"
name="b7" process="process">
<property name="session"
value="com.acme.services.broker.PurchaseGoods"/>
<property name="serviceName"
value="ReturnBuyerResponse"/>
<property name="serviceCategory"
value="PurchaseGoods.Store"/>
@@ -132,7 +132,7 @@
<jms-listener busidref="StoreService5"
maxThreads="1" name="StoreServiceListener"/>
</listeners>
<actions mep="OneWay">
- <action
class="org.jboss.soa.overlord.jbossesb.actions.ScheduleStateAction"
name="b9" process="process">
+ <action
class="org.jboss.soa.overlord.jbossesb.stateful.actions.ScheduleStateAction"
name="b9" process="process">
<property name="session"
value="com.acme.services.broker.PurchaseGoods"/>
<property name="serviceName"
value="ReturnBuyerResponse"/>
<property name="serviceCategory"
value="PurchaseGoods.Store"/>
@@ -147,7 +147,7 @@
<actions mep="OneWay">
<action
class="com.acme.services.broker.SetBuyResponseMessageAction"
name="b11" process="process">
</action>
- <action
class="org.jboss.soa.overlord.jbossesb.actions.SendMessageAction"
name="b12" process="process">
+ <action
class="org.jboss.soa.overlord.jbossesb.stateful.actions.SendMessageAction"
name="b12" process="process">
<property name="session"
value="com.acme.services.broker.PurchaseGoods"/>
<property name="operation" value="buy"/>
<property name="messageType"
value="BuyConfirmed"/>
@@ -165,7 +165,7 @@
<jms-listener busidref="StoreService7"
maxThreads="1" name="StoreServiceListener"/>
</listeners>
<actions mep="OneWay">
- <action
class="org.jboss.soa.overlord.jbossesb.actions.ReceiveMessageAction"
name="b14" process="process">
+ <action
class="org.jboss.soa.overlord.jbossesb.stateful.actions.ReceiveMessageAction"
name="b14" process="process">
<property name="session"
value="com.acme.services.broker.PurchaseGoods"/>
<property name="operation"
value="checkCredit"/>
<property name="messageType"
value="CreditCheckInvalid"/>
@@ -178,7 +178,7 @@
</action>
<action
class="com.acme.services.broker.SetBuyFailedMessageAction" name="b15"
process="process">
</action>
- <action
class="org.jboss.soa.overlord.jbossesb.actions.SendMessageAction"
name="b16" process="process">
+ <action
class="org.jboss.soa.overlord.jbossesb.stateful.actions.SendMessageAction"
name="b16" process="process">
<property name="operation" value="buy"/>
<property name="messageType"
value="BuyFailed"/>
<property name="clientEPR"
value="client"/>