Overlord SVN: r462 - in cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src: java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions and 5 other directories.
by overlord-commits@lists.jboss.org
Author: objectiser
Date: 2009-01-13 15:01:58 -0500 (Tue, 13 Jan 2009)
New Revision: 462
Modified:
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/DefaultESBService.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/ESBAction.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/ESBService.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/AbstractESBAction.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/CreateSessionAction.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/PerformAction.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateless/MessageRouterAction.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/change/AbstractESBModelChangeRule.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/DefaultESBServiceTest.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/TestESBAction.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/TestESBService.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/CreateSessionActionTest.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/IfActionTest.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/MessageRouterActionTest.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/ParallelActionTest.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/PerformActionTest.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/ReceiveMessageActionTest.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/RetrieveSessionActionTest.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/ScheduleStateActionTest.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/SendMessageActionTest.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/SetMessageActionTest.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/SetStateActionTest.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/SwitchActionTest.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/WhenActionTest.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/WhileActionTest.java
Log:
Refactored some method names to be more meaningful - e.g. isCreateSession - so as not to get confused with the stateful 'CreateSessionAction', where it can also be used to indicate the start of a 'session type' even in the stateless approach. Also fixed some methods that relied on finding a 'stateful' action to be able to get properties such as conversation type and service description name.
Modified: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/DefaultESBService.java
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/DefaultESBService.java 2009-01-12 21:17:36 UTC (rev 461)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/DefaultESBService.java 2009-01-13 20:01:58 UTC (rev 462)
@@ -377,7 +377,7 @@
ESBAction action=getFirstSessionBasedAction();
if (action != null) {
- if (action.isCreateSession()) {
+ if (action.isSessionType()) {
String bool=action.getPropertyValue(ROOT_PROPERTY);
if (bool != null) {
ret = bool.equalsIgnoreCase("true");
@@ -412,17 +412,25 @@
}
/**
- * This method determines whether the ESB service descriptor
- * starts with a CreateSessionAction.
+ * This method determines whether the ESB service descriptor represents
+ * a new session type.
*
- * @return Whether the service has a CreateSessionAction
+ * @return Whether the service descriptor represents a new session type
*/
- public boolean isCreateSession() {
+ public boolean isSessionType() {
boolean ret=false;
- ESBAction action=getFirstSessionBasedAction();
+ ESBAction action=null;
+ if (isStateless()) {
+ if (getActions().size() > 0) {
+ action = getActions().get(0);
+ }
+ } else {
+ action = getFirstSessionBasedAction();
+ }
+
if (action != null) {
- ret = action.isCreateSession();
+ ret = action.isSessionType();
}
return(ret);
@@ -508,32 +516,41 @@
*/
public String getServiceDescriptionName() {
String ret=null;
- ESBAction action=getFirstSessionBasedAction();
- if (action != null) {
- if (action.isCreateSession() || (action.getActionClass() != null &&
- action.getActionClass().equals(RETRIEVE_SESSION_ACTION_CLASS))) {
+ if (isStateless()) {
+ ESBAction action=getGatewayAction();
+
+ if (action != null) {
ret = action.getPropertyValue(SERVICE_DESCRIPTION_NAME_PROPERTY);
+ }
+ } else {
+ ESBAction action=getFirstSessionBasedAction();
+
+ if (action != null) {
+ if (action.isSessionType() || (action.getActionClass() != null &&
+ action.getActionClass().equals(RETRIEVE_SESSION_ACTION_CLASS))) {
+ ret = action.getPropertyValue(SERVICE_DESCRIPTION_NAME_PROPERTY);
+
+ if (ret == null) {
+ String session=action.getPropertyValue(BUSINESS_OBJECT_TYPE_PROPERTY);
+
+ java.lang.annotation.Annotation annotation=
+ getServiceAnnotation(session);
- if (ret == null) {
- String session=action.getPropertyValue(BUSINESS_OBJECT_TYPE_PROPERTY);
-
- java.lang.annotation.Annotation annotation=
- getServiceAnnotation(session);
-
- if (annotation != null) {
- try {
- java.lang.reflect.Method method=
- annotation.getClass().getMethod(NAME_ATTR, (Class<?>[])null);
-
- Object val=method.invoke(annotation, (Object[])null);
-
- if (val instanceof String) {
- ret = (String)val;
+ if (annotation != null) {
+ try {
+ java.lang.reflect.Method method=
+ annotation.getClass().getMethod(NAME_ATTR, (Class<?>[])null);
+
+ Object val=method.invoke(annotation, (Object[])null);
+
+ if (val instanceof String) {
+ ret = (String)val;
+ }
+ } catch(Throwable t) {
+ logger.log(java.util.logging.Level.SEVERE,
+ "Failed to get 'name' annotation value", t);
}
- } catch(Throwable t) {
- logger.log(java.util.logging.Level.SEVERE,
- "Failed to get 'name' annotation value", t);
}
}
}
@@ -551,32 +568,41 @@
*/
public String getConversationType() {
String ret=null;
- ESBAction action=getFirstSessionBasedAction();
- if (action != null) {
- if (action.isCreateSession()) {
+ if (isStateless()) {
+ ESBAction action=getGatewayAction();
+
+ if (action != null) {
ret = action.getPropertyValue(CONVERSATION_TYPE_PROPERTY);
+ }
+ } else {
+ ESBAction action=getFirstSessionBasedAction();
+
+ if (action != null) {
+ if (action.isSessionType()) {
+ ret = action.getPropertyValue(CONVERSATION_TYPE_PROPERTY);
+
+ if (ret == null) {
+ String session=action.getPropertyValue(BUSINESS_OBJECT_TYPE_PROPERTY);
+
+ java.lang.annotation.Annotation annotation=
+ getServiceAnnotation(session);
- if (ret == null) {
- String session=action.getPropertyValue(BUSINESS_OBJECT_TYPE_PROPERTY);
-
- java.lang.annotation.Annotation annotation=
- getServiceAnnotation(session);
-
- if (annotation != null) {
- try {
- java.lang.reflect.Method method=
- annotation.getClass().getMethod(CONVERSATION_TYPE_PROPERTY,
- (Class<?>[])null);
-
- Object val=method.invoke(annotation, (Object[])null);
-
- if (val instanceof String) {
- ret = (String)val;
+ if (annotation != null) {
+ try {
+ java.lang.reflect.Method method=
+ annotation.getClass().getMethod(CONVERSATION_TYPE_PROPERTY,
+ (Class<?>[])null);
+
+ Object val=method.invoke(annotation, (Object[])null);
+
+ if (val instanceof String) {
+ ret = (String)val;
+ }
+ } catch(Throwable t) {
+ logger.log(java.util.logging.Level.SEVERE,
+ "Failed to get 'name' annotation value", t);
}
- } catch(Throwable t) {
- logger.log(java.util.logging.Level.SEVERE,
- "Failed to get 'name' annotation value", t);
}
}
}
@@ -656,12 +682,16 @@
public Conversation convert(ConversionContext context) {
Conversation ret=null;
- if (isCreateSession()) {
+ if (isSessionType()) {
ret = new Conversation();
ret.derivedFrom(this);
ret.getBlock().derivedFrom(this);
+ // Determine if conversation is stateless
+ ret.setStateless(isStateless());
+
+ // Configure model name
ModelName modelName=new ModelName();
modelName.setName(getServiceDescriptionName());
Modified: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/ESBAction.java
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/ESBAction.java 2009-01-12 21:17:36 UTC (rev 461)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/ESBAction.java 2009-01-13 20:01:58 UTC (rev 462)
@@ -58,11 +58,11 @@
/**
* This method determines whether the ESB action represents
- * a CreateSessionAction.
+ * a new session type.
*
- * @return Whether the action is a CreateSessionAction
+ * @return Whether the action represents a new session type
*/
- public boolean isCreateSession();
+ public boolean isSessionType();
/**
* This method determines whether the action is a gateway
Modified: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/ESBService.java
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/ESBService.java 2009-01-12 21:17:36 UTC (rev 461)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/ESBService.java 2009-01-13 20:01:58 UTC (rev 462)
@@ -111,12 +111,12 @@
public boolean isRoot();
/**
- * This method determines whether the ESB service descriptor
- * starts with a CreateSessionAction.
+ * This method determines whether the ESB service descriptor represents
+ * a new session type.
*
- * @return Whether the service has a CreateSessionAction
+ * @return Whether the service descriptor represents a new session type
*/
- public boolean isCreateSession();
+ public boolean isSessionType();
/**
* This method determines whether the service is a gateway
Modified: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/AbstractESBAction.java
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/AbstractESBAction.java 2009-01-12 21:17:36 UTC (rev 461)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/AbstractESBAction.java 2009-01-13 20:01:58 UTC (rev 462)
@@ -241,11 +241,11 @@
/**
* This method determines whether the ESB action represents
- * a CreateSessionAction.
+ * a new session type.
*
- * @return Whether the action is a CreateSessionAction
+ * @return Whether the action represents a new session type
*/
- public boolean isCreateSession() {
+ public boolean isSessionType() {
return(false);
}
Modified: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/CreateSessionAction.java
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/CreateSessionAction.java 2009-01-12 21:17:36 UTC (rev 461)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/CreateSessionAction.java 2009-01-13 20:01:58 UTC (rev 462)
@@ -61,11 +61,12 @@
/**
* This method determines whether the ESB action represents
- * a CreateSessionAction.
+ * a new session type.
*
- * @return Whether the action is a CreateSessionAction
+ * @return Whether the action represents a new session type
*/
- public boolean isCreateSession() {
+ @Override
+ public boolean isSessionType() {
return(true);
}
Modified: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/PerformAction.java
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/PerformAction.java 2009-01-12 21:17:36 UTC (rev 461)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/PerformAction.java 2009-01-13 20:01:58 UTC (rev 462)
@@ -142,7 +142,7 @@
// Check if performed state starts with a create session action
if (m_service != null &&
- m_service.isCreateSession() == false) {
+ m_service.isSessionType() == false) {
l.error(new ModelIssue(this, org.scribble.util.MessageUtil.format(
java.util.PropertyResourceBundle.getBundle(
"org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
Modified: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateless/MessageRouterAction.java
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateless/MessageRouterAction.java 2009-01-12 21:17:36 UTC (rev 461)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateless/MessageRouterAction.java 2009-01-13 20:01:58 UTC (rev 462)
@@ -49,11 +49,8 @@
public static final String PATHS = "paths";
public static final String MESSAGE_ELEMENT="message";
public static final String TYPE_ATTR="type";
+ public static final String CONVERSATION_TYPE = "conversationType";
- public static final String ELSE = "else";
- public static final String ELSEIF = "elseif";
- public static final String IF = "if";
-
/**
* The constructor for the action.
*
@@ -77,16 +74,6 @@
super(service, ESBActionFactory.getConversationAction(
MessageRouterAction.class));
}
-
- /**
- * This method determines whether the action is related to a behavioural
- * session.
- *
- * @return Whether the action is session based
- */
- public boolean isSessionBased() {
- return(false);
- }
/**
* This method determines whether the action is a gateway
@@ -94,9 +81,21 @@
*
* @return Whether the action is a gateway
*/
+ @Override
public boolean isGateway() {
return(true);
}
+
+ /**
+ * This method determines whether the ESB action represents
+ * a new session type.
+ *
+ * @return Whether the action represents a new session type
+ */
+ @Override
+ public boolean isSessionType() {
+ return(true);
+ }
/**
* This method adds a route to the message router action.
@@ -210,6 +209,7 @@
@Override
protected java.util.List<String> getMandatoryProperties() {
java.util.List<String> ret=super.getMandatoryProperties();
+ ret.add(CONVERSATION_TYPE);
ret.add(PATHS);
return(ret);
}
@@ -323,8 +323,7 @@
org.w3c.dom.Node n=nl.item(i);
if (n instanceof org.w3c.dom.Element) {
- if (n.getNodeName().equals(IF) ||
- n.getNodeName().equals(ELSEIF)) {
+ if (n.getNodeName().equals(ROUTE)) {
String category=((org.w3c.dom.Element)n).getAttribute(SERVICE_CATEGORY);
String name=((org.w3c.dom.Element)n).getAttribute(SERVICE_NAME);
@@ -338,18 +337,6 @@
if (service != null) {
service.convert(cond.getContents(), context);
}
- } else if (n.getNodeName().equals(ELSE)) {
- String category=((org.w3c.dom.Element)n).getAttribute(SERVICE_CATEGORY);
- String name=((org.w3c.dom.Element)n).getAttribute(SERVICE_NAME);
-
- Block block=new Block();
- choice.setElseBlock(block);
-
- ESBService service=getService().getModel().getService(category, name);
-
- if (service != null) {
- service.convert(block.getContents(), context);
- }
}
}
}
Modified: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/change/AbstractESBModelChangeRule.java
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/change/AbstractESBModelChangeRule.java 2009-01-12 21:17:36 UTC (rev 461)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/change/AbstractESBModelChangeRule.java 2009-01-13 20:01:58 UTC (rev 462)
@@ -113,7 +113,7 @@
for (int i=0; ret == false && i < pos; i++) {
ESBAction action=service.getActions().get(i);
- if (action.isSessionBased() && !action.isCreateSession()) {
+ if (action.isSessionBased() && !action.isSessionType()) {
ret = true;
}
}
Modified: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/DefaultESBServiceTest.java
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/DefaultESBServiceTest.java 2009-01-12 21:17:36 UTC (rev 461)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/DefaultESBServiceTest.java 2009-01-13 20:01:58 UTC (rev 462)
@@ -148,7 +148,7 @@
service.getActions().add(act1);
- if (service.isCreateSession() == false) {
+ if (service.isSessionType() == false) {
fail("Service should be 'create session'");
}
}
@@ -160,7 +160,7 @@
service.getActions().add(act1);
- if (service.isCreateSession()) {
+ if (service.isSessionType()) {
fail("Service should NOT be 'create session'");
}
}
Modified: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/TestESBAction.java
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/TestESBAction.java 2009-01-12 21:17:36 UTC (rev 461)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/TestESBAction.java 2009-01-13 20:01:58 UTC (rev 462)
@@ -84,7 +84,7 @@
m_sessionBased = bool;
}
- public boolean isCreateSession() {
+ public boolean isSessionType() {
return(m_createSession);
}
Modified: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/TestESBService.java
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/TestESBService.java 2009-01-12 21:17:36 UTC (rev 461)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/TestESBService.java 2009-01-13 20:01:58 UTC (rev 462)
@@ -152,7 +152,7 @@
m_createSession = bool;
}
- public boolean isCreateSession() {
+ public boolean isSessionType() {
return(m_createSession);
}
Modified: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/CreateSessionActionTest.java
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/CreateSessionActionTest.java 2009-01-12 21:17:36 UTC (rev 461)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/CreateSessionActionTest.java 2009-01-13 20:01:58 UTC (rev 462)
@@ -172,7 +172,7 @@
CreateSessionAction action=new CreateSessionAction(service, null);
- if (action.isCreateSession() == false) {
+ if (action.isSessionType() == false) {
fail("Action is not flagged as a 'CreateSession'");
}
}
Modified: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/IfActionTest.java
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/IfActionTest.java 2009-01-12 21:17:36 UTC (rev 461)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/IfActionTest.java 2009-01-13 20:01:58 UTC (rev 462)
@@ -613,7 +613,7 @@
IfAction action=new IfAction(service, null);
- if (action.isCreateSession() == true) {
+ if (action.isSessionType() == true) {
fail("Action is flagged as a 'CreateSession'");
}
}
Modified: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/MessageRouterActionTest.java
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/MessageRouterActionTest.java 2009-01-12 21:17:36 UTC (rev 461)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/MessageRouterActionTest.java 2009-01-13 20:01:58 UTC (rev 462)
@@ -255,7 +255,7 @@
MessageRouterAction action=new MessageRouterAction(service, null);
- if (action.isCreateSession() == true) {
+ if (action.isSessionType() == true) {
fail("Action is flagged as a 'CreateSession'");
}
}
Modified: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/ParallelActionTest.java
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/ParallelActionTest.java 2009-01-12 21:17:36 UTC (rev 461)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/ParallelActionTest.java 2009-01-13 20:01:58 UTC (rev 462)
@@ -509,7 +509,7 @@
ParallelAction action=new ParallelAction(service, null);
- if (action.isCreateSession() == true) {
+ if (action.isSessionType() == true) {
fail("Action is flagged as a 'CreateSession'");
}
}
Modified: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/PerformActionTest.java
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/PerformActionTest.java 2009-01-12 21:17:36 UTC (rev 461)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/PerformActionTest.java 2009-01-13 20:01:58 UTC (rev 462)
@@ -742,7 +742,7 @@
PerformAction action=new PerformAction(service, null);
- if (action.isCreateSession() == true) {
+ if (action.isSessionType() == true) {
fail("Action is flagged as a 'CreateSession'");
}
}
Modified: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/ReceiveMessageActionTest.java
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/ReceiveMessageActionTest.java 2009-01-12 21:17:36 UTC (rev 461)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/ReceiveMessageActionTest.java 2009-01-13 20:01:58 UTC (rev 462)
@@ -270,7 +270,7 @@
ReceiveMessageAction action=new ReceiveMessageAction(service, null);
- if (action.isCreateSession() == true) {
+ if (action.isSessionType() == true) {
fail("Action is flagged as a 'CreateSession'");
}
}
Modified: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/RetrieveSessionActionTest.java
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/RetrieveSessionActionTest.java 2009-01-12 21:17:36 UTC (rev 461)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/RetrieveSessionActionTest.java 2009-01-13 20:01:58 UTC (rev 462)
@@ -111,7 +111,7 @@
RetrieveSessionAction action=new RetrieveSessionAction(service, null);
- if (action.isCreateSession() == true) {
+ if (action.isSessionType() == true) {
fail("Action is flagged as a 'CreateSession'");
}
}
Modified: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/ScheduleStateActionTest.java
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/ScheduleStateActionTest.java 2009-01-12 21:17:36 UTC (rev 461)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/ScheduleStateActionTest.java 2009-01-13 20:01:58 UTC (rev 462)
@@ -240,7 +240,7 @@
ScheduleStateAction action=new ScheduleStateAction(service, null);
- if (action.isCreateSession() == true) {
+ if (action.isSessionType() == true) {
fail("Action is flagged as a 'CreateSession'");
}
}
Modified: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/SendMessageActionTest.java
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/SendMessageActionTest.java 2009-01-12 21:17:36 UTC (rev 461)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/SendMessageActionTest.java 2009-01-13 20:01:58 UTC (rev 462)
@@ -346,7 +346,7 @@
SendMessageAction action=new SendMessageAction(service, null);
- if (action.isCreateSession() == true) {
+ if (action.isSessionType() == true) {
fail("Action is flagged as a 'CreateSession'");
}
}
Modified: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/SetMessageActionTest.java
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/SetMessageActionTest.java 2009-01-12 21:17:36 UTC (rev 461)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/SetMessageActionTest.java 2009-01-13 20:01:58 UTC (rev 462)
@@ -57,7 +57,7 @@
SetMessageAction action=new SetMessageAction(service, null);
- if (action.isCreateSession() == true) {
+ if (action.isSessionType() == true) {
fail("Action is flagged as a 'CreateSession'");
}
}
Modified: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/SetStateActionTest.java
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/SetStateActionTest.java 2009-01-12 21:17:36 UTC (rev 461)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/SetStateActionTest.java 2009-01-13 20:01:58 UTC (rev 462)
@@ -312,7 +312,7 @@
SetStateAction action=new SetStateAction(service, null);
- if (action.isCreateSession() == true) {
+ if (action.isSessionType() == true) {
fail("Action is flagged as a 'CreateSession'");
}
}
Modified: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/SwitchActionTest.java
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/SwitchActionTest.java 2009-01-12 21:17:36 UTC (rev 461)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/SwitchActionTest.java 2009-01-13 20:01:58 UTC (rev 462)
@@ -365,7 +365,7 @@
SwitchAction action=new SwitchAction(service, null);
- if (action.isCreateSession() == true) {
+ if (action.isSessionType() == true) {
fail("Action is flagged as a 'CreateSession'");
}
}
Modified: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/WhenActionTest.java
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/WhenActionTest.java 2009-01-12 21:17:36 UTC (rev 461)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/WhenActionTest.java 2009-01-13 20:01:58 UTC (rev 462)
@@ -357,7 +357,7 @@
WhenAction action=new WhenAction(service, null);
- if (action.isCreateSession() == true) {
+ if (action.isSessionType() == true) {
fail("Action is flagged as a 'CreateSession'");
}
}
Modified: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/WhileActionTest.java
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/WhileActionTest.java 2009-01-12 21:17:36 UTC (rev 461)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/WhileActionTest.java 2009-01-13 20:01:58 UTC (rev 462)
@@ -548,7 +548,7 @@
WhileAction action=new WhileAction(service, null);
- if (action.isCreateSession() == true) {
+ if (action.isSessionType() == true) {
fail("Action is flagged as a 'CreateSession'");
}
}
15 years, 3 months
Overlord SVN: r461 - cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions.
by overlord-commits@lists.jboss.org
Author: objectiser
Date: 2009-01-12 16:17:36 -0500 (Mon, 12 Jan 2009)
New Revision: 461
Added:
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/AbstractESBAction.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/Messages.properties
Log:
Initial work on defining a set of 'stateless' conversational actions, along side the previous 'stateful' equivalents.
Added: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/AbstractESBAction.java
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/AbstractESBAction.java (rev 0)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/AbstractESBAction.java 2009-01-12 21:17:36 UTC (rev 461)
@@ -0,0 +1,594 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, 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.
+ */
+package org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions;
+
+import java.util.logging.Logger;
+
+import org.scribble.model.*;
+import org.scribble.model.admin.ModelIssue;
+import org.scribble.model.admin.ModelListener;
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.*;
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.util.ESBModelUtil;
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.util.ProblemDefinitions;
+
+/**
+ * This is the generic ESB action class.
+ *
+ * @author gary
+ */
+public abstract class AbstractESBAction extends ModelObject
+ implements ESBAction {
+
+ public static final String ACTION_ELEMENT = "action";
+ public static final String VALUE_ATTR = "value";
+ public static final String NAME_ATTR = "name";
+ public static final String PROPERTY_ELEMENT = "property";
+ public static final String CLASS_PROPERTY = "class";
+
+ /**
+ * The constructor for initializing the action based on
+ * an existing DOM element.
+ */
+ protected AbstractESBAction(ESBService service,
+ org.w3c.dom.Element action) {
+ initExistingAction(service, action);
+ }
+
+ /**
+ * The contructor for initializing a new action.
+ */
+ protected AbstractESBAction(ESBService service,
+ String actionClass) {
+ initNewAction(service, actionClass);
+ }
+
+ /**
+ * This method initializes the action.
+ *
+ * @param service The reference to the service in which
+ * the action is contained
+ * @param actionClass The action class
+ */
+ protected void initNewAction(ESBService service,
+ String actionClass) {
+ m_service = service;
+
+ m_action = service.getService().
+ getOwnerDocument().createElement(ACTION_ELEMENT);
+
+ m_action.setAttribute(CLASS_PROPERTY, actionClass);
+
+ getSource().setObject(this);
+ }
+
+ /**
+ * This method initializes the action.
+ *
+ * @param service The reference to the service in which
+ * the action is contained
+ * @param action The XML configuration details for the action
+ */
+ protected void initExistingAction(ESBService service,
+ org.w3c.dom.Element action) {
+ m_service = service;
+ m_action = action;
+
+ int servicesStartPos=-1;
+
+ if (m_service.getModel() != null &&
+ m_service.getModel().getOriginalContents() != null &&
+ (servicesStartPos=m_service.getModel().
+ getOriginalContents().indexOf("<services>")) != -1) {
+
+ // Find positional information
+ int servCount=m_service.getServicePosition();
+ int actionCount=getActionPosition();
+
+ String str=m_service.getModel().getOriginalContents();
+
+ int startPosition=str.indexOf("<service", servicesStartPos+2);
+ int endPosition=-1;
+ int loggedEndPosition=-1;
+
+ while (startPosition != -1 && servCount > 0) {
+ servCount--;
+
+ endPosition = str.indexOf("</service>", startPosition);
+
+ if (servCount > 0) {
+ startPosition=str.indexOf("<service", endPosition);
+ }
+ }
+
+ int actionsStartPos=-1;
+
+ if (actionCount > 0 &&
+ startPosition != -1 && endPosition != -1 &&
+ (actionsStartPos=str.indexOf("<actions",
+ startPosition)) != -1 &&
+ actionsStartPos < endPosition) {
+ startPosition=str.indexOf("<action", actionsStartPos+2);
+ endPosition=-1;
+
+ while (startPosition != -1 && actionCount > 0) {
+ actionCount--;
+
+ loggedEndPosition = str.indexOf('>', startPosition);
+
+ endPosition = str.indexOf("</action>", startPosition);
+
+ if (actionCount > 0) {
+ startPosition=str.indexOf("<action", endPosition);
+ }
+ }
+
+ // Check whether single line element
+ int inlineEndPos=str.indexOf("/>", startPosition);
+ int nextStartPos=str.indexOf("<", startPosition+1);
+
+ if (inlineEndPos != -1 && inlineEndPos < nextStartPos) {
+ endPosition = inlineEndPos;
+ }
+ }
+
+ getSource().setStartPosition(startPosition);
+ getSource().setEndPosition(loggedEndPosition);
+
+ getSource().getProperties().put("path",
+ ESBModelUtil.getPath(m_action));
+
+ getSource().setObject(this);
+ }
+ }
+
+ /**
+ * This method initializes the links with the ESB service descriptors
+ * identified in each path of the action.
+ */
+ public void initializeLinks() {
+ }
+
+ /**
+ * This method validates the ESB action and reports warnings or
+ * errors to the supplied model listener.
+ *
+ * @param l The model listener
+ */
+ public void validate(ModelListener l) {
+
+ java.util.List<String> mandatory=getMandatoryProperties();
+
+ for (int i=0; i < mandatory.size(); i++) {
+ if (getPropertyValue(mandatory.get(i)) == null) {
+ java.util.Map<String,Object> props=new java.util.HashMap<String,Object>();
+ props.put(ProblemDefinitions.PROBLEM_PROPERTY,
+ mandatory.get(i));
+ l.error(new ModelIssue(this, org.scribble.util.MessageUtil.format(
+ java.util.PropertyResourceBundle.getBundle(
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
+ "_NOT_SPECIFIED_PROPERTY",
+ new String[]{mandatory.get(i)}), props));
+ }
+ }
+
+ java.util.List<String> propNames=getPropertyNames();
+
+ for (int i=0; i < propNames.size(); i++) {
+ String propName=propNames.get(i);
+
+ if (getOptionalProperties().contains(propName) == false &&
+ getMandatoryProperties().contains(propName) == false) {
+ l.error(new ModelIssue(this, org.scribble.util.MessageUtil.format(
+ java.util.PropertyResourceBundle.getBundle(
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
+ "_UNKNOWN_PROPERTY",
+ new String[]{propName})));
+ }
+ }
+
+ // Validate links
+ for (int i=0; i < m_links.size(); i++) {
+ ESBLink link=(ESBLink)m_links.get(i);
+
+ if (link.getService() == null) {
+ // If target service not found, then report error
+ // unless it is a remote service, so defined in a
+ // different file
+ if (link.isRemote() == false) {
+ l.error(new ModelIssue(this, org.scribble.util.MessageUtil.format(
+ java.util.PropertyResourceBundle.getBundle(
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.Messages"),
+ "_NOT_FOUND_SERVICE_DESCRIPTOR",
+ new String[]{link.getCategory(),link.getName()})));
+ }
+ }
+ }
+ }
+
+ /**
+ * This method determines if the action represents a loop construct.
+ *
+ * @return Whether the action represents a loop construct
+ */
+ public boolean isLoop() {
+ return(false);
+ }
+
+ /**
+ * This method determines whether the action is related to a behavioural
+ * session.
+ *
+ * @return Whether the action is session based
+ */
+ public boolean isSessionBased() {
+ return(false);
+ }
+
+ /**
+ * This method determines whether the ESB action represents
+ * a CreateSessionAction.
+ *
+ * @return Whether the action is a CreateSessionAction
+ */
+ public boolean isCreateSession() {
+ return(false);
+ }
+
+ /**
+ * This method determines whether the action is a gateway
+ * for inbound requests.
+ *
+ * @return Whether the action is a gateway
+ */
+ public boolean isGateway() {
+ return(false);
+ }
+
+ /**
+ * This method determines whether the gateway service is
+ * related to a stateless session.
+ *
+ * @return Whether the gateway service is stateless
+ */
+ public boolean isStateless() {
+ return(false);
+ }
+
+ /**
+ * This method indicates whether this action performs another
+ * sub-conversation.
+ *
+ * @return Whether the action is a 'perform'
+ */
+ public boolean isPerform() {
+ return(false);
+ }
+
+ /**
+ * This method indicates whether the action is an initiator.
+ * Initiator actions must precede any other session based
+ * action, within an ESB service.
+ *
+ * @return Whether the action is an initiator
+ */
+ public boolean isInitiator() {
+ return(false);
+ }
+
+ /**
+ * This method returns the mandatory property names.
+ *
+ * @return The mandatory property names
+ */
+ protected java.util.List<String> getMandatoryProperties() {
+ java.util.List<String> ret=new java.util.Vector<String>();
+ return(ret);
+ }
+
+ /**
+ * This method returns the optional property names.
+ *
+ * @return The optional property names
+ */
+ protected java.util.List<String> getOptionalProperties() {
+ java.util.List<String> ret=new java.util.Vector<String>();
+ ret.add(DefaultESBService.SERVICE_DESCRIPTION_NAME_PROPERTY);
+ return(ret);
+ }
+
+ /**
+ * This method returns the action's class name.
+ *
+ * @return The action's class name
+ */
+ public String getActionClass() {
+ String ret=null;
+
+ if (m_action != null) {
+ ret = m_action.getAttribute(CLASS_PROPERTY);
+ }
+
+ return(ret);
+ }
+
+ /**
+ * This method returns the property value associated
+ * with the supplied name.
+ *
+ * @param property The property name
+ * @return The property value, or null if not found
+ */
+ public String getPropertyValue(String property) {
+ String ret=null;
+
+ if (m_action != null) {
+ org.w3c.dom.NodeList nl=m_action.getChildNodes();
+
+ for (int i=0; ret == null && i < nl.getLength(); i++) {
+ if (nl.item(i) instanceof org.w3c.dom.Element &&
+ nl.item(i).getNodeName().equals(PROPERTY_ELEMENT) &&
+ ((org.w3c.dom.Element)nl.item(i)).getAttribute(NAME_ATTR).
+ equals(property)) {
+ ret = ((org.w3c.dom.Element)nl.item(i)).getAttribute(VALUE_ATTR);
+ }
+ }
+ }
+
+ return(ret);
+ }
+
+ /**
+ * This method determines the property value, associated
+ * with the supplied name, is defined.
+ *
+ * @param property The property name
+ * @return Whether the property has been defined
+ */
+ public boolean hasProperty(String property) {
+ boolean ret=false;
+
+ if (m_action != null) {
+ org.w3c.dom.NodeList nl=m_action.getChildNodes();
+
+ for (int i=0; ret == false && i < nl.getLength(); i++) {
+ if (nl.item(i) instanceof org.w3c.dom.Element &&
+ nl.item(i).getNodeName().equals(PROPERTY_ELEMENT) &&
+ ((org.w3c.dom.Element)nl.item(i)).getAttribute(NAME_ATTR).
+ equals(property)) {
+ ret = true;
+ }
+ }
+ }
+
+ return(ret);
+ }
+
+ /**
+ * This method returns the element associated with the
+ * requested property. If the property does not exist, then
+ * it will be created.
+ *
+ * @param property The property
+ * @return The element
+ */
+ public org.w3c.dom.Element getPropertyElement(String property) {
+ org.w3c.dom.Element ret=null;
+
+ if (m_action != null) {
+ org.w3c.dom.NodeList nl=
+ getAction().getElementsByTagName(PROPERTY_ELEMENT);
+
+ for (int i=0; ret == null && i < nl.getLength(); i++) {
+ if (nl.item(i) instanceof org.w3c.dom.Element) {
+ String propName=((org.w3c.dom.Element)nl.item(i)).getAttribute(NAME_ATTR);
+
+ if (propName != null && propName.equals(property)) {
+ ret = (org.w3c.dom.Element)nl.item(i);
+ }
+ }
+ }
+
+ if (ret == null) {
+ ret = getAction().getOwnerDocument().createElement(PROPERTY_ELEMENT);
+ ret.setAttribute(NAME_ATTR, property);
+
+ m_action.appendChild(ret);
+ }
+ }
+
+ return(ret);
+ }
+
+ /**
+ * This method removes the named property from the action.
+ *
+ * @param property The property name
+ */
+ public void removePropertyElement(String property) {
+
+ if (m_action != null) {
+ org.w3c.dom.Node prop=null;
+ org.w3c.dom.NodeList nl=
+ getAction().getElementsByTagName(PROPERTY_ELEMENT);
+
+ for (int i=0; prop == null && i < nl.getLength(); i++) {
+ if (nl.item(i) instanceof org.w3c.dom.Element) {
+ String propName=((org.w3c.dom.Element)nl.item(i)).getAttribute(NAME_ATTR);
+
+ if (propName != null && propName.equals(property)) {
+ prop = nl.item(i);
+ }
+ }
+ }
+
+ if (prop != null) {
+ m_action.removeChild(prop);
+ }
+ }
+ }
+
+ /**
+ * This method returns the list of property names defined for
+ * this action.
+ *
+ * @return The list of property names
+ */
+ public java.util.List<String> getPropertyNames() {
+ java.util.List<String> ret=new java.util.Vector<String>();
+
+ if (m_action != null) {
+ org.w3c.dom.NodeList nl=m_action.getChildNodes();
+
+ for (int i=0; i < nl.getLength(); i++) {
+ if (nl.item(i) instanceof org.w3c.dom.Element &&
+ nl.item(i).getNodeName().equals(PROPERTY_ELEMENT)) {
+ ret.add(((org.w3c.dom.Element)nl.item(i)).getAttribute(NAME_ATTR));
+ }
+ }
+ }
+
+ return(ret);
+ }
+
+ /**
+ * This method returns the 'property' child nodes, associated with the
+ * supplied property name, within the action configuration.
+ *
+ * @param property The property name
+ * @return The list of child nodes
+ */
+ public org.w3c.dom.NodeList getPropertyChildNodes(String property) {
+ org.w3c.dom.NodeList ret=null;
+
+ org.w3c.dom.NodeList nl=m_action.getChildNodes();
+
+ for (int i=0; ret == null && i < nl.getLength(); i++) {
+ if (nl.item(i) instanceof org.w3c.dom.Element &&
+ nl.item(i).getNodeName().equals(PROPERTY_ELEMENT) &&
+ ((org.w3c.dom.Element)nl.item(i)).getAttribute(NAME_ATTR).
+ equals(property)) {
+ ret = ((org.w3c.dom.Element)nl.item(i)).getChildNodes();
+ }
+ }
+
+ return(ret);
+ }
+
+ /**
+ * This method returns the reference to the service that contains the
+ * action.
+ *
+ * @return The service
+ */
+ public ESBService getService() {
+ return(m_service);
+ }
+
+ /**
+ * This method sets the service description name property.
+ *
+ * @param name The service description name
+ */
+ public void setServiceDescriptionName(String name) {
+
+ org.w3c.dom.Element prop=getPropertyElement(
+ DefaultESBService.SERVICE_DESCRIPTION_NAME_PROPERTY);
+
+ if (prop != null) {
+ prop.setAttribute(VALUE_ATTR, name);
+ }
+ }
+
+ /**
+ * This method sets the business object type property.
+ *
+ * @param name The business object type
+ */
+ public void setBusinessObjectType(String type) {
+
+ org.w3c.dom.Element prop=getPropertyElement(
+ DefaultESBService.BUSINESS_OBJECT_TYPE_PROPERTY);
+
+ if (prop != null) {
+ prop.setAttribute(VALUE_ATTR, type);
+ }
+ }
+
+ /**
+ * This method returns the XML configuration representation of the action.
+ *
+ * @return The XML configuration for the action
+ */
+ public org.w3c.dom.Element getAction() {
+ return(m_action);
+ }
+
+ /**
+ * This method converts the ESB action into an equivalent
+ * behavioural description for conformance checking.
+ *
+ * @param activities The list of activities that will contain
+ * the converted action(s)
+ * @param context The conversion context
+ */
+ public abstract void convert(java.util.List<Activity> activities,
+ ConversionContext context);
+
+ /**
+ * This method returns the node position of the action configuration
+ * within the service descriptor.
+ *
+ * @return The action position
+ */
+ protected int getActionPosition() {
+ org.w3c.dom.Element service=(org.w3c.dom.Element)
+ getAction().getParentNode().getParentNode();
+
+ int actionCount=0;
+ boolean f_end=false;
+
+ org.w3c.dom.NodeList acts=service.getElementsByTagName(ACTION_ELEMENT);
+
+ for (int i=0; f_end == false &&
+ i < acts.getLength(); i++) {
+ org.w3c.dom.Node act=acts.item(i);
+
+ actionCount++;
+ if (act == getAction()) {
+ f_end = true;
+ }
+ }
+
+ return(actionCount);
+ }
+
+ /**
+ * This method returns the list of links established by this action.
+ *
+ * @return The list of links
+ */
+ protected java.util.List<ESBLink> getLinks() {
+ return(m_links);
+ }
+
+ private static Logger logger = Logger.getLogger("org.jboss.tools.overlord.cdl.runtime.jbossesb.model");
+
+ private ESBService m_service=null;
+ private org.w3c.dom.Element m_action=null;
+ private java.util.List<ESBLink> m_links=new java.util.Vector<ESBLink>();
+}
Added: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/Messages.properties
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/Messages.properties (rev 0)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/Messages.properties 2009-01-12 21:17:36 UTC (rev 461)
@@ -0,0 +1,17 @@
+# /*
+# * JBoss, Home of Professional Open Source
+# * Copyright 2008, Red Hat Middleware LLC, 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.
+# */
15 years, 3 months
Overlord SVN: r460 - cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions.
by overlord-commits@lists.jboss.org
Author: objectiser
Date: 2009-01-12 16:17:01 -0500 (Mon, 12 Jan 2009)
New Revision: 460
Removed:
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/AbstractESBAction.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/Messages.properties
Log:
Initial work on defining a set of 'stateless' conversational actions, along side the previous 'stateful' equivalents.
Deleted: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/AbstractESBAction.java
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/AbstractESBAction.java 2009-01-12 21:15:25 UTC (rev 459)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/AbstractESBAction.java 2009-01-12 21:17:01 UTC (rev 460)
@@ -1,626 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, 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.
- */
-package org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions;
-
-import java.util.logging.Logger;
-
-import org.scribble.model.*;
-import org.scribble.model.admin.ModelIssue;
-import org.scribble.model.admin.ModelListener;
-import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.*;
-import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.util.ESBModelUtil;
-import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.util.ProblemDefinitions;
-
-/**
- * This is the generic ESB action class.
- *
- * @author gary
- */
-public abstract class AbstractESBAction extends ModelObject
- implements ESBAction {
-
- public static final String IDENTITIES = "identities";
- public static final String ACTION_ELEMENT = "action";
- public static final String VALUE_ATTR = "value";
- public static final String NAME_ATTR = "name";
- public static final String PROPERTY_ELEMENT = "property";
- public static final String CLASS_PROPERTY = "class";
-
- /**
- * The constructor for initializing the action based on
- * an existing DOM element.
- */
- protected AbstractESBAction(ESBService service,
- org.w3c.dom.Element action) {
- initExistingAction(service, action);
- }
-
- /**
- * The contructor for initializing a new action.
- */
- protected AbstractESBAction(ESBService service,
- String actionClass) {
- initNewAction(service, actionClass);
- }
-
- /**
- * This method initializes the action.
- *
- * @param service The reference to the service in which
- * the action is contained
- * @param actionClass The action class
- */
- protected void initNewAction(ESBService service,
- String actionClass) {
- m_service = service;
-
- m_action = service.getService().
- getOwnerDocument().createElement(ACTION_ELEMENT);
-
- m_action.setAttribute(CLASS_PROPERTY, actionClass);
-
- getSource().setObject(this);
- }
-
- /**
- * This method initializes the action.
- *
- * @param service The reference to the service in which
- * the action is contained
- * @param action The XML configuration details for the action
- */
- protected void initExistingAction(ESBService service,
- org.w3c.dom.Element action) {
- m_service = service;
- m_action = action;
-
- int servicesStartPos=-1;
-
- if (m_service.getModel() != null &&
- m_service.getModel().getOriginalContents() != null &&
- (servicesStartPos=m_service.getModel().
- getOriginalContents().indexOf("<services>")) != -1) {
-
- // Find positional information
- int servCount=m_service.getServicePosition();
- int actionCount=getActionPosition();
-
- String str=m_service.getModel().getOriginalContents();
-
- int startPosition=str.indexOf("<service", servicesStartPos+2);
- int endPosition=-1;
- int loggedEndPosition=-1;
-
- while (startPosition != -1 && servCount > 0) {
- servCount--;
-
- endPosition = str.indexOf("</service>", startPosition);
-
- if (servCount > 0) {
- startPosition=str.indexOf("<service", endPosition);
- }
- }
-
- int actionsStartPos=-1;
-
- if (actionCount > 0 &&
- startPosition != -1 && endPosition != -1 &&
- (actionsStartPos=str.indexOf("<actions",
- startPosition)) != -1 &&
- actionsStartPos < endPosition) {
- startPosition=str.indexOf("<action", actionsStartPos+2);
- endPosition=-1;
-
- while (startPosition != -1 && actionCount > 0) {
- actionCount--;
-
- loggedEndPosition = str.indexOf('>', startPosition);
-
- endPosition = str.indexOf("</action>", startPosition);
-
- if (actionCount > 0) {
- startPosition=str.indexOf("<action", endPosition);
- }
- }
-
- // Check whether single line element
- int inlineEndPos=str.indexOf("/>", startPosition);
- int nextStartPos=str.indexOf("<", startPosition+1);
-
- if (inlineEndPos != -1 && inlineEndPos < nextStartPos) {
- endPosition = inlineEndPos;
- }
- }
-
- getSource().setStartPosition(startPosition);
- getSource().setEndPosition(loggedEndPosition);
-
- getSource().getProperties().put("path",
- ESBModelUtil.getPath(m_action));
-
- getSource().setObject(this);
- }
- }
-
- /**
- * This method initializes the links with the ESB service descriptors
- * identified in each path of the action.
- */
- public void initializeLinks() {
- }
-
- /**
- * This method validates the ESB action and reports warnings or
- * errors to the supplied model listener.
- *
- * @param l The model listener
- */
- public void validate(ModelListener l) {
-
- java.util.List<String> mandatory=getMandatoryProperties();
-
- for (int i=0; i < mandatory.size(); i++) {
- if (getPropertyValue(mandatory.get(i)) == null) {
- java.util.Map<String,Object> props=new java.util.HashMap<String,Object>();
- props.put(ProblemDefinitions.PROBLEM_PROPERTY,
- mandatory.get(i));
- l.error(new ModelIssue(this, org.scribble.util.MessageUtil.format(
- java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.Messages"),
- "_NOT_SPECIFIED_PROPERTY",
- new String[]{mandatory.get(i)}), props));
- }
- }
-
- java.util.List<String> propNames=getPropertyNames();
-
- for (int i=0; i < propNames.size(); i++) {
- String propName=propNames.get(i);
-
- if (getOptionalProperties().contains(propName) == false &&
- getMandatoryProperties().contains(propName) == false) {
- l.error(new ModelIssue(this, org.scribble.util.MessageUtil.format(
- java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.Messages"),
- "_UNKNOWN_PROPERTY",
- new String[]{propName})));
- }
- }
-
- String session=getPropertyValue(DefaultESBService.BUSINESS_OBJECT_TYPE_PROPERTY);
-
- if (session != null) {
- // Validate that the business object type exists
- try {
- ClassLoader cl=
- org.jboss.tools.overlord.cdl.runtime.jbossesb.model.util.ClasspathUtil.getClassLoader(getService().getModel());
-
- try {
- Class.forName(session, true, cl);
- } catch(ClassNotFoundException cfne) {
- l.error(new ModelIssue(this, org.scribble.util.MessageUtil.format(
- java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.Messages"),
- "_NOT_FOUND_BUSINESS_OBJECT_TYPE",
- new String[]{session})));
- }
-
- } catch(Exception e) {
- logger.log(java.util.logging.Level.SEVERE,
- "Failed to load business class '"+session+"'", e);
- }
- }
-
- // Validate links
- for (int i=0; i < m_links.size(); i++) {
- ESBLink link=(ESBLink)m_links.get(i);
-
- if (link.getService() == null) {
- // If target service not found, then report error
- // unless it is a remote service, so defined in a
- // different file
- if (link.isRemote() == false) {
- l.error(new ModelIssue(this, org.scribble.util.MessageUtil.format(
- java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.Messages"),
- "_NOT_FOUND_SERVICE_DESCRIPTOR",
- new String[]{link.getCategory(),link.getName()})));
- }
- } else if (getService().getSessionName() != null &&
- isPerform() == false && link.isRemote() == false &&
- link.getService().getSessionName() != null &&
- getService().getSessionName().equals(
- link.getService().getSessionName()) == false) {
-
- java.util.Map<String,Object> props=new java.util.HashMap<String,Object>();
- props.put(ProblemDefinitions.PROBLEM_PROPERTY,
- DefaultESBService.BUSINESS_OBJECT_TYPE_PROPERTY);
-
- l.error(new ModelIssue(this, org.scribble.util.MessageUtil.format(
- java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.Messages"),
- "_MISMATCH_SESSION_CLASS",
- new String[]{link.getCategory(),link.getName()}), props));
- }
- }
- }
-
- /**
- * This method determines if the action represents a loop construct.
- *
- * @return Whether the action represents a loop construct
- */
- public boolean isLoop() {
- return(false);
- }
-
- /**
- * This method determines whether the action is related to a behavioural
- * session.
- *
- * @return Whether the action is session based
- */
- public boolean isSessionBased() {
- return(true);
- }
-
- /**
- * This method determines whether the ESB action represents
- * a CreateSessionAction.
- *
- * @return Whether the action is a CreateSessionAction
- */
- public boolean isCreateSession() {
- return(false);
- }
-
- /**
- * This method determines whether the action is a gateway
- * for inbound requests.
- *
- * @return Whether the action is a gateway
- */
- public boolean isGateway() {
- return(false);
- }
-
- /**
- * This method indicates whether this action performs another
- * sub-conversation.
- *
- * @return Whether the action is a 'perform'
- */
- public boolean isPerform() {
- return(false);
- }
-
- /**
- * This method indicates whether the action is an initiator.
- * Initiator actions must precede any other session based
- * action, within an ESB service.
- *
- * @return Whether the action is an initiator
- */
- public boolean isInitiator() {
- return(false);
- }
-
- /**
- * This method returns the mandatory property names.
- *
- * @return The mandatory property names
- */
- protected java.util.List<String> getMandatoryProperties() {
- java.util.List<String> ret=new java.util.Vector<String>();
- return(ret);
- }
-
- /**
- * This method returns the optional property names.
- *
- * @return The optional property names
- */
- protected java.util.List<String> getOptionalProperties() {
- java.util.List<String> ret=new java.util.Vector<String>();
- ret.add(DefaultESBService.BUSINESS_OBJECT_TYPE_PROPERTY);
- ret.add(IDENTITIES);
- ret.add(DefaultESBService.SERVICE_DESCRIPTION_NAME_PROPERTY);
- return(ret);
- }
-
- /**
- * This method returns the action's class name.
- *
- * @return The action's class name
- */
- public String getActionClass() {
- String ret=null;
-
- if (m_action != null) {
- ret = m_action.getAttribute(CLASS_PROPERTY);
- }
-
- return(ret);
- }
-
- /**
- * This method returns the property value associated
- * with the supplied name.
- *
- * @param property The property name
- * @return The property value, or null if not found
- */
- public String getPropertyValue(String property) {
- String ret=null;
-
- if (m_action != null) {
- org.w3c.dom.NodeList nl=m_action.getChildNodes();
-
- for (int i=0; ret == null && i < nl.getLength(); i++) {
- if (nl.item(i) instanceof org.w3c.dom.Element &&
- nl.item(i).getNodeName().equals(PROPERTY_ELEMENT) &&
- ((org.w3c.dom.Element)nl.item(i)).getAttribute(NAME_ATTR).
- equals(property)) {
- ret = ((org.w3c.dom.Element)nl.item(i)).getAttribute(VALUE_ATTR);
- }
- }
- }
-
- return(ret);
- }
-
- /**
- * This method determines the property value, associated
- * with the supplied name, is defined.
- *
- * @param property The property name
- * @return Whether the property has been defined
- */
- public boolean hasProperty(String property) {
- boolean ret=false;
-
- if (m_action != null) {
- org.w3c.dom.NodeList nl=m_action.getChildNodes();
-
- for (int i=0; ret == false && i < nl.getLength(); i++) {
- if (nl.item(i) instanceof org.w3c.dom.Element &&
- nl.item(i).getNodeName().equals(PROPERTY_ELEMENT) &&
- ((org.w3c.dom.Element)nl.item(i)).getAttribute(NAME_ATTR).
- equals(property)) {
- ret = true;
- }
- }
- }
-
- return(ret);
- }
-
- /**
- * This method returns the element associated with the
- * requested property. If the property does not exist, then
- * it will be created.
- *
- * @param property The property
- * @return The element
- */
- public org.w3c.dom.Element getPropertyElement(String property) {
- org.w3c.dom.Element ret=null;
-
- if (m_action != null) {
- org.w3c.dom.NodeList nl=
- getAction().getElementsByTagName(PROPERTY_ELEMENT);
-
- for (int i=0; ret == null && i < nl.getLength(); i++) {
- if (nl.item(i) instanceof org.w3c.dom.Element) {
- String propName=((org.w3c.dom.Element)nl.item(i)).getAttribute(NAME_ATTR);
-
- if (propName != null && propName.equals(property)) {
- ret = (org.w3c.dom.Element)nl.item(i);
- }
- }
- }
-
- if (ret == null) {
- ret = getAction().getOwnerDocument().createElement(PROPERTY_ELEMENT);
- ret.setAttribute(NAME_ATTR, property);
-
- m_action.appendChild(ret);
- }
- }
-
- return(ret);
- }
-
- /**
- * This method removes the named property from the action.
- *
- * @param property The property name
- */
- public void removePropertyElement(String property) {
-
- if (m_action != null) {
- org.w3c.dom.Node prop=null;
- org.w3c.dom.NodeList nl=
- getAction().getElementsByTagName(PROPERTY_ELEMENT);
-
- for (int i=0; prop == null && i < nl.getLength(); i++) {
- if (nl.item(i) instanceof org.w3c.dom.Element) {
- String propName=((org.w3c.dom.Element)nl.item(i)).getAttribute(NAME_ATTR);
-
- if (propName != null && propName.equals(property)) {
- prop = nl.item(i);
- }
- }
- }
-
- if (prop != null) {
- m_action.removeChild(prop);
- }
- }
- }
-
- /**
- * This method returns the list of property names defined for
- * this action.
- *
- * @return The list of property names
- */
- public java.util.List<String> getPropertyNames() {
- java.util.List<String> ret=new java.util.Vector<String>();
-
- if (m_action != null) {
- org.w3c.dom.NodeList nl=m_action.getChildNodes();
-
- for (int i=0; i < nl.getLength(); i++) {
- if (nl.item(i) instanceof org.w3c.dom.Element &&
- nl.item(i).getNodeName().equals(PROPERTY_ELEMENT)) {
- ret.add(((org.w3c.dom.Element)nl.item(i)).getAttribute(NAME_ATTR));
- }
- }
- }
-
- return(ret);
- }
-
- /**
- * This method returns the 'property' child nodes, associated with the
- * supplied property name, within the action configuration.
- *
- * @param property The property name
- * @return The list of child nodes
- */
- public org.w3c.dom.NodeList getPropertyChildNodes(String property) {
- org.w3c.dom.NodeList ret=null;
-
- org.w3c.dom.NodeList nl=m_action.getChildNodes();
-
- for (int i=0; ret == null && i < nl.getLength(); i++) {
- if (nl.item(i) instanceof org.w3c.dom.Element &&
- nl.item(i).getNodeName().equals(PROPERTY_ELEMENT) &&
- ((org.w3c.dom.Element)nl.item(i)).getAttribute(NAME_ATTR).
- equals(property)) {
- ret = ((org.w3c.dom.Element)nl.item(i)).getChildNodes();
- }
- }
-
- return(ret);
- }
-
- /**
- * This method returns the reference to the service that contains the
- * action.
- *
- * @return The service
- */
- public ESBService getService() {
- return(m_service);
- }
-
- /**
- * This method sets the service description name property.
- *
- * @param name The service description name
- */
- public void setServiceDescriptionName(String name) {
-
- org.w3c.dom.Element prop=getPropertyElement(
- DefaultESBService.SERVICE_DESCRIPTION_NAME_PROPERTY);
-
- if (prop != null) {
- prop.setAttribute(VALUE_ATTR, name);
- }
- }
-
- /**
- * This method sets the business object type property.
- *
- * @param name The business object type
- */
- public void setBusinessObjectType(String type) {
-
- org.w3c.dom.Element prop=getPropertyElement(
- DefaultESBService.BUSINESS_OBJECT_TYPE_PROPERTY);
-
- if (prop != null) {
- prop.setAttribute(VALUE_ATTR, type);
- }
- }
-
- /**
- * This method returns the XML configuration representation of the action.
- *
- * @return The XML configuration for the action
- */
- public org.w3c.dom.Element getAction() {
- return(m_action);
- }
-
- /**
- * This method returns the list of links established by this action.
- *
- * @return The list of links
- */
- protected java.util.List<ESBLink> getLinks() {
- return(m_links);
- }
-
- /**
- * This method converts the ESB action into an equivalent
- * behavioural description for conformance checking.
- *
- * @param activities The list of activities that will contain
- * the converted action(s)
- * @param context The conversion context
- */
- public abstract void convert(java.util.List<Activity> activities,
- ConversionContext context);
-
- /**
- * This method returns the node position of the action configuration
- * within the service descriptor.
- *
- * @return The action position
- */
- protected int getActionPosition() {
- org.w3c.dom.Element service=(org.w3c.dom.Element)
- getAction().getParentNode().getParentNode();
-
- int actionCount=0;
- boolean f_end=false;
-
- org.w3c.dom.NodeList acts=service.getElementsByTagName(ACTION_ELEMENT);
-
- for (int i=0; f_end == false &&
- i < acts.getLength(); i++) {
- org.w3c.dom.Node act=acts.item(i);
-
- actionCount++;
- if (act == getAction()) {
- f_end = true;
- }
- }
-
- return(actionCount);
- }
-
- private static Logger logger = Logger.getLogger("org.jboss.tools.overlord.cdl.runtime.jbossesb.model");
-
- private ESBService m_service=null;
- private org.w3c.dom.Element m_action=null;
- private java.util.List<ESBLink> m_links=new java.util.Vector<ESBLink>();
-}
Deleted: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/Messages.properties
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/Messages.properties 2009-01-12 21:15:25 UTC (rev 459)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/Messages.properties 2009-01-12 21:17:01 UTC (rev 460)
@@ -1,47 +0,0 @@
-# /*
-# * JBoss, Home of Professional Open Source
-# * Copyright 2008, Red Hat Middleware LLC, 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.
-# */
-
-_BOOLEAN=Boolean property '{0}' can only have a 'true' or 'false' value
-_CANNOT_INITIATE_NON_ROOT=Cannot 'initiate' non-root service descriptor for category '{0}' and name '{1}'
-_CANNOT_SESSION_BASED_ACTIONS_WITH_ROUTER=Cannot define MessageRouterAction with session based actions in service descriptor
-_IF_ORDER_WRONG=IfAction must have an 'if' path, followed by zero or more 'elseif' paths and ending with an optional 'else' path
-_INVALID_PROPERTY_TYPE=Property '{0}' on class '{1}' must be of type '{2}'
-_MISMATCH_SESSION_CLASS=Session class mismatch with service descriptor for category '{0}' and name '{1}'
-_MULTIPLE_JOINS=Action has multiple joins
-_MUST_DEFINE_SINGLE_WHILE_PATH=While action must have a single 'while' path
-_MUST_DEFINE_SINGLE_WHILE_EXIT=While action must have a single 'exit' path
-_MUST_INITIATE_ROOT=Must 'initiate' root service descriptor for category '{0}' and name '{1}'
-_NOT_FOUND_VARIABLE=Variable '{0}' could not be found on class '{1}'
-_NOT_FOUND_VARIABLE_PROPERTY=Variable '{0}' contains property '{1}' that could not be found on class '{2}'
-_NOT_FOUND_PERFORM_CREATE_SESSION=Perform action can only invoke a service descriptor that starts with a CreateSessionAction
-_NOT_READABLE_PROPERTY=Property '{0}' on class '{1}' is not readable
-_NOT_SPECIFIED_CONVERSATION_TYPE=Conversation type must be specified on root service descriptor
-_NOT_SPECIFIED_CONVERSATION_TYPE_ROLE=Conversation type '{0}' must specify a role name following the '@' symbol
-_NOT_SPECIFIED_PROPERTY=Property '{0}' must be specified
-_NOT_SPECIFIED_REQ_RESP_EPR=Send does not contain request service category/name or response client EPR
-_NOT_WRITABLE_PROPERTY=Property '{0}' on class '{1}' is not writable
-_MUST_BE_FIRST_ACTION='{0}' action must be first in the service descriptor
-_MUST_SPECIFY_STATE_OR_MESSAGE_EXPRESSION=Must specify either a State OR Message based expression
-_PARALLEL_MORE_THAN_TWO_PATHS=Parallel action must specify two or more paths
-_PARALLEL_PATH_AFTER_JOIN=Parallel path must not be defined after a join
-_PATH_SERVICE_DETAILS_MISSING=One or more paths are missing the service cateogry and/or name
-_ROUTER_ONE_OR_MORE_PATHS=MessageRouter action must specify one or more routes
-_SWITCH_ONE_OR_MORE_PATHS=Switch action must specify atleast one case
-_UNKNOWN_PROPERTY=Property '{0}' is unknown for this action
-_WHEN_ONE_OR_MORE_PATHS=When action must specify atleast one entry
-_WHILE_PATH_AFTER_EXIT=While path must not be defined after an exit
15 years, 3 months
Overlord SVN: r459 - in cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src: java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions and 6 other directories.
by overlord-commits@lists.jboss.org
Author: objectiser
Date: 2009-01-12 16:15:25 -0500 (Mon, 12 Jan 2009)
New Revision: 459
Added:
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/AbstractInteractionMessageAction.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/AbstractStatefulESBAction.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/CreateSessionAction.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/IfAction.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/MessageRouterAction.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/Messages.properties
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/ParallelAction.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/PerformAction.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/ReceiveMessageAction.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/RetrieveSessionAction.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/ScheduleStateAction.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/SendMessageAction.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/SetMessageAction.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/SetStateAction.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/SwitchAction.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/UnsupportedAction.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/WhenAction.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/WhileAction.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateless/
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateless/AbstractInteractionMessageAction.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateless/IfAction.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateless/MessageRouterAction.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateless/ReceiveMessageAction.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateless/SendMessageAction.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateless/SwitchAction.java
Removed:
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/AbstractInteractionMessageAction.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/CreateSessionAction.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/IfAction.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/MessageRouterAction.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/ParallelAction.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/PerformAction.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/ReceiveMessageAction.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/RetrieveSessionAction.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/ScheduleStateAction.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/SendMessageAction.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/SetMessageAction.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/SetStateAction.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/SwitchAction.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/UnsupportedAction.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/WhenAction.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/WhileAction.java
Modified:
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/DefaultESBService.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/ESBAction.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/ESBActionFactory.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/ESBService.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/change/AbstractESBModelChangeRule.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/change/ConversationInteractionModelChangeRule.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/change/ConversationModelChangeRule.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/change/IfModelChangeRule.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/change/LanguageToConversationModelChangeRule.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/change/MessageSignatureModelChangeRule.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/change/ParallelModelChangeRule.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/change/RunModelChangeRule.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/change/SpawnModelChangeRule.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/change/TypeReferenceModelChangeRule.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/change/WhenModelChangeRule.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/change/WhileModelChangeRule.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/DefaultESBServiceTest.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/TestESBAction.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/TestESBService.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/CreateSessionActionTest.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/IfActionTest.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/MessageRouterActionTest.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/ParallelActionTest.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/PerformActionTest.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/ReceiveMessageActionTest.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/RetrieveSessionActionTest.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/ScheduleStateActionTest.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/SendMessageActionTest.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/SetMessageActionTest.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/SetStateActionTest.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/SwitchActionTest.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/WhenActionTest.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/WhileActionTest.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/change/ConversationInteractionModelChangeRuleTest.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/change/IfModelChangeRuleTest.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/change/ParallelModelChangeRuleTest.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/change/RunModelChangeRuleTest.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/change/SpawnModelChangeRuleTest.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/change/WhenModelChangeRuleTest.java
cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/change/WhileModelChangeRuleTest.java
Log:
Initial work on defining a set of 'stateless' conversational actions, along side the previous 'stateful' equivalents.
Modified: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/DefaultESBService.java
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/DefaultESBService.java 2009-01-08 13:25:36 UTC (rev 458)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/DefaultESBService.java 2009-01-12 21:15:25 UTC (rev 459)
@@ -366,33 +366,42 @@
*/
public boolean isRoot() {
boolean ret=false;
- ESBAction action=getFirstSessionBasedAction();
- if (action != null) {
- if (action.isCreateSession()) {
- String bool=action.getPropertyValue(ROOT_PROPERTY);
- if (bool != null) {
- ret = bool.equalsIgnoreCase("true");
- } else {
- String session=action.getPropertyValue(BUSINESS_OBJECT_TYPE_PROPERTY);
-
- java.lang.annotation.Annotation annotation=
- getServiceAnnotation(session);
-
- if (annotation != null) {
- try {
- java.lang.reflect.Method method=
- annotation.getClass().getMethod(ROOT_PROPERTY,
- (Class<?>[])null);
-
- Object val=method.invoke(annotation, (Object[])null);
-
- if (val instanceof Boolean) {
- ret = ((Boolean)val).booleanValue();
+ if (isStateless()) {
+ // Check for gateway service
+ ret = isGateway();
+
+ } else {
+ // Determine if the root property is true
+ // on the create session action
+ ESBAction action=getFirstSessionBasedAction();
+
+ if (action != null) {
+ if (action.isCreateSession()) {
+ String bool=action.getPropertyValue(ROOT_PROPERTY);
+ if (bool != null) {
+ ret = bool.equalsIgnoreCase("true");
+ } else {
+ String session=action.getPropertyValue(BUSINESS_OBJECT_TYPE_PROPERTY);
+
+ java.lang.annotation.Annotation annotation=
+ getServiceAnnotation(session);
+
+ if (annotation != null) {
+ try {
+ java.lang.reflect.Method method=
+ annotation.getClass().getMethod(ROOT_PROPERTY,
+ (Class<?>[])null);
+
+ Object val=method.invoke(annotation, (Object[])null);
+
+ if (val instanceof Boolean) {
+ ret = ((Boolean)val).booleanValue();
+ }
+ } catch(Throwable t) {
+ logger.log(java.util.logging.Level.SEVERE,
+ "Failed to get 'root' annotation value", t);
}
- } catch(Throwable t) {
- logger.log(java.util.logging.Level.SEVERE,
- "Failed to get 'root' annotation value", t);
}
}
}
@@ -454,6 +463,24 @@
}
/**
+ * This method determines whether the gateway service is
+ * related to a stateless session.
+ *
+ * @return Whether the gateway service is stateless
+ */
+ public boolean isStateless() {
+ boolean ret=false;
+
+ for (int i=0; i < m_actions.size(); i++) {
+ if (m_actions.get(i).isGateway()) {
+ ret = m_actions.get(i).isGateway();
+ }
+ }
+
+ return(ret);
+ }
+
+ /**
* This method returns the first session based action in the
* service descriptor.
*
Modified: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/ESBAction.java
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/ESBAction.java 2009-01-08 13:25:36 UTC (rev 458)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/ESBAction.java 2009-01-12 21:15:25 UTC (rev 459)
@@ -73,6 +73,15 @@
public boolean isGateway();
/**
+ * This method determines whether a gateway action is
+ * stateless. This method is only relevant when the
+ * isGateway() method returns true.
+ *
+ * @return Whether the action is a stateless
+ */
+ public boolean isStateless();
+
+ /**
* This method indicates whether this action performs another
* sub-conversation.
*
Modified: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/ESBActionFactory.java
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/ESBActionFactory.java 2009-01-08 13:25:36 UTC (rev 458)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/ESBActionFactory.java 2009-01-12 21:15:25 UTC (rev 459)
@@ -19,7 +19,7 @@
import java.util.logging.Logger;
-import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.UnsupportedAction;
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.UnsupportedAction;
/**
* This class provides a factory for ESBAction instances.
@@ -29,10 +29,12 @@
public class ESBActionFactory {
public static final String MODEL_ACTION_PACKAGE =
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions";
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.";
public static final String CLASS_ATTR = "class";
public static final String CONVERSATION_ACTION_PACKAGE =
- "org.jboss.soa.overlord.jbossesb.actions";
+ "org.jboss.soa.overlord.jbossesb.actions.";
+ public static final String STATELESS="stateless.";
+ public static final String STATEFUL="stateful.";
/**
* This method creates an ESBAction instance relevant to the
@@ -50,13 +52,24 @@
// Check that it is a conversation based ESB action
if (actionType.startsWith(CONVERSATION_ACTION_PACKAGE)) {
- int index=actionType.lastIndexOf('.');
- if (index != -1) {
- String actionName=actionType.substring(index+1);
+ actionType = actionType.substring(CONVERSATION_ACTION_PACKAGE.length());
+
+ String stateValue=null;
+
+ if (actionType.startsWith(STATEFUL)) {
+ actionType = actionType.substring(STATEFUL.length());
+ stateValue = STATEFUL;
+ } else if (actionType.startsWith(STATELESS)) {
+ actionType = actionType.substring(STATELESS.length());
+ stateValue = STATELESS;
+ }
+
+ if (stateValue != null) {
try {
Class<?> cls=(Class<?>)
- Class.forName(MODEL_ACTION_PACKAGE+"."+actionName);
+ Class.forName(MODEL_ACTION_PACKAGE+
+ stateValue+actionType);
java.lang.reflect.Constructor<?> con=
cls.getConstructor(new Class<?>[]{ESBService.class,
@@ -67,7 +80,8 @@
} catch(Exception e) {
logger.log(java.util.logging.Level.SEVERE,
"Unable to find action class '"+
- MODEL_ACTION_PACKAGE+"."+actionName+"'", e);
+ MODEL_ACTION_PACKAGE+stateValue+
+ actionType+"'", e);
}
}
}
@@ -93,12 +107,22 @@
// Check that it is a conversation based ESB action
if (actionType.startsWith(MODEL_ACTION_PACKAGE)) {
- int index=actionType.lastIndexOf('.');
- if (index != -1) {
- String actionName=actionType.substring(index+1);
-
- ret = CONVERSATION_ACTION_PACKAGE+"."+actionName;
+ actionType = actionType.substring(CONVERSATION_ACTION_PACKAGE.length());
+
+ String stateValue=null;
+
+ if (actionType.startsWith(STATEFUL)) {
+ actionType = actionType.substring(STATEFUL.length());
+ stateValue = STATEFUL;
+ } else if (actionType.startsWith(STATELESS)) {
+ actionType = actionType.substring(STATELESS.length());
+ stateValue = STATELESS;
}
+
+ if (stateValue != null) {
+ ret = CONVERSATION_ACTION_PACKAGE+
+ stateValue+actionType;
+ }
}
return(ret);
Modified: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/ESBService.java
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/ESBService.java 2009-01-08 13:25:36 UTC (rev 458)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/ESBService.java 2009-01-12 21:15:25 UTC (rev 459)
@@ -135,6 +135,14 @@
public ESBAction getGatewayAction();
/**
+ * This method determines whether the gateway service is
+ * related to a stateless session.
+ *
+ * @return Whether the gateway service is stateless
+ */
+ public boolean isStateless();
+
+ /**
* This method returns the service description name associated with the
* ESB service.
*
Deleted: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/AbstractInteractionMessageAction.java
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/AbstractInteractionMessageAction.java 2009-01-08 13:25:36 UTC (rev 458)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/AbstractInteractionMessageAction.java 2009-01-12 21:15:25 UTC (rev 459)
@@ -1,143 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, 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.
- */
-package org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions;
-
-import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.*;
-
-/**
- * The abstract model component for the 'ReceiveMessageAction'
- * and 'SendMessageAction'.
- *
- * @author gary
- */
-public abstract class AbstractInteractionMessageAction extends AbstractESBAction {
-
- public static final String IDENTITIES = "identities";
- public static final String MESSAGE_TYPE = "messageType";
- public static final String OPERATION = "operation";
- public static final String CLIENT_EPR = "clientEPR";
-
- /**
- * The constructor for the action.
- *
- * @param service The reference to the service in which
- * the action is contained
- * @param action The XML configuration details for the action
- */
- public AbstractInteractionMessageAction(ESBService service,
- org.w3c.dom.Element action) {
- super(service, action);
- }
-
- /**
- * The contructor for initializing a new action.
- */
- protected AbstractInteractionMessageAction(ESBService service,
- String actionClass) {
- super(service, actionClass);
- }
-
- /**
- * This method returns the mandatory property names.
- *
- * @return The mandatory property names
- */
- @Override
- protected java.util.List<String> getMandatoryProperties() {
- java.util.List<String> ret=super.getMandatoryProperties();
- ret.add(MESSAGE_TYPE);
- ret.add(IDENTITIES);
- return(ret);
- }
-
- /**
- * This method returns the optional property names.
- *
- * @return The optional property names
- */
- @Override
- protected java.util.List<String> getOptionalProperties() {
- java.util.List<String> ret=super.getOptionalProperties();
- ret.add(OPERATION);
- ret.add(CLIENT_EPR);
- return(ret);
- }
-
- /**
- * This method sets the operation property.
- *
- * @param operation The operation
- */
- public void setOperation(String operation) {
-
- if (operation != null) {
- org.w3c.dom.Element prop=getPropertyElement(OPERATION);
-
- if (prop != null) {
- prop.setAttribute(VALUE_ATTR, operation);
- }
- } else {
- removePropertyElement(OPERATION);
- }
- }
-
- /**
- * This method sets the message type.
- *
- * @param type The message type
- */
- public void setMessageType(String type) {
-
- org.w3c.dom.Element prop=getPropertyElement(MESSAGE_TYPE);
-
- if (prop != null) {
- prop.setAttribute(VALUE_ATTR, type);
- }
- }
-
- /**
- * This method returns the message type.
- *
- * @return The message type
- */
- public String getMessageType() {
- String ret=null;
-
- org.w3c.dom.Element prop=getPropertyElement(MESSAGE_TYPE);
-
- if (prop != null && prop.hasAttribute(VALUE_ATTR)) {
- ret = prop.getAttribute(VALUE_ATTR);
- }
-
- return(ret);
- }
-
- /**
- * This method sets the client's EPR label property.
- *
- * @param epr The client EPR label
- */
- public void setClientEPR(String epr) {
-
- org.w3c.dom.Element prop=getPropertyElement(CLIENT_EPR);
-
- if (prop != null) {
- prop.setAttribute(VALUE_ATTR, epr);
- }
- }
-}
Deleted: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/CreateSessionAction.java
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/CreateSessionAction.java 2009-01-08 13:25:36 UTC (rev 458)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/CreateSessionAction.java 2009-01-12 21:15:25 UTC (rev 459)
@@ -1,172 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, 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.
- */
-package org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions;
-
-import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.ConversionContext;
-import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.ESBAction;
-import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.ESBActionFactory;
-import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.ESBService;
-import org.scribble.model.*;
-import org.scribble.model.admin.ModelIssue;
-import org.scribble.model.admin.ModelListener;
-
-/**
- * The model component for the 'CreateSessionAction'.
- *
- * @author gary
- */
-public class CreateSessionAction extends AbstractESBAction {
-
- public static final String ROOT = "root";
- public static final String CONVERSATION_TYPE = "conversationType";
-
- /**
- * The constructor for the action.
- *
- * @param service The reference to the service in which
- * the action is contained
- * @param action The XML configuration details for the action
- */
- public CreateSessionAction(ESBService service,
- org.w3c.dom.Element action) {
- super(service, action);
- }
-
- /**
- * This constructor initializes the DOM element for
- * the action.
- *
- * @param service The reference to the service in which
- * the action will be contained
- */
- public CreateSessionAction(ESBService service) {
- super(service, ESBActionFactory.getConversationAction(
- CreateSessionAction.class));
- }
-
- /**
- * This method determines whether the ESB action represents
- * a CreateSessionAction.
- *
- * @return Whether the action is a CreateSessionAction
- */
- public boolean isCreateSession() {
- return(true);
- }
-
- /**
- * This method returns the optional property names.
- *
- * @return The optional property names
- */
- @Override
- protected java.util.List<String> getOptionalProperties() {
- java.util.List<String> ret=super.getOptionalProperties();
- ret.add(CONVERSATION_TYPE);
- ret.add(ROOT);
- return(ret);
- }
-
- /**
- * This method validates the ESB action and reports warnings or
- * errors to the supplied model listener.
- *
- * @param l The model listener
- */
- @Override
- public void validate(ModelListener l) {
- super.validate(l);
-
- // Action must be first conversation based action in
- // the service
- if (getService() != null && getService().getActions().size() > 0) {
- ESBAction act=getService().getActions().get(0);
-
- if (act != this) {
- l.error(new ModelIssue(this, org.scribble.util.MessageUtil.format(
- java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.Messages"),
- "_MUST_BE_FIRST_ACTION",
- new String[]{"CreateSession"})));
- }
- }
-
- // If service is root, then need to defined conversation type
- if (getService().isRoot()) {
- if (getService().getConversationType() == null) {
- l.error(new ModelIssue(this, org.scribble.util.MessageUtil.format(
- java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.Messages"),
- "_NOT_SPECIFIED_CONVERSATION_TYPE",
- new String[]{})));
- } else {
- int index=getService().getConversationType().indexOf('@');
- String convType=getService().getConversationType().trim();
-
- if (index == -1 || index == convType.length()-1) {
- l.error(new ModelIssue(this, org.scribble.util.MessageUtil.format(
- java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.Messages"),
- "_NOT_SPECIFIED_CONVERSATION_TYPE_ROLE",
- new String[]{convType})));
- }
- }
- }
- }
-
- /**
- * This method converts the ESB action into an equivalent
- * behavioural description for conformance checking.
- *
- * @param activities The list of activities that will contain
- * the converted action(s)
- * @param context The conversion context
- */
- @Override
- public void convert(java.util.List<Activity> activities,
- ConversionContext context) {
- }
-
- /**
- * This method sets the root property.
- *
- * @param root The root
- */
- public void setRoot(boolean root) {
-
- org.w3c.dom.Element prop=getPropertyElement(ROOT);
-
- if (prop != null) {
- prop.setAttribute(VALUE_ATTR, ""+root);
- }
- }
-
- /**
- * This method sets the conversation type property.
- *
- * @param name The conversation type
- */
- public void setConversationType(String type) {
-
- org.w3c.dom.Element prop=getPropertyElement(CONVERSATION_TYPE);
-
- if (prop != null) {
- prop.setAttribute(VALUE_ATTR, type);
- }
- }
-}
Deleted: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/IfAction.java
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/IfAction.java 2009-01-08 13:25:36 UTC (rev 458)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/IfAction.java 2009-01-12 21:15:25 UTC (rev 459)
@@ -1,324 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, 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.
- */
-package org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions;
-
-import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.*;
-import org.scribble.model.*;
-import org.scribble.model.admin.ModelIssue;
-import org.scribble.model.admin.ModelListener;
-import org.scribble.conversation.model.*;
-
-/**
- * The model component for the 'IfAction'.
- *
- * @author gary
- */
-public class IfAction extends AbstractESBAction {
-
- public static final String SERVICE_NAME = "service-name";
- public static final String SERVICE_CATEGORY = "service-category";
- public static final String IMMEDIATE = "immediate";
- public static final String EXPRESSION = "expression";
- public static final String ELSE = "else";
- public static final String ELSEIF = "elseif";
- public static final String IF = "if";
- public static final String PATHS = "paths";
-
- /**
- * The constructor for the action.
- *
- * @param service The reference to the service in which
- * the action is contained
- * @param action The XML configuration details for the action
- */
- public IfAction(ESBService service,
- org.w3c.dom.Element action) {
- super(service, action);
- }
-
- /**
- * This constructor initializes the DOM element for
- * the action.
- *
- * @param service The reference to the service in which
- * the action will be contained
- */
- public IfAction(ESBService service) {
- super(service, ESBActionFactory.getConversationAction(
- IfAction.class));
- }
-
- /**
- * This method initializes the links with the ESB service descriptors
- * identified in each path of the action.
- */
- @Override
- public void initializeLinks() {
- super.initializeLinks();
-
- org.w3c.dom.NodeList nl=getPropertyChildNodes(PATHS);
-
- for (int i=0; i < nl.getLength(); i++) {
-
- org.w3c.dom.Node n=nl.item(i);
-
- if (n instanceof org.w3c.dom.Element &&
- (n.getNodeName().equals(IF) ||
- n.getNodeName().equals(ELSEIF) ||
- n.getNodeName().equals(ELSE))) {
- if (((org.w3c.dom.Element)n).hasAttribute(SERVICE_CATEGORY) &&
- ((org.w3c.dom.Element)n).hasAttribute(SERVICE_NAME)) {
- String category=((org.w3c.dom.Element)n).getAttribute(SERVICE_CATEGORY);
- String name=((org.w3c.dom.Element)n).getAttribute(SERVICE_NAME);
-
- // Lookup service associated with category and name
- ESBService service=getService().getModel().getService(category, name);
-
- String immediate=((org.w3c.dom.Element)n).getAttribute(IMMEDIATE);
-
- // Initialize link, even if service is null - this will be
- // reported as a validation error later
- getLinks().add(new ESBLink(category, name, service,
- (immediate != null && immediate.equalsIgnoreCase("true"))));
- }
- }
- }
- }
-
- /**
- * This method returns the mandatory property names.
- *
- * @return The mandatory property names
- */
- @Override
- protected java.util.List<String> getMandatoryProperties() {
- java.util.List<String> ret=super.getMandatoryProperties();
- ret.add(PATHS);
- return(ret);
- }
-
- /**
- * This method validates the ESB action and reports warnings or
- * errors to the supplied model listener.
- *
- * @param l The model listener
- */
- @Override
- public void validate(ModelListener l) {
- super.validate(l);
-
- org.w3c.dom.NodeList nl=getPropertyChildNodes(PATHS);
- boolean f_if=false;
- boolean f_else=false;
- boolean f_orderWrong=false;
- boolean f_serviceDetailsMissing=false;
- boolean f_immediateInvalid=false;
-
- for (int i=0; nl != null && i < nl.getLength(); i++) {
-
- org.w3c.dom.Node n=nl.item(i);
-
- if (n instanceof org.w3c.dom.Element) {
- if (n.getNodeName().equals(IF)) {
- if (f_if) {
- f_orderWrong = true;
- }
-
- f_if = true;
-
- if (((org.w3c.dom.Element)n).hasAttribute(SERVICE_CATEGORY) == false ||
- ((org.w3c.dom.Element)n).hasAttribute(SERVICE_NAME) == false) {
- f_serviceDetailsMissing = true;
- }
-
- String immediate=((org.w3c.dom.Element)n).getAttribute(IMMEDIATE);
-
- if (((org.w3c.dom.Element)n).hasAttribute(IMMEDIATE) &&
- immediate.equalsIgnoreCase("true") == false &&
- immediate.equalsIgnoreCase("false") == false) {
- f_immediateInvalid = true;
- }
- } else if (n.getNodeName().equals(ELSEIF)) {
-
- if (f_if == false || f_else) {
- f_orderWrong = true;
- }
-
- if (((org.w3c.dom.Element)n).hasAttribute(SERVICE_CATEGORY) == false ||
- ((org.w3c.dom.Element)n).hasAttribute(SERVICE_NAME) == false) {
- f_serviceDetailsMissing = true;
- }
-
- String immediate=((org.w3c.dom.Element)n).getAttribute(IMMEDIATE);
-
- if (((org.w3c.dom.Element)n).hasAttribute(IMMEDIATE) &&
- immediate.equalsIgnoreCase("true") == false &&
- immediate.equalsIgnoreCase("false") == false) {
- f_immediateInvalid = true;
- }
- } else if (n.getNodeName().equals(ELSE)) {
-
- if (f_if == false || f_else) {
- f_orderWrong = true;
- }
-
- f_else = true;
-
- if (((org.w3c.dom.Element)n).hasAttribute(SERVICE_CATEGORY) == false ||
- ((org.w3c.dom.Element)n).hasAttribute(SERVICE_NAME) == false) {
- f_serviceDetailsMissing = true;
- }
-
- String immediate=((org.w3c.dom.Element)n).getAttribute(IMMEDIATE);
-
- if (((org.w3c.dom.Element)n).hasAttribute(IMMEDIATE) &&
- immediate.equalsIgnoreCase("true") == false &&
- immediate.equalsIgnoreCase("false") == false) {
- f_immediateInvalid = true;
- }
- }
- }
- }
-
- // Report any errors
- if (nl != null && (f_if == false || f_orderWrong)) {
- l.error(new ModelIssue(this, org.scribble.util.MessageUtil.format(
- java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.Messages"),
- "_IF_ORDER_WRONG",
- new String[]{})));
- }
-
- if (f_serviceDetailsMissing) {
- l.error(new ModelIssue(this, org.scribble.util.MessageUtil.format(
- java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.Messages"),
- "_PATH_SERVICE_DETAILS_MISSING",
- new String[]{})));
- }
-
- if (f_immediateInvalid) {
- l.error(new ModelIssue(this, org.scribble.util.MessageUtil.format(
- java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.Messages"),
- "_BOOLEAN",
- new String[]{IMMEDIATE})));
- }
- }
-
- /**
- * This method converts the ESB action into an equivalent
- * behavioural description for conformance checking.
- *
- * @param activities The list of activities that will contain
- * the converted action(s)
- * @param context The conversion context
- */
- @Override
- public void convert(java.util.List<Activity> activities,
- ConversionContext context) {
-
- org.w3c.dom.NodeList nl=getPropertyChildNodes(PATHS);
-
- If choice=new If();
- activities.add(choice);
-
- for (int i=0; i < nl.getLength(); i++) {
-
- org.w3c.dom.Node n=nl.item(i);
-
- if (n instanceof org.w3c.dom.Element) {
- if (n.getNodeName().equals(IF) ||
- n.getNodeName().equals(ELSEIF)) {
- String category=((org.w3c.dom.Element)n).getAttribute(SERVICE_CATEGORY);
- String name=((org.w3c.dom.Element)n).getAttribute(SERVICE_NAME);
-
- // TODO: Convert the conditional expression if defined
-
- ConditionalBlock cond=new ConditionalBlock();
- choice.getConditionalBlocks().add(cond);
-
- ESBService service=getService().getModel().getService(category, name);
-
- if (service != null) {
- service.convert(cond.getContents(), context);
- }
- } else if (n.getNodeName().equals(ELSE)) {
- String category=((org.w3c.dom.Element)n).getAttribute(SERVICE_CATEGORY);
- String name=((org.w3c.dom.Element)n).getAttribute(SERVICE_NAME);
-
- Block block=new Block();
- choice.setElseBlock(block);
-
- ESBService service=getService().getModel().getService(category, name);
-
- if (service != null) {
- service.convert(block.getContents(), context);
- }
- }
- }
- }
- }
-
- /**
- * This method adds a path to the if action.
- *
- * @param type The type of path (IF, ELSEIF or ELSE)
- * @param category The service category
- * @param name The service name
- * @param immediate Whether invocation should be immediate
- * @param expr The expression, if type is IF or ELSEIF
- * @param position The position, if type is ELSEIF
- */
- public void addPath(String type, String category, String name,
- boolean immediate, String expr, int position) {
-
- org.w3c.dom.NodeList nl=
- getAction().getElementsByTagName(PROPERTY_ELEMENT);
-
- org.w3c.dom.Element paths=null;
-
- for (int i=0; paths == null && i < nl.getLength(); i++) {
- if (nl.item(i) instanceof org.w3c.dom.Element) {
- String propName=((org.w3c.dom.Element)nl.item(i)).getAttribute(NAME_ATTR);
-
- if (propName != null && propName.equals(PATHS)) {
- paths = (org.w3c.dom.Element)nl.item(i);
- }
- }
- }
-
- if (paths == null) {
- paths = getAction().getOwnerDocument().createElement(PROPERTY_ELEMENT);
- paths.setAttribute(NAME_ATTR, PATHS);
-
- getAction().appendChild(paths);
- }
-
- org.w3c.dom.Element path=getAction().getOwnerDocument().createElement(type);
- path.setAttribute(SERVICE_CATEGORY, category);
- path.setAttribute(SERVICE_NAME, name);
- path.setAttribute(IMMEDIATE, ""+immediate);
-
- if (expr != null && (type == IF || type == ELSEIF)) {
- path.setAttribute(EXPRESSION, expr);
- }
-
- paths.appendChild(path);
- }
-}
Deleted: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/MessageRouterAction.java
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/MessageRouterAction.java 2009-01-08 13:25:36 UTC (rev 458)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/MessageRouterAction.java 2009-01-12 21:15:25 UTC (rev 459)
@@ -1,386 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, 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.
- */
-package org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions;
-
-import java.util.logging.Logger;
-
-import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.*;
-import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.util.IdentityUtil;
-import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.util.InteractionUtil;
-import org.scribble.conversation.model.*;
-import org.scribble.model.*;
-import org.scribble.model.admin.ModelIssue;
-import org.scribble.model.admin.ModelListener;
-
-/**
- * The model component for the 'MessageRouterAction'. Although
- * not an integral part of the behaviour of a service, it provides
- * a behavioural gateway to ensure that messages sent to a
- * specific endpoint reference are routed to the appropriate
- * ESB service descriptor. Therefore the routing configuration
- * needs to be synchronized with the definition of the service
- * descriptors representing the various behavioural states associated
- * with a service.
- *
- * @author gary
- */
-public class MessageRouterAction extends AbstractESBAction {
-
- public static final String IDENTITIES_ELEMENT = "identities";
- public static final String INITIATE = "initiate";
- public static final String SERVICE_NAME = "service-name";
- public static final String SERVICE_CATEGORY = "service-category";
- public static final String ROUTE = "route";
- public static final String PATHS = "paths";
- public static final String MESSAGE_ELEMENT="message";
- public static final String TYPE_ATTR="type";
-
- /**
- * The constructor for the action.
- *
- * @param service The reference to the service in which
- * the action is contained
- * @param action The XML configuration details for the action
- */
- public MessageRouterAction(ESBService service,
- org.w3c.dom.Element action) {
- super(service, action);
- }
-
- /**
- * This constructor initializes the DOM element for
- * the action.
- *
- * @param service The reference to the service in which
- * the action will be contained
- */
- public MessageRouterAction(ESBService service) {
- super(service, ESBActionFactory.getConversationAction(
- MessageRouterAction.class));
- }
-
- /**
- * This method initializes the links with the ESB service descriptors
- * identified in each path of the action.
- */
- @Override
- public void initializeLinks() {
- super.initializeLinks();
-
- org.w3c.dom.NodeList nl=getPropertyChildNodes(PATHS);
-
- for (int i=0; nl != null && i < nl.getLength(); i++) {
-
- org.w3c.dom.Node n=nl.item(i);
-
- if (n instanceof org.w3c.dom.Element) {
- if (n.getNodeName().equals(ROUTE)) {
- if (((org.w3c.dom.Element)n).hasAttribute(SERVICE_CATEGORY) &&
- ((org.w3c.dom.Element)n).hasAttribute(SERVICE_NAME)) {
- String category=((org.w3c.dom.Element)n).getAttribute(SERVICE_CATEGORY);
- String name=((org.w3c.dom.Element)n).getAttribute(SERVICE_NAME);
- String initiate=((org.w3c.dom.Element)n).getAttribute(INITIATE);
-
- // Lookup service associated with category and name
- ESBService service=getService().getModel().getService(category, name);
-
- // Initialize link, even if service is null - this will be
- // reported as a validation error later
- getLinks().add(new ESBLink(category, name, service, true));
-
- if (service != null) {
- if (initiate != null && initiate.equalsIgnoreCase("true")) {
- m_initiateServices.add(service);
- } else {
- m_services.add(service);
- }
- }
- }
- }
- }
- }
- }
-
- /**
- * This method determines whether the action is related to a behavioural
- * session.
- *
- * @return Whether the action is session based
- */
- public boolean isSessionBased() {
- return(false);
- }
-
- /**
- * This method determines whether the action is a gateway
- * for inbound requests.
- *
- * @return Whether the action is a gateway
- */
- public boolean isGateway() {
- return(true);
- }
-
- /**
- * This method adds a route to the message router action.
- *
- * @param category The service category
- * @param name The service name
- * @param initiate Whether the route initiates the service
- * @param messageTypes The list of message types
- */
- public void addRoute(String category, String name, boolean initiate,
- java.util.List<MessageSignature> messageTypes) {
-
- org.w3c.dom.Element paths=getPropertyElement(PATHS);
-
- org.w3c.dom.Element path=
- getAction().getOwnerDocument().createElement(ROUTE);
- path.setAttribute(SERVICE_CATEGORY, category);
- path.setAttribute(SERVICE_NAME, name);
-
- if (initiate) {
- path.setAttribute(INITIATE, Boolean.toString(initiate));
- }
-
- for (int i=0; i < messageTypes.size(); i++) {
- org.w3c.dom.Element mt=
- getAction().getOwnerDocument().createElement(MESSAGE_ELEMENT);
-
- if (messageTypes.get(i).getTypes().size() == 1) {
- TypeReference ref=messageTypes.get(i).getTypes().get(0);
-
- mt.setAttribute(TYPE_ATTR, InteractionUtil.getTypeString(ref));
-
- path.appendChild(mt);
-
- if (messageTypes.get(i).getParent() instanceof ConversationInteraction &&
- ((ConversationInteraction)messageTypes.get(i).getParent()).
- getEnclosingDefinition() instanceof Conversation &&
- ((ConversationInteraction)messageTypes.get(i).getParent()).
- getEnclosingDefinition().getModel()
- instanceof ConversationModel) {
-
- org.w3c.dom.Element identities=
- mt.getOwnerDocument().createElement(IDENTITIES_ELEMENT);
-
- java.util.List<Identity> ids=((Conversation)
- ((ConversationInteraction)messageTypes.get(i).getParent()).
- getEnclosingDefinition()).getIdentities();
-
- java.util.List<IdentityLocator> locators=
- ((ConversationModel)((ConversationInteraction)messageTypes.get(i).getParent()).
- getEnclosingDefinition().
- getModel()).getIdentityLocators();
-
- IdentityUtil.defineIdentities(identities, messageTypes.get(i),
- ids, locators);
-
- mt.appendChild(identities);
- }
-
- } else {
- logger.warning("Can only handle single type message signatures");
- }
- }
-
- paths.appendChild(path);
- }
-
- /**
- * This method returns the number of routes associated with
- * the message router.
- *
- * @return The number of routes
- */
- public int getNumberOfRoutes() {
- int ret=0;
-
- org.w3c.dom.NodeList nl=getAction().getElementsByTagName(ROUTE);
-
- ret = nl.getLength();
-
- return(ret);
- }
-
- /**
- * This method returns the DOM element associated with the
- * specified route.
- *
- * @param index The index of the required route
- * @return The route element, or null if not found
- */
- public org.w3c.dom.Element getRouteElement(int index) {
- org.w3c.dom.Element ret=null;
-
- org.w3c.dom.NodeList nl=getAction().getElementsByTagName(ROUTE);
-
- if (index >= 0 && index < nl.getLength() &&
- nl.item(index) instanceof org.w3c.dom.Element) {
- ret = (org.w3c.dom.Element)nl.item(index);
- }
-
- return(ret);
- }
-
- /**
- * This method returns the DOM element associated with the
- * specified service category and name.
- *
- * @param category The service category
- * @param name The service name
- * @return The route element, or null if not found
- */
- public org.w3c.dom.Element getRouteElement(String category,
- String name) {
- org.w3c.dom.Element ret=null;
-
- org.w3c.dom.NodeList nl=getAction().getElementsByTagName(ROUTE);
-
- for (int i=0; ret == null && i < nl.getLength(); i++) {
- if (nl.item(i) instanceof org.w3c.dom.Element) {
- ret = (org.w3c.dom.Element)nl.item(i);
-
- if (ret.getAttribute(SERVICE_CATEGORY).equals(category) == false ||
- ret.getAttribute(SERVICE_NAME).equals(name) == false) {
- ret = null;
- }
- }
- }
-
- return(ret);
- }
-
- /**
- * This method returns the mandatory property names.
- *
- * @return The mandatory property names
- */
- @Override
- protected java.util.List<String> getMandatoryProperties() {
- java.util.List<String> ret=super.getMandatoryProperties();
- ret.add(PATHS);
- return(ret);
- }
-
- /**
- * This method validates the ESB action and reports warnings or
- * errors to the supplied model listener.
- *
- * @param l The model listener
- */
- @Override
- public void validate(ModelListener l) {
- super.validate(l);
-
- // Check that message router has no other session based
- // ESB actions in the same service descriptor
- if (getService().isSessionBased()) {
- l.error(new ModelIssue(this, org.scribble.util.MessageUtil.format(
- java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.Messages"),
- "_CANNOT_SESSION_BASED_ACTIONS_WITH_ROUTER",
- new String[]{})));
- }
-
- // Check that 'initate' services have a 'CreateSessionAction' and
- // represent the root behaviour
- for (int i=0; i < m_initiateServices.size(); i++) {
- ESBService service=m_initiateServices.get(i);
-
- if (service.isRoot() == false) {
- l.error(new ModelIssue(this, org.scribble.util.MessageUtil.format(
- java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.Messages"),
- "_CANNOT_INITIATE_NON_ROOT",
- new String[]{service.getCategory(),
- service.getName()})));
- }
- }
-
- // Check that non-'initate' services don't have a 'CreateSessionAction' and
- // represent the root behaviour
- for (int i=0; i < m_services.size(); i++) {
- ESBService service=m_services.get(i);
-
- if (service.isRoot()) {
- l.error(new ModelIssue(this, org.scribble.util.MessageUtil.format(
- java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.Messages"),
- "_MUST_INITIATE_ROOT",
- new String[]{service.getCategory(),
- service.getName()})));
- }
- }
-
- org.w3c.dom.NodeList nl=getPropertyChildNodes(PATHS);
- boolean f_serviceDetailsMissing=false;
- int routeCount=0;
-
- for (int i=0; nl != null && i < nl.getLength(); i++) {
-
- org.w3c.dom.Node n=nl.item(i);
-
- if (n instanceof org.w3c.dom.Element) {
- if (n.getNodeName().equals(ROUTE)) {
- routeCount++;
-
- if (((org.w3c.dom.Element)n).hasAttribute(SERVICE_CATEGORY) == false ||
- ((org.w3c.dom.Element)n).hasAttribute(SERVICE_NAME) == false) {
- f_serviceDetailsMissing = true;
- }
- }
- }
- }
-
- // Report any errors
- if (nl != null && routeCount < 1) {
- l.error(new ModelIssue(this, org.scribble.util.MessageUtil.format(
- java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.Messages"),
- "_ROUTER_ONE_OR_MORE_PATHS",
- new String[]{})));
- }
-
- if (f_serviceDetailsMissing) {
- l.error(new ModelIssue(this, org.scribble.util.MessageUtil.format(
- java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.Messages"),
- "_PATH_SERVICE_DETAILS_MISSING",
- new String[]{})));
- }
- }
-
- /**
- * This method converts the ESB action into an equivalent
- * behavioural description for conformance checking.
- *
- * @param activities The list of activities that will contain
- * the converted action(s)
- * @param context The conversion context
- */
- @Override
- public void convert(java.util.List<Activity> activities,
- ConversionContext context) {
- }
-
- private static Logger logger = Logger.getLogger("org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions");
-
- private java.util.List<ESBService> m_initiateServices=new java.util.Vector<ESBService>();
- private java.util.List<ESBService> m_services=new java.util.Vector<ESBService>();
-}
Deleted: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/ParallelAction.java
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/ParallelAction.java 2009-01-08 13:25:36 UTC (rev 458)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/ParallelAction.java 2009-01-12 21:15:25 UTC (rev 459)
@@ -1,327 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, 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.
- */
-package org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions;
-
-import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.*;
-import org.scribble.model.*;
-import org.scribble.model.admin.ModelIssue;
-import org.scribble.model.admin.ModelListener;
-import org.scribble.conversation.model.*;
-
-/**
- * The model component for the 'ParallelAction'.
- *
- * @author gary
- */
-public class ParallelAction extends AbstractESBAction {
-
- public static final String SERVICE_NAME = "service-name";
- public static final String SERVICE_CATEGORY = "service-category";
- public static final String IMMEDIATE = "immediate";
- private static final String JOIN = "join";
- private static final String PATH = "path";
- private static final String PATHS = "paths";
-
- /**
- * The constructor for the action.
- *
- * @param service The reference to the service in which
- * the action is contained
- * @param action The XML configuration details for the action
- */
- public ParallelAction(ESBService service,
- org.w3c.dom.Element action) {
- super(service, action);
- }
-
- /**
- * This constructor initializes the DOM element for
- * the action.
- *
- * @param service The reference to the service in which
- * the action will be contained
- */
- public ParallelAction(ESBService service) {
- super(service, ESBActionFactory.getConversationAction(
- ParallelAction.class));
- }
-
- /**
- * This method initializes the links with the ESB service descriptors
- * identified in each path of the action.
- */
- @Override
- public void initializeLinks() {
- super.initializeLinks();
-
- org.w3c.dom.NodeList nl=getPropertyChildNodes(PATHS);
-
- for (int i=0; i < nl.getLength(); i++) {
-
- org.w3c.dom.Node n=nl.item(i);
-
- if (n instanceof org.w3c.dom.Element) {
- if (n.getNodeName().equals(PATH)) {
- if (((org.w3c.dom.Element)n).hasAttribute(SERVICE_CATEGORY) &&
- ((org.w3c.dom.Element)n).hasAttribute(SERVICE_NAME)) {
- String category=((org.w3c.dom.Element)n).getAttribute(SERVICE_CATEGORY);
- String name=((org.w3c.dom.Element)n).getAttribute(SERVICE_NAME);
-
- // Lookup service associated with category and name
- ESBService service=getService().getModel().getService(category, name);
-
- String immediate=((org.w3c.dom.Element)n).getAttribute(IMMEDIATE);
-
- // Initialize link, even if service is null - this will be
- // reported as a validation error later
- getLinks().add(new ESBLink(category, name, service,
- (immediate != null && immediate.equalsIgnoreCase("true"))));
-
- if (service != null) {
- m_services.add(service);
- }
- }
- } else if (n.getNodeName().equals(JOIN)) {
- if (((org.w3c.dom.Element)n).hasAttribute(SERVICE_CATEGORY) &&
- ((org.w3c.dom.Element)n).hasAttribute(SERVICE_NAME)) {
- m_joinCategory=((org.w3c.dom.Element)n).getAttribute(SERVICE_CATEGORY);
- m_joinName=((org.w3c.dom.Element)n).getAttribute(SERVICE_NAME);
-
- // Lookup service associated with category and name
- m_joinService=getService().getModel().getService(m_joinCategory, m_joinName);
-
- // Initialize link, even if service is null - this will be
- // reported as a validation error later
- getLinks().add(new ESBLink(m_joinCategory, m_joinName, m_joinService, true));
- }
- }
- }
- }
- }
-
- /**
- * This method returns the mandatory property names.
- *
- * @return The mandatory property names
- */
- @Override
- protected java.util.List<String> getMandatoryProperties() {
- java.util.List<String> ret=super.getMandatoryProperties();
- ret.add(PATHS);
- return(ret);
- }
-
- /**
- * This method validates the ESB action and reports warnings or
- * errors to the supplied model listener.
- *
- * @param l The model listener
- */
- @Override
- public void validate(ModelListener l) {
- super.validate(l);
-
- org.w3c.dom.NodeList nl=getPropertyChildNodes(PATHS);
- boolean f_joined=false;
- int pathCount=0;
- boolean f_pathAfterJoin=false;
- boolean f_multipleJoins=false;
- boolean f_serviceDetailsMissing=false;
- boolean f_immediateInvalid=false;
-
- for (int i=0; nl != null && i < nl.getLength(); i++) {
-
- org.w3c.dom.Node n=nl.item(i);
-
- if (n instanceof org.w3c.dom.Element) {
- if (n.getNodeName().equals(PATH)) {
- pathCount++;
-
- if (f_joined) {
- f_pathAfterJoin = true;
- }
-
- if (((org.w3c.dom.Element)n).hasAttribute(SERVICE_CATEGORY) == false ||
- ((org.w3c.dom.Element)n).hasAttribute(SERVICE_NAME) == false) {
- f_serviceDetailsMissing = true;
- }
-
- String immediate=((org.w3c.dom.Element)n).getAttribute(IMMEDIATE);
-
- if (((org.w3c.dom.Element)n).hasAttribute(IMMEDIATE) &&
- immediate.equalsIgnoreCase("true") == false &&
- immediate.equalsIgnoreCase("false") == false) {
- f_immediateInvalid = true;
- }
- } else if (n.getNodeName().equals(JOIN)) {
-
- if (f_joined) {
- f_multipleJoins = true;
- }
-
- f_joined = true;
-
- if (((org.w3c.dom.Element)n).hasAttribute(SERVICE_CATEGORY) == false ||
- ((org.w3c.dom.Element)n).hasAttribute(SERVICE_NAME) == false) {
- f_serviceDetailsMissing = true;
- }
- }
- }
- }
-
- // Report any errors
- if (nl != null && pathCount < 2) {
- l.error(new ModelIssue(this, org.scribble.util.MessageUtil.format(
- java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.Messages"),
- "_PARALLEL_MORE_THAN_TWO_PATHS",
- new String[]{})));
- }
-
- if (f_pathAfterJoin) {
- l.error(new ModelIssue(this, org.scribble.util.MessageUtil.format(
- java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.Messages"),
- "_PARALLEL_PATH_AFTER_JOIN",
- new String[]{})));
- }
-
- if (f_multipleJoins) {
- l.error(new ModelIssue(this, org.scribble.util.MessageUtil.format(
- java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.Messages"),
- "_MULTIPLE_JOINS",
- new String[]{})));
- }
-
- if (f_serviceDetailsMissing) {
- l.error(new ModelIssue(this, org.scribble.util.MessageUtil.format(
- java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.Messages"),
- "_PATH_SERVICE_DETAILS_MISSING",
- new String[]{})));
- }
-
- if (f_immediateInvalid) {
- l.error(new ModelIssue(this, org.scribble.util.MessageUtil.format(
- java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.Messages"),
- "_BOOLEAN",
- new String[]{IMMEDIATE})));
- }
- }
-
- /**
- * This method converts the ESB action into an equivalent
- * behavioural description for conformance checking.
- *
- * @param activities The list of activities that will contain
- * the converted action(s)
- * @param context The conversion context
- */
- @Override
- public void convert(java.util.List<Activity> activities,
- ConversionContext context) {
-
- Parallel parallel=new Parallel();
- activities.add(parallel);
-
- parallel.derivedFrom(this);
-
- if (m_joinService != null) {
- context.markJoin(m_joinService);
- }
-
- for (int i=0; i < m_services.size(); i++) {
- Block block=new Block();
-
- ESBService service=m_services.get(i);
-
- if (service != null) {
- service.convert(block.getContents(), context);
- }
-
- // TODO: Only temporary check while conformance
- // check does not handle
- //if (block.getContents().size() > 0) {
- parallel.getBlocks().add(block);
- //}
- }
-
- // TODO: Only temporary check while conformance
- // check does not handle
- //if (parallel.getBlocks().size() == 0) {
- // activities.remove(parallel);
- //}
-
- if (m_joinService != null) {
- m_joinService.convert(activities, context);
- }
- }
-
- /**
- * This method adds a path to the parallel action.
- *
- * @param category The service category
- * @param name The service name
- * @param immediate Whether invocation should be immediate
- * @param join Whether the path is for the parallel, or join
- * @param position The position
- */
- public void addPath(String category, String name,
- boolean immediate, boolean join, int position) {
-
- org.w3c.dom.NodeList nl=
- getAction().getElementsByTagName(PROPERTY_ELEMENT);
-
- org.w3c.dom.Element paths=null;
-
- for (int i=0; paths == null && i < nl.getLength(); i++) {
- if (nl.item(i) instanceof org.w3c.dom.Element) {
- String propName=((org.w3c.dom.Element)nl.item(i)).getAttribute(NAME_ATTR);
-
- if (propName != null && propName.equals(PATHS)) {
- paths = (org.w3c.dom.Element)nl.item(i);
- }
- }
- }
-
- if (paths == null) {
- paths = getAction().getOwnerDocument().createElement(PROPERTY_ELEMENT);
- paths.setAttribute(NAME_ATTR, PATHS);
-
- getAction().appendChild(paths);
- }
-
- org.w3c.dom.Element path=
- getAction().getOwnerDocument().createElement(join ? JOIN : PATH);
- path.setAttribute(SERVICE_CATEGORY, category);
- path.setAttribute(SERVICE_NAME, name);
-
- if (immediate) {
- path.setAttribute(IMMEDIATE, Boolean.TRUE.toString());
- }
-
- paths.appendChild(path);
- }
-
- private java.util.List<ESBService> m_services=new java.util.Vector<ESBService>();
- private String m_joinCategory=null;
- private String m_joinName=null;
- private ESBService m_joinService=null;
-}
Deleted: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/PerformAction.java
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/PerformAction.java 2009-01-08 13:25:36 UTC (rev 458)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/PerformAction.java 2009-01-12 21:15:25 UTC (rev 459)
@@ -1,325 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, 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.
- */
-package org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions;
-
-import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.*;
-import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.util.PropertyUtil;
-import org.scribble.model.*;
-import org.scribble.model.admin.ModelIssue;
-import org.scribble.model.admin.ModelListener;
-import org.scribble.conversation.model.*;
-
-/**
- * The model component for the 'WhenAction'.
- *
- * @author gary
- */
-public class PerformAction extends AbstractESBAction {
-
- private static final String BIND_ELEMENT = "bind";
- private static final String TO_VARIABLE_ATTR = "to-variable";
- public static final String SERVICE_NAME = "serviceName";
- public static final String SERVICE_CATEGORY = "serviceCategory";
- public static final String RETURN_SERVICE_NAME = "returnServiceName";
- public static final String RETURN_SERVICE_CATEGORY = "returnServiceCategory";
- public static final String BIND_DETAILS = "bindDetails";
- public static final String PARENT_REFERENCE = "parentReference";
-
- /**
- * The constructor for the action.
- *
- * @param service The reference to the service in which
- * the action is contained
- * @param action The XML configuration details for the action
- */
- public PerformAction(ESBService service,
- org.w3c.dom.Element action) {
- super(service, action);
- }
-
- /**
- * This constructor initializes the DOM element for
- * the action.
- *
- * @param service The reference to the service in which
- * the action will be contained
- */
- public PerformAction(ESBService service) {
- super(service, ESBActionFactory.getConversationAction(
- PerformAction.class));
- }
-
- /**
- * This method initializes the links with the ESB service descriptors
- * identified in each path of the action.
- */
- @Override
- public void initializeLinks() {
- super.initializeLinks();
-
- m_category=getPropertyValue(SERVICE_CATEGORY);
- m_name=getPropertyValue(SERVICE_NAME);
-
- if (m_category != null && m_name != null) {
- m_service=getService().getModel().getService(m_category, m_name);
-
- getLinks().add(new ESBLink(m_category, m_name, m_service, true));
- }
-
- m_joinCategory=getPropertyValue(RETURN_SERVICE_CATEGORY);
- m_joinName=getPropertyValue(RETURN_SERVICE_NAME);
-
- if (m_joinCategory != null && m_joinName != null) {
- m_joinService=getService().getModel().getService(m_joinCategory, m_joinName);
-
- getLinks().add(new ESBLink(m_joinCategory, m_joinName, m_joinService, true));
- }
- }
-
- /**
- * This method indicates whether this action performs another
- * sub-conversation.
- *
- * @return Whether the action is a 'perform'
- */
- @Override
- public boolean isPerform() {
- return(true);
- }
-
- /**
- * This method returns the mandatory property names.
- *
- * @return The mandatory property names
- */
- @Override
- protected java.util.List<String> getMandatoryProperties() {
- java.util.List<String> ret=super.getMandatoryProperties();
- ret.add(SERVICE_CATEGORY);
- ret.add(SERVICE_NAME);
- return(ret);
- }
-
- /**
- * This method returns the optional property names.
- *
- * @return The optional property names
- */
- @Override
- protected java.util.List<String> getOptionalProperties() {
- java.util.List<String> ret=super.getOptionalProperties();
- ret.add(RETURN_SERVICE_NAME);
- ret.add(RETURN_SERVICE_CATEGORY);
- ret.add(BIND_DETAILS);
- ret.add(PARENT_REFERENCE);
- return(ret);
- }
-
- /**
- * This method validates the ESB action and reports warnings or
- * errors to the supplied model listener.
- *
- * @param l The model listener
- */
- @Override
- public void validate(ModelListener l) {
- super.validate(l);
-
- // Check if performed state starts with a create session action
- if (m_service != null &&
- m_service.isCreateSession() == false) {
- l.error(new ModelIssue(this, org.scribble.util.MessageUtil.format(
- java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.Messages"),
- "_NOT_FOUND_PERFORM_CREATE_SESSION",
- new String[]{})));
- }
-
- // Check if performed service has relevant bind
- // and parent properties
- if (m_service != null &&
- m_service.getSessionClass() != null) {
-
- if (hasProperty(PARENT_REFERENCE)) {
- String parentRefProperty=getPropertyValue(PARENT_REFERENCE);
-
- if (PropertyUtil.isProperty(m_service.getSessionClass(),
- parentRefProperty) == false) {
- l.error(new ModelIssue(this, org.scribble.util.MessageUtil.format(
- java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.Messages"),
- "_NOT_FOUND_VARIABLE",
- new String[]{parentRefProperty,
- m_service.getSessionClass().getName()})));
- } else if (PropertyUtil.hasWritableProperty(m_service.getSessionClass(),
- parentRefProperty) == false) {
- l.error(new ModelIssue(this, org.scribble.util.MessageUtil.format(
- java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.Messages"),
- "_NOT_WRITABLE_PROPERTY",
- new String[]{parentRefProperty,
- m_service.getSessionClass().getName()})));
- }
-
- Class<?> parentCls=PropertyUtil.getPropertyType(
- m_service.getSessionClass(), parentRefProperty);
-
- if (parentCls != null && getService() != null &&
- getService().getSessionClass() != null &&
- parentCls.isAssignableFrom(
- getService().getSessionClass()) == false) {
- l.error(new ModelIssue(this, org.scribble.util.MessageUtil.format(
- java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.Messages"),
- "_INVALID_PROPERTY_TYPE",
- new String[]{parentRefProperty,
- m_service.getSessionClass().getName(),
- getService().getSessionClass().getName()})));
- }
- }
-
- if (hasProperty(BIND_DETAILS)) {
- org.w3c.dom.Element elem=getPropertyElement(BIND_DETAILS);
-
- org.w3c.dom.NodeList nl=elem.getElementsByTagName(BIND_ELEMENT);
-
- for (int i=0; i < nl.getLength(); i++) {
- if (nl.item(i) instanceof org.w3c.dom.Element) {
- org.w3c.dom.Element bind=(org.w3c.dom.Element)nl.item(i);
-
- if (bind.hasAttribute(TO_VARIABLE_ATTR)) {
- String variable=bind.getAttribute(TO_VARIABLE_ATTR);
-
- if (PropertyUtil.isProperty(m_service.getSessionClass(),
- variable) == false) {
- l.error(new ModelIssue(this, org.scribble.util.MessageUtil.format(
- java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.Messages"),
- "_NOT_FOUND_VARIABLE",
- new String[]{variable,
- m_service.getSessionClass().getName()})));
-
- } else if (PropertyUtil.hasWritableProperty(m_service.getSessionClass(),
- variable) == false) {
- l.error(new ModelIssue(this, org.scribble.util.MessageUtil.format(
- java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.Messages"),
- "_NOT_WRITABLE_PROPERTY",
- new String[]{variable,
- m_service.getSessionClass().getName()})));
- }
- } else {
- // Possibly report if 'to-variable' not
- // defined?
- }
- }
- }
- }
- }
- }
-
- /**
- * This method converts the ESB action into an equivalent
- * behavioural description for conformance checking.
- *
- * @param activities The list of activities that will contain
- * the converted action(s)
- * @param context The conversion context
- */
- @Override
- public void convert(java.util.List<Activity> activities,
- ConversionContext context) {
-
- Compose elem=null;
-
- // Check if perform is asynchronous
- if (hasProperty(RETURN_SERVICE_NAME)) {
- elem = new Run();
- } else {
- elem = new Spawn();
- }
-
- activities.add(elem);
-
- elem.derivedFrom(this);
-
- Conversation definition=new Conversation();
-
- elem.setInlineDefinition(definition);
-
- if (m_service != null) {
- // TODO: May need to be separate definition, in case the
- // same state is called from a number of different
- // places
- m_service.convert(definition.getBlock().getContents(), context);
- }
-
- if (m_joinService != null) {
- m_joinService.convert(activities, context);
- }
- }
-
- /**
- * This method sets the destination service descriptor properties.
- *
- * @param category The category
- * @param name The name
- */
- public void setDestination(String category, String name) {
-
- org.w3c.dom.Element prop=getPropertyElement(SERVICE_CATEGORY);
-
- if (prop != null) {
- prop.setAttribute(VALUE_ATTR, category);
- }
-
- prop = getPropertyElement(SERVICE_NAME);
-
- if (prop != null) {
- prop.setAttribute(VALUE_ATTR, name);
- }
- }
-
- /**
- * This method sets the return destination service descriptor properties.
- *
- * @param category The category
- * @param name The name
- */
- public void setReturnDestination(String category, String name) {
-
- org.w3c.dom.Element prop=getPropertyElement(RETURN_SERVICE_CATEGORY);
-
- if (prop != null) {
- prop.setAttribute(VALUE_ATTR, category);
- }
-
- prop = getPropertyElement(RETURN_SERVICE_NAME);
-
- if (prop != null) {
- prop.setAttribute(VALUE_ATTR, name);
- }
- }
-
- private String m_category=null;
- private String m_name=null;
- private ESBService m_service=null;
- private String m_joinCategory=null;
- private String m_joinName=null;
- private ESBService m_joinService=null;
-}
Deleted: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/ReceiveMessageAction.java
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/ReceiveMessageAction.java 2009-01-08 13:25:36 UTC (rev 458)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/ReceiveMessageAction.java 2009-01-12 21:15:25 UTC (rev 459)
@@ -1,119 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, 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.
- */
-package org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions;
-
-import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.*;
-import org.scribble.conversation.model.*;
-import org.scribble.model.*;
-
-/**
- * The model component for the 'ReceiveMessageAction'.
- *
- * @author gary
- */
-public class ReceiveMessageAction extends AbstractInteractionMessageAction {
-
- /**
- * The constructor for the action.
- *
- * @param service The reference to the service in which
- * the action is contained
- * @param action The XML configuration details for the action
- */
- public ReceiveMessageAction(ESBService service,
- org.w3c.dom.Element action) {
- super(service, action);
- }
-
- /**
- * This constructor initializes the DOM element for
- * the action.
- *
- * @param service The reference to the service in which
- * the action will be contained
- */
- public ReceiveMessageAction(ESBService service) {
- super(service, ESBActionFactory.getConversationAction(
- ReceiveMessageAction.class));
- }
-
- /**
- * This method indicates whether the action is an initiator.
- * Initiator actions must precede any other session based
- * action, within an ESB service.
- *
- * @return Whether the action is an initiator
- */
- @Override
- public boolean isInitiator() {
- return(true);
- }
-
- /**
- * This method converts the ESB action into an equivalent
- * behavioural description for conformance checking.
- *
- * @param activities The list of activities that will contain
- * the converted action(s)
- * @param context The conversion context
- */
- @Override
- public void convert(java.util.List<Activity> activities,
- ConversionContext context) {
-
- ConversationInteraction recv=new ConversationInteraction();
- activities.add(recv);
-
- recv.derivedFrom(this);
-
- MessageSignature ms=new MessageSignature();
- ms.derivedFrom(this);
-
- recv.setMessageSignature(ms);
-
- ms.setOperation(getPropertyValue(OPERATION));
-
- String type=getPropertyValue(MESSAGE_TYPE);
- if (type != null && type.length() > 0) {
- String ns=null;
- String local=type;
-
- if (type.charAt(0) == '{') {
- int endindex=type.indexOf('}');
-
- if (endindex != -1) {
- ns = type.substring(1, endindex);
- local = type.substring(endindex+1);
- }
- }
-
- TypeReference ref=new TypeReference();
- ref.setLocalpart(local);
- ref.setNamespace(ns);
-
- ref.derivedFrom(this);
-
- ms.getTypes().add(ref);
- }
-
- // Initialize the 'to' role to be this participant
- if (context.getRole() != null) {
- recv.setToRole(new Role(context.getRole()));
- }
- }
-}
Deleted: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/RetrieveSessionAction.java
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/RetrieveSessionAction.java 2009-01-08 13:25:36 UTC (rev 458)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/RetrieveSessionAction.java 2009-01-12 21:15:25 UTC (rev 459)
@@ -1,96 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, 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.
- */
-package org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions;
-
-import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.*;
-import org.scribble.model.*;
-import org.scribble.model.admin.ModelIssue;
-import org.scribble.model.admin.ModelListener;
-
-/**
- * The model component for the 'RetrieveSessionAction'.
- *
- * @author gary
- */
-public class RetrieveSessionAction extends AbstractESBAction {
-
- public static final String IDENTITIES = "identities";
-
- /**
- * The constructor for the action.
- *
- * @param service The reference to the service in which
- * the action is contained
- * @param action The XML configuration details for the action
- */
- public RetrieveSessionAction(ESBService service,
- org.w3c.dom.Element action) {
- super(service, action);
- }
-
- /**
- * This method returns the mandatory property names.
- *
- * @return The mandatory property names
- */
- @Override
- protected java.util.List<String> getMandatoryProperties() {
- java.util.List<String> ret=super.getMandatoryProperties();
- ret.add(IDENTITIES);
- return(ret);
- }
-
- /**
- * This method validates the ESB action and reports warnings or
- * errors to the supplied model listener.
- *
- * @param l The model listener
- */
- @Override
- public void validate(ModelListener l) {
- super.validate(l);
-
- // Action must be first conversation based action in
- // the service
- if (getService() != null && getService().getActions().size() > 0) {
- ESBAction act=getService().getActions().get(0);
-
- if (act != this) {
- l.error(new ModelIssue(this, org.scribble.util.MessageUtil.format(
- java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.Messages"),
- "_MUST_BE_FIRST_ACTION",
- new String[]{"RetrieveSession"})));
- }
- }
- }
-
- /**
- * This method converts the ESB action into an equivalent
- * behavioural description for conformance checking.
- *
- * @param activities The list of activities that will contain
- * the converted action(s)
- * @param context The conversion context
- */
- @Override
- public void convert(java.util.List<Activity> activities,
- ConversionContext context) {
- }
-
-}
\ No newline at end of file
Deleted: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/ScheduleStateAction.java
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/ScheduleStateAction.java 2009-01-08 13:25:36 UTC (rev 458)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/ScheduleStateAction.java 2009-01-12 21:15:25 UTC (rev 459)
@@ -1,184 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, 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.
- */
-package org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions;
-
-import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.*;
-import org.scribble.model.*;
-import org.scribble.model.admin.ModelIssue;
-import org.scribble.model.admin.ModelListener;
-
-/**
- * The model component for the 'ScheduleStateAction'.
- *
- * @author gary
- */
-public class ScheduleStateAction extends AbstractESBAction {
-
- public static final String IMMEDIATE = "immediate";
- public static final String SERVICE_NAME = "serviceName";
- public static final String SERVICE_CATEGORY = "serviceCategory";
-
- /**
- * The constructor for the action.
- *
- * @param service The reference to the service in which
- * the action is contained
- * @param action The XML configuration details for the action
- */
- public ScheduleStateAction(ESBService service,
- org.w3c.dom.Element action) {
- super(service, action);
- }
-
- /**
- * This constructor initializes the DOM element for
- * the action.
- *
- * @param service The reference to the service in which
- * the action will be contained
- */
- public ScheduleStateAction(ESBService service) {
- super(service, ESBActionFactory.getConversationAction(
- ScheduleStateAction.class));
- }
-
- /**
- * This method initializes the links with the ESB service descriptors
- * identified in each path of the action.
- */
- @Override
- public void initializeLinks() {
- super.initializeLinks();
-
- String serviceCategory=getPropertyValue(SERVICE_CATEGORY);
- String serviceName=getPropertyValue(SERVICE_NAME);
- String immediate=getPropertyValue(IMMEDIATE);
-
- m_service=getService().getModel().getService(serviceCategory, serviceName);
-
- getLinks().add(new ESBLink(serviceCategory, serviceName, m_service,
- (immediate != null && immediate.equalsIgnoreCase("true"))));
- }
-
- /**
- * This method returns the mandatory property names.
- *
- * @return The mandatory property names
- */
- @Override
- protected java.util.List<String> getMandatoryProperties() {
- java.util.List<String> ret=super.getMandatoryProperties();
- ret.add(SERVICE_CATEGORY);
- ret.add(SERVICE_NAME);
- return(ret);
- }
-
- /**
- * This method returns the optional property names.
- *
- * @return The optional property names
- */
- @Override
- protected java.util.List<String> getOptionalProperties() {
- java.util.List<String> ret=super.getOptionalProperties();
- ret.add(IMMEDIATE);
- return(ret);
- }
-
- /**
- * This method validates the ESB action and reports warnings or
- * errors to the supplied model listener.
- *
- * @param l The model listener
- */
- @Override
- public void validate(ModelListener l) {
- super.validate(l);
-
- String immediate=getPropertyValue(IMMEDIATE);
-
- if (immediate != null && immediate.equalsIgnoreCase("true") == false &&
- immediate.equalsIgnoreCase("false") == false) {
- l.error(new ModelIssue(this, org.scribble.util.MessageUtil.format(
- java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.Messages"),
- "_BOOLEAN",
- new String[]{IMMEDIATE})));
- }
- }
-
- /**
- * This method converts the ESB action into an equivalent
- * behavioural description for conformance checking.
- *
- * @param activities The list of activities that will contain
- * the converted action(s)
- * @param context The conversion context
- */
- @Override
- public void convert(java.util.List<Activity> activities,
- ConversionContext context) {
-
- // If the service has been located, then convert its activities
- // if it is either not a loop construct (i.e. a while action), or
- // if it is a loop, then we need to ensure that it is not in the
- // current stack of ESB services that logically 'contain' this
- // action. If this action is within the scope of the loop, then
- // the default behaviour should be to return to the loop
- // condition (i.e. just let the loop return implicitly).
- if (m_service != null &&
- (m_service.isLoop() == false ||
- context.isOnStack(m_service) == false) &&
- context.isJoin(m_service) == false) {
- m_service.convert(activities, context);
- }
- }
-
- /**
- * This method sets the destination service descriptor properties.
- *
- * @param category The category
- * @param name The name
- * @param immediate Whether the invoke immediately
- */
- public void setDestination(String category, String name,
- boolean immediate) {
-
- org.w3c.dom.Element prop=getPropertyElement(SERVICE_CATEGORY);
-
- if (prop != null) {
- prop.setAttribute(VALUE_ATTR, category);
- }
-
- prop = getPropertyElement(SERVICE_NAME);
-
- if (prop != null) {
- prop.setAttribute(VALUE_ATTR, name);
- }
-
- if (immediate) {
- prop = getPropertyElement(IMMEDIATE);
-
- if (prop != null) {
- prop.setAttribute(VALUE_ATTR, Boolean.toString(immediate));
- }
- }
- }
-
- private ESBService m_service=null;
-}
\ No newline at end of file
Deleted: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/SendMessageAction.java
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/SendMessageAction.java 2009-01-08 13:25:36 UTC (rev 458)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/SendMessageAction.java 2009-01-12 21:15:25 UTC (rev 459)
@@ -1,288 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, 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.
- */
-package org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions;
-
-import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.*;
-import org.scribble.conversation.model.*;
-import org.scribble.model.*;
-import org.scribble.model.admin.ModelIssue;
-import org.scribble.model.admin.ModelListener;
-
-/**
- * The model component for the 'SendMessageAction'.
- *
- * @author gary
- */
-public class SendMessageAction extends AbstractInteractionMessageAction {
-
- public static final String RESPONSE_SERVICE_NAME = "responseServiceName";
- public static final String RESPONSE_SERVICE_CATEGORY = "responseServiceCategory";
- public static final String SERVICE_NAME = "serviceName";
- public static final String SERVICE_CATEGORY = "serviceCategory";
- public static final String SERVICE_NAME_EXPRESSION = "serviceNameExpression";
- public static final String SERVICE_CATEGORY_EXPRESSION = "serviceCategoryExpression";
-
- /**
- * The constructor for the action.
- *
- * @param service The reference to the service in which
- * the action is contained
- * @param action The XML configuration details for the action
- */
- public SendMessageAction(ESBService service,
- org.w3c.dom.Element action) {
- super(service, action);
- }
-
- /**
- * This constructor initializes the DOM element for
- * the action.
- *
- * @param service The reference to the service in which
- * the action will be contained
- */
- public SendMessageAction(ESBService service) {
- super(service, ESBActionFactory.getConversationAction(
- SendMessageAction.class));
- }
-
- /**
- * This method initializes the links with the ESB service descriptors
- * identified in each path of the action.
- */
- @Override
- public void initializeLinks() {
- super.initializeLinks();
-
- String serviceCategory=getPropertyValue(SERVICE_CATEGORY);
- String serviceName=getPropertyValue(SERVICE_NAME);
- String responseServiceCategory=getPropertyValue(RESPONSE_SERVICE_CATEGORY);
- String responseServiceName=getPropertyValue(RESPONSE_SERVICE_NAME);
-
- if (serviceCategory != null && serviceName != null) {
- ESBService service=getService().getModel().getService(
- serviceCategory, serviceName);
-
- getLinks().add(new ESBLink(serviceCategory, serviceName,
- service, true, true));
- }
-
- if (responseServiceCategory != null && responseServiceName != null) {
- ESBService service=getService().getModel().getService(
- responseServiceCategory, responseServiceName);
-
- getLinks().add(new ESBLink(responseServiceCategory,
- responseServiceName, service, false));
- }
- }
-
- /**
- * This method returns the optional property names.
- *
- * @return The optional property names
- */
- @Override
- protected java.util.List<String> getOptionalProperties() {
- java.util.List<String> ret=super.getOptionalProperties();
- ret.add(RESPONSE_SERVICE_NAME);
- ret.add(RESPONSE_SERVICE_CATEGORY);
- ret.add(SERVICE_NAME);
- ret.add(SERVICE_CATEGORY);
- ret.add(SERVICE_NAME_EXPRESSION);
- ret.add(SERVICE_CATEGORY_EXPRESSION);
- return(ret);
- }
-
- /**
- * This method validates the ESB action and reports warnings or
- * errors to the supplied model listener.
- *
- * @param l The model listener
- */
- @Override
- public void validate(ModelListener l) {
- super.validate(l);
-
- // If sending request, then category/name must be specified,
- // else a response requires the 'client epr'. Validate that
- // either case is true.
- if (getPropertyValue(SERVICE_CATEGORY) != null &&
- getPropertyValue(SERVICE_NAME) != null) {
- // Sending a request
-
- } else if (getPropertyValue(SERVICE_CATEGORY_EXPRESSION) != null &&
- getPropertyValue(SERVICE_NAME_EXPRESSION) != null) {
- // Sending a request to service derived from expression
- // on the pojo state
-
- } else if (getPropertyValue(CLIENT_EPR) != null) {
- // Sending a response
-
- // TODO: Validate that the client EPR has been sent on
- // a preceding received request
- } else {
- l.error(new ModelIssue(this, org.scribble.util.MessageUtil.format(
- java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.Messages"),
- "_NOT_SPECIFIED_REQ_RESP_EPR",
- new String[]{})));
- }
- }
-
- /**
- * This method converts the ESB action into an equivalent
- * behavioural description for conformance checking.
- *
- * @param activities The list of activities that will contain
- * the converted action(s)
- * @param context The conversion context
- */
- @Override
- public void convert(java.util.List<Activity> activities,
- ConversionContext context) {
-
- ConversationInteraction send=new ConversationInteraction();
- activities.add(send);
-
- send.derivedFrom(this);
-
- MessageSignature ms=new MessageSignature();
- ms.derivedFrom(this);
-
- send.setMessageSignature(ms);
-
- ms.setOperation(getPropertyValue(OPERATION));
-
- String type=getPropertyValue(MESSAGE_TYPE);
- if (type != null && type.length() > 0) {
- String ns=null;
- String local=type;
-
- if (type.charAt(0) == '{') {
- int endindex=type.indexOf('}');
-
- if (endindex != -1) {
- ns = type.substring(1, endindex);
- local = type.substring(endindex+1);
- }
- }
-
- TypeReference ref=new TypeReference();
- ref.setLocalpart(local);
- ref.setNamespace(ns);
-
- ref.derivedFrom(this);
-
- ms.getTypes().add(ref);
- }
-
- // Initialize the 'from' role to be this participant
- // (for now until 'to' role can be set)
- if (context.getRole() != null) {
- send.setFromRole(new Role(context.getRole()));
- }
-
- // TODO: Initialize the 'to' role (possibly to a
- // namespace=service category and localpart=service
- // name. This would need to be mapped when doing
- // conformance checking - might be an issue, may
- // need to declare the name.
-
- // Check if a response control link has been
- // specified
- String responseServiceCategory=getPropertyValue(RESPONSE_SERVICE_CATEGORY);
- String responseServiceName=getPropertyValue(RESPONSE_SERVICE_NAME);
-
- if (responseServiceCategory != null && responseServiceName != null) {
- ESBService service=getService().getModel().getService(
- responseServiceCategory, responseServiceName);
-
- // Add activities from the 'response' service descriptor into
- // the set of activities. If service not found, then ignore
- // here as will be reported as part of the validation of links.
- if (service != null) {
- service.convert(activities, context);
- }
- }
- }
-
- /**
- * This method sets the destination service descriptor properties.
- *
- * @param category The category
- * @param name The name
- */
- public void setDestination(String category, String name) {
-
- org.w3c.dom.Element prop=getPropertyElement(SERVICE_CATEGORY);
-
- if (prop != null) {
- prop.setAttribute(VALUE_ATTR, category);
- }
-
- prop = getPropertyElement(SERVICE_NAME);
-
- if (prop != null) {
- prop.setAttribute(VALUE_ATTR, name);
- }
- }
-
- /**
- * This method sets the destination expressions for the
- * service descriptor properties.
- *
- * @param categoryExpr The category expression
- * @param nameExpr The name expression
- */
- public void setDestinationExpression(String categoryExpr,
- String nameExpr) {
-
- org.w3c.dom.Element prop=getPropertyElement(SERVICE_CATEGORY_EXPRESSION);
-
- if (prop != null) {
- prop.setAttribute(VALUE_ATTR, categoryExpr);
- }
-
- prop = getPropertyElement(SERVICE_NAME_EXPRESSION);
-
- if (prop != null) {
- prop.setAttribute(VALUE_ATTR, nameExpr);
- }
- }
-
- /**
- * This method sets the response service descriptor properties.
- *
- * @param category The category
- * @param name The name
- */
- public void setResponseDestination(String category, String name) {
-
- org.w3c.dom.Element prop=getPropertyElement(RESPONSE_SERVICE_CATEGORY);
-
- if (prop != null) {
- prop.setAttribute(VALUE_ATTR, category);
- }
-
- prop = getPropertyElement(RESPONSE_SERVICE_NAME);
-
- if (prop != null) {
- prop.setAttribute(VALUE_ATTR, name);
- }
- }
-}
Deleted: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/SetMessageAction.java
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/SetMessageAction.java 2009-01-08 13:25:36 UTC (rev 458)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/SetMessageAction.java 2009-01-12 21:15:25 UTC (rev 459)
@@ -1,94 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, 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.
- */
-package org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions;
-
-import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.*;
-import org.scribble.model.*;
-import org.scribble.model.admin.ModelListener;
-
-/**
- * The model component for the 'SetMessageAction'.
- *
- * @author gary
- */
-public class SetMessageAction extends AbstractESBAction {
-
- public static final String STATE_EXPRESSION = "stateExpression";
- public static final String HEADER_PROPERTY = "headerProperty";
-
- /**
- * The constructor for the action.
- *
- * @param service The reference to the service in which
- * the action is contained
- * @param action The XML configuration details for the action
- */
- public SetMessageAction(ESBService service,
- org.w3c.dom.Element action) {
- super(service, action);
- }
-
- /**
- * This method returns the mandatory property names.
- *
- * @return The mandatory property names
- */
- @Override
- protected java.util.List<String> getMandatoryProperties() {
- java.util.List<String> ret=super.getMandatoryProperties();
- ret.add(STATE_EXPRESSION);
- return(ret);
- }
-
- /**
- * This method returns the optional property names.
- *
- * @return The optional property names
- */
- @Override
- protected java.util.List<String> getOptionalProperties() {
- java.util.List<String> ret=super.getOptionalProperties();
- ret.add(HEADER_PROPERTY);
- return(ret);
- }
-
- /**
- * This method validates the ESB action and reports warnings or
- * errors to the supplied model listener.
- *
- * @param l The model listener
- */
- @Override
- public void validate(ModelListener l) {
- super.validate(l);
-
- }
-
- /**
- * This method converts the ESB action into an equivalent
- * behavioural description for conformance checking.
- *
- * @param activities The list of activities that will contain
- * the converted action(s)
- * @param context The conversion context
- */
- @Override
- public void convert(java.util.List<Activity> activities,
- ConversionContext context) {
- }
-}
Deleted: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/SetStateAction.java
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/SetStateAction.java 2009-01-08 13:25:36 UTC (rev 458)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/SetStateAction.java 2009-01-12 21:15:25 UTC (rev 459)
@@ -1,167 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, 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.
- */
-package org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions;
-
-import java.util.logging.Logger;
-
-import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.*;
-import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.util.PropertyUtil;
-import org.scribble.model.*;
-import org.scribble.model.admin.ModelIssue;
-import org.scribble.model.admin.ModelListener;
-
-/**
- * The model component for the 'SetStateAction'.
- *
- * @author gary
- */
-public class SetStateAction extends AbstractESBAction {
-
- public static final String STATE_EXPRESSION = "stateExpression";
- public static final String MESSAGE_EXPRESSION = "messageExpression";
- public static final String VARIABLE = "variable";
-
- /**
- * The constructor for the action.
- *
- * @param service The reference to the service in which
- * the action is contained
- * @param action The XML configuration details for the action
- */
- public SetStateAction(ESBService service,
- org.w3c.dom.Element action) {
- super(service, action);
- }
-
- /**
- * This method returns the mandatory property names.
- *
- * @return The mandatory property names
- */
- @Override
- protected java.util.List<String> getMandatoryProperties() {
- java.util.List<String> ret=super.getMandatoryProperties();
- ret.add(VARIABLE);
- return(ret);
- }
-
- /**
- * This method returns the optional property names.
- *
- * @return The optional property names
- */
- @Override
- protected java.util.List<String> getOptionalProperties() {
- java.util.List<String> ret=super.getOptionalProperties();
- ret.add(STATE_EXPRESSION);
- ret.add(MESSAGE_EXPRESSION);
- return(ret);
- }
-
- /**
- * This method validates the ESB action and reports warnings or
- * errors to the supplied model listener.
- *
- * @param l The model listener
- */
- @Override
- public void validate(ModelListener l) {
- super.validate(l);
-
- String variable=getPropertyValue(VARIABLE);
-
- if (variable != null) {
-
- // Check that variable defined on session class
- Class<?> cls=getService().getSessionClass();
-
- java.util.StringTokenizer st=new java.util.StringTokenizer(variable, ".");
-
- while (cls != null && st.hasMoreTokens()) {
- String token=st.nextToken();
-
- if (cls != null) {
- if (PropertyUtil.isProperty(cls, token) == false) {
-
- if (variable.equals(token)) {
- l.error(new ModelIssue(this, org.scribble.util.MessageUtil.format(
- java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.Messages"),
- "_NOT_FOUND_VARIABLE",
- new String[]{variable, cls.getName()})));
- } else {
- l.error(new ModelIssue(this, org.scribble.util.MessageUtil.format(
- java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.Messages"),
- "_NOT_FOUND_VARIABLE_PROPERTY",
- new String[]{variable, token, cls.getName()})));
- }
- } else if (st.hasMoreTokens()) {
- // Check property can be read
- if (!PropertyUtil.hasReadableProperty(cls, token)) {
- l.error(new ModelIssue(this, org.scribble.util.MessageUtil.format(
- java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.Messages"),
- "_NOT_READABLE_PROPERTY",
- new String[]{token, cls.getName()})));
- }
- } else {
- // Check property can be written
- if (!PropertyUtil.hasWritableProperty(cls, token)) {
- l.error(new ModelIssue(this, org.scribble.util.MessageUtil.format(
- java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.Messages"),
- "_NOT_WRITABLE_PROPERTY",
- new String[]{token, cls.getName()})));
- }
- }
-
- cls = PropertyUtil.getPropertyType(cls, token);
- }
- }
- }
-
- // Check that state or message expression defined
- String stateExpression=getPropertyValue(STATE_EXPRESSION);
- String messageExpression=getPropertyValue(MESSAGE_EXPRESSION);
-
- if ((stateExpression == null && messageExpression == null) ||
- (stateExpression != null && messageExpression != null)) {
- l.error(new ModelIssue(this, org.scribble.util.MessageUtil.format(
- java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.Messages"),
- "_MUST_SPECIFY_STATE_OR_MESSAGE_EXPRESSION",
- new String[]{})));
- }
- }
-
- /**
- * This method converts the ESB action into an equivalent
- * behavioural description for conformance checking.
- *
- * @param activities The list of activities that will contain
- * the converted action(s)
- * @param context The conversion context
- */
- @Override
- public void convert(java.util.List<Activity> activities,
- ConversionContext context) {
- }
-
- private static Logger logger = Logger.getLogger("org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions");
-}
Deleted: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/SwitchAction.java
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/SwitchAction.java 2009-01-08 13:25:36 UTC (rev 458)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/SwitchAction.java 2009-01-12 21:15:25 UTC (rev 459)
@@ -1,252 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, 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.
- */
-package org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions;
-
-import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.*;
-import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.util.InteractionUtil;
-import org.scribble.model.*;
-import org.scribble.model.admin.ModelIssue;
-import org.scribble.model.admin.ModelListener;
-import org.scribble.conversation.model.*;
-
-/**
- * The model component for the 'SwitchAction'.
- *
- * @author gary
- */
-public class SwitchAction extends AbstractESBAction {
-
- public static final String TYPE_ATTR = "type";
- public static final String MESSAGE_ELEMENT = "message";
- private static final String SERVICE_NAME = "service-name";
- private static final String SERVICE_CATEGORY = "service-category";
- private static final String CASE = "case";
- private static final String PATHS = "paths";
-
- /**
- * The constructor for the action.
- *
- * @param service The reference to the service in which
- * the action is contained
- * @param action The XML configuration details for the action
- */
- public SwitchAction(ESBService service,
- org.w3c.dom.Element action) {
- super(service, action);
- }
-
- /**
- * This constructor initializes the DOM element for
- * the action.
- *
- * @param service The reference to the service in which
- * the action will be contained
- */
- public SwitchAction(ESBService service) {
- super(service, ESBActionFactory.getConversationAction(
- SwitchAction.class));
- }
-
- /**
- * This method initializes the links with the ESB service descriptors
- * identified in each path of the action.
- */
- @Override
- public void initializeLinks() {
- super.initializeLinks();
-
- org.w3c.dom.NodeList nl=getPropertyChildNodes(PATHS);
-
- for (int i=0; i < nl.getLength(); i++) {
-
- org.w3c.dom.Node n=nl.item(i);
-
- if (n instanceof org.w3c.dom.Element &&
- n.getNodeName().equals(CASE)) {
- if (((org.w3c.dom.Element)n).hasAttribute(SERVICE_CATEGORY) &&
- ((org.w3c.dom.Element)n).hasAttribute(SERVICE_NAME)) {
- String category=((org.w3c.dom.Element)n).getAttribute(SERVICE_CATEGORY);
- String name=((org.w3c.dom.Element)n).getAttribute(SERVICE_NAME);
-
- // Lookup service associated with category and name
- ESBService service=getService().getModel().getService(category, name);
-
- // Initialize link, even if service is null - this will be
- // reported as a validation error later
- getLinks().add(new ESBLink(category, name, service, true));
- }
- }
- }
- }
-
- /**
- * This method returns the mandatory property names.
- *
- * @return The mandatory property names
- */
- @Override
- protected java.util.List<String> getMandatoryProperties() {
- java.util.List<String> ret=super.getMandatoryProperties();
- ret.add(PATHS);
- return(ret);
- }
-
- /**
- * This method indicates whether the action is an initiator.
- * Initiator actions must precede any other session based
- * action, within an ESB service.
- *
- * @return Whether the action is an initiator
- */
- @Override
- public boolean isInitiator() {
- return(true);
- }
-
- /**
- * This method validates the ESB action and reports warnings or
- * errors to the supplied model listener.
- *
- * @param l The model listener
- */
- @Override
- public void validate(ModelListener l) {
- super.validate(l);
-
- org.w3c.dom.NodeList nl=getPropertyChildNodes(PATHS);
- int pathCount=0;
- boolean f_serviceDetailsMissing=false;
-
- for (int i=0; nl != null && i < nl.getLength(); i++) {
-
- org.w3c.dom.Node n=nl.item(i);
-
- if (n instanceof org.w3c.dom.Element) {
- if (n.getNodeName().equals(CASE)) {
- pathCount++;
-
- if (((org.w3c.dom.Element)n).hasAttribute(SERVICE_CATEGORY) == false ||
- ((org.w3c.dom.Element)n).hasAttribute(SERVICE_NAME) == false) {
- f_serviceDetailsMissing = true;
- }
- }
- }
- }
-
- // Report any errors
- if (nl != null && pathCount < 1) {
- l.error(new ModelIssue(this, org.scribble.util.MessageUtil.format(
- java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.Messages"),
- "_SWITCH_ONE_OR_MORE_PATHS",
- new String[]{})));
- }
-
- if (f_serviceDetailsMissing) {
- l.error(new ModelIssue(this, org.scribble.util.MessageUtil.format(
- java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.Messages"),
- "_PATH_SERVICE_DETAILS_MISSING",
- new String[]{})));
- }
- }
-
- /**
- * This method converts the ESB action into an equivalent
- * behavioural description for conformance checking.
- *
- * @param activities The list of activities that will contain
- * the converted action(s)
- * @param context The conversion context
- */
- @Override
- public void convert(java.util.List<Activity> activities,
- ConversionContext context) {
-
- org.w3c.dom.NodeList nl=getPropertyChildNodes(PATHS);
-
- If choice=new If();
- activities.add(choice);
-
- for (int i=0; i < nl.getLength(); i++) {
-
- org.w3c.dom.Node n=nl.item(i);
-
- if (n instanceof org.w3c.dom.Element &&
- n.getNodeName().equals(CASE)) {
- String category=((org.w3c.dom.Element)n).getAttribute(SERVICE_CATEGORY);
- String name=((org.w3c.dom.Element)n).getAttribute(SERVICE_NAME);
-
- // Conditional block with no expression - i.e. the
- // expression is non-observable, as the path will be
- // selected based on the next message that arrives
- ConditionalBlock block=new ConditionalBlock();
- choice.getConditionalBlocks().add(block);
-
- ESBService service=getService().getModel().getService(category, name);
-
- if (service != null) {
- service.convert(block.getContents(), context);
- }
- }
- }
- }
-
- /**
- * This method adds a path to the switch action.
- *
- * @param category The service category
- * @param name The service name
- * @param messageTypes The set of interactions
- * @param position The position
- */
- public void addCase(String category, String name,
- java.util.Set<Interaction> messageTypes, int position) {
-
- org.w3c.dom.Element paths=getPropertyElement(PATHS);
-
- org.w3c.dom.Element path=
- getAction().getOwnerDocument().createElement(CASE);
- path.setAttribute(SERVICE_CATEGORY, category);
- path.setAttribute(SERVICE_NAME, name);
-
- if (messageTypes != null) {
- java.util.Iterator<Interaction> iter=messageTypes.iterator();
-
- while (iter.hasNext()) {
- Interaction interaction=iter.next();
-
- //TODO: Only deals with single type for now
- if (InteractionUtil.isSend(interaction) == false &&
- interaction.getMessageSignature().getTypes().size()==1) {
- org.w3c.dom.Element mt=
- getAction().getOwnerDocument().createElement(MESSAGE_ELEMENT);
-
- mt.setAttribute(TYPE_ATTR,
- InteractionUtil.getTypeString(
- interaction.getMessageSignature().
- getTypes().get(0)));
-
- path.appendChild(mt);
- }
- }
- }
-
- paths.appendChild(path);
- }
-}
Deleted: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/UnsupportedAction.java
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/UnsupportedAction.java 2009-01-08 13:25:36 UTC (rev 458)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/UnsupportedAction.java 2009-01-12 21:15:25 UTC (rev 459)
@@ -1,77 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, 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.
- */
-package org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions;
-
-import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.*;
-import org.scribble.model.*;
-import org.scribble.model.admin.ModelListener;
-
-/**
- * This class represents an unsupported (or custom) action within
- * the conversation based ESB service descriptor.
- *
- * @author gary
- */
-public class UnsupportedAction extends AbstractESBAction {
-
- /**
- * The constructor for the action.
- *
- * @param service The reference to the service in which
- * the action is contained
- * @param action The XML configuration details for the action
- */
- public UnsupportedAction(ESBService service,
- org.w3c.dom.Element action) {
- super(service, action);
- }
-
- /**
- * This method determines whether the action is related to a behavioural
- * session.
- *
- * @return Whether the action is session based
- */
- public boolean isSessionBased() {
- return(false);
- }
-
- /**
- * This method validates the ESB action and reports warnings or
- * errors to the supplied model listener.
- *
- * @param l The model listener
- */
- @Override
- public void validate(ModelListener l) {
- // Don't validate unsupported actions
- }
-
- /**
- * This method converts the ESB action into an equivalent
- * behavioural description for conformance checking.
- *
- * @param activities The list of activities that will contain
- * the converted action(s)
- * @param context The conversion context
- */
- public void convert(java.util.List<Activity> activities,
- ConversionContext context) {
- }
-
-}
Deleted: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/WhenAction.java
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/WhenAction.java 2009-01-08 13:25:36 UTC (rev 458)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/WhenAction.java 2009-01-12 21:15:25 UTC (rev 459)
@@ -1,241 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, 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.
- */
-package org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions;
-
-import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.*;
-import org.scribble.model.*;
-import org.scribble.model.admin.ModelIssue;
-import org.scribble.model.admin.ModelListener;
-import org.scribble.conversation.model.*;
-
-/**
- * The model component for the 'WhenAction'.
- *
- * @author gary
- */
-public class WhenAction extends AbstractESBAction {
-
- private static final String SERVICE_NAME = "service-name";
- private static final String SERVICE_CATEGORY = "service-category";
- private static final String WHEN = "when";
- private static final String PATHS = "paths";
-
- /**
- * The constructor for the action.
- *
- * @param service The reference to the service in which
- * the action is contained
- * @param action The XML configuration details for the action
- */
- public WhenAction(ESBService service,
- org.w3c.dom.Element action) {
- super(service, action);
- }
-
- /**
- * This constructor initializes the DOM element for
- * the action.
- *
- * @param service The reference to the service in which
- * the action will be contained
- */
- public WhenAction(ESBService service) {
- super(service, ESBActionFactory.getConversationAction(
- WhenAction.class));
- }
-
- /**
- * This method initializes the links with the ESB service descriptors
- * identified in each path of the action.
- */
- @Override
- public void initializeLinks() {
- super.initializeLinks();
-
- org.w3c.dom.NodeList nl=getPropertyChildNodes(PATHS);
-
- for (int i=0; i < nl.getLength(); i++) {
-
- org.w3c.dom.Node n=nl.item(i);
-
- if (n instanceof org.w3c.dom.Element) {
- if (n.getNodeName().equals(WHEN)) {
- if (((org.w3c.dom.Element)n).hasAttribute(SERVICE_CATEGORY) &&
- ((org.w3c.dom.Element)n).hasAttribute(SERVICE_NAME)) {
- String category=((org.w3c.dom.Element)n).getAttribute(SERVICE_CATEGORY);
- String name=((org.w3c.dom.Element)n).getAttribute(SERVICE_NAME);
-
- // Lookup service associated with category and name
- ESBService service=getService().getModel().getService(category, name);
-
- // Initialize link, even if service is null - this will be
- // reported as a validation error later
- getLinks().add(new ESBLink(category, name, service, true));
-
- if (service != null) {
- m_services.add(service);
- }
- }
- }
- }
- }
- }
-
- /**
- * This method returns the mandatory property names.
- *
- * @return The mandatory property names
- */
- @Override
- protected java.util.List<String> getMandatoryProperties() {
- java.util.List<String> ret=super.getMandatoryProperties();
- ret.add(PATHS);
- return(ret);
- }
-
- /**
- * This method validates the ESB action and reports warnings or
- * errors to the supplied model listener.
- *
- * @param l The model listener
- */
- @Override
- public void validate(ModelListener l) {
- super.validate(l);
-
- // TODO: Valid if decision-method
- // specified, that method exists, if expression, then
- // validate the expression etc.
-
- org.w3c.dom.NodeList nl=getPropertyChildNodes(PATHS);
- int pathCount=0;
- boolean f_serviceDetailsMissing=false;
-
- for (int i=0; nl != null && i < nl.getLength(); i++) {
-
- org.w3c.dom.Node n=nl.item(i);
-
- if (n instanceof org.w3c.dom.Element) {
- if (n.getNodeName().equals(WHEN)) {
- pathCount++;
-
- if (((org.w3c.dom.Element)n).hasAttribute(SERVICE_CATEGORY) == false ||
- ((org.w3c.dom.Element)n).hasAttribute(SERVICE_NAME) == false) {
- f_serviceDetailsMissing = true;
- }
- }
- }
- }
-
- // Report any errors
- if (nl != null && pathCount < 1) {
- l.error(new ModelIssue(this, org.scribble.util.MessageUtil.format(
- java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.Messages"),
- "_WHEN_ONE_OR_MORE_PATHS",
- new String[]{})));
- }
-
- if (f_serviceDetailsMissing) {
- l.error(new ModelIssue(this, org.scribble.util.MessageUtil.format(
- java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.Messages"),
- "_PATH_SERVICE_DETAILS_MISSING",
- new String[]{})));
- }
- }
-
- /**
- * This method converts the ESB action into an equivalent
- * behavioural description for conformance checking.
- *
- * @param activities The list of activities that will contain
- * the converted action(s)
- * @param context The conversion context
- */
- @Override
- public void convert(java.util.List<Activity> activities,
- ConversionContext context) {
-
- When elem=new When();
- activities.add(elem);
-
- elem.derivedFrom(this);
-
- if (m_joinService != null) {
- context.markJoin(m_joinService);
- }
-
- for (int i=0; i < m_services.size(); i++) {
- ConditionalBlock block=new ConditionalBlock();
-
- m_services.get(i).convert(block.getContents(), context);
-
- elem.getConditionalBlocks().add(block);
- }
-
- if (m_joinService != null) {
- m_joinService.convert(activities, context);
- }
- }
-
- /**
- * This method adds a path to the when action.
- *
- * @param category The service category
- * @param name The service name
- * @param position The position
- */
- public void addPath(String category, String name,
- int position) {
-
- org.w3c.dom.NodeList nl=
- getAction().getElementsByTagName(PROPERTY_ELEMENT);
-
- org.w3c.dom.Element paths=null;
-
- for (int i=0; paths == null && i < nl.getLength(); i++) {
- if (nl.item(i) instanceof org.w3c.dom.Element) {
- String propName=((org.w3c.dom.Element)nl.item(i)).getAttribute(NAME_ATTR);
-
- if (propName != null && propName.equals(PATHS)) {
- paths = (org.w3c.dom.Element)nl.item(i);
- }
- }
- }
-
- if (paths == null) {
- paths = getAction().getOwnerDocument().createElement(PROPERTY_ELEMENT);
- paths.setAttribute(NAME_ATTR, PATHS);
-
- getAction().appendChild(paths);
- }
-
- org.w3c.dom.Element path=
- getAction().getOwnerDocument().createElement(WHEN);
- path.setAttribute(SERVICE_CATEGORY, category);
- path.setAttribute(SERVICE_NAME, name);
-
- paths.appendChild(path);
- }
-
- private java.util.List<ESBService> m_services=new java.util.Vector<ESBService>();
- private String m_joinCategory=null;
- private String m_joinName=null;
- private ESBService m_joinService=null;
-}
Deleted: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/WhileAction.java
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/WhileAction.java 2009-01-08 13:25:36 UTC (rev 458)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/WhileAction.java 2009-01-12 21:15:25 UTC (rev 459)
@@ -1,386 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, 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.
- */
-package org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions;
-
-import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.*;
-import org.scribble.model.*;
-import org.scribble.model.admin.ModelIssue;
-import org.scribble.model.admin.ModelListener;
-import org.scribble.conversation.model.*;
-
-/**
- * The model component for the 'WhileAction'.
- *
- * @author gary
- */
-public class WhileAction extends AbstractESBAction {
-
- public static final String SERVICE_NAME = "service-name";
- public static final String SERVICE_CATEGORY = "service-category";
- public static final String IMMEDIATE = "immediate";
- private static final String WHILE = "while";
- private static final String EXIT = "exit";
- private static final String PATHS = "paths";
- public static final String MESSAGE_ELEMENT="message";
- public static final String TYPE_ATTR="type";
-
- /**
- * The constructor for the action.
- *
- * @param service The reference to the service in which
- * the action is contained
- * @param action The XML configuration details for the action
- */
- public WhileAction(ESBService service,
- org.w3c.dom.Element action) {
- super(service, action);
- }
-
- /**
- * This constructor initializes the DOM element for
- * the action.
- *
- * @param service The reference to the service in which
- * the action will be contained
- */
- public WhileAction(ESBService service) {
- super(service, ESBActionFactory.getConversationAction(
- WhileAction.class));
- }
-
- /**
- * This method initializes the links with the ESB service descriptors
- * identified in each path of the action.
- */
- @Override
- public void initializeLinks() {
- super.initializeLinks();
-
- org.w3c.dom.NodeList nl=getPropertyChildNodes(PATHS);
-
- for (int i=0; i < nl.getLength(); i++) {
-
- org.w3c.dom.Node n=nl.item(i);
-
- if (n instanceof org.w3c.dom.Element) {
- if (n.getNodeName().equals(WHILE)) {
- if (((org.w3c.dom.Element)n).hasAttribute(SERVICE_CATEGORY) &&
- ((org.w3c.dom.Element)n).hasAttribute(SERVICE_NAME)) {
- m_loopCategory=((org.w3c.dom.Element)n).getAttribute(SERVICE_CATEGORY);
- m_loopName=((org.w3c.dom.Element)n).getAttribute(SERVICE_NAME);
-
- // Lookup service associated with category and name
- m_loopService=getService().getModel().getService(m_loopCategory, m_loopName);
-
- String immediate=((org.w3c.dom.Element)n).getAttribute(IMMEDIATE);
-
- // Initialize link, even if service is null - this will be
- // reported as a validation error later
- getLinks().add(new ESBLink(m_loopCategory, m_loopName, m_loopService,
- (immediate != null && immediate.equalsIgnoreCase("true"))));
- }
- } else if (n.getNodeName().equals(EXIT)) {
- if (((org.w3c.dom.Element)n).hasAttribute(SERVICE_CATEGORY) &&
- ((org.w3c.dom.Element)n).hasAttribute(SERVICE_NAME)) {
- m_exitCategory=((org.w3c.dom.Element)n).getAttribute(SERVICE_CATEGORY);
- m_exitName=((org.w3c.dom.Element)n).getAttribute(SERVICE_NAME);
-
- // Lookup service associated with category and name
- m_exitService=getService().getModel().getService(m_exitCategory, m_exitName);
-
- String immediate=((org.w3c.dom.Element)n).getAttribute(IMMEDIATE);
-
- // Initialize link, even if service is null - this will be
- // reported as a validation error later
- getLinks().add(new ESBLink(m_exitCategory, m_exitName, m_exitService,
- (immediate != null && immediate.equalsIgnoreCase("true"))));
- }
- }
- }
- }
- }
-
- /**
- * This method determines if the action represents a loop construct.
- *
- * @return Whether the action represents a loop construct
- */
- @Override
- public boolean isLoop() {
- return(true);
- }
-
- /**
- * This method indicates whether the action is an initiator.
- * Initiator actions must precede any other session based
- * action, within an ESB service.
- *
- * @return Whether the action is an initiator
- */
- @Override
- public boolean isInitiator() {
- return(true);
- }
-
- /**
- * This method returns the mandatory property names.
- *
- * @return The mandatory property names
- */
- @Override
- protected java.util.List<String> getMandatoryProperties() {
- java.util.List<String> ret=super.getMandatoryProperties();
- ret.add(PATHS);
- return(ret);
- }
-
- /**
- * This method validates the ESB action and reports warnings or
- * errors to the supplied model listener.
- *
- * @param l The model listener
- */
- @Override
- public void validate(ModelListener l) {
- super.validate(l);
-
- // While action must be first conversation based action in
- // the service
- if (getService() != null && getService().getActions().size() > 0) {
- ESBAction act=getService().getActions().get(0);
-
- if (act != this) {
- l.error(new ModelIssue(this, org.scribble.util.MessageUtil.format(
- java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.Messages"),
- "_MUST_BE_FIRST_ACTION",
- new String[]{"While"})));
- }
- }
-
- // TODO: Validate while/exit order, if decision-method
- // specified, that method exists, if expression, then
- // validate the expression etc.
-
- // TODO: Validate that the loop service returns back to the
- // while action for all paths
-
- org.w3c.dom.NodeList nl=getPropertyChildNodes(PATHS);
- boolean f_while=false;
- boolean f_exit=false;
- boolean f_multipleWhiles=false;
- boolean f_multipleExits=false;
- boolean f_serviceDetailsMissing=false;
- boolean f_pathAfterExit=false;
- boolean f_immediateInvalid=false;
-
- for (int i=0; nl != null && i < nl.getLength(); i++) {
-
- org.w3c.dom.Node n=nl.item(i);
-
- if (n instanceof org.w3c.dom.Element) {
- if (n.getNodeName().equals(WHILE)) {
-
- if (f_while) {
- f_multipleWhiles = true;
- }
-
- if (f_exit) {
- f_pathAfterExit = true;
- }
-
- f_while = true;
-
- if (((org.w3c.dom.Element)n).hasAttribute(SERVICE_CATEGORY) == false ||
- ((org.w3c.dom.Element)n).hasAttribute(SERVICE_NAME) == false) {
- f_serviceDetailsMissing = true;
- }
-
- String immediate=((org.w3c.dom.Element)n).getAttribute(IMMEDIATE);
-
- if (((org.w3c.dom.Element)n).hasAttribute(IMMEDIATE) &&
- immediate.equalsIgnoreCase("true") == false &&
- immediate.equalsIgnoreCase("false") == false) {
- f_immediateInvalid = true;
- }
- } else if (n.getNodeName().equals(EXIT)) {
-
- if (f_exit) {
- f_multipleExits = true;
- }
-
- f_exit = true;
-
- if (((org.w3c.dom.Element)n).hasAttribute(SERVICE_CATEGORY) == false ||
- ((org.w3c.dom.Element)n).hasAttribute(SERVICE_NAME) == false) {
- f_serviceDetailsMissing = true;
- }
-
- String immediate=((org.w3c.dom.Element)n).getAttribute(IMMEDIATE);
-
- if (((org.w3c.dom.Element)n).hasAttribute(IMMEDIATE) &&
- immediate.equalsIgnoreCase("true") == false &&
- immediate.equalsIgnoreCase("false") == false) {
- f_immediateInvalid = true;
- }
- }
- }
- }
-
- // Report any errors
- if (nl != null && (f_while == false || f_multipleWhiles)) {
- l.error(new ModelIssue(this, org.scribble.util.MessageUtil.format(
- java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.Messages"),
- "_MUST_DEFINE_SINGLE_WHILE_PATH",
- new String[]{})));
- }
-
- if (nl != null && (f_exit == false || f_multipleExits)) {
- l.error(new ModelIssue(this, org.scribble.util.MessageUtil.format(
- java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.Messages"),
- "_MUST_DEFINE_SINGLE_WHILE_EXIT",
- new String[]{})));
- }
-
- if (f_pathAfterExit) {
- l.error(new ModelIssue(this, org.scribble.util.MessageUtil.format(
- java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.Messages"),
- "_WHILE_PATH_AFTER_EXIT",
- new String[]{})));
- }
-
- if (f_serviceDetailsMissing) {
- l.error(new ModelIssue(this, org.scribble.util.MessageUtil.format(
- java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.Messages"),
- "_PATH_SERVICE_DETAILS_MISSING",
- new String[]{})));
- }
-
- if (f_immediateInvalid) {
- l.error(new ModelIssue(this, org.scribble.util.MessageUtil.format(
- java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.Messages"),
- "_BOOLEAN",
- new String[]{IMMEDIATE})));
- }
- }
-
- /**
- * This method converts the ESB action into an equivalent
- * behavioural description for conformance checking.
- *
- * @param activities The list of activities that will contain
- * the converted action(s)
- * @param context The conversion context
- */
- @Override
- public void convert(java.util.List<Activity> activities,
- ConversionContext context) {
-
- While elem=new While();
- activities.add(elem);
-
- elem.derivedFrom(this);
-
- ConditionalBlock block=new ConditionalBlock();
- elem.setBlock(block);
-
- if (m_loopService != null) {
- context.push(getService());
-
- m_loopService.convert(elem.getBlock().getContents(), context);
-
- context.pop(getService());
- }
-
- if (m_exitService != null) {
- m_exitService.convert(activities, context);
- }
- }
-
- /**
- * This method adds a path to the when action.
- *
- * @param category The service category
- * @param name The service name
- * @param position The position
- */
- public void addPath(String category, String name, boolean exit,
- java.util.List<MessageSignature> messageTypes,
- int position) {
-
- org.w3c.dom.NodeList nl=
- getAction().getElementsByTagName(PROPERTY_ELEMENT);
-
- org.w3c.dom.Element paths=null;
-
- for (int i=0; paths == null && i < nl.getLength(); i++) {
- if (nl.item(i) instanceof org.w3c.dom.Element) {
- String propName=((org.w3c.dom.Element)nl.item(i)).getAttribute(NAME_ATTR);
-
- if (propName != null && propName.equals(PATHS)) {
- paths = (org.w3c.dom.Element)nl.item(i);
- }
- }
- }
-
- if (paths == null) {
- paths = getAction().getOwnerDocument().createElement(PROPERTY_ELEMENT);
- paths.setAttribute(NAME_ATTR, PATHS);
-
- getAction().appendChild(paths);
- }
-
- org.w3c.dom.Element path=
- getAction().getOwnerDocument().createElement(exit?EXIT:WHILE);
- path.setAttribute(SERVICE_CATEGORY, category);
- path.setAttribute(SERVICE_NAME, name);
-
- paths.appendChild(path);
-
- for (int i=0; i < messageTypes.size(); i++) {
- org.w3c.dom.Element mt=
- getAction().getOwnerDocument().createElement(MESSAGE_ELEMENT);
-
- if (messageTypes.get(i).getTypes().size() == 1) {
- TypeReference ref=messageTypes.get(i).getTypes().get(0);
- String type="";
-
- if (ref.getNamespace() != null) {
- type += "{"+ref.getNamespace()+"}";
- }
- type += ref.getLocalpart();
-
- mt.setAttribute(TYPE_ATTR, type);
-
- path.appendChild(mt);
- }
- }
- }
-
- private String m_loopCategory=null;
- private String m_loopName=null;
- private ESBService m_loopService=null;
- private String m_exitCategory=null;
- private String m_exitName=null;
- private ESBService m_exitService=null;
-}
Copied: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/AbstractInteractionMessageAction.java (from rev 436, cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/AbstractInteractionMessageAction.java)
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/AbstractInteractionMessageAction.java (rev 0)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/AbstractInteractionMessageAction.java 2009-01-12 21:15:25 UTC (rev 459)
@@ -0,0 +1,143 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, 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.
+ */
+package org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful;
+
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.*;
+
+/**
+ * The abstract model component for the 'ReceiveMessageAction'
+ * and 'SendMessageAction'.
+ *
+ * @author gary
+ */
+public abstract class AbstractInteractionMessageAction extends AbstractStatefulESBAction {
+
+ public static final String IDENTITIES = "identities";
+ public static final String MESSAGE_TYPE = "messageType";
+ public static final String OPERATION = "operation";
+ public static final String CLIENT_EPR = "clientEPR";
+
+ /**
+ * The constructor for the action.
+ *
+ * @param service The reference to the service in which
+ * the action is contained
+ * @param action The XML configuration details for the action
+ */
+ public AbstractInteractionMessageAction(ESBService service,
+ org.w3c.dom.Element action) {
+ super(service, action);
+ }
+
+ /**
+ * The contructor for initializing a new action.
+ */
+ protected AbstractInteractionMessageAction(ESBService service,
+ String actionClass) {
+ super(service, actionClass);
+ }
+
+ /**
+ * This method returns the mandatory property names.
+ *
+ * @return The mandatory property names
+ */
+ @Override
+ protected java.util.List<String> getMandatoryProperties() {
+ java.util.List<String> ret=super.getMandatoryProperties();
+ ret.add(MESSAGE_TYPE);
+ ret.add(IDENTITIES);
+ return(ret);
+ }
+
+ /**
+ * This method returns the optional property names.
+ *
+ * @return The optional property names
+ */
+ @Override
+ protected java.util.List<String> getOptionalProperties() {
+ java.util.List<String> ret=super.getOptionalProperties();
+ ret.add(OPERATION);
+ ret.add(CLIENT_EPR);
+ return(ret);
+ }
+
+ /**
+ * This method sets the operation property.
+ *
+ * @param operation The operation
+ */
+ public void setOperation(String operation) {
+
+ if (operation != null) {
+ org.w3c.dom.Element prop=getPropertyElement(OPERATION);
+
+ if (prop != null) {
+ prop.setAttribute(VALUE_ATTR, operation);
+ }
+ } else {
+ removePropertyElement(OPERATION);
+ }
+ }
+
+ /**
+ * This method sets the message type.
+ *
+ * @param type The message type
+ */
+ public void setMessageType(String type) {
+
+ org.w3c.dom.Element prop=getPropertyElement(MESSAGE_TYPE);
+
+ if (prop != null) {
+ prop.setAttribute(VALUE_ATTR, type);
+ }
+ }
+
+ /**
+ * This method returns the message type.
+ *
+ * @return The message type
+ */
+ public String getMessageType() {
+ String ret=null;
+
+ org.w3c.dom.Element prop=getPropertyElement(MESSAGE_TYPE);
+
+ if (prop != null && prop.hasAttribute(VALUE_ATTR)) {
+ ret = prop.getAttribute(VALUE_ATTR);
+ }
+
+ return(ret);
+ }
+
+ /**
+ * This method sets the client's EPR label property.
+ *
+ * @param epr The client EPR label
+ */
+ public void setClientEPR(String epr) {
+
+ org.w3c.dom.Element prop=getPropertyElement(CLIENT_EPR);
+
+ if (prop != null) {
+ prop.setAttribute(VALUE_ATTR, epr);
+ }
+ }
+}
Property changes on: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/AbstractInteractionMessageAction.java
___________________________________________________________________
Name: svn:mergeinfo
+
Copied: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/AbstractStatefulESBAction.java (from rev 436, cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/AbstractESBAction.java)
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/AbstractStatefulESBAction.java (rev 0)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/AbstractStatefulESBAction.java 2009-01-12 21:15:25 UTC (rev 459)
@@ -0,0 +1,153 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, 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.
+ */
+package org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful;
+
+import java.util.logging.Logger;
+
+import org.scribble.model.admin.ModelIssue;
+import org.scribble.model.admin.ModelListener;
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.*;
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.AbstractESBAction;
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.util.ProblemDefinitions;
+
+/**
+ * This is the generic ESB action class.
+ *
+ * @author gary
+ */
+public abstract class AbstractStatefulESBAction extends AbstractESBAction {
+
+ public static final String IDENTITIES = "identities";
+ public static final String ACTION_ELEMENT = "action";
+ public static final String VALUE_ATTR = "value";
+ public static final String NAME_ATTR = "name";
+ public static final String PROPERTY_ELEMENT = "property";
+ public static final String CLASS_PROPERTY = "class";
+
+ /**
+ * The constructor for initializing the action based on
+ * an existing DOM element.
+ */
+ protected AbstractStatefulESBAction(ESBService service,
+ org.w3c.dom.Element action) {
+ super(service, action);
+ }
+
+ /**
+ * The contructor for initializing a new action.
+ */
+ protected AbstractStatefulESBAction(ESBService service,
+ String actionClass) {
+ super(service, actionClass);
+ }
+
+ /**
+ * This method validates the ESB action and reports warnings or
+ * errors to the supplied model listener.
+ *
+ * @param l The model listener
+ */
+ public void validate(ModelListener l) {
+ super.validate(l);
+
+ String session=getPropertyValue(DefaultESBService.BUSINESS_OBJECT_TYPE_PROPERTY);
+
+ if (session != null) {
+ // Validate that the business object type exists
+ try {
+ ClassLoader cl=
+ org.jboss.tools.overlord.cdl.runtime.jbossesb.model.util.ClasspathUtil.getClassLoader(getService().getModel());
+
+ try {
+ Class.forName(session, true, cl);
+ } catch(ClassNotFoundException cfne) {
+ l.error(new ModelIssue(this, org.scribble.util.MessageUtil.format(
+ java.util.PropertyResourceBundle.getBundle(
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.Messages"),
+ "_NOT_FOUND_BUSINESS_OBJECT_TYPE",
+ new String[]{session})));
+ }
+
+ } catch(Exception e) {
+ logger.log(java.util.logging.Level.SEVERE,
+ "Failed to load business class '"+session+"'", e);
+ }
+ }
+
+ // Validate links
+ for (int i=0; i < getLinks().size(); i++) {
+ ESBLink link=(ESBLink)getLinks().get(i);
+
+ if (getService().getSessionName() != null &&
+ isPerform() == false && link.isRemote() == false &&
+ link.getService().getSessionName() != null &&
+ getService().getSessionName().equals(
+ link.getService().getSessionName()) == false) {
+
+ java.util.Map<String,Object> props=new java.util.HashMap<String,Object>();
+ props.put(ProblemDefinitions.PROBLEM_PROPERTY,
+ DefaultESBService.BUSINESS_OBJECT_TYPE_PROPERTY);
+
+ l.error(new ModelIssue(this, org.scribble.util.MessageUtil.format(
+ java.util.PropertyResourceBundle.getBundle(
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
+ "_MISMATCH_SESSION_CLASS",
+ new String[]{link.getCategory(),link.getName()}), props));
+ }
+ }
+ }
+
+ /**
+ * This method determines whether the action is related to a behavioural
+ * session.
+ *
+ * @return Whether the action is session based
+ */
+ public boolean isSessionBased() {
+ return(true);
+ }
+
+ /**
+ * This method returns the optional property names.
+ *
+ * @return The optional property names
+ */
+ protected java.util.List<String> getOptionalProperties() {
+ java.util.List<String> ret=super.getOptionalProperties();
+ ret.add(DefaultESBService.BUSINESS_OBJECT_TYPE_PROPERTY);
+ ret.add(IDENTITIES);
+ return(ret);
+ }
+
+ /**
+ * This method sets the business object type property.
+ *
+ * @param name The business object type
+ */
+ public void setBusinessObjectType(String type) {
+
+ org.w3c.dom.Element prop=getPropertyElement(
+ DefaultESBService.BUSINESS_OBJECT_TYPE_PROPERTY);
+
+ if (prop != null) {
+ prop.setAttribute(VALUE_ATTR, type);
+ }
+ }
+
+ private static Logger logger = Logger.getLogger("org.jboss.tools.overlord.cdl.runtime.jbossesb.model");
+}
Property changes on: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/AbstractStatefulESBAction.java
___________________________________________________________________
Name: svn:mergeinfo
+
Copied: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/CreateSessionAction.java (from rev 436, cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/CreateSessionAction.java)
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/CreateSessionAction.java (rev 0)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/CreateSessionAction.java 2009-01-12 21:15:25 UTC (rev 459)
@@ -0,0 +1,172 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, 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.
+ */
+package org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful;
+
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.ConversionContext;
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.ESBAction;
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.ESBActionFactory;
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.ESBService;
+import org.scribble.model.*;
+import org.scribble.model.admin.ModelIssue;
+import org.scribble.model.admin.ModelListener;
+
+/**
+ * The model component for the 'CreateSessionAction'.
+ *
+ * @author gary
+ */
+public class CreateSessionAction extends AbstractStatefulESBAction {
+
+ public static final String ROOT = "root";
+ public static final String CONVERSATION_TYPE = "conversationType";
+
+ /**
+ * The constructor for the action.
+ *
+ * @param service The reference to the service in which
+ * the action is contained
+ * @param action The XML configuration details for the action
+ */
+ public CreateSessionAction(ESBService service,
+ org.w3c.dom.Element action) {
+ super(service, action);
+ }
+
+ /**
+ * This constructor initializes the DOM element for
+ * the action.
+ *
+ * @param service The reference to the service in which
+ * the action will be contained
+ */
+ public CreateSessionAction(ESBService service) {
+ super(service, ESBActionFactory.getConversationAction(
+ CreateSessionAction.class));
+ }
+
+ /**
+ * This method determines whether the ESB action represents
+ * a CreateSessionAction.
+ *
+ * @return Whether the action is a CreateSessionAction
+ */
+ public boolean isCreateSession() {
+ return(true);
+ }
+
+ /**
+ * This method returns the optional property names.
+ *
+ * @return The optional property names
+ */
+ @Override
+ protected java.util.List<String> getOptionalProperties() {
+ java.util.List<String> ret=super.getOptionalProperties();
+ ret.add(CONVERSATION_TYPE);
+ ret.add(ROOT);
+ return(ret);
+ }
+
+ /**
+ * This method validates the ESB action and reports warnings or
+ * errors to the supplied model listener.
+ *
+ * @param l The model listener
+ */
+ @Override
+ public void validate(ModelListener l) {
+ super.validate(l);
+
+ // Action must be first conversation based action in
+ // the service
+ if (getService() != null && getService().getActions().size() > 0) {
+ ESBAction act=getService().getActions().get(0);
+
+ if (act != this) {
+ l.error(new ModelIssue(this, org.scribble.util.MessageUtil.format(
+ java.util.PropertyResourceBundle.getBundle(
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
+ "_MUST_BE_FIRST_ACTION",
+ new String[]{"CreateSession"})));
+ }
+ }
+
+ // If service is root, then need to defined conversation type
+ if (getService().isRoot()) {
+ if (getService().getConversationType() == null) {
+ l.error(new ModelIssue(this, org.scribble.util.MessageUtil.format(
+ java.util.PropertyResourceBundle.getBundle(
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
+ "_NOT_SPECIFIED_CONVERSATION_TYPE",
+ new String[]{})));
+ } else {
+ int index=getService().getConversationType().indexOf('@');
+ String convType=getService().getConversationType().trim();
+
+ if (index == -1 || index == convType.length()-1) {
+ l.error(new ModelIssue(this, org.scribble.util.MessageUtil.format(
+ java.util.PropertyResourceBundle.getBundle(
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
+ "_NOT_SPECIFIED_CONVERSATION_TYPE_ROLE",
+ new String[]{convType})));
+ }
+ }
+ }
+ }
+
+ /**
+ * This method converts the ESB action into an equivalent
+ * behavioural description for conformance checking.
+ *
+ * @param activities The list of activities that will contain
+ * the converted action(s)
+ * @param context The conversion context
+ */
+ @Override
+ public void convert(java.util.List<Activity> activities,
+ ConversionContext context) {
+ }
+
+ /**
+ * This method sets the root property.
+ *
+ * @param root The root
+ */
+ public void setRoot(boolean root) {
+
+ org.w3c.dom.Element prop=getPropertyElement(ROOT);
+
+ if (prop != null) {
+ prop.setAttribute(VALUE_ATTR, ""+root);
+ }
+ }
+
+ /**
+ * This method sets the conversation type property.
+ *
+ * @param name The conversation type
+ */
+ public void setConversationType(String type) {
+
+ org.w3c.dom.Element prop=getPropertyElement(CONVERSATION_TYPE);
+
+ if (prop != null) {
+ prop.setAttribute(VALUE_ATTR, type);
+ }
+ }
+}
Property changes on: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/CreateSessionAction.java
___________________________________________________________________
Name: svn:mergeinfo
+
Copied: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/IfAction.java (from rev 436, cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/IfAction.java)
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/IfAction.java (rev 0)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/IfAction.java 2009-01-12 21:15:25 UTC (rev 459)
@@ -0,0 +1,324 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, 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.
+ */
+package org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful;
+
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.*;
+import org.scribble.model.*;
+import org.scribble.model.admin.ModelIssue;
+import org.scribble.model.admin.ModelListener;
+import org.scribble.conversation.model.*;
+
+/**
+ * The model component for the 'IfAction'.
+ *
+ * @author gary
+ */
+public class IfAction extends AbstractStatefulESBAction {
+
+ public static final String SERVICE_NAME = "service-name";
+ public static final String SERVICE_CATEGORY = "service-category";
+ public static final String IMMEDIATE = "immediate";
+ public static final String EXPRESSION = "expression";
+ public static final String ELSE = "else";
+ public static final String ELSEIF = "elseif";
+ public static final String IF = "if";
+ public static final String PATHS = "paths";
+
+ /**
+ * The constructor for the action.
+ *
+ * @param service The reference to the service in which
+ * the action is contained
+ * @param action The XML configuration details for the action
+ */
+ public IfAction(ESBService service,
+ org.w3c.dom.Element action) {
+ super(service, action);
+ }
+
+ /**
+ * This constructor initializes the DOM element for
+ * the action.
+ *
+ * @param service The reference to the service in which
+ * the action will be contained
+ */
+ public IfAction(ESBService service) {
+ super(service, ESBActionFactory.getConversationAction(
+ IfAction.class));
+ }
+
+ /**
+ * This method initializes the links with the ESB service descriptors
+ * identified in each path of the action.
+ */
+ @Override
+ public void initializeLinks() {
+ super.initializeLinks();
+
+ org.w3c.dom.NodeList nl=getPropertyChildNodes(PATHS);
+
+ for (int i=0; i < nl.getLength(); i++) {
+
+ org.w3c.dom.Node n=nl.item(i);
+
+ if (n instanceof org.w3c.dom.Element &&
+ (n.getNodeName().equals(IF) ||
+ n.getNodeName().equals(ELSEIF) ||
+ n.getNodeName().equals(ELSE))) {
+ if (((org.w3c.dom.Element)n).hasAttribute(SERVICE_CATEGORY) &&
+ ((org.w3c.dom.Element)n).hasAttribute(SERVICE_NAME)) {
+ String category=((org.w3c.dom.Element)n).getAttribute(SERVICE_CATEGORY);
+ String name=((org.w3c.dom.Element)n).getAttribute(SERVICE_NAME);
+
+ // Lookup service associated with category and name
+ ESBService service=getService().getModel().getService(category, name);
+
+ String immediate=((org.w3c.dom.Element)n).getAttribute(IMMEDIATE);
+
+ // Initialize link, even if service is null - this will be
+ // reported as a validation error later
+ getLinks().add(new ESBLink(category, name, service,
+ (immediate != null && immediate.equalsIgnoreCase("true"))));
+ }
+ }
+ }
+ }
+
+ /**
+ * This method returns the mandatory property names.
+ *
+ * @return The mandatory property names
+ */
+ @Override
+ protected java.util.List<String> getMandatoryProperties() {
+ java.util.List<String> ret=super.getMandatoryProperties();
+ ret.add(PATHS);
+ return(ret);
+ }
+
+ /**
+ * This method validates the ESB action and reports warnings or
+ * errors to the supplied model listener.
+ *
+ * @param l The model listener
+ */
+ @Override
+ public void validate(ModelListener l) {
+ super.validate(l);
+
+ org.w3c.dom.NodeList nl=getPropertyChildNodes(PATHS);
+ boolean f_if=false;
+ boolean f_else=false;
+ boolean f_orderWrong=false;
+ boolean f_serviceDetailsMissing=false;
+ boolean f_immediateInvalid=false;
+
+ for (int i=0; nl != null && i < nl.getLength(); i++) {
+
+ org.w3c.dom.Node n=nl.item(i);
+
+ if (n instanceof org.w3c.dom.Element) {
+ if (n.getNodeName().equals(IF)) {
+ if (f_if) {
+ f_orderWrong = true;
+ }
+
+ f_if = true;
+
+ if (((org.w3c.dom.Element)n).hasAttribute(SERVICE_CATEGORY) == false ||
+ ((org.w3c.dom.Element)n).hasAttribute(SERVICE_NAME) == false) {
+ f_serviceDetailsMissing = true;
+ }
+
+ String immediate=((org.w3c.dom.Element)n).getAttribute(IMMEDIATE);
+
+ if (((org.w3c.dom.Element)n).hasAttribute(IMMEDIATE) &&
+ immediate.equalsIgnoreCase("true") == false &&
+ immediate.equalsIgnoreCase("false") == false) {
+ f_immediateInvalid = true;
+ }
+ } else if (n.getNodeName().equals(ELSEIF)) {
+
+ if (f_if == false || f_else) {
+ f_orderWrong = true;
+ }
+
+ if (((org.w3c.dom.Element)n).hasAttribute(SERVICE_CATEGORY) == false ||
+ ((org.w3c.dom.Element)n).hasAttribute(SERVICE_NAME) == false) {
+ f_serviceDetailsMissing = true;
+ }
+
+ String immediate=((org.w3c.dom.Element)n).getAttribute(IMMEDIATE);
+
+ if (((org.w3c.dom.Element)n).hasAttribute(IMMEDIATE) &&
+ immediate.equalsIgnoreCase("true") == false &&
+ immediate.equalsIgnoreCase("false") == false) {
+ f_immediateInvalid = true;
+ }
+ } else if (n.getNodeName().equals(ELSE)) {
+
+ if (f_if == false || f_else) {
+ f_orderWrong = true;
+ }
+
+ f_else = true;
+
+ if (((org.w3c.dom.Element)n).hasAttribute(SERVICE_CATEGORY) == false ||
+ ((org.w3c.dom.Element)n).hasAttribute(SERVICE_NAME) == false) {
+ f_serviceDetailsMissing = true;
+ }
+
+ String immediate=((org.w3c.dom.Element)n).getAttribute(IMMEDIATE);
+
+ if (((org.w3c.dom.Element)n).hasAttribute(IMMEDIATE) &&
+ immediate.equalsIgnoreCase("true") == false &&
+ immediate.equalsIgnoreCase("false") == false) {
+ f_immediateInvalid = true;
+ }
+ }
+ }
+ }
+
+ // Report any errors
+ if (nl != null && (f_if == false || f_orderWrong)) {
+ l.error(new ModelIssue(this, org.scribble.util.MessageUtil.format(
+ java.util.PropertyResourceBundle.getBundle(
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
+ "_IF_ORDER_WRONG",
+ new String[]{})));
+ }
+
+ if (f_serviceDetailsMissing) {
+ l.error(new ModelIssue(this, org.scribble.util.MessageUtil.format(
+ java.util.PropertyResourceBundle.getBundle(
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
+ "_PATH_SERVICE_DETAILS_MISSING",
+ new String[]{})));
+ }
+
+ if (f_immediateInvalid) {
+ l.error(new ModelIssue(this, org.scribble.util.MessageUtil.format(
+ java.util.PropertyResourceBundle.getBundle(
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
+ "_BOOLEAN",
+ new String[]{IMMEDIATE})));
+ }
+ }
+
+ /**
+ * This method converts the ESB action into an equivalent
+ * behavioural description for conformance checking.
+ *
+ * @param activities The list of activities that will contain
+ * the converted action(s)
+ * @param context The conversion context
+ */
+ @Override
+ public void convert(java.util.List<Activity> activities,
+ ConversionContext context) {
+
+ org.w3c.dom.NodeList nl=getPropertyChildNodes(PATHS);
+
+ If choice=new If();
+ activities.add(choice);
+
+ for (int i=0; i < nl.getLength(); i++) {
+
+ org.w3c.dom.Node n=nl.item(i);
+
+ if (n instanceof org.w3c.dom.Element) {
+ if (n.getNodeName().equals(IF) ||
+ n.getNodeName().equals(ELSEIF)) {
+ String category=((org.w3c.dom.Element)n).getAttribute(SERVICE_CATEGORY);
+ String name=((org.w3c.dom.Element)n).getAttribute(SERVICE_NAME);
+
+ // TODO: Convert the conditional expression if defined
+
+ ConditionalBlock cond=new ConditionalBlock();
+ choice.getConditionalBlocks().add(cond);
+
+ ESBService service=getService().getModel().getService(category, name);
+
+ if (service != null) {
+ service.convert(cond.getContents(), context);
+ }
+ } else if (n.getNodeName().equals(ELSE)) {
+ String category=((org.w3c.dom.Element)n).getAttribute(SERVICE_CATEGORY);
+ String name=((org.w3c.dom.Element)n).getAttribute(SERVICE_NAME);
+
+ Block block=new Block();
+ choice.setElseBlock(block);
+
+ ESBService service=getService().getModel().getService(category, name);
+
+ if (service != null) {
+ service.convert(block.getContents(), context);
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * This method adds a path to the if action.
+ *
+ * @param type The type of path (IF, ELSEIF or ELSE)
+ * @param category The service category
+ * @param name The service name
+ * @param immediate Whether invocation should be immediate
+ * @param expr The expression, if type is IF or ELSEIF
+ * @param position The position, if type is ELSEIF
+ */
+ public void addPath(String type, String category, String name,
+ boolean immediate, String expr, int position) {
+
+ org.w3c.dom.NodeList nl=
+ getAction().getElementsByTagName(PROPERTY_ELEMENT);
+
+ org.w3c.dom.Element paths=null;
+
+ for (int i=0; paths == null && i < nl.getLength(); i++) {
+ if (nl.item(i) instanceof org.w3c.dom.Element) {
+ String propName=((org.w3c.dom.Element)nl.item(i)).getAttribute(NAME_ATTR);
+
+ if (propName != null && propName.equals(PATHS)) {
+ paths = (org.w3c.dom.Element)nl.item(i);
+ }
+ }
+ }
+
+ if (paths == null) {
+ paths = getAction().getOwnerDocument().createElement(PROPERTY_ELEMENT);
+ paths.setAttribute(NAME_ATTR, PATHS);
+
+ getAction().appendChild(paths);
+ }
+
+ org.w3c.dom.Element path=getAction().getOwnerDocument().createElement(type);
+ path.setAttribute(SERVICE_CATEGORY, category);
+ path.setAttribute(SERVICE_NAME, name);
+ path.setAttribute(IMMEDIATE, ""+immediate);
+
+ if (expr != null && (type == IF || type == ELSEIF)) {
+ path.setAttribute(EXPRESSION, expr);
+ }
+
+ paths.appendChild(path);
+ }
+}
Property changes on: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/IfAction.java
___________________________________________________________________
Name: svn:mergeinfo
+
Copied: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/MessageRouterAction.java (from rev 436, cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/MessageRouterAction.java)
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/MessageRouterAction.java (rev 0)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/MessageRouterAction.java 2009-01-12 21:15:25 UTC (rev 459)
@@ -0,0 +1,386 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, 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.
+ */
+package org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful;
+
+import java.util.logging.Logger;
+
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.*;
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.util.IdentityUtil;
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.util.InteractionUtil;
+import org.scribble.conversation.model.*;
+import org.scribble.model.*;
+import org.scribble.model.admin.ModelIssue;
+import org.scribble.model.admin.ModelListener;
+
+/**
+ * The model component for the 'MessageRouterAction'. Although
+ * not an integral part of the behaviour of a service, it provides
+ * a behavioural gateway to ensure that messages sent to a
+ * specific endpoint reference are routed to the appropriate
+ * ESB service descriptor. Therefore the routing configuration
+ * needs to be synchronized with the definition of the service
+ * descriptors representing the various behavioural states associated
+ * with a service.
+ *
+ * @author gary
+ */
+public class MessageRouterAction extends AbstractStatefulESBAction {
+
+ public static final String IDENTITIES_ELEMENT = "identities";
+ public static final String INITIATE = "initiate";
+ public static final String SERVICE_NAME = "service-name";
+ public static final String SERVICE_CATEGORY = "service-category";
+ public static final String ROUTE = "route";
+ public static final String PATHS = "paths";
+ public static final String MESSAGE_ELEMENT="message";
+ public static final String TYPE_ATTR="type";
+
+ /**
+ * The constructor for the action.
+ *
+ * @param service The reference to the service in which
+ * the action is contained
+ * @param action The XML configuration details for the action
+ */
+ public MessageRouterAction(ESBService service,
+ org.w3c.dom.Element action) {
+ super(service, action);
+ }
+
+ /**
+ * This constructor initializes the DOM element for
+ * the action.
+ *
+ * @param service The reference to the service in which
+ * the action will be contained
+ */
+ public MessageRouterAction(ESBService service) {
+ super(service, ESBActionFactory.getConversationAction(
+ MessageRouterAction.class));
+ }
+
+ /**
+ * This method initializes the links with the ESB service descriptors
+ * identified in each path of the action.
+ */
+ @Override
+ public void initializeLinks() {
+ super.initializeLinks();
+
+ org.w3c.dom.NodeList nl=getPropertyChildNodes(PATHS);
+
+ for (int i=0; nl != null && i < nl.getLength(); i++) {
+
+ org.w3c.dom.Node n=nl.item(i);
+
+ if (n instanceof org.w3c.dom.Element) {
+ if (n.getNodeName().equals(ROUTE)) {
+ if (((org.w3c.dom.Element)n).hasAttribute(SERVICE_CATEGORY) &&
+ ((org.w3c.dom.Element)n).hasAttribute(SERVICE_NAME)) {
+ String category=((org.w3c.dom.Element)n).getAttribute(SERVICE_CATEGORY);
+ String name=((org.w3c.dom.Element)n).getAttribute(SERVICE_NAME);
+ String initiate=((org.w3c.dom.Element)n).getAttribute(INITIATE);
+
+ // Lookup service associated with category and name
+ ESBService service=getService().getModel().getService(category, name);
+
+ // Initialize link, even if service is null - this will be
+ // reported as a validation error later
+ getLinks().add(new ESBLink(category, name, service, true));
+
+ if (service != null) {
+ if (initiate != null && initiate.equalsIgnoreCase("true")) {
+ m_initiateServices.add(service);
+ } else {
+ m_services.add(service);
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * This method determines whether the action is related to a behavioural
+ * session.
+ *
+ * @return Whether the action is session based
+ */
+ public boolean isSessionBased() {
+ return(false);
+ }
+
+ /**
+ * This method determines whether the action is a gateway
+ * for inbound requests.
+ *
+ * @return Whether the action is a gateway
+ */
+ public boolean isGateway() {
+ return(true);
+ }
+
+ /**
+ * This method adds a route to the message router action.
+ *
+ * @param category The service category
+ * @param name The service name
+ * @param initiate Whether the route initiates the service
+ * @param messageTypes The list of message types
+ */
+ public void addRoute(String category, String name, boolean initiate,
+ java.util.List<MessageSignature> messageTypes) {
+
+ org.w3c.dom.Element paths=getPropertyElement(PATHS);
+
+ org.w3c.dom.Element path=
+ getAction().getOwnerDocument().createElement(ROUTE);
+ path.setAttribute(SERVICE_CATEGORY, category);
+ path.setAttribute(SERVICE_NAME, name);
+
+ if (initiate) {
+ path.setAttribute(INITIATE, Boolean.toString(initiate));
+ }
+
+ for (int i=0; i < messageTypes.size(); i++) {
+ org.w3c.dom.Element mt=
+ getAction().getOwnerDocument().createElement(MESSAGE_ELEMENT);
+
+ if (messageTypes.get(i).getTypes().size() == 1) {
+ TypeReference ref=messageTypes.get(i).getTypes().get(0);
+
+ mt.setAttribute(TYPE_ATTR, InteractionUtil.getTypeString(ref));
+
+ path.appendChild(mt);
+
+ if (messageTypes.get(i).getParent() instanceof ConversationInteraction &&
+ ((ConversationInteraction)messageTypes.get(i).getParent()).
+ getEnclosingDefinition() instanceof Conversation &&
+ ((ConversationInteraction)messageTypes.get(i).getParent()).
+ getEnclosingDefinition().getModel()
+ instanceof ConversationModel) {
+
+ org.w3c.dom.Element identities=
+ mt.getOwnerDocument().createElement(IDENTITIES_ELEMENT);
+
+ java.util.List<Identity> ids=((Conversation)
+ ((ConversationInteraction)messageTypes.get(i).getParent()).
+ getEnclosingDefinition()).getIdentities();
+
+ java.util.List<IdentityLocator> locators=
+ ((ConversationModel)((ConversationInteraction)messageTypes.get(i).getParent()).
+ getEnclosingDefinition().
+ getModel()).getIdentityLocators();
+
+ IdentityUtil.defineIdentities(identities, messageTypes.get(i),
+ ids, locators);
+
+ mt.appendChild(identities);
+ }
+
+ } else {
+ logger.warning("Can only handle single type message signatures");
+ }
+ }
+
+ paths.appendChild(path);
+ }
+
+ /**
+ * This method returns the number of routes associated with
+ * the message router.
+ *
+ * @return The number of routes
+ */
+ public int getNumberOfRoutes() {
+ int ret=0;
+
+ org.w3c.dom.NodeList nl=getAction().getElementsByTagName(ROUTE);
+
+ ret = nl.getLength();
+
+ return(ret);
+ }
+
+ /**
+ * This method returns the DOM element associated with the
+ * specified route.
+ *
+ * @param index The index of the required route
+ * @return The route element, or null if not found
+ */
+ public org.w3c.dom.Element getRouteElement(int index) {
+ org.w3c.dom.Element ret=null;
+
+ org.w3c.dom.NodeList nl=getAction().getElementsByTagName(ROUTE);
+
+ if (index >= 0 && index < nl.getLength() &&
+ nl.item(index) instanceof org.w3c.dom.Element) {
+ ret = (org.w3c.dom.Element)nl.item(index);
+ }
+
+ return(ret);
+ }
+
+ /**
+ * This method returns the DOM element associated with the
+ * specified service category and name.
+ *
+ * @param category The service category
+ * @param name The service name
+ * @return The route element, or null if not found
+ */
+ public org.w3c.dom.Element getRouteElement(String category,
+ String name) {
+ org.w3c.dom.Element ret=null;
+
+ org.w3c.dom.NodeList nl=getAction().getElementsByTagName(ROUTE);
+
+ for (int i=0; ret == null && i < nl.getLength(); i++) {
+ if (nl.item(i) instanceof org.w3c.dom.Element) {
+ ret = (org.w3c.dom.Element)nl.item(i);
+
+ if (ret.getAttribute(SERVICE_CATEGORY).equals(category) == false ||
+ ret.getAttribute(SERVICE_NAME).equals(name) == false) {
+ ret = null;
+ }
+ }
+ }
+
+ return(ret);
+ }
+
+ /**
+ * This method returns the mandatory property names.
+ *
+ * @return The mandatory property names
+ */
+ @Override
+ protected java.util.List<String> getMandatoryProperties() {
+ java.util.List<String> ret=super.getMandatoryProperties();
+ ret.add(PATHS);
+ return(ret);
+ }
+
+ /**
+ * This method validates the ESB action and reports warnings or
+ * errors to the supplied model listener.
+ *
+ * @param l The model listener
+ */
+ @Override
+ public void validate(ModelListener l) {
+ super.validate(l);
+
+ // Check that message router has no other session based
+ // ESB actions in the same service descriptor
+ if (getService().isSessionBased()) {
+ l.error(new ModelIssue(this, org.scribble.util.MessageUtil.format(
+ java.util.PropertyResourceBundle.getBundle(
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
+ "_CANNOT_SESSION_BASED_ACTIONS_WITH_ROUTER",
+ new String[]{})));
+ }
+
+ // Check that 'initate' services have a 'CreateSessionAction' and
+ // represent the root behaviour
+ for (int i=0; i < m_initiateServices.size(); i++) {
+ ESBService service=m_initiateServices.get(i);
+
+ if (service.isRoot() == false) {
+ l.error(new ModelIssue(this, org.scribble.util.MessageUtil.format(
+ java.util.PropertyResourceBundle.getBundle(
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
+ "_CANNOT_INITIATE_NON_ROOT",
+ new String[]{service.getCategory(),
+ service.getName()})));
+ }
+ }
+
+ // Check that non-'initate' services don't have a 'CreateSessionAction' and
+ // represent the root behaviour
+ for (int i=0; i < m_services.size(); i++) {
+ ESBService service=m_services.get(i);
+
+ if (service.isRoot()) {
+ l.error(new ModelIssue(this, org.scribble.util.MessageUtil.format(
+ java.util.PropertyResourceBundle.getBundle(
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
+ "_MUST_INITIATE_ROOT",
+ new String[]{service.getCategory(),
+ service.getName()})));
+ }
+ }
+
+ org.w3c.dom.NodeList nl=getPropertyChildNodes(PATHS);
+ boolean f_serviceDetailsMissing=false;
+ int routeCount=0;
+
+ for (int i=0; nl != null && i < nl.getLength(); i++) {
+
+ org.w3c.dom.Node n=nl.item(i);
+
+ if (n instanceof org.w3c.dom.Element) {
+ if (n.getNodeName().equals(ROUTE)) {
+ routeCount++;
+
+ if (((org.w3c.dom.Element)n).hasAttribute(SERVICE_CATEGORY) == false ||
+ ((org.w3c.dom.Element)n).hasAttribute(SERVICE_NAME) == false) {
+ f_serviceDetailsMissing = true;
+ }
+ }
+ }
+ }
+
+ // Report any errors
+ if (nl != null && routeCount < 1) {
+ l.error(new ModelIssue(this, org.scribble.util.MessageUtil.format(
+ java.util.PropertyResourceBundle.getBundle(
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
+ "_ROUTER_ONE_OR_MORE_PATHS",
+ new String[]{})));
+ }
+
+ if (f_serviceDetailsMissing) {
+ l.error(new ModelIssue(this, org.scribble.util.MessageUtil.format(
+ java.util.PropertyResourceBundle.getBundle(
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
+ "_PATH_SERVICE_DETAILS_MISSING",
+ new String[]{})));
+ }
+ }
+
+ /**
+ * This method converts the ESB action into an equivalent
+ * behavioural description for conformance checking.
+ *
+ * @param activities The list of activities that will contain
+ * the converted action(s)
+ * @param context The conversion context
+ */
+ @Override
+ public void convert(java.util.List<Activity> activities,
+ ConversionContext context) {
+ }
+
+ private static Logger logger = Logger.getLogger("org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions");
+
+ private java.util.List<ESBService> m_initiateServices=new java.util.Vector<ESBService>();
+ private java.util.List<ESBService> m_services=new java.util.Vector<ESBService>();
+}
Property changes on: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/MessageRouterAction.java
___________________________________________________________________
Name: svn:mergeinfo
+
Copied: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/Messages.properties (from rev 436, cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/Messages.properties)
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/Messages.properties (rev 0)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/Messages.properties 2009-01-12 21:15:25 UTC (rev 459)
@@ -0,0 +1,47 @@
+# /*
+# * JBoss, Home of Professional Open Source
+# * Copyright 2008, Red Hat Middleware LLC, 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.
+# */
+
+_BOOLEAN=Boolean property '{0}' can only have a 'true' or 'false' value
+_CANNOT_INITIATE_NON_ROOT=Cannot 'initiate' non-root service descriptor for category '{0}' and name '{1}'
+_CANNOT_SESSION_BASED_ACTIONS_WITH_ROUTER=Cannot define MessageRouterAction with session based actions in service descriptor
+_IF_ORDER_WRONG=IfAction must have an 'if' path, followed by zero or more 'elseif' paths and ending with an optional 'else' path
+_INVALID_PROPERTY_TYPE=Property '{0}' on class '{1}' must be of type '{2}'
+_MISMATCH_SESSION_CLASS=Session class mismatch with service descriptor for category '{0}' and name '{1}'
+_MULTIPLE_JOINS=Action has multiple joins
+_MUST_DEFINE_SINGLE_WHILE_PATH=While action must have a single 'while' path
+_MUST_DEFINE_SINGLE_WHILE_EXIT=While action must have a single 'exit' path
+_MUST_INITIATE_ROOT=Must 'initiate' root service descriptor for category '{0}' and name '{1}'
+_NOT_FOUND_VARIABLE=Variable '{0}' could not be found on class '{1}'
+_NOT_FOUND_VARIABLE_PROPERTY=Variable '{0}' contains property '{1}' that could not be found on class '{2}'
+_NOT_FOUND_PERFORM_CREATE_SESSION=Perform action can only invoke a service descriptor that starts with a CreateSessionAction
+_NOT_READABLE_PROPERTY=Property '{0}' on class '{1}' is not readable
+_NOT_SPECIFIED_CONVERSATION_TYPE=Conversation type must be specified on root service descriptor
+_NOT_SPECIFIED_CONVERSATION_TYPE_ROLE=Conversation type '{0}' must specify a role name following the '@' symbol
+_NOT_SPECIFIED_PROPERTY=Property '{0}' must be specified
+_NOT_SPECIFIED_REQ_RESP_EPR=Send does not contain request service category/name or response client EPR
+_NOT_WRITABLE_PROPERTY=Property '{0}' on class '{1}' is not writable
+_MUST_BE_FIRST_ACTION='{0}' action must be first in the service descriptor
+_MUST_SPECIFY_STATE_OR_MESSAGE_EXPRESSION=Must specify either a State OR Message based expression
+_PARALLEL_MORE_THAN_TWO_PATHS=Parallel action must specify two or more paths
+_PARALLEL_PATH_AFTER_JOIN=Parallel path must not be defined after a join
+_PATH_SERVICE_DETAILS_MISSING=One or more paths are missing the service cateogry and/or name
+_ROUTER_ONE_OR_MORE_PATHS=MessageRouter action must specify one or more routes
+_SWITCH_ONE_OR_MORE_PATHS=Switch action must specify atleast one case
+_UNKNOWN_PROPERTY=Property '{0}' is unknown for this action
+_WHEN_ONE_OR_MORE_PATHS=When action must specify atleast one entry
+_WHILE_PATH_AFTER_EXIT=While path must not be defined after an exit
Property changes on: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/Messages.properties
___________________________________________________________________
Name: svn:mergeinfo
+
Copied: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/ParallelAction.java (from rev 436, cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/ParallelAction.java)
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/ParallelAction.java (rev 0)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/ParallelAction.java 2009-01-12 21:15:25 UTC (rev 459)
@@ -0,0 +1,327 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, 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.
+ */
+package org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful;
+
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.*;
+import org.scribble.model.*;
+import org.scribble.model.admin.ModelIssue;
+import org.scribble.model.admin.ModelListener;
+import org.scribble.conversation.model.*;
+
+/**
+ * The model component for the 'ParallelAction'.
+ *
+ * @author gary
+ */
+public class ParallelAction extends AbstractStatefulESBAction {
+
+ public static final String SERVICE_NAME = "service-name";
+ public static final String SERVICE_CATEGORY = "service-category";
+ public static final String IMMEDIATE = "immediate";
+ private static final String JOIN = "join";
+ private static final String PATH = "path";
+ private static final String PATHS = "paths";
+
+ /**
+ * The constructor for the action.
+ *
+ * @param service The reference to the service in which
+ * the action is contained
+ * @param action The XML configuration details for the action
+ */
+ public ParallelAction(ESBService service,
+ org.w3c.dom.Element action) {
+ super(service, action);
+ }
+
+ /**
+ * This constructor initializes the DOM element for
+ * the action.
+ *
+ * @param service The reference to the service in which
+ * the action will be contained
+ */
+ public ParallelAction(ESBService service) {
+ super(service, ESBActionFactory.getConversationAction(
+ ParallelAction.class));
+ }
+
+ /**
+ * This method initializes the links with the ESB service descriptors
+ * identified in each path of the action.
+ */
+ @Override
+ public void initializeLinks() {
+ super.initializeLinks();
+
+ org.w3c.dom.NodeList nl=getPropertyChildNodes(PATHS);
+
+ for (int i=0; i < nl.getLength(); i++) {
+
+ org.w3c.dom.Node n=nl.item(i);
+
+ if (n instanceof org.w3c.dom.Element) {
+ if (n.getNodeName().equals(PATH)) {
+ if (((org.w3c.dom.Element)n).hasAttribute(SERVICE_CATEGORY) &&
+ ((org.w3c.dom.Element)n).hasAttribute(SERVICE_NAME)) {
+ String category=((org.w3c.dom.Element)n).getAttribute(SERVICE_CATEGORY);
+ String name=((org.w3c.dom.Element)n).getAttribute(SERVICE_NAME);
+
+ // Lookup service associated with category and name
+ ESBService service=getService().getModel().getService(category, name);
+
+ String immediate=((org.w3c.dom.Element)n).getAttribute(IMMEDIATE);
+
+ // Initialize link, even if service is null - this will be
+ // reported as a validation error later
+ getLinks().add(new ESBLink(category, name, service,
+ (immediate != null && immediate.equalsIgnoreCase("true"))));
+
+ if (service != null) {
+ m_services.add(service);
+ }
+ }
+ } else if (n.getNodeName().equals(JOIN)) {
+ if (((org.w3c.dom.Element)n).hasAttribute(SERVICE_CATEGORY) &&
+ ((org.w3c.dom.Element)n).hasAttribute(SERVICE_NAME)) {
+ m_joinCategory=((org.w3c.dom.Element)n).getAttribute(SERVICE_CATEGORY);
+ m_joinName=((org.w3c.dom.Element)n).getAttribute(SERVICE_NAME);
+
+ // Lookup service associated with category and name
+ m_joinService=getService().getModel().getService(m_joinCategory, m_joinName);
+
+ // Initialize link, even if service is null - this will be
+ // reported as a validation error later
+ getLinks().add(new ESBLink(m_joinCategory, m_joinName, m_joinService, true));
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * This method returns the mandatory property names.
+ *
+ * @return The mandatory property names
+ */
+ @Override
+ protected java.util.List<String> getMandatoryProperties() {
+ java.util.List<String> ret=super.getMandatoryProperties();
+ ret.add(PATHS);
+ return(ret);
+ }
+
+ /**
+ * This method validates the ESB action and reports warnings or
+ * errors to the supplied model listener.
+ *
+ * @param l The model listener
+ */
+ @Override
+ public void validate(ModelListener l) {
+ super.validate(l);
+
+ org.w3c.dom.NodeList nl=getPropertyChildNodes(PATHS);
+ boolean f_joined=false;
+ int pathCount=0;
+ boolean f_pathAfterJoin=false;
+ boolean f_multipleJoins=false;
+ boolean f_serviceDetailsMissing=false;
+ boolean f_immediateInvalid=false;
+
+ for (int i=0; nl != null && i < nl.getLength(); i++) {
+
+ org.w3c.dom.Node n=nl.item(i);
+
+ if (n instanceof org.w3c.dom.Element) {
+ if (n.getNodeName().equals(PATH)) {
+ pathCount++;
+
+ if (f_joined) {
+ f_pathAfterJoin = true;
+ }
+
+ if (((org.w3c.dom.Element)n).hasAttribute(SERVICE_CATEGORY) == false ||
+ ((org.w3c.dom.Element)n).hasAttribute(SERVICE_NAME) == false) {
+ f_serviceDetailsMissing = true;
+ }
+
+ String immediate=((org.w3c.dom.Element)n).getAttribute(IMMEDIATE);
+
+ if (((org.w3c.dom.Element)n).hasAttribute(IMMEDIATE) &&
+ immediate.equalsIgnoreCase("true") == false &&
+ immediate.equalsIgnoreCase("false") == false) {
+ f_immediateInvalid = true;
+ }
+ } else if (n.getNodeName().equals(JOIN)) {
+
+ if (f_joined) {
+ f_multipleJoins = true;
+ }
+
+ f_joined = true;
+
+ if (((org.w3c.dom.Element)n).hasAttribute(SERVICE_CATEGORY) == false ||
+ ((org.w3c.dom.Element)n).hasAttribute(SERVICE_NAME) == false) {
+ f_serviceDetailsMissing = true;
+ }
+ }
+ }
+ }
+
+ // Report any errors
+ if (nl != null && pathCount < 2) {
+ l.error(new ModelIssue(this, org.scribble.util.MessageUtil.format(
+ java.util.PropertyResourceBundle.getBundle(
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
+ "_PARALLEL_MORE_THAN_TWO_PATHS",
+ new String[]{})));
+ }
+
+ if (f_pathAfterJoin) {
+ l.error(new ModelIssue(this, org.scribble.util.MessageUtil.format(
+ java.util.PropertyResourceBundle.getBundle(
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
+ "_PARALLEL_PATH_AFTER_JOIN",
+ new String[]{})));
+ }
+
+ if (f_multipleJoins) {
+ l.error(new ModelIssue(this, org.scribble.util.MessageUtil.format(
+ java.util.PropertyResourceBundle.getBundle(
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
+ "_MULTIPLE_JOINS",
+ new String[]{})));
+ }
+
+ if (f_serviceDetailsMissing) {
+ l.error(new ModelIssue(this, org.scribble.util.MessageUtil.format(
+ java.util.PropertyResourceBundle.getBundle(
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
+ "_PATH_SERVICE_DETAILS_MISSING",
+ new String[]{})));
+ }
+
+ if (f_immediateInvalid) {
+ l.error(new ModelIssue(this, org.scribble.util.MessageUtil.format(
+ java.util.PropertyResourceBundle.getBundle(
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
+ "_BOOLEAN",
+ new String[]{IMMEDIATE})));
+ }
+ }
+
+ /**
+ * This method converts the ESB action into an equivalent
+ * behavioural description for conformance checking.
+ *
+ * @param activities The list of activities that will contain
+ * the converted action(s)
+ * @param context The conversion context
+ */
+ @Override
+ public void convert(java.util.List<Activity> activities,
+ ConversionContext context) {
+
+ Parallel parallel=new Parallel();
+ activities.add(parallel);
+
+ parallel.derivedFrom(this);
+
+ if (m_joinService != null) {
+ context.markJoin(m_joinService);
+ }
+
+ for (int i=0; i < m_services.size(); i++) {
+ Block block=new Block();
+
+ ESBService service=m_services.get(i);
+
+ if (service != null) {
+ service.convert(block.getContents(), context);
+ }
+
+ // TODO: Only temporary check while conformance
+ // check does not handle
+ //if (block.getContents().size() > 0) {
+ parallel.getBlocks().add(block);
+ //}
+ }
+
+ // TODO: Only temporary check while conformance
+ // check does not handle
+ //if (parallel.getBlocks().size() == 0) {
+ // activities.remove(parallel);
+ //}
+
+ if (m_joinService != null) {
+ m_joinService.convert(activities, context);
+ }
+ }
+
+ /**
+ * This method adds a path to the parallel action.
+ *
+ * @param category The service category
+ * @param name The service name
+ * @param immediate Whether invocation should be immediate
+ * @param join Whether the path is for the parallel, or join
+ * @param position The position
+ */
+ public void addPath(String category, String name,
+ boolean immediate, boolean join, int position) {
+
+ org.w3c.dom.NodeList nl=
+ getAction().getElementsByTagName(PROPERTY_ELEMENT);
+
+ org.w3c.dom.Element paths=null;
+
+ for (int i=0; paths == null && i < nl.getLength(); i++) {
+ if (nl.item(i) instanceof org.w3c.dom.Element) {
+ String propName=((org.w3c.dom.Element)nl.item(i)).getAttribute(NAME_ATTR);
+
+ if (propName != null && propName.equals(PATHS)) {
+ paths = (org.w3c.dom.Element)nl.item(i);
+ }
+ }
+ }
+
+ if (paths == null) {
+ paths = getAction().getOwnerDocument().createElement(PROPERTY_ELEMENT);
+ paths.setAttribute(NAME_ATTR, PATHS);
+
+ getAction().appendChild(paths);
+ }
+
+ org.w3c.dom.Element path=
+ getAction().getOwnerDocument().createElement(join ? JOIN : PATH);
+ path.setAttribute(SERVICE_CATEGORY, category);
+ path.setAttribute(SERVICE_NAME, name);
+
+ if (immediate) {
+ path.setAttribute(IMMEDIATE, Boolean.TRUE.toString());
+ }
+
+ paths.appendChild(path);
+ }
+
+ private java.util.List<ESBService> m_services=new java.util.Vector<ESBService>();
+ private String m_joinCategory=null;
+ private String m_joinName=null;
+ private ESBService m_joinService=null;
+}
Property changes on: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/ParallelAction.java
___________________________________________________________________
Name: svn:mergeinfo
+
Copied: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/PerformAction.java (from rev 436, cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/PerformAction.java)
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/PerformAction.java (rev 0)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/PerformAction.java 2009-01-12 21:15:25 UTC (rev 459)
@@ -0,0 +1,325 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, 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.
+ */
+package org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful;
+
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.*;
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.util.PropertyUtil;
+import org.scribble.model.*;
+import org.scribble.model.admin.ModelIssue;
+import org.scribble.model.admin.ModelListener;
+import org.scribble.conversation.model.*;
+
+/**
+ * The model component for the 'WhenAction'.
+ *
+ * @author gary
+ */
+public class PerformAction extends AbstractStatefulESBAction {
+
+ private static final String BIND_ELEMENT = "bind";
+ private static final String TO_VARIABLE_ATTR = "to-variable";
+ public static final String SERVICE_NAME = "serviceName";
+ public static final String SERVICE_CATEGORY = "serviceCategory";
+ public static final String RETURN_SERVICE_NAME = "returnServiceName";
+ public static final String RETURN_SERVICE_CATEGORY = "returnServiceCategory";
+ public static final String BIND_DETAILS = "bindDetails";
+ public static final String PARENT_REFERENCE = "parentReference";
+
+ /**
+ * The constructor for the action.
+ *
+ * @param service The reference to the service in which
+ * the action is contained
+ * @param action The XML configuration details for the action
+ */
+ public PerformAction(ESBService service,
+ org.w3c.dom.Element action) {
+ super(service, action);
+ }
+
+ /**
+ * This constructor initializes the DOM element for
+ * the action.
+ *
+ * @param service The reference to the service in which
+ * the action will be contained
+ */
+ public PerformAction(ESBService service) {
+ super(service, ESBActionFactory.getConversationAction(
+ PerformAction.class));
+ }
+
+ /**
+ * This method initializes the links with the ESB service descriptors
+ * identified in each path of the action.
+ */
+ @Override
+ public void initializeLinks() {
+ super.initializeLinks();
+
+ m_category=getPropertyValue(SERVICE_CATEGORY);
+ m_name=getPropertyValue(SERVICE_NAME);
+
+ if (m_category != null && m_name != null) {
+ m_service=getService().getModel().getService(m_category, m_name);
+
+ getLinks().add(new ESBLink(m_category, m_name, m_service, true));
+ }
+
+ m_joinCategory=getPropertyValue(RETURN_SERVICE_CATEGORY);
+ m_joinName=getPropertyValue(RETURN_SERVICE_NAME);
+
+ if (m_joinCategory != null && m_joinName != null) {
+ m_joinService=getService().getModel().getService(m_joinCategory, m_joinName);
+
+ getLinks().add(new ESBLink(m_joinCategory, m_joinName, m_joinService, true));
+ }
+ }
+
+ /**
+ * This method indicates whether this action performs another
+ * sub-conversation.
+ *
+ * @return Whether the action is a 'perform'
+ */
+ @Override
+ public boolean isPerform() {
+ return(true);
+ }
+
+ /**
+ * This method returns the mandatory property names.
+ *
+ * @return The mandatory property names
+ */
+ @Override
+ protected java.util.List<String> getMandatoryProperties() {
+ java.util.List<String> ret=super.getMandatoryProperties();
+ ret.add(SERVICE_CATEGORY);
+ ret.add(SERVICE_NAME);
+ return(ret);
+ }
+
+ /**
+ * This method returns the optional property names.
+ *
+ * @return The optional property names
+ */
+ @Override
+ protected java.util.List<String> getOptionalProperties() {
+ java.util.List<String> ret=super.getOptionalProperties();
+ ret.add(RETURN_SERVICE_NAME);
+ ret.add(RETURN_SERVICE_CATEGORY);
+ ret.add(BIND_DETAILS);
+ ret.add(PARENT_REFERENCE);
+ return(ret);
+ }
+
+ /**
+ * This method validates the ESB action and reports warnings or
+ * errors to the supplied model listener.
+ *
+ * @param l The model listener
+ */
+ @Override
+ public void validate(ModelListener l) {
+ super.validate(l);
+
+ // Check if performed state starts with a create session action
+ if (m_service != null &&
+ m_service.isCreateSession() == false) {
+ l.error(new ModelIssue(this, org.scribble.util.MessageUtil.format(
+ java.util.PropertyResourceBundle.getBundle(
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
+ "_NOT_FOUND_PERFORM_CREATE_SESSION",
+ new String[]{})));
+ }
+
+ // Check if performed service has relevant bind
+ // and parent properties
+ if (m_service != null &&
+ m_service.getSessionClass() != null) {
+
+ if (hasProperty(PARENT_REFERENCE)) {
+ String parentRefProperty=getPropertyValue(PARENT_REFERENCE);
+
+ if (PropertyUtil.isProperty(m_service.getSessionClass(),
+ parentRefProperty) == false) {
+ l.error(new ModelIssue(this, org.scribble.util.MessageUtil.format(
+ java.util.PropertyResourceBundle.getBundle(
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
+ "_NOT_FOUND_VARIABLE",
+ new String[]{parentRefProperty,
+ m_service.getSessionClass().getName()})));
+ } else if (PropertyUtil.hasWritableProperty(m_service.getSessionClass(),
+ parentRefProperty) == false) {
+ l.error(new ModelIssue(this, org.scribble.util.MessageUtil.format(
+ java.util.PropertyResourceBundle.getBundle(
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
+ "_NOT_WRITABLE_PROPERTY",
+ new String[]{parentRefProperty,
+ m_service.getSessionClass().getName()})));
+ }
+
+ Class<?> parentCls=PropertyUtil.getPropertyType(
+ m_service.getSessionClass(), parentRefProperty);
+
+ if (parentCls != null && getService() != null &&
+ getService().getSessionClass() != null &&
+ parentCls.isAssignableFrom(
+ getService().getSessionClass()) == false) {
+ l.error(new ModelIssue(this, org.scribble.util.MessageUtil.format(
+ java.util.PropertyResourceBundle.getBundle(
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
+ "_INVALID_PROPERTY_TYPE",
+ new String[]{parentRefProperty,
+ m_service.getSessionClass().getName(),
+ getService().getSessionClass().getName()})));
+ }
+ }
+
+ if (hasProperty(BIND_DETAILS)) {
+ org.w3c.dom.Element elem=getPropertyElement(BIND_DETAILS);
+
+ org.w3c.dom.NodeList nl=elem.getElementsByTagName(BIND_ELEMENT);
+
+ for (int i=0; i < nl.getLength(); i++) {
+ if (nl.item(i) instanceof org.w3c.dom.Element) {
+ org.w3c.dom.Element bind=(org.w3c.dom.Element)nl.item(i);
+
+ if (bind.hasAttribute(TO_VARIABLE_ATTR)) {
+ String variable=bind.getAttribute(TO_VARIABLE_ATTR);
+
+ if (PropertyUtil.isProperty(m_service.getSessionClass(),
+ variable) == false) {
+ l.error(new ModelIssue(this, org.scribble.util.MessageUtil.format(
+ java.util.PropertyResourceBundle.getBundle(
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
+ "_NOT_FOUND_VARIABLE",
+ new String[]{variable,
+ m_service.getSessionClass().getName()})));
+
+ } else if (PropertyUtil.hasWritableProperty(m_service.getSessionClass(),
+ variable) == false) {
+ l.error(new ModelIssue(this, org.scribble.util.MessageUtil.format(
+ java.util.PropertyResourceBundle.getBundle(
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
+ "_NOT_WRITABLE_PROPERTY",
+ new String[]{variable,
+ m_service.getSessionClass().getName()})));
+ }
+ } else {
+ // Possibly report if 'to-variable' not
+ // defined?
+ }
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * This method converts the ESB action into an equivalent
+ * behavioural description for conformance checking.
+ *
+ * @param activities The list of activities that will contain
+ * the converted action(s)
+ * @param context The conversion context
+ */
+ @Override
+ public void convert(java.util.List<Activity> activities,
+ ConversionContext context) {
+
+ Compose elem=null;
+
+ // Check if perform is asynchronous
+ if (hasProperty(RETURN_SERVICE_NAME)) {
+ elem = new Run();
+ } else {
+ elem = new Spawn();
+ }
+
+ activities.add(elem);
+
+ elem.derivedFrom(this);
+
+ Conversation definition=new Conversation();
+
+ elem.setInlineDefinition(definition);
+
+ if (m_service != null) {
+ // TODO: May need to be separate definition, in case the
+ // same state is called from a number of different
+ // places
+ m_service.convert(definition.getBlock().getContents(), context);
+ }
+
+ if (m_joinService != null) {
+ m_joinService.convert(activities, context);
+ }
+ }
+
+ /**
+ * This method sets the destination service descriptor properties.
+ *
+ * @param category The category
+ * @param name The name
+ */
+ public void setDestination(String category, String name) {
+
+ org.w3c.dom.Element prop=getPropertyElement(SERVICE_CATEGORY);
+
+ if (prop != null) {
+ prop.setAttribute(VALUE_ATTR, category);
+ }
+
+ prop = getPropertyElement(SERVICE_NAME);
+
+ if (prop != null) {
+ prop.setAttribute(VALUE_ATTR, name);
+ }
+ }
+
+ /**
+ * This method sets the return destination service descriptor properties.
+ *
+ * @param category The category
+ * @param name The name
+ */
+ public void setReturnDestination(String category, String name) {
+
+ org.w3c.dom.Element prop=getPropertyElement(RETURN_SERVICE_CATEGORY);
+
+ if (prop != null) {
+ prop.setAttribute(VALUE_ATTR, category);
+ }
+
+ prop = getPropertyElement(RETURN_SERVICE_NAME);
+
+ if (prop != null) {
+ prop.setAttribute(VALUE_ATTR, name);
+ }
+ }
+
+ private String m_category=null;
+ private String m_name=null;
+ private ESBService m_service=null;
+ private String m_joinCategory=null;
+ private String m_joinName=null;
+ private ESBService m_joinService=null;
+}
Property changes on: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/PerformAction.java
___________________________________________________________________
Name: svn:mergeinfo
+
Copied: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/ReceiveMessageAction.java (from rev 436, cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/ReceiveMessageAction.java)
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/ReceiveMessageAction.java (rev 0)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/ReceiveMessageAction.java 2009-01-12 21:15:25 UTC (rev 459)
@@ -0,0 +1,119 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, 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.
+ */
+package org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful;
+
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.*;
+import org.scribble.conversation.model.*;
+import org.scribble.model.*;
+
+/**
+ * The model component for the 'ReceiveMessageAction'.
+ *
+ * @author gary
+ */
+public class ReceiveMessageAction extends AbstractInteractionMessageAction {
+
+ /**
+ * The constructor for the action.
+ *
+ * @param service The reference to the service in which
+ * the action is contained
+ * @param action The XML configuration details for the action
+ */
+ public ReceiveMessageAction(ESBService service,
+ org.w3c.dom.Element action) {
+ super(service, action);
+ }
+
+ /**
+ * This constructor initializes the DOM element for
+ * the action.
+ *
+ * @param service The reference to the service in which
+ * the action will be contained
+ */
+ public ReceiveMessageAction(ESBService service) {
+ super(service, ESBActionFactory.getConversationAction(
+ ReceiveMessageAction.class));
+ }
+
+ /**
+ * This method indicates whether the action is an initiator.
+ * Initiator actions must precede any other session based
+ * action, within an ESB service.
+ *
+ * @return Whether the action is an initiator
+ */
+ @Override
+ public boolean isInitiator() {
+ return(true);
+ }
+
+ /**
+ * This method converts the ESB action into an equivalent
+ * behavioural description for conformance checking.
+ *
+ * @param activities The list of activities that will contain
+ * the converted action(s)
+ * @param context The conversion context
+ */
+ @Override
+ public void convert(java.util.List<Activity> activities,
+ ConversionContext context) {
+
+ ConversationInteraction recv=new ConversationInteraction();
+ activities.add(recv);
+
+ recv.derivedFrom(this);
+
+ MessageSignature ms=new MessageSignature();
+ ms.derivedFrom(this);
+
+ recv.setMessageSignature(ms);
+
+ ms.setOperation(getPropertyValue(OPERATION));
+
+ String type=getPropertyValue(MESSAGE_TYPE);
+ if (type != null && type.length() > 0) {
+ String ns=null;
+ String local=type;
+
+ if (type.charAt(0) == '{') {
+ int endindex=type.indexOf('}');
+
+ if (endindex != -1) {
+ ns = type.substring(1, endindex);
+ local = type.substring(endindex+1);
+ }
+ }
+
+ TypeReference ref=new TypeReference();
+ ref.setLocalpart(local);
+ ref.setNamespace(ns);
+
+ ref.derivedFrom(this);
+
+ ms.getTypes().add(ref);
+ }
+
+ // Initialize the 'to' role to be this participant
+ if (context.getRole() != null) {
+ recv.setToRole(new Role(context.getRole()));
+ }
+ }
+}
Property changes on: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/ReceiveMessageAction.java
___________________________________________________________________
Name: svn:mergeinfo
+
Copied: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/RetrieveSessionAction.java (from rev 436, cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/RetrieveSessionAction.java)
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/RetrieveSessionAction.java (rev 0)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/RetrieveSessionAction.java 2009-01-12 21:15:25 UTC (rev 459)
@@ -0,0 +1,96 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, 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.
+ */
+package org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful;
+
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.*;
+import org.scribble.model.*;
+import org.scribble.model.admin.ModelIssue;
+import org.scribble.model.admin.ModelListener;
+
+/**
+ * The model component for the 'RetrieveSessionAction'.
+ *
+ * @author gary
+ */
+public class RetrieveSessionAction extends AbstractStatefulESBAction {
+
+ public static final String IDENTITIES = "identities";
+
+ /**
+ * The constructor for the action.
+ *
+ * @param service The reference to the service in which
+ * the action is contained
+ * @param action The XML configuration details for the action
+ */
+ public RetrieveSessionAction(ESBService service,
+ org.w3c.dom.Element action) {
+ super(service, action);
+ }
+
+ /**
+ * This method returns the mandatory property names.
+ *
+ * @return The mandatory property names
+ */
+ @Override
+ protected java.util.List<String> getMandatoryProperties() {
+ java.util.List<String> ret=super.getMandatoryProperties();
+ ret.add(IDENTITIES);
+ return(ret);
+ }
+
+ /**
+ * This method validates the ESB action and reports warnings or
+ * errors to the supplied model listener.
+ *
+ * @param l The model listener
+ */
+ @Override
+ public void validate(ModelListener l) {
+ super.validate(l);
+
+ // Action must be first conversation based action in
+ // the service
+ if (getService() != null && getService().getActions().size() > 0) {
+ ESBAction act=getService().getActions().get(0);
+
+ if (act != this) {
+ l.error(new ModelIssue(this, org.scribble.util.MessageUtil.format(
+ java.util.PropertyResourceBundle.getBundle(
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
+ "_MUST_BE_FIRST_ACTION",
+ new String[]{"RetrieveSession"})));
+ }
+ }
+ }
+
+ /**
+ * This method converts the ESB action into an equivalent
+ * behavioural description for conformance checking.
+ *
+ * @param activities The list of activities that will contain
+ * the converted action(s)
+ * @param context The conversion context
+ */
+ @Override
+ public void convert(java.util.List<Activity> activities,
+ ConversionContext context) {
+ }
+
+}
\ No newline at end of file
Property changes on: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/RetrieveSessionAction.java
___________________________________________________________________
Name: svn:mergeinfo
+
Copied: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/ScheduleStateAction.java (from rev 436, cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/ScheduleStateAction.java)
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/ScheduleStateAction.java (rev 0)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/ScheduleStateAction.java 2009-01-12 21:15:25 UTC (rev 459)
@@ -0,0 +1,184 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, 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.
+ */
+package org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful;
+
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.*;
+import org.scribble.model.*;
+import org.scribble.model.admin.ModelIssue;
+import org.scribble.model.admin.ModelListener;
+
+/**
+ * The model component for the 'ScheduleStateAction'.
+ *
+ * @author gary
+ */
+public class ScheduleStateAction extends AbstractStatefulESBAction {
+
+ public static final String IMMEDIATE = "immediate";
+ public static final String SERVICE_NAME = "serviceName";
+ public static final String SERVICE_CATEGORY = "serviceCategory";
+
+ /**
+ * The constructor for the action.
+ *
+ * @param service The reference to the service in which
+ * the action is contained
+ * @param action The XML configuration details for the action
+ */
+ public ScheduleStateAction(ESBService service,
+ org.w3c.dom.Element action) {
+ super(service, action);
+ }
+
+ /**
+ * This constructor initializes the DOM element for
+ * the action.
+ *
+ * @param service The reference to the service in which
+ * the action will be contained
+ */
+ public ScheduleStateAction(ESBService service) {
+ super(service, ESBActionFactory.getConversationAction(
+ ScheduleStateAction.class));
+ }
+
+ /**
+ * This method initializes the links with the ESB service descriptors
+ * identified in each path of the action.
+ */
+ @Override
+ public void initializeLinks() {
+ super.initializeLinks();
+
+ String serviceCategory=getPropertyValue(SERVICE_CATEGORY);
+ String serviceName=getPropertyValue(SERVICE_NAME);
+ String immediate=getPropertyValue(IMMEDIATE);
+
+ m_service=getService().getModel().getService(serviceCategory, serviceName);
+
+ getLinks().add(new ESBLink(serviceCategory, serviceName, m_service,
+ (immediate != null && immediate.equalsIgnoreCase("true"))));
+ }
+
+ /**
+ * This method returns the mandatory property names.
+ *
+ * @return The mandatory property names
+ */
+ @Override
+ protected java.util.List<String> getMandatoryProperties() {
+ java.util.List<String> ret=super.getMandatoryProperties();
+ ret.add(SERVICE_CATEGORY);
+ ret.add(SERVICE_NAME);
+ return(ret);
+ }
+
+ /**
+ * This method returns the optional property names.
+ *
+ * @return The optional property names
+ */
+ @Override
+ protected java.util.List<String> getOptionalProperties() {
+ java.util.List<String> ret=super.getOptionalProperties();
+ ret.add(IMMEDIATE);
+ return(ret);
+ }
+
+ /**
+ * This method validates the ESB action and reports warnings or
+ * errors to the supplied model listener.
+ *
+ * @param l The model listener
+ */
+ @Override
+ public void validate(ModelListener l) {
+ super.validate(l);
+
+ String immediate=getPropertyValue(IMMEDIATE);
+
+ if (immediate != null && immediate.equalsIgnoreCase("true") == false &&
+ immediate.equalsIgnoreCase("false") == false) {
+ l.error(new ModelIssue(this, org.scribble.util.MessageUtil.format(
+ java.util.PropertyResourceBundle.getBundle(
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
+ "_BOOLEAN",
+ new String[]{IMMEDIATE})));
+ }
+ }
+
+ /**
+ * This method converts the ESB action into an equivalent
+ * behavioural description for conformance checking.
+ *
+ * @param activities The list of activities that will contain
+ * the converted action(s)
+ * @param context The conversion context
+ */
+ @Override
+ public void convert(java.util.List<Activity> activities,
+ ConversionContext context) {
+
+ // If the service has been located, then convert its activities
+ // if it is either not a loop construct (i.e. a while action), or
+ // if it is a loop, then we need to ensure that it is not in the
+ // current stack of ESB services that logically 'contain' this
+ // action. If this action is within the scope of the loop, then
+ // the default behaviour should be to return to the loop
+ // condition (i.e. just let the loop return implicitly).
+ if (m_service != null &&
+ (m_service.isLoop() == false ||
+ context.isOnStack(m_service) == false) &&
+ context.isJoin(m_service) == false) {
+ m_service.convert(activities, context);
+ }
+ }
+
+ /**
+ * This method sets the destination service descriptor properties.
+ *
+ * @param category The category
+ * @param name The name
+ * @param immediate Whether the invoke immediately
+ */
+ public void setDestination(String category, String name,
+ boolean immediate) {
+
+ org.w3c.dom.Element prop=getPropertyElement(SERVICE_CATEGORY);
+
+ if (prop != null) {
+ prop.setAttribute(VALUE_ATTR, category);
+ }
+
+ prop = getPropertyElement(SERVICE_NAME);
+
+ if (prop != null) {
+ prop.setAttribute(VALUE_ATTR, name);
+ }
+
+ if (immediate) {
+ prop = getPropertyElement(IMMEDIATE);
+
+ if (prop != null) {
+ prop.setAttribute(VALUE_ATTR, Boolean.toString(immediate));
+ }
+ }
+ }
+
+ private ESBService m_service=null;
+}
\ No newline at end of file
Property changes on: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/ScheduleStateAction.java
___________________________________________________________________
Name: svn:mergeinfo
+
Copied: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/SendMessageAction.java (from rev 436, cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/SendMessageAction.java)
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/SendMessageAction.java (rev 0)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/SendMessageAction.java 2009-01-12 21:15:25 UTC (rev 459)
@@ -0,0 +1,288 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, 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.
+ */
+package org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful;
+
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.*;
+import org.scribble.conversation.model.*;
+import org.scribble.model.*;
+import org.scribble.model.admin.ModelIssue;
+import org.scribble.model.admin.ModelListener;
+
+/**
+ * The model component for the 'SendMessageAction'.
+ *
+ * @author gary
+ */
+public class SendMessageAction extends AbstractInteractionMessageAction {
+
+ public static final String RESPONSE_SERVICE_NAME = "responseServiceName";
+ public static final String RESPONSE_SERVICE_CATEGORY = "responseServiceCategory";
+ public static final String SERVICE_NAME = "serviceName";
+ public static final String SERVICE_CATEGORY = "serviceCategory";
+ public static final String SERVICE_NAME_EXPRESSION = "serviceNameExpression";
+ public static final String SERVICE_CATEGORY_EXPRESSION = "serviceCategoryExpression";
+
+ /**
+ * The constructor for the action.
+ *
+ * @param service The reference to the service in which
+ * the action is contained
+ * @param action The XML configuration details for the action
+ */
+ public SendMessageAction(ESBService service,
+ org.w3c.dom.Element action) {
+ super(service, action);
+ }
+
+ /**
+ * This constructor initializes the DOM element for
+ * the action.
+ *
+ * @param service The reference to the service in which
+ * the action will be contained
+ */
+ public SendMessageAction(ESBService service) {
+ super(service, ESBActionFactory.getConversationAction(
+ SendMessageAction.class));
+ }
+
+ /**
+ * This method initializes the links with the ESB service descriptors
+ * identified in each path of the action.
+ */
+ @Override
+ public void initializeLinks() {
+ super.initializeLinks();
+
+ String serviceCategory=getPropertyValue(SERVICE_CATEGORY);
+ String serviceName=getPropertyValue(SERVICE_NAME);
+ String responseServiceCategory=getPropertyValue(RESPONSE_SERVICE_CATEGORY);
+ String responseServiceName=getPropertyValue(RESPONSE_SERVICE_NAME);
+
+ if (serviceCategory != null && serviceName != null) {
+ ESBService service=getService().getModel().getService(
+ serviceCategory, serviceName);
+
+ getLinks().add(new ESBLink(serviceCategory, serviceName,
+ service, true, true));
+ }
+
+ if (responseServiceCategory != null && responseServiceName != null) {
+ ESBService service=getService().getModel().getService(
+ responseServiceCategory, responseServiceName);
+
+ getLinks().add(new ESBLink(responseServiceCategory,
+ responseServiceName, service, false));
+ }
+ }
+
+ /**
+ * This method returns the optional property names.
+ *
+ * @return The optional property names
+ */
+ @Override
+ protected java.util.List<String> getOptionalProperties() {
+ java.util.List<String> ret=super.getOptionalProperties();
+ ret.add(RESPONSE_SERVICE_NAME);
+ ret.add(RESPONSE_SERVICE_CATEGORY);
+ ret.add(SERVICE_NAME);
+ ret.add(SERVICE_CATEGORY);
+ ret.add(SERVICE_NAME_EXPRESSION);
+ ret.add(SERVICE_CATEGORY_EXPRESSION);
+ return(ret);
+ }
+
+ /**
+ * This method validates the ESB action and reports warnings or
+ * errors to the supplied model listener.
+ *
+ * @param l The model listener
+ */
+ @Override
+ public void validate(ModelListener l) {
+ super.validate(l);
+
+ // If sending request, then category/name must be specified,
+ // else a response requires the 'client epr'. Validate that
+ // either case is true.
+ if (getPropertyValue(SERVICE_CATEGORY) != null &&
+ getPropertyValue(SERVICE_NAME) != null) {
+ // Sending a request
+
+ } else if (getPropertyValue(SERVICE_CATEGORY_EXPRESSION) != null &&
+ getPropertyValue(SERVICE_NAME_EXPRESSION) != null) {
+ // Sending a request to service derived from expression
+ // on the pojo state
+
+ } else if (getPropertyValue(CLIENT_EPR) != null) {
+ // Sending a response
+
+ // TODO: Validate that the client EPR has been sent on
+ // a preceding received request
+ } else {
+ l.error(new ModelIssue(this, org.scribble.util.MessageUtil.format(
+ java.util.PropertyResourceBundle.getBundle(
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
+ "_NOT_SPECIFIED_REQ_RESP_EPR",
+ new String[]{})));
+ }
+ }
+
+ /**
+ * This method converts the ESB action into an equivalent
+ * behavioural description for conformance checking.
+ *
+ * @param activities The list of activities that will contain
+ * the converted action(s)
+ * @param context The conversion context
+ */
+ @Override
+ public void convert(java.util.List<Activity> activities,
+ ConversionContext context) {
+
+ ConversationInteraction send=new ConversationInteraction();
+ activities.add(send);
+
+ send.derivedFrom(this);
+
+ MessageSignature ms=new MessageSignature();
+ ms.derivedFrom(this);
+
+ send.setMessageSignature(ms);
+
+ ms.setOperation(getPropertyValue(OPERATION));
+
+ String type=getPropertyValue(MESSAGE_TYPE);
+ if (type != null && type.length() > 0) {
+ String ns=null;
+ String local=type;
+
+ if (type.charAt(0) == '{') {
+ int endindex=type.indexOf('}');
+
+ if (endindex != -1) {
+ ns = type.substring(1, endindex);
+ local = type.substring(endindex+1);
+ }
+ }
+
+ TypeReference ref=new TypeReference();
+ ref.setLocalpart(local);
+ ref.setNamespace(ns);
+
+ ref.derivedFrom(this);
+
+ ms.getTypes().add(ref);
+ }
+
+ // Initialize the 'from' role to be this participant
+ // (for now until 'to' role can be set)
+ if (context.getRole() != null) {
+ send.setFromRole(new Role(context.getRole()));
+ }
+
+ // TODO: Initialize the 'to' role (possibly to a
+ // namespace=service category and localpart=service
+ // name. This would need to be mapped when doing
+ // conformance checking - might be an issue, may
+ // need to declare the name.
+
+ // Check if a response control link has been
+ // specified
+ String responseServiceCategory=getPropertyValue(RESPONSE_SERVICE_CATEGORY);
+ String responseServiceName=getPropertyValue(RESPONSE_SERVICE_NAME);
+
+ if (responseServiceCategory != null && responseServiceName != null) {
+ ESBService service=getService().getModel().getService(
+ responseServiceCategory, responseServiceName);
+
+ // Add activities from the 'response' service descriptor into
+ // the set of activities. If service not found, then ignore
+ // here as will be reported as part of the validation of links.
+ if (service != null) {
+ service.convert(activities, context);
+ }
+ }
+ }
+
+ /**
+ * This method sets the destination service descriptor properties.
+ *
+ * @param category The category
+ * @param name The name
+ */
+ public void setDestination(String category, String name) {
+
+ org.w3c.dom.Element prop=getPropertyElement(SERVICE_CATEGORY);
+
+ if (prop != null) {
+ prop.setAttribute(VALUE_ATTR, category);
+ }
+
+ prop = getPropertyElement(SERVICE_NAME);
+
+ if (prop != null) {
+ prop.setAttribute(VALUE_ATTR, name);
+ }
+ }
+
+ /**
+ * This method sets the destination expressions for the
+ * service descriptor properties.
+ *
+ * @param categoryExpr The category expression
+ * @param nameExpr The name expression
+ */
+ public void setDestinationExpression(String categoryExpr,
+ String nameExpr) {
+
+ org.w3c.dom.Element prop=getPropertyElement(SERVICE_CATEGORY_EXPRESSION);
+
+ if (prop != null) {
+ prop.setAttribute(VALUE_ATTR, categoryExpr);
+ }
+
+ prop = getPropertyElement(SERVICE_NAME_EXPRESSION);
+
+ if (prop != null) {
+ prop.setAttribute(VALUE_ATTR, nameExpr);
+ }
+ }
+
+ /**
+ * This method sets the response service descriptor properties.
+ *
+ * @param category The category
+ * @param name The name
+ */
+ public void setResponseDestination(String category, String name) {
+
+ org.w3c.dom.Element prop=getPropertyElement(RESPONSE_SERVICE_CATEGORY);
+
+ if (prop != null) {
+ prop.setAttribute(VALUE_ATTR, category);
+ }
+
+ prop = getPropertyElement(RESPONSE_SERVICE_NAME);
+
+ if (prop != null) {
+ prop.setAttribute(VALUE_ATTR, name);
+ }
+ }
+}
Property changes on: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/SendMessageAction.java
___________________________________________________________________
Name: svn:mergeinfo
+
Copied: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/SetMessageAction.java (from rev 436, cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/SetMessageAction.java)
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/SetMessageAction.java (rev 0)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/SetMessageAction.java 2009-01-12 21:15:25 UTC (rev 459)
@@ -0,0 +1,94 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, 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.
+ */
+package org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful;
+
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.*;
+import org.scribble.model.*;
+import org.scribble.model.admin.ModelListener;
+
+/**
+ * The model component for the 'SetMessageAction'.
+ *
+ * @author gary
+ */
+public class SetMessageAction extends AbstractStatefulESBAction {
+
+ public static final String STATE_EXPRESSION = "stateExpression";
+ public static final String HEADER_PROPERTY = "headerProperty";
+
+ /**
+ * The constructor for the action.
+ *
+ * @param service The reference to the service in which
+ * the action is contained
+ * @param action The XML configuration details for the action
+ */
+ public SetMessageAction(ESBService service,
+ org.w3c.dom.Element action) {
+ super(service, action);
+ }
+
+ /**
+ * This method returns the mandatory property names.
+ *
+ * @return The mandatory property names
+ */
+ @Override
+ protected java.util.List<String> getMandatoryProperties() {
+ java.util.List<String> ret=super.getMandatoryProperties();
+ ret.add(STATE_EXPRESSION);
+ return(ret);
+ }
+
+ /**
+ * This method returns the optional property names.
+ *
+ * @return The optional property names
+ */
+ @Override
+ protected java.util.List<String> getOptionalProperties() {
+ java.util.List<String> ret=super.getOptionalProperties();
+ ret.add(HEADER_PROPERTY);
+ return(ret);
+ }
+
+ /**
+ * This method validates the ESB action and reports warnings or
+ * errors to the supplied model listener.
+ *
+ * @param l The model listener
+ */
+ @Override
+ public void validate(ModelListener l) {
+ super.validate(l);
+
+ }
+
+ /**
+ * This method converts the ESB action into an equivalent
+ * behavioural description for conformance checking.
+ *
+ * @param activities The list of activities that will contain
+ * the converted action(s)
+ * @param context The conversion context
+ */
+ @Override
+ public void convert(java.util.List<Activity> activities,
+ ConversionContext context) {
+ }
+}
Property changes on: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/SetMessageAction.java
___________________________________________________________________
Name: svn:mergeinfo
+
Copied: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/SetStateAction.java (from rev 436, cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/SetStateAction.java)
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/SetStateAction.java (rev 0)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/SetStateAction.java 2009-01-12 21:15:25 UTC (rev 459)
@@ -0,0 +1,167 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, 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.
+ */
+package org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful;
+
+import java.util.logging.Logger;
+
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.*;
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.util.PropertyUtil;
+import org.scribble.model.*;
+import org.scribble.model.admin.ModelIssue;
+import org.scribble.model.admin.ModelListener;
+
+/**
+ * The model component for the 'SetStateAction'.
+ *
+ * @author gary
+ */
+public class SetStateAction extends AbstractStatefulESBAction {
+
+ public static final String STATE_EXPRESSION = "stateExpression";
+ public static final String MESSAGE_EXPRESSION = "messageExpression";
+ public static final String VARIABLE = "variable";
+
+ /**
+ * The constructor for the action.
+ *
+ * @param service The reference to the service in which
+ * the action is contained
+ * @param action The XML configuration details for the action
+ */
+ public SetStateAction(ESBService service,
+ org.w3c.dom.Element action) {
+ super(service, action);
+ }
+
+ /**
+ * This method returns the mandatory property names.
+ *
+ * @return The mandatory property names
+ */
+ @Override
+ protected java.util.List<String> getMandatoryProperties() {
+ java.util.List<String> ret=super.getMandatoryProperties();
+ ret.add(VARIABLE);
+ return(ret);
+ }
+
+ /**
+ * This method returns the optional property names.
+ *
+ * @return The optional property names
+ */
+ @Override
+ protected java.util.List<String> getOptionalProperties() {
+ java.util.List<String> ret=super.getOptionalProperties();
+ ret.add(STATE_EXPRESSION);
+ ret.add(MESSAGE_EXPRESSION);
+ return(ret);
+ }
+
+ /**
+ * This method validates the ESB action and reports warnings or
+ * errors to the supplied model listener.
+ *
+ * @param l The model listener
+ */
+ @Override
+ public void validate(ModelListener l) {
+ super.validate(l);
+
+ String variable=getPropertyValue(VARIABLE);
+
+ if (variable != null) {
+
+ // Check that variable defined on session class
+ Class<?> cls=getService().getSessionClass();
+
+ java.util.StringTokenizer st=new java.util.StringTokenizer(variable, ".");
+
+ while (cls != null && st.hasMoreTokens()) {
+ String token=st.nextToken();
+
+ if (cls != null) {
+ if (PropertyUtil.isProperty(cls, token) == false) {
+
+ if (variable.equals(token)) {
+ l.error(new ModelIssue(this, org.scribble.util.MessageUtil.format(
+ java.util.PropertyResourceBundle.getBundle(
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
+ "_NOT_FOUND_VARIABLE",
+ new String[]{variable, cls.getName()})));
+ } else {
+ l.error(new ModelIssue(this, org.scribble.util.MessageUtil.format(
+ java.util.PropertyResourceBundle.getBundle(
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
+ "_NOT_FOUND_VARIABLE_PROPERTY",
+ new String[]{variable, token, cls.getName()})));
+ }
+ } else if (st.hasMoreTokens()) {
+ // Check property can be read
+ if (!PropertyUtil.hasReadableProperty(cls, token)) {
+ l.error(new ModelIssue(this, org.scribble.util.MessageUtil.format(
+ java.util.PropertyResourceBundle.getBundle(
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
+ "_NOT_READABLE_PROPERTY",
+ new String[]{token, cls.getName()})));
+ }
+ } else {
+ // Check property can be written
+ if (!PropertyUtil.hasWritableProperty(cls, token)) {
+ l.error(new ModelIssue(this, org.scribble.util.MessageUtil.format(
+ java.util.PropertyResourceBundle.getBundle(
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
+ "_NOT_WRITABLE_PROPERTY",
+ new String[]{token, cls.getName()})));
+ }
+ }
+
+ cls = PropertyUtil.getPropertyType(cls, token);
+ }
+ }
+ }
+
+ // Check that state or message expression defined
+ String stateExpression=getPropertyValue(STATE_EXPRESSION);
+ String messageExpression=getPropertyValue(MESSAGE_EXPRESSION);
+
+ if ((stateExpression == null && messageExpression == null) ||
+ (stateExpression != null && messageExpression != null)) {
+ l.error(new ModelIssue(this, org.scribble.util.MessageUtil.format(
+ java.util.PropertyResourceBundle.getBundle(
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
+ "_MUST_SPECIFY_STATE_OR_MESSAGE_EXPRESSION",
+ new String[]{})));
+ }
+ }
+
+ /**
+ * This method converts the ESB action into an equivalent
+ * behavioural description for conformance checking.
+ *
+ * @param activities The list of activities that will contain
+ * the converted action(s)
+ * @param context The conversion context
+ */
+ @Override
+ public void convert(java.util.List<Activity> activities,
+ ConversionContext context) {
+ }
+
+ private static Logger logger = Logger.getLogger("org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions");
+}
Property changes on: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/SetStateAction.java
___________________________________________________________________
Name: svn:mergeinfo
+
Copied: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/SwitchAction.java (from rev 436, cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/SwitchAction.java)
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/SwitchAction.java (rev 0)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/SwitchAction.java 2009-01-12 21:15:25 UTC (rev 459)
@@ -0,0 +1,252 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, 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.
+ */
+package org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful;
+
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.*;
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.util.InteractionUtil;
+import org.scribble.model.*;
+import org.scribble.model.admin.ModelIssue;
+import org.scribble.model.admin.ModelListener;
+import org.scribble.conversation.model.*;
+
+/**
+ * The model component for the 'SwitchAction'.
+ *
+ * @author gary
+ */
+public class SwitchAction extends AbstractStatefulESBAction {
+
+ public static final String TYPE_ATTR = "type";
+ public static final String MESSAGE_ELEMENT = "message";
+ private static final String SERVICE_NAME = "service-name";
+ private static final String SERVICE_CATEGORY = "service-category";
+ private static final String CASE = "case";
+ private static final String PATHS = "paths";
+
+ /**
+ * The constructor for the action.
+ *
+ * @param service The reference to the service in which
+ * the action is contained
+ * @param action The XML configuration details for the action
+ */
+ public SwitchAction(ESBService service,
+ org.w3c.dom.Element action) {
+ super(service, action);
+ }
+
+ /**
+ * This constructor initializes the DOM element for
+ * the action.
+ *
+ * @param service The reference to the service in which
+ * the action will be contained
+ */
+ public SwitchAction(ESBService service) {
+ super(service, ESBActionFactory.getConversationAction(
+ SwitchAction.class));
+ }
+
+ /**
+ * This method initializes the links with the ESB service descriptors
+ * identified in each path of the action.
+ */
+ @Override
+ public void initializeLinks() {
+ super.initializeLinks();
+
+ org.w3c.dom.NodeList nl=getPropertyChildNodes(PATHS);
+
+ for (int i=0; i < nl.getLength(); i++) {
+
+ org.w3c.dom.Node n=nl.item(i);
+
+ if (n instanceof org.w3c.dom.Element &&
+ n.getNodeName().equals(CASE)) {
+ if (((org.w3c.dom.Element)n).hasAttribute(SERVICE_CATEGORY) &&
+ ((org.w3c.dom.Element)n).hasAttribute(SERVICE_NAME)) {
+ String category=((org.w3c.dom.Element)n).getAttribute(SERVICE_CATEGORY);
+ String name=((org.w3c.dom.Element)n).getAttribute(SERVICE_NAME);
+
+ // Lookup service associated with category and name
+ ESBService service=getService().getModel().getService(category, name);
+
+ // Initialize link, even if service is null - this will be
+ // reported as a validation error later
+ getLinks().add(new ESBLink(category, name, service, true));
+ }
+ }
+ }
+ }
+
+ /**
+ * This method returns the mandatory property names.
+ *
+ * @return The mandatory property names
+ */
+ @Override
+ protected java.util.List<String> getMandatoryProperties() {
+ java.util.List<String> ret=super.getMandatoryProperties();
+ ret.add(PATHS);
+ return(ret);
+ }
+
+ /**
+ * This method indicates whether the action is an initiator.
+ * Initiator actions must precede any other session based
+ * action, within an ESB service.
+ *
+ * @return Whether the action is an initiator
+ */
+ @Override
+ public boolean isInitiator() {
+ return(true);
+ }
+
+ /**
+ * This method validates the ESB action and reports warnings or
+ * errors to the supplied model listener.
+ *
+ * @param l The model listener
+ */
+ @Override
+ public void validate(ModelListener l) {
+ super.validate(l);
+
+ org.w3c.dom.NodeList nl=getPropertyChildNodes(PATHS);
+ int pathCount=0;
+ boolean f_serviceDetailsMissing=false;
+
+ for (int i=0; nl != null && i < nl.getLength(); i++) {
+
+ org.w3c.dom.Node n=nl.item(i);
+
+ if (n instanceof org.w3c.dom.Element) {
+ if (n.getNodeName().equals(CASE)) {
+ pathCount++;
+
+ if (((org.w3c.dom.Element)n).hasAttribute(SERVICE_CATEGORY) == false ||
+ ((org.w3c.dom.Element)n).hasAttribute(SERVICE_NAME) == false) {
+ f_serviceDetailsMissing = true;
+ }
+ }
+ }
+ }
+
+ // Report any errors
+ if (nl != null && pathCount < 1) {
+ l.error(new ModelIssue(this, org.scribble.util.MessageUtil.format(
+ java.util.PropertyResourceBundle.getBundle(
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
+ "_SWITCH_ONE_OR_MORE_PATHS",
+ new String[]{})));
+ }
+
+ if (f_serviceDetailsMissing) {
+ l.error(new ModelIssue(this, org.scribble.util.MessageUtil.format(
+ java.util.PropertyResourceBundle.getBundle(
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
+ "_PATH_SERVICE_DETAILS_MISSING",
+ new String[]{})));
+ }
+ }
+
+ /**
+ * This method converts the ESB action into an equivalent
+ * behavioural description for conformance checking.
+ *
+ * @param activities The list of activities that will contain
+ * the converted action(s)
+ * @param context The conversion context
+ */
+ @Override
+ public void convert(java.util.List<Activity> activities,
+ ConversionContext context) {
+
+ org.w3c.dom.NodeList nl=getPropertyChildNodes(PATHS);
+
+ If choice=new If();
+ activities.add(choice);
+
+ for (int i=0; i < nl.getLength(); i++) {
+
+ org.w3c.dom.Node n=nl.item(i);
+
+ if (n instanceof org.w3c.dom.Element &&
+ n.getNodeName().equals(CASE)) {
+ String category=((org.w3c.dom.Element)n).getAttribute(SERVICE_CATEGORY);
+ String name=((org.w3c.dom.Element)n).getAttribute(SERVICE_NAME);
+
+ // Conditional block with no expression - i.e. the
+ // expression is non-observable, as the path will be
+ // selected based on the next message that arrives
+ ConditionalBlock block=new ConditionalBlock();
+ choice.getConditionalBlocks().add(block);
+
+ ESBService service=getService().getModel().getService(category, name);
+
+ if (service != null) {
+ service.convert(block.getContents(), context);
+ }
+ }
+ }
+ }
+
+ /**
+ * This method adds a path to the switch action.
+ *
+ * @param category The service category
+ * @param name The service name
+ * @param messageTypes The set of interactions
+ * @param position The position
+ */
+ public void addCase(String category, String name,
+ java.util.Set<Interaction> messageTypes, int position) {
+
+ org.w3c.dom.Element paths=getPropertyElement(PATHS);
+
+ org.w3c.dom.Element path=
+ getAction().getOwnerDocument().createElement(CASE);
+ path.setAttribute(SERVICE_CATEGORY, category);
+ path.setAttribute(SERVICE_NAME, name);
+
+ if (messageTypes != null) {
+ java.util.Iterator<Interaction> iter=messageTypes.iterator();
+
+ while (iter.hasNext()) {
+ Interaction interaction=iter.next();
+
+ //TODO: Only deals with single type for now
+ if (InteractionUtil.isSend(interaction) == false &&
+ interaction.getMessageSignature().getTypes().size()==1) {
+ org.w3c.dom.Element mt=
+ getAction().getOwnerDocument().createElement(MESSAGE_ELEMENT);
+
+ mt.setAttribute(TYPE_ATTR,
+ InteractionUtil.getTypeString(
+ interaction.getMessageSignature().
+ getTypes().get(0)));
+
+ path.appendChild(mt);
+ }
+ }
+ }
+
+ paths.appendChild(path);
+ }
+}
Property changes on: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/SwitchAction.java
___________________________________________________________________
Name: svn:mergeinfo
+
Copied: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/UnsupportedAction.java (from rev 436, cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/UnsupportedAction.java)
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/UnsupportedAction.java (rev 0)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/UnsupportedAction.java 2009-01-12 21:15:25 UTC (rev 459)
@@ -0,0 +1,77 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, 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.
+ */
+package org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful;
+
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.*;
+import org.scribble.model.*;
+import org.scribble.model.admin.ModelListener;
+
+/**
+ * This class represents an unsupported (or custom) action within
+ * the conversation based ESB service descriptor.
+ *
+ * @author gary
+ */
+public class UnsupportedAction extends AbstractStatefulESBAction {
+
+ /**
+ * The constructor for the action.
+ *
+ * @param service The reference to the service in which
+ * the action is contained
+ * @param action The XML configuration details for the action
+ */
+ public UnsupportedAction(ESBService service,
+ org.w3c.dom.Element action) {
+ super(service, action);
+ }
+
+ /**
+ * This method determines whether the action is related to a behavioural
+ * session.
+ *
+ * @return Whether the action is session based
+ */
+ public boolean isSessionBased() {
+ return(false);
+ }
+
+ /**
+ * This method validates the ESB action and reports warnings or
+ * errors to the supplied model listener.
+ *
+ * @param l The model listener
+ */
+ @Override
+ public void validate(ModelListener l) {
+ // Don't validate unsupported actions
+ }
+
+ /**
+ * This method converts the ESB action into an equivalent
+ * behavioural description for conformance checking.
+ *
+ * @param activities The list of activities that will contain
+ * the converted action(s)
+ * @param context The conversion context
+ */
+ public void convert(java.util.List<Activity> activities,
+ ConversionContext context) {
+ }
+
+}
Property changes on: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/UnsupportedAction.java
___________________________________________________________________
Name: svn:mergeinfo
+
Copied: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/WhenAction.java (from rev 436, cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/WhenAction.java)
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/WhenAction.java (rev 0)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/WhenAction.java 2009-01-12 21:15:25 UTC (rev 459)
@@ -0,0 +1,241 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, 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.
+ */
+package org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful;
+
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.*;
+import org.scribble.model.*;
+import org.scribble.model.admin.ModelIssue;
+import org.scribble.model.admin.ModelListener;
+import org.scribble.conversation.model.*;
+
+/**
+ * The model component for the 'WhenAction'.
+ *
+ * @author gary
+ */
+public class WhenAction extends AbstractStatefulESBAction {
+
+ private static final String SERVICE_NAME = "service-name";
+ private static final String SERVICE_CATEGORY = "service-category";
+ private static final String WHEN = "when";
+ private static final String PATHS = "paths";
+
+ /**
+ * The constructor for the action.
+ *
+ * @param service The reference to the service in which
+ * the action is contained
+ * @param action The XML configuration details for the action
+ */
+ public WhenAction(ESBService service,
+ org.w3c.dom.Element action) {
+ super(service, action);
+ }
+
+ /**
+ * This constructor initializes the DOM element for
+ * the action.
+ *
+ * @param service The reference to the service in which
+ * the action will be contained
+ */
+ public WhenAction(ESBService service) {
+ super(service, ESBActionFactory.getConversationAction(
+ WhenAction.class));
+ }
+
+ /**
+ * This method initializes the links with the ESB service descriptors
+ * identified in each path of the action.
+ */
+ @Override
+ public void initializeLinks() {
+ super.initializeLinks();
+
+ org.w3c.dom.NodeList nl=getPropertyChildNodes(PATHS);
+
+ for (int i=0; i < nl.getLength(); i++) {
+
+ org.w3c.dom.Node n=nl.item(i);
+
+ if (n instanceof org.w3c.dom.Element) {
+ if (n.getNodeName().equals(WHEN)) {
+ if (((org.w3c.dom.Element)n).hasAttribute(SERVICE_CATEGORY) &&
+ ((org.w3c.dom.Element)n).hasAttribute(SERVICE_NAME)) {
+ String category=((org.w3c.dom.Element)n).getAttribute(SERVICE_CATEGORY);
+ String name=((org.w3c.dom.Element)n).getAttribute(SERVICE_NAME);
+
+ // Lookup service associated with category and name
+ ESBService service=getService().getModel().getService(category, name);
+
+ // Initialize link, even if service is null - this will be
+ // reported as a validation error later
+ getLinks().add(new ESBLink(category, name, service, true));
+
+ if (service != null) {
+ m_services.add(service);
+ }
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * This method returns the mandatory property names.
+ *
+ * @return The mandatory property names
+ */
+ @Override
+ protected java.util.List<String> getMandatoryProperties() {
+ java.util.List<String> ret=super.getMandatoryProperties();
+ ret.add(PATHS);
+ return(ret);
+ }
+
+ /**
+ * This method validates the ESB action and reports warnings or
+ * errors to the supplied model listener.
+ *
+ * @param l The model listener
+ */
+ @Override
+ public void validate(ModelListener l) {
+ super.validate(l);
+
+ // TODO: Valid if decision-method
+ // specified, that method exists, if expression, then
+ // validate the expression etc.
+
+ org.w3c.dom.NodeList nl=getPropertyChildNodes(PATHS);
+ int pathCount=0;
+ boolean f_serviceDetailsMissing=false;
+
+ for (int i=0; nl != null && i < nl.getLength(); i++) {
+
+ org.w3c.dom.Node n=nl.item(i);
+
+ if (n instanceof org.w3c.dom.Element) {
+ if (n.getNodeName().equals(WHEN)) {
+ pathCount++;
+
+ if (((org.w3c.dom.Element)n).hasAttribute(SERVICE_CATEGORY) == false ||
+ ((org.w3c.dom.Element)n).hasAttribute(SERVICE_NAME) == false) {
+ f_serviceDetailsMissing = true;
+ }
+ }
+ }
+ }
+
+ // Report any errors
+ if (nl != null && pathCount < 1) {
+ l.error(new ModelIssue(this, org.scribble.util.MessageUtil.format(
+ java.util.PropertyResourceBundle.getBundle(
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
+ "_WHEN_ONE_OR_MORE_PATHS",
+ new String[]{})));
+ }
+
+ if (f_serviceDetailsMissing) {
+ l.error(new ModelIssue(this, org.scribble.util.MessageUtil.format(
+ java.util.PropertyResourceBundle.getBundle(
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
+ "_PATH_SERVICE_DETAILS_MISSING",
+ new String[]{})));
+ }
+ }
+
+ /**
+ * This method converts the ESB action into an equivalent
+ * behavioural description for conformance checking.
+ *
+ * @param activities The list of activities that will contain
+ * the converted action(s)
+ * @param context The conversion context
+ */
+ @Override
+ public void convert(java.util.List<Activity> activities,
+ ConversionContext context) {
+
+ When elem=new When();
+ activities.add(elem);
+
+ elem.derivedFrom(this);
+
+ if (m_joinService != null) {
+ context.markJoin(m_joinService);
+ }
+
+ for (int i=0; i < m_services.size(); i++) {
+ ConditionalBlock block=new ConditionalBlock();
+
+ m_services.get(i).convert(block.getContents(), context);
+
+ elem.getConditionalBlocks().add(block);
+ }
+
+ if (m_joinService != null) {
+ m_joinService.convert(activities, context);
+ }
+ }
+
+ /**
+ * This method adds a path to the when action.
+ *
+ * @param category The service category
+ * @param name The service name
+ * @param position The position
+ */
+ public void addPath(String category, String name,
+ int position) {
+
+ org.w3c.dom.NodeList nl=
+ getAction().getElementsByTagName(PROPERTY_ELEMENT);
+
+ org.w3c.dom.Element paths=null;
+
+ for (int i=0; paths == null && i < nl.getLength(); i++) {
+ if (nl.item(i) instanceof org.w3c.dom.Element) {
+ String propName=((org.w3c.dom.Element)nl.item(i)).getAttribute(NAME_ATTR);
+
+ if (propName != null && propName.equals(PATHS)) {
+ paths = (org.w3c.dom.Element)nl.item(i);
+ }
+ }
+ }
+
+ if (paths == null) {
+ paths = getAction().getOwnerDocument().createElement(PROPERTY_ELEMENT);
+ paths.setAttribute(NAME_ATTR, PATHS);
+
+ getAction().appendChild(paths);
+ }
+
+ org.w3c.dom.Element path=
+ getAction().getOwnerDocument().createElement(WHEN);
+ path.setAttribute(SERVICE_CATEGORY, category);
+ path.setAttribute(SERVICE_NAME, name);
+
+ paths.appendChild(path);
+ }
+
+ private java.util.List<ESBService> m_services=new java.util.Vector<ESBService>();
+ private String m_joinCategory=null;
+ private String m_joinName=null;
+ private ESBService m_joinService=null;
+}
Property changes on: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/WhenAction.java
___________________________________________________________________
Name: svn:mergeinfo
+
Copied: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/WhileAction.java (from rev 436, cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/WhileAction.java)
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/WhileAction.java (rev 0)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/WhileAction.java 2009-01-12 21:15:25 UTC (rev 459)
@@ -0,0 +1,386 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, 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.
+ */
+package org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful;
+
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.*;
+import org.scribble.model.*;
+import org.scribble.model.admin.ModelIssue;
+import org.scribble.model.admin.ModelListener;
+import org.scribble.conversation.model.*;
+
+/**
+ * The model component for the 'WhileAction'.
+ *
+ * @author gary
+ */
+public class WhileAction extends AbstractStatefulESBAction {
+
+ public static final String SERVICE_NAME = "service-name";
+ public static final String SERVICE_CATEGORY = "service-category";
+ public static final String IMMEDIATE = "immediate";
+ private static final String WHILE = "while";
+ private static final String EXIT = "exit";
+ private static final String PATHS = "paths";
+ public static final String MESSAGE_ELEMENT="message";
+ public static final String TYPE_ATTR="type";
+
+ /**
+ * The constructor for the action.
+ *
+ * @param service The reference to the service in which
+ * the action is contained
+ * @param action The XML configuration details for the action
+ */
+ public WhileAction(ESBService service,
+ org.w3c.dom.Element action) {
+ super(service, action);
+ }
+
+ /**
+ * This constructor initializes the DOM element for
+ * the action.
+ *
+ * @param service The reference to the service in which
+ * the action will be contained
+ */
+ public WhileAction(ESBService service) {
+ super(service, ESBActionFactory.getConversationAction(
+ WhileAction.class));
+ }
+
+ /**
+ * This method initializes the links with the ESB service descriptors
+ * identified in each path of the action.
+ */
+ @Override
+ public void initializeLinks() {
+ super.initializeLinks();
+
+ org.w3c.dom.NodeList nl=getPropertyChildNodes(PATHS);
+
+ for (int i=0; i < nl.getLength(); i++) {
+
+ org.w3c.dom.Node n=nl.item(i);
+
+ if (n instanceof org.w3c.dom.Element) {
+ if (n.getNodeName().equals(WHILE)) {
+ if (((org.w3c.dom.Element)n).hasAttribute(SERVICE_CATEGORY) &&
+ ((org.w3c.dom.Element)n).hasAttribute(SERVICE_NAME)) {
+ m_loopCategory=((org.w3c.dom.Element)n).getAttribute(SERVICE_CATEGORY);
+ m_loopName=((org.w3c.dom.Element)n).getAttribute(SERVICE_NAME);
+
+ // Lookup service associated with category and name
+ m_loopService=getService().getModel().getService(m_loopCategory, m_loopName);
+
+ String immediate=((org.w3c.dom.Element)n).getAttribute(IMMEDIATE);
+
+ // Initialize link, even if service is null - this will be
+ // reported as a validation error later
+ getLinks().add(new ESBLink(m_loopCategory, m_loopName, m_loopService,
+ (immediate != null && immediate.equalsIgnoreCase("true"))));
+ }
+ } else if (n.getNodeName().equals(EXIT)) {
+ if (((org.w3c.dom.Element)n).hasAttribute(SERVICE_CATEGORY) &&
+ ((org.w3c.dom.Element)n).hasAttribute(SERVICE_NAME)) {
+ m_exitCategory=((org.w3c.dom.Element)n).getAttribute(SERVICE_CATEGORY);
+ m_exitName=((org.w3c.dom.Element)n).getAttribute(SERVICE_NAME);
+
+ // Lookup service associated with category and name
+ m_exitService=getService().getModel().getService(m_exitCategory, m_exitName);
+
+ String immediate=((org.w3c.dom.Element)n).getAttribute(IMMEDIATE);
+
+ // Initialize link, even if service is null - this will be
+ // reported as a validation error later
+ getLinks().add(new ESBLink(m_exitCategory, m_exitName, m_exitService,
+ (immediate != null && immediate.equalsIgnoreCase("true"))));
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * This method determines if the action represents a loop construct.
+ *
+ * @return Whether the action represents a loop construct
+ */
+ @Override
+ public boolean isLoop() {
+ return(true);
+ }
+
+ /**
+ * This method indicates whether the action is an initiator.
+ * Initiator actions must precede any other session based
+ * action, within an ESB service.
+ *
+ * @return Whether the action is an initiator
+ */
+ @Override
+ public boolean isInitiator() {
+ return(true);
+ }
+
+ /**
+ * This method returns the mandatory property names.
+ *
+ * @return The mandatory property names
+ */
+ @Override
+ protected java.util.List<String> getMandatoryProperties() {
+ java.util.List<String> ret=super.getMandatoryProperties();
+ ret.add(PATHS);
+ return(ret);
+ }
+
+ /**
+ * This method validates the ESB action and reports warnings or
+ * errors to the supplied model listener.
+ *
+ * @param l The model listener
+ */
+ @Override
+ public void validate(ModelListener l) {
+ super.validate(l);
+
+ // While action must be first conversation based action in
+ // the service
+ if (getService() != null && getService().getActions().size() > 0) {
+ ESBAction act=getService().getActions().get(0);
+
+ if (act != this) {
+ l.error(new ModelIssue(this, org.scribble.util.MessageUtil.format(
+ java.util.PropertyResourceBundle.getBundle(
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
+ "_MUST_BE_FIRST_ACTION",
+ new String[]{"While"})));
+ }
+ }
+
+ // TODO: Validate while/exit order, if decision-method
+ // specified, that method exists, if expression, then
+ // validate the expression etc.
+
+ // TODO: Validate that the loop service returns back to the
+ // while action for all paths
+
+ org.w3c.dom.NodeList nl=getPropertyChildNodes(PATHS);
+ boolean f_while=false;
+ boolean f_exit=false;
+ boolean f_multipleWhiles=false;
+ boolean f_multipleExits=false;
+ boolean f_serviceDetailsMissing=false;
+ boolean f_pathAfterExit=false;
+ boolean f_immediateInvalid=false;
+
+ for (int i=0; nl != null && i < nl.getLength(); i++) {
+
+ org.w3c.dom.Node n=nl.item(i);
+
+ if (n instanceof org.w3c.dom.Element) {
+ if (n.getNodeName().equals(WHILE)) {
+
+ if (f_while) {
+ f_multipleWhiles = true;
+ }
+
+ if (f_exit) {
+ f_pathAfterExit = true;
+ }
+
+ f_while = true;
+
+ if (((org.w3c.dom.Element)n).hasAttribute(SERVICE_CATEGORY) == false ||
+ ((org.w3c.dom.Element)n).hasAttribute(SERVICE_NAME) == false) {
+ f_serviceDetailsMissing = true;
+ }
+
+ String immediate=((org.w3c.dom.Element)n).getAttribute(IMMEDIATE);
+
+ if (((org.w3c.dom.Element)n).hasAttribute(IMMEDIATE) &&
+ immediate.equalsIgnoreCase("true") == false &&
+ immediate.equalsIgnoreCase("false") == false) {
+ f_immediateInvalid = true;
+ }
+ } else if (n.getNodeName().equals(EXIT)) {
+
+ if (f_exit) {
+ f_multipleExits = true;
+ }
+
+ f_exit = true;
+
+ if (((org.w3c.dom.Element)n).hasAttribute(SERVICE_CATEGORY) == false ||
+ ((org.w3c.dom.Element)n).hasAttribute(SERVICE_NAME) == false) {
+ f_serviceDetailsMissing = true;
+ }
+
+ String immediate=((org.w3c.dom.Element)n).getAttribute(IMMEDIATE);
+
+ if (((org.w3c.dom.Element)n).hasAttribute(IMMEDIATE) &&
+ immediate.equalsIgnoreCase("true") == false &&
+ immediate.equalsIgnoreCase("false") == false) {
+ f_immediateInvalid = true;
+ }
+ }
+ }
+ }
+
+ // Report any errors
+ if (nl != null && (f_while == false || f_multipleWhiles)) {
+ l.error(new ModelIssue(this, org.scribble.util.MessageUtil.format(
+ java.util.PropertyResourceBundle.getBundle(
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
+ "_MUST_DEFINE_SINGLE_WHILE_PATH",
+ new String[]{})));
+ }
+
+ if (nl != null && (f_exit == false || f_multipleExits)) {
+ l.error(new ModelIssue(this, org.scribble.util.MessageUtil.format(
+ java.util.PropertyResourceBundle.getBundle(
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
+ "_MUST_DEFINE_SINGLE_WHILE_EXIT",
+ new String[]{})));
+ }
+
+ if (f_pathAfterExit) {
+ l.error(new ModelIssue(this, org.scribble.util.MessageUtil.format(
+ java.util.PropertyResourceBundle.getBundle(
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
+ "_WHILE_PATH_AFTER_EXIT",
+ new String[]{})));
+ }
+
+ if (f_serviceDetailsMissing) {
+ l.error(new ModelIssue(this, org.scribble.util.MessageUtil.format(
+ java.util.PropertyResourceBundle.getBundle(
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
+ "_PATH_SERVICE_DETAILS_MISSING",
+ new String[]{})));
+ }
+
+ if (f_immediateInvalid) {
+ l.error(new ModelIssue(this, org.scribble.util.MessageUtil.format(
+ java.util.PropertyResourceBundle.getBundle(
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
+ "_BOOLEAN",
+ new String[]{IMMEDIATE})));
+ }
+ }
+
+ /**
+ * This method converts the ESB action into an equivalent
+ * behavioural description for conformance checking.
+ *
+ * @param activities The list of activities that will contain
+ * the converted action(s)
+ * @param context The conversion context
+ */
+ @Override
+ public void convert(java.util.List<Activity> activities,
+ ConversionContext context) {
+
+ While elem=new While();
+ activities.add(elem);
+
+ elem.derivedFrom(this);
+
+ ConditionalBlock block=new ConditionalBlock();
+ elem.setBlock(block);
+
+ if (m_loopService != null) {
+ context.push(getService());
+
+ m_loopService.convert(elem.getBlock().getContents(), context);
+
+ context.pop(getService());
+ }
+
+ if (m_exitService != null) {
+ m_exitService.convert(activities, context);
+ }
+ }
+
+ /**
+ * This method adds a path to the when action.
+ *
+ * @param category The service category
+ * @param name The service name
+ * @param position The position
+ */
+ public void addPath(String category, String name, boolean exit,
+ java.util.List<MessageSignature> messageTypes,
+ int position) {
+
+ org.w3c.dom.NodeList nl=
+ getAction().getElementsByTagName(PROPERTY_ELEMENT);
+
+ org.w3c.dom.Element paths=null;
+
+ for (int i=0; paths == null && i < nl.getLength(); i++) {
+ if (nl.item(i) instanceof org.w3c.dom.Element) {
+ String propName=((org.w3c.dom.Element)nl.item(i)).getAttribute(NAME_ATTR);
+
+ if (propName != null && propName.equals(PATHS)) {
+ paths = (org.w3c.dom.Element)nl.item(i);
+ }
+ }
+ }
+
+ if (paths == null) {
+ paths = getAction().getOwnerDocument().createElement(PROPERTY_ELEMENT);
+ paths.setAttribute(NAME_ATTR, PATHS);
+
+ getAction().appendChild(paths);
+ }
+
+ org.w3c.dom.Element path=
+ getAction().getOwnerDocument().createElement(exit?EXIT:WHILE);
+ path.setAttribute(SERVICE_CATEGORY, category);
+ path.setAttribute(SERVICE_NAME, name);
+
+ paths.appendChild(path);
+
+ for (int i=0; i < messageTypes.size(); i++) {
+ org.w3c.dom.Element mt=
+ getAction().getOwnerDocument().createElement(MESSAGE_ELEMENT);
+
+ if (messageTypes.get(i).getTypes().size() == 1) {
+ TypeReference ref=messageTypes.get(i).getTypes().get(0);
+ String type="";
+
+ if (ref.getNamespace() != null) {
+ type += "{"+ref.getNamespace()+"}";
+ }
+ type += ref.getLocalpart();
+
+ mt.setAttribute(TYPE_ATTR, type);
+
+ path.appendChild(mt);
+ }
+ }
+ }
+
+ private String m_loopCategory=null;
+ private String m_loopName=null;
+ private ESBService m_loopService=null;
+ private String m_exitCategory=null;
+ private String m_exitName=null;
+ private ESBService m_exitService=null;
+}
Property changes on: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateful/WhileAction.java
___________________________________________________________________
Name: svn:mergeinfo
+
Added: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateless/AbstractInteractionMessageAction.java
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateless/AbstractInteractionMessageAction.java (rev 0)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateless/AbstractInteractionMessageAction.java 2009-01-12 21:15:25 UTC (rev 459)
@@ -0,0 +1,142 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, 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.
+ */
+package org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateless;
+
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.*;
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.*;
+
+/**
+ * The abstract model component for the 'ReceiveMessageAction'
+ * and 'SendMessageAction'.
+ *
+ * @author gary
+ */
+public abstract class AbstractInteractionMessageAction extends AbstractESBAction {
+
+ public static final String MESSAGE_TYPE = "messageType";
+ public static final String OPERATION = "operation";
+ public static final String CLIENT_EPR = "clientEPR";
+
+ /**
+ * The constructor for the action.
+ *
+ * @param service The reference to the service in which
+ * the action is contained
+ * @param action The XML configuration details for the action
+ */
+ public AbstractInteractionMessageAction(ESBService service,
+ org.w3c.dom.Element action) {
+ super(service, action);
+ }
+
+ /**
+ * The contructor for initializing a new action.
+ */
+ protected AbstractInteractionMessageAction(ESBService service,
+ String actionClass) {
+ super(service, actionClass);
+ }
+
+ /**
+ * This method returns the mandatory property names.
+ *
+ * @return The mandatory property names
+ */
+ @Override
+ protected java.util.List<String> getMandatoryProperties() {
+ java.util.List<String> ret=super.getMandatoryProperties();
+ ret.add(MESSAGE_TYPE);
+ return(ret);
+ }
+
+ /**
+ * This method returns the optional property names.
+ *
+ * @return The optional property names
+ */
+ @Override
+ protected java.util.List<String> getOptionalProperties() {
+ java.util.List<String> ret=super.getOptionalProperties();
+ ret.add(OPERATION);
+ ret.add(CLIENT_EPR);
+ return(ret);
+ }
+
+ /**
+ * This method sets the operation property.
+ *
+ * @param operation The operation
+ */
+ public void setOperation(String operation) {
+
+ if (operation != null) {
+ org.w3c.dom.Element prop=getPropertyElement(OPERATION);
+
+ if (prop != null) {
+ prop.setAttribute(VALUE_ATTR, operation);
+ }
+ } else {
+ removePropertyElement(OPERATION);
+ }
+ }
+
+ /**
+ * This method sets the message type.
+ *
+ * @param type The message type
+ */
+ public void setMessageType(String type) {
+
+ org.w3c.dom.Element prop=getPropertyElement(MESSAGE_TYPE);
+
+ if (prop != null) {
+ prop.setAttribute(VALUE_ATTR, type);
+ }
+ }
+
+ /**
+ * This method returns the message type.
+ *
+ * @return The message type
+ */
+ public String getMessageType() {
+ String ret=null;
+
+ org.w3c.dom.Element prop=getPropertyElement(MESSAGE_TYPE);
+
+ if (prop != null && prop.hasAttribute(VALUE_ATTR)) {
+ ret = prop.getAttribute(VALUE_ATTR);
+ }
+
+ return(ret);
+ }
+
+ /**
+ * This method sets the client's EPR label property.
+ *
+ * @param epr The client EPR label
+ */
+ public void setClientEPR(String epr) {
+
+ org.w3c.dom.Element prop=getPropertyElement(CLIENT_EPR);
+
+ if (prop != null) {
+ prop.setAttribute(VALUE_ATTR, epr);
+ }
+ }
+}
Added: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateless/IfAction.java
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateless/IfAction.java (rev 0)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateless/IfAction.java 2009-01-12 21:15:25 UTC (rev 459)
@@ -0,0 +1,325 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, 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.
+ */
+package org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateless;
+
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.*;
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.*;
+import org.scribble.model.*;
+import org.scribble.model.admin.ModelIssue;
+import org.scribble.model.admin.ModelListener;
+import org.scribble.conversation.model.*;
+
+/**
+ * The model component for the 'IfAction'.
+ *
+ * @author gary
+ */
+public class IfAction extends AbstractESBAction {
+
+ public static final String SERVICE_NAME = "service-name";
+ public static final String SERVICE_CATEGORY = "service-category";
+ public static final String IMMEDIATE = "immediate";
+ public static final String EXPRESSION = "expression"; // ???
+ public static final String ELSE = "else";
+ public static final String ELSEIF = "elseif";
+ public static final String IF = "if";
+ public static final String PATHS = "paths";
+
+ /**
+ * The constructor for the action.
+ *
+ * @param service The reference to the service in which
+ * the action is contained
+ * @param action The XML configuration details for the action
+ */
+ public IfAction(ESBService service,
+ org.w3c.dom.Element action) {
+ super(service, action);
+ }
+
+ /**
+ * This constructor initializes the DOM element for
+ * the action.
+ *
+ * @param service The reference to the service in which
+ * the action will be contained
+ */
+ public IfAction(ESBService service) {
+ super(service, ESBActionFactory.getConversationAction(
+ IfAction.class));
+ }
+
+ /**
+ * This method initializes the links with the ESB service descriptors
+ * identified in each path of the action.
+ */
+ @Override
+ public void initializeLinks() {
+ super.initializeLinks();
+
+ org.w3c.dom.NodeList nl=getPropertyChildNodes(PATHS);
+
+ for (int i=0; i < nl.getLength(); i++) {
+
+ org.w3c.dom.Node n=nl.item(i);
+
+ if (n instanceof org.w3c.dom.Element &&
+ (n.getNodeName().equals(IF) ||
+ n.getNodeName().equals(ELSEIF) ||
+ n.getNodeName().equals(ELSE))) {
+ if (((org.w3c.dom.Element)n).hasAttribute(SERVICE_CATEGORY) &&
+ ((org.w3c.dom.Element)n).hasAttribute(SERVICE_NAME)) {
+ String category=((org.w3c.dom.Element)n).getAttribute(SERVICE_CATEGORY);
+ String name=((org.w3c.dom.Element)n).getAttribute(SERVICE_NAME);
+
+ // Lookup service associated with category and name
+ ESBService service=getService().getModel().getService(category, name);
+
+ String immediate=((org.w3c.dom.Element)n).getAttribute(IMMEDIATE);
+
+ // Initialize link, even if service is null - this will be
+ // reported as a validation error later
+ getLinks().add(new ESBLink(category, name, service,
+ (immediate != null && immediate.equalsIgnoreCase("true"))));
+ }
+ }
+ }
+ }
+
+ /**
+ * This method returns the mandatory property names.
+ *
+ * @return The mandatory property names
+ */
+ @Override
+ protected java.util.List<String> getMandatoryProperties() {
+ java.util.List<String> ret=super.getMandatoryProperties();
+ ret.add(PATHS);
+ return(ret);
+ }
+
+ /**
+ * This method validates the ESB action and reports warnings or
+ * errors to the supplied model listener.
+ *
+ * @param l The model listener
+ */
+ @Override
+ public void validate(ModelListener l) {
+ super.validate(l);
+
+ org.w3c.dom.NodeList nl=getPropertyChildNodes(PATHS);
+ boolean f_if=false;
+ boolean f_else=false;
+ boolean f_orderWrong=false;
+ boolean f_serviceDetailsMissing=false;
+ boolean f_immediateInvalid=false;
+
+ for (int i=0; nl != null && i < nl.getLength(); i++) {
+
+ org.w3c.dom.Node n=nl.item(i);
+
+ if (n instanceof org.w3c.dom.Element) {
+ if (n.getNodeName().equals(IF)) {
+ if (f_if) {
+ f_orderWrong = true;
+ }
+
+ f_if = true;
+
+ if (((org.w3c.dom.Element)n).hasAttribute(SERVICE_CATEGORY) == false ||
+ ((org.w3c.dom.Element)n).hasAttribute(SERVICE_NAME) == false) {
+ f_serviceDetailsMissing = true;
+ }
+
+ String immediate=((org.w3c.dom.Element)n).getAttribute(IMMEDIATE);
+
+ if (((org.w3c.dom.Element)n).hasAttribute(IMMEDIATE) &&
+ immediate.equalsIgnoreCase("true") == false &&
+ immediate.equalsIgnoreCase("false") == false) {
+ f_immediateInvalid = true;
+ }
+ } else if (n.getNodeName().equals(ELSEIF)) {
+
+ if (f_if == false || f_else) {
+ f_orderWrong = true;
+ }
+
+ if (((org.w3c.dom.Element)n).hasAttribute(SERVICE_CATEGORY) == false ||
+ ((org.w3c.dom.Element)n).hasAttribute(SERVICE_NAME) == false) {
+ f_serviceDetailsMissing = true;
+ }
+
+ String immediate=((org.w3c.dom.Element)n).getAttribute(IMMEDIATE);
+
+ if (((org.w3c.dom.Element)n).hasAttribute(IMMEDIATE) &&
+ immediate.equalsIgnoreCase("true") == false &&
+ immediate.equalsIgnoreCase("false") == false) {
+ f_immediateInvalid = true;
+ }
+ } else if (n.getNodeName().equals(ELSE)) {
+
+ if (f_if == false || f_else) {
+ f_orderWrong = true;
+ }
+
+ f_else = true;
+
+ if (((org.w3c.dom.Element)n).hasAttribute(SERVICE_CATEGORY) == false ||
+ ((org.w3c.dom.Element)n).hasAttribute(SERVICE_NAME) == false) {
+ f_serviceDetailsMissing = true;
+ }
+
+ String immediate=((org.w3c.dom.Element)n).getAttribute(IMMEDIATE);
+
+ if (((org.w3c.dom.Element)n).hasAttribute(IMMEDIATE) &&
+ immediate.equalsIgnoreCase("true") == false &&
+ immediate.equalsIgnoreCase("false") == false) {
+ f_immediateInvalid = true;
+ }
+ }
+ }
+ }
+
+ // Report any errors
+ if (nl != null && (f_if == false || f_orderWrong)) {
+ l.error(new ModelIssue(this, org.scribble.util.MessageUtil.format(
+ java.util.PropertyResourceBundle.getBundle(
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
+ "_IF_ORDER_WRONG",
+ new String[]{})));
+ }
+
+ if (f_serviceDetailsMissing) {
+ l.error(new ModelIssue(this, org.scribble.util.MessageUtil.format(
+ java.util.PropertyResourceBundle.getBundle(
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
+ "_PATH_SERVICE_DETAILS_MISSING",
+ new String[]{})));
+ }
+
+ if (f_immediateInvalid) {
+ l.error(new ModelIssue(this, org.scribble.util.MessageUtil.format(
+ java.util.PropertyResourceBundle.getBundle(
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
+ "_BOOLEAN",
+ new String[]{IMMEDIATE})));
+ }
+ }
+
+ /**
+ * This method converts the ESB action into an equivalent
+ * behavioural description for conformance checking.
+ *
+ * @param activities The list of activities that will contain
+ * the converted action(s)
+ * @param context The conversion context
+ */
+ @Override
+ public void convert(java.util.List<Activity> activities,
+ ConversionContext context) {
+
+ org.w3c.dom.NodeList nl=getPropertyChildNodes(PATHS);
+
+ If choice=new If();
+ activities.add(choice);
+
+ for (int i=0; i < nl.getLength(); i++) {
+
+ org.w3c.dom.Node n=nl.item(i);
+
+ if (n instanceof org.w3c.dom.Element) {
+ if (n.getNodeName().equals(IF) ||
+ n.getNodeName().equals(ELSEIF)) {
+ String category=((org.w3c.dom.Element)n).getAttribute(SERVICE_CATEGORY);
+ String name=((org.w3c.dom.Element)n).getAttribute(SERVICE_NAME);
+
+ // TODO: Convert the conditional expression if defined
+
+ ConditionalBlock cond=new ConditionalBlock();
+ choice.getConditionalBlocks().add(cond);
+
+ ESBService service=getService().getModel().getService(category, name);
+
+ if (service != null) {
+ service.convert(cond.getContents(), context);
+ }
+ } else if (n.getNodeName().equals(ELSE)) {
+ String category=((org.w3c.dom.Element)n).getAttribute(SERVICE_CATEGORY);
+ String name=((org.w3c.dom.Element)n).getAttribute(SERVICE_NAME);
+
+ Block block=new Block();
+ choice.setElseBlock(block);
+
+ ESBService service=getService().getModel().getService(category, name);
+
+ if (service != null) {
+ service.convert(block.getContents(), context);
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * This method adds a path to the if action.
+ *
+ * @param type The type of path (IF, ELSEIF or ELSE)
+ * @param category The service category
+ * @param name The service name
+ * @param immediate Whether invocation should be immediate
+ * @param expr The expression, if type is IF or ELSEIF
+ * @param position The position, if type is ELSEIF
+ */
+ public void addPath(String type, String category, String name,
+ boolean immediate, String expr, int position) {
+
+ org.w3c.dom.NodeList nl=
+ getAction().getElementsByTagName(PROPERTY_ELEMENT);
+
+ org.w3c.dom.Element paths=null;
+
+ for (int i=0; paths == null && i < nl.getLength(); i++) {
+ if (nl.item(i) instanceof org.w3c.dom.Element) {
+ String propName=((org.w3c.dom.Element)nl.item(i)).getAttribute(NAME_ATTR);
+
+ if (propName != null && propName.equals(PATHS)) {
+ paths = (org.w3c.dom.Element)nl.item(i);
+ }
+ }
+ }
+
+ if (paths == null) {
+ paths = getAction().getOwnerDocument().createElement(PROPERTY_ELEMENT);
+ paths.setAttribute(NAME_ATTR, PATHS);
+
+ getAction().appendChild(paths);
+ }
+
+ org.w3c.dom.Element path=getAction().getOwnerDocument().createElement(type);
+ path.setAttribute(SERVICE_CATEGORY, category);
+ path.setAttribute(SERVICE_NAME, name);
+ path.setAttribute(IMMEDIATE, ""+immediate);
+
+ if (expr != null && (type == IF || type == ELSEIF)) {
+ path.setAttribute(EXPRESSION, expr);
+ }
+
+ paths.appendChild(path);
+ }
+}
Added: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateless/MessageRouterAction.java
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateless/MessageRouterAction.java (rev 0)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateless/MessageRouterAction.java 2009-01-12 21:15:25 UTC (rev 459)
@@ -0,0 +1,362 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, 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.
+ */
+package org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateless;
+
+import java.util.logging.Logger;
+
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.*;
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.*;
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.util.InteractionUtil;
+import org.scribble.conversation.model.ConditionalBlock;
+import org.scribble.conversation.model.If;
+import org.scribble.model.*;
+import org.scribble.model.admin.ModelIssue;
+import org.scribble.model.admin.ModelListener;
+
+/**
+ * The model component for the 'MessageRouterAction'. Although
+ * not an integral part of the behaviour of a service, it provides
+ * a behavioural gateway to ensure that messages sent to a
+ * specific endpoint reference are routed to the appropriate
+ * ESB service descriptor. Therefore the routing configuration
+ * needs to be synchronized with the definition of the service
+ * descriptors representing the various behavioural states associated
+ * with a service.
+ *
+ * @author gary
+ */
+public class MessageRouterAction extends AbstractESBAction {
+
+ public static final String INITIATE = "initiate";
+ public static final String SERVICE_NAME = "service-name";
+ public static final String SERVICE_CATEGORY = "service-category";
+ public static final String ROUTE = "route";
+ public static final String PATHS = "paths";
+ public static final String MESSAGE_ELEMENT="message";
+ public static final String TYPE_ATTR="type";
+
+ public static final String ELSE = "else";
+ public static final String ELSEIF = "elseif";
+ public static final String IF = "if";
+
+ /**
+ * The constructor for the action.
+ *
+ * @param service The reference to the service in which
+ * the action is contained
+ * @param action The XML configuration details for the action
+ */
+ public MessageRouterAction(ESBService service,
+ org.w3c.dom.Element action) {
+ super(service, action);
+ }
+
+ /**
+ * This constructor initializes the DOM element for
+ * the action.
+ *
+ * @param service The reference to the service in which
+ * the action will be contained
+ */
+ public MessageRouterAction(ESBService service) {
+ super(service, ESBActionFactory.getConversationAction(
+ MessageRouterAction.class));
+ }
+
+ /**
+ * This method determines whether the action is related to a behavioural
+ * session.
+ *
+ * @return Whether the action is session based
+ */
+ public boolean isSessionBased() {
+ return(false);
+ }
+
+ /**
+ * This method determines whether the action is a gateway
+ * for inbound requests.
+ *
+ * @return Whether the action is a gateway
+ */
+ public boolean isGateway() {
+ return(true);
+ }
+
+ /**
+ * This method adds a route to the message router action.
+ *
+ * @param category The service category
+ * @param name The service name
+ * @param initiate Whether the route initiates the service
+ * @param messageTypes The list of message types
+ */
+ public void addRoute(String category, String name, boolean initiate,
+ java.util.List<MessageSignature> messageTypes) {
+
+ org.w3c.dom.Element paths=getPropertyElement(PATHS);
+
+ org.w3c.dom.Element path=
+ getAction().getOwnerDocument().createElement(ROUTE);
+ path.setAttribute(SERVICE_CATEGORY, category);
+ path.setAttribute(SERVICE_NAME, name);
+
+ if (initiate) {
+ path.setAttribute(INITIATE, Boolean.toString(initiate));
+ }
+
+ for (int i=0; i < messageTypes.size(); i++) {
+ org.w3c.dom.Element mt=
+ getAction().getOwnerDocument().createElement(MESSAGE_ELEMENT);
+
+ if (messageTypes.get(i).getTypes().size() == 1) {
+ TypeReference ref=messageTypes.get(i).getTypes().get(0);
+
+ mt.setAttribute(TYPE_ATTR, InteractionUtil.getTypeString(ref));
+
+ path.appendChild(mt);
+ } else {
+ logger.warning("Can only handle single type message signatures");
+ }
+ }
+
+ paths.appendChild(path);
+ }
+
+ /**
+ * This method returns the number of routes associated with
+ * the message router.
+ *
+ * @return The number of routes
+ */
+ public int getNumberOfRoutes() {
+ int ret=0;
+
+ org.w3c.dom.NodeList nl=getAction().getElementsByTagName(ROUTE);
+
+ ret = nl.getLength();
+
+ return(ret);
+ }
+
+ /**
+ * This method returns the DOM element associated with the
+ * specified route.
+ *
+ * @param index The index of the required route
+ * @return The route element, or null if not found
+ */
+ public org.w3c.dom.Element getRouteElement(int index) {
+ org.w3c.dom.Element ret=null;
+
+ org.w3c.dom.NodeList nl=getAction().getElementsByTagName(ROUTE);
+
+ if (index >= 0 && index < nl.getLength() &&
+ nl.item(index) instanceof org.w3c.dom.Element) {
+ ret = (org.w3c.dom.Element)nl.item(index);
+ }
+
+ return(ret);
+ }
+
+ /**
+ * This method returns the DOM element associated with the
+ * specified service category and name.
+ *
+ * @param category The service category
+ * @param name The service name
+ * @return The route element, or null if not found
+ */
+ public org.w3c.dom.Element getRouteElement(String category,
+ String name) {
+ org.w3c.dom.Element ret=null;
+
+ org.w3c.dom.NodeList nl=getAction().getElementsByTagName(ROUTE);
+
+ for (int i=0; ret == null && i < nl.getLength(); i++) {
+ if (nl.item(i) instanceof org.w3c.dom.Element) {
+ ret = (org.w3c.dom.Element)nl.item(i);
+
+ if (ret.getAttribute(SERVICE_CATEGORY).equals(category) == false ||
+ ret.getAttribute(SERVICE_NAME).equals(name) == false) {
+ ret = null;
+ }
+ }
+ }
+
+ return(ret);
+ }
+
+ /**
+ * This method returns the mandatory property names.
+ *
+ * @return The mandatory property names
+ */
+ @Override
+ protected java.util.List<String> getMandatoryProperties() {
+ java.util.List<String> ret=super.getMandatoryProperties();
+ ret.add(PATHS);
+ return(ret);
+ }
+
+ /**
+ * This method validates the ESB action and reports warnings or
+ * errors to the supplied model listener.
+ *
+ * @param l The model listener
+ */
+ @Override
+ public void validate(ModelListener l) {
+ super.validate(l);
+
+ // Check that message router has no other session based
+ // ESB actions in the same service descriptor
+ if (getService().isSessionBased()) {
+ l.error(new ModelIssue(this, org.scribble.util.MessageUtil.format(
+ java.util.PropertyResourceBundle.getBundle(
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
+ "_CANNOT_SESSION_BASED_ACTIONS_WITH_ROUTER",
+ new String[]{})));
+ }
+
+ // Check that 'initate' services have a 'CreateSessionAction' and
+ // represent the root behaviour
+ for (int i=0; i < m_initiateServices.size(); i++) {
+ ESBService service=m_initiateServices.get(i);
+
+ if (service.isRoot() == false) {
+ l.error(new ModelIssue(this, org.scribble.util.MessageUtil.format(
+ java.util.PropertyResourceBundle.getBundle(
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
+ "_CANNOT_INITIATE_NON_ROOT",
+ new String[]{service.getCategory(),
+ service.getName()})));
+ }
+ }
+
+ // Check that non-'initate' services don't have a 'CreateSessionAction' and
+ // represent the root behaviour
+ for (int i=0; i < m_services.size(); i++) {
+ ESBService service=m_services.get(i);
+
+ if (service.isRoot()) {
+ l.error(new ModelIssue(this, org.scribble.util.MessageUtil.format(
+ java.util.PropertyResourceBundle.getBundle(
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
+ "_MUST_INITIATE_ROOT",
+ new String[]{service.getCategory(),
+ service.getName()})));
+ }
+ }
+
+ org.w3c.dom.NodeList nl=getPropertyChildNodes(PATHS);
+ boolean f_serviceDetailsMissing=false;
+ int routeCount=0;
+
+ for (int i=0; nl != null && i < nl.getLength(); i++) {
+
+ org.w3c.dom.Node n=nl.item(i);
+
+ if (n instanceof org.w3c.dom.Element) {
+ if (n.getNodeName().equals(ROUTE)) {
+ routeCount++;
+
+ if (((org.w3c.dom.Element)n).hasAttribute(SERVICE_CATEGORY) == false ||
+ ((org.w3c.dom.Element)n).hasAttribute(SERVICE_NAME) == false) {
+ f_serviceDetailsMissing = true;
+ }
+ }
+ }
+ }
+
+ // Report any errors
+ if (nl != null && routeCount < 1) {
+ l.error(new ModelIssue(this, org.scribble.util.MessageUtil.format(
+ java.util.PropertyResourceBundle.getBundle(
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
+ "_ROUTER_ONE_OR_MORE_PATHS",
+ new String[]{})));
+ }
+
+ if (f_serviceDetailsMissing) {
+ l.error(new ModelIssue(this, org.scribble.util.MessageUtil.format(
+ java.util.PropertyResourceBundle.getBundle(
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
+ "_PATH_SERVICE_DETAILS_MISSING",
+ new String[]{})));
+ }
+ }
+
+ /**
+ * This method converts the ESB action into an equivalent
+ * behavioural description for conformance checking.
+ *
+ * @param activities The list of activities that will contain
+ * the converted action(s)
+ * @param context The conversion context
+ */
+ @Override
+ public void convert(java.util.List<Activity> activities,
+ ConversionContext context) {
+ org.w3c.dom.NodeList nl=getPropertyChildNodes(PATHS);
+
+ If choice=new If();
+ activities.add(choice);
+
+ for (int i=0; i < nl.getLength(); i++) {
+
+ org.w3c.dom.Node n=nl.item(i);
+
+ if (n instanceof org.w3c.dom.Element) {
+ if (n.getNodeName().equals(IF) ||
+ n.getNodeName().equals(ELSEIF)) {
+ String category=((org.w3c.dom.Element)n).getAttribute(SERVICE_CATEGORY);
+ String name=((org.w3c.dom.Element)n).getAttribute(SERVICE_NAME);
+
+ // TODO: Convert the conditional expression if defined
+
+ ConditionalBlock cond=new ConditionalBlock();
+ choice.getConditionalBlocks().add(cond);
+
+ ESBService service=getService().getModel().getService(category, name);
+
+ if (service != null) {
+ service.convert(cond.getContents(), context);
+ }
+ } else if (n.getNodeName().equals(ELSE)) {
+ String category=((org.w3c.dom.Element)n).getAttribute(SERVICE_CATEGORY);
+ String name=((org.w3c.dom.Element)n).getAttribute(SERVICE_NAME);
+
+ Block block=new Block();
+ choice.setElseBlock(block);
+
+ ESBService service=getService().getModel().getService(category, name);
+
+ if (service != null) {
+ service.convert(block.getContents(), context);
+ }
+ }
+ }
+ }
+ }
+
+ private static Logger logger = Logger.getLogger("org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateless");
+
+ private java.util.List<ESBService> m_initiateServices=new java.util.Vector<ESBService>();
+ private java.util.List<ESBService> m_services=new java.util.Vector<ESBService>();
+}
Added: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateless/ReceiveMessageAction.java
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateless/ReceiveMessageAction.java (rev 0)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateless/ReceiveMessageAction.java 2009-01-12 21:15:25 UTC (rev 459)
@@ -0,0 +1,107 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, 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.
+ */
+package org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateless;
+
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.*;
+import org.scribble.conversation.model.*;
+import org.scribble.model.*;
+
+/**
+ * The model component for the 'ReceiveMessageAction'.
+ *
+ * @author gary
+ */
+public class ReceiveMessageAction extends AbstractInteractionMessageAction {
+
+ /**
+ * The constructor for the action.
+ *
+ * @param service The reference to the service in which
+ * the action is contained
+ * @param action The XML configuration details for the action
+ */
+ public ReceiveMessageAction(ESBService service,
+ org.w3c.dom.Element action) {
+ super(service, action);
+ }
+
+ /**
+ * This constructor initializes the DOM element for
+ * the action.
+ *
+ * @param service The reference to the service in which
+ * the action will be contained
+ */
+ public ReceiveMessageAction(ESBService service) {
+ super(service, ESBActionFactory.getConversationAction(
+ ReceiveMessageAction.class));
+ }
+
+ /**
+ * This method converts the ESB action into an equivalent
+ * behavioural description for conformance checking.
+ *
+ * @param activities The list of activities that will contain
+ * the converted action(s)
+ * @param context The conversion context
+ */
+ @Override
+ public void convert(java.util.List<Activity> activities,
+ ConversionContext context) {
+
+ ConversationInteraction recv=new ConversationInteraction();
+ activities.add(recv);
+
+ recv.derivedFrom(this);
+
+ MessageSignature ms=new MessageSignature();
+ ms.derivedFrom(this);
+
+ recv.setMessageSignature(ms);
+
+ ms.setOperation(getPropertyValue(OPERATION));
+
+ String type=getPropertyValue(MESSAGE_TYPE);
+ if (type != null && type.length() > 0) {
+ String ns=null;
+ String local=type;
+
+ if (type.charAt(0) == '{') {
+ int endindex=type.indexOf('}');
+
+ if (endindex != -1) {
+ ns = type.substring(1, endindex);
+ local = type.substring(endindex+1);
+ }
+ }
+
+ TypeReference ref=new TypeReference();
+ ref.setLocalpart(local);
+ ref.setNamespace(ns);
+
+ ref.derivedFrom(this);
+
+ ms.getTypes().add(ref);
+ }
+
+ // Initialize the 'to' role to be this participant
+ if (context.getRole() != null) {
+ recv.setToRole(new Role(context.getRole()));
+ }
+ }
+}
Added: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateless/SendMessageAction.java
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateless/SendMessageAction.java (rev 0)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateless/SendMessageAction.java 2009-01-12 21:15:25 UTC (rev 459)
@@ -0,0 +1,213 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, 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.
+ */
+package org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateless;
+
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.*;
+import org.scribble.conversation.model.*;
+import org.scribble.model.*;
+import org.scribble.model.admin.ModelIssue;
+import org.scribble.model.admin.ModelListener;
+
+/**
+ * The model component for the 'SendMessageAction'.
+ *
+ * @author gary
+ */
+public class SendMessageAction extends AbstractInteractionMessageAction {
+
+ public static final String SERVICE_NAME = "serviceName";
+ public static final String SERVICE_CATEGORY = "serviceCategory";
+ public static final String SERVICE_NAME_EXPRESSION = "serviceNameExpression";
+ public static final String SERVICE_CATEGORY_EXPRESSION = "serviceCategoryExpression";
+
+ /**
+ * The constructor for the action.
+ *
+ * @param service The reference to the service in which
+ * the action is contained
+ * @param action The XML configuration details for the action
+ */
+ public SendMessageAction(ESBService service,
+ org.w3c.dom.Element action) {
+ super(service, action);
+ }
+
+ /**
+ * This constructor initializes the DOM element for
+ * the action.
+ *
+ * @param service The reference to the service in which
+ * the action will be contained
+ */
+ public SendMessageAction(ESBService service) {
+ super(service, ESBActionFactory.getConversationAction(
+ SendMessageAction.class));
+ }
+
+ /**
+ * This method returns the optional property names.
+ *
+ * @return The optional property names
+ */
+ @Override
+ protected java.util.List<String> getOptionalProperties() {
+ java.util.List<String> ret=super.getOptionalProperties();
+ ret.add(SERVICE_NAME);
+ ret.add(SERVICE_CATEGORY);
+
+ // TODO: Not sure about whether expressions can be
+ // used as no state?
+ ret.add(SERVICE_NAME_EXPRESSION);
+ ret.add(SERVICE_CATEGORY_EXPRESSION);
+ return(ret);
+ }
+
+ /**
+ * This method validates the ESB action and reports warnings or
+ * errors to the supplied model listener.
+ *
+ * @param l The model listener
+ */
+ @Override
+ public void validate(ModelListener l) {
+ super.validate(l);
+
+ // If sending request, then category/name must be specified,
+ // else a response requires the 'client epr'. Validate that
+ // either case is true.
+ if (getPropertyValue(SERVICE_CATEGORY) != null &&
+ getPropertyValue(SERVICE_NAME) != null) {
+ // Sending a request
+
+ } else if (getPropertyValue(SERVICE_CATEGORY_EXPRESSION) != null &&
+ getPropertyValue(SERVICE_NAME_EXPRESSION) != null) {
+ // Sending a request to service derived from expression
+ // on the pojo state
+
+ } else if (getPropertyValue(CLIENT_EPR) != null) {
+ // Sending a response
+
+ // TODO: Validate that the client EPR has been sent on
+ // a preceding received request
+ } else {
+ l.error(new ModelIssue(this, org.scribble.util.MessageUtil.format(
+ java.util.PropertyResourceBundle.getBundle(
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
+ "_NOT_SPECIFIED_REQ_RESP_EPR",
+ new String[]{})));
+ }
+ }
+
+ /**
+ * This method converts the ESB action into an equivalent
+ * behavioural description for conformance checking.
+ *
+ * @param activities The list of activities that will contain
+ * the converted action(s)
+ * @param context The conversion context
+ */
+ @Override
+ public void convert(java.util.List<Activity> activities,
+ ConversionContext context) {
+
+ ConversationInteraction send=new ConversationInteraction();
+ activities.add(send);
+
+ send.derivedFrom(this);
+
+ MessageSignature ms=new MessageSignature();
+ ms.derivedFrom(this);
+
+ send.setMessageSignature(ms);
+
+ ms.setOperation(getPropertyValue(OPERATION));
+
+ String type=getPropertyValue(MESSAGE_TYPE);
+ if (type != null && type.length() > 0) {
+ String ns=null;
+ String local=type;
+
+ if (type.charAt(0) == '{') {
+ int endindex=type.indexOf('}');
+
+ if (endindex != -1) {
+ ns = type.substring(1, endindex);
+ local = type.substring(endindex+1);
+ }
+ }
+
+ TypeReference ref=new TypeReference();
+ ref.setLocalpart(local);
+ ref.setNamespace(ns);
+
+ ref.derivedFrom(this);
+
+ ms.getTypes().add(ref);
+ }
+
+ // Initialize the 'from' role to be this participant
+ // (for now until 'to' role can be set)
+ if (context.getRole() != null) {
+ send.setFromRole(new Role(context.getRole()));
+ }
+ }
+
+ /**
+ * This method sets the destination service descriptor properties.
+ *
+ * @param category The category
+ * @param name The name
+ */
+ public void setDestination(String category, String name) {
+
+ org.w3c.dom.Element prop=getPropertyElement(SERVICE_CATEGORY);
+
+ if (prop != null) {
+ prop.setAttribute(VALUE_ATTR, category);
+ }
+
+ prop = getPropertyElement(SERVICE_NAME);
+
+ if (prop != null) {
+ prop.setAttribute(VALUE_ATTR, name);
+ }
+ }
+
+ /**
+ * This method sets the destination expressions for the
+ * service descriptor properties.
+ *
+ * @param categoryExpr The category expression
+ * @param nameExpr The name expression
+ */
+ public void setDestinationExpression(String categoryExpr,
+ String nameExpr) {
+
+ org.w3c.dom.Element prop=getPropertyElement(SERVICE_CATEGORY_EXPRESSION);
+
+ if (prop != null) {
+ prop.setAttribute(VALUE_ATTR, categoryExpr);
+ }
+
+ prop = getPropertyElement(SERVICE_NAME_EXPRESSION);
+
+ if (prop != null) {
+ prop.setAttribute(VALUE_ATTR, nameExpr);
+ }
+ }
+}
Added: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateless/SwitchAction.java
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateless/SwitchAction.java (rev 0)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/stateless/SwitchAction.java 2009-01-12 21:15:25 UTC (rev 459)
@@ -0,0 +1,241 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, 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.
+ */
+package org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateless;
+
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.*;
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.*;
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.util.InteractionUtil;
+import org.scribble.model.*;
+import org.scribble.model.admin.ModelIssue;
+import org.scribble.model.admin.ModelListener;
+import org.scribble.conversation.model.*;
+
+/**
+ * The model component for the 'SwitchAction'.
+ *
+ * @author gary
+ */
+public class SwitchAction extends AbstractESBAction {
+
+ public static final String TYPE_ATTR = "type";
+ public static final String MESSAGE_ELEMENT = "message";
+ private static final String SERVICE_NAME = "service-name";
+ private static final String SERVICE_CATEGORY = "service-category";
+ private static final String CASE = "case";
+ private static final String PATHS = "paths";
+
+ /**
+ * The constructor for the action.
+ *
+ * @param service The reference to the service in which
+ * the action is contained
+ * @param action The XML configuration details for the action
+ */
+ public SwitchAction(ESBService service,
+ org.w3c.dom.Element action) {
+ super(service, action);
+ }
+
+ /**
+ * This constructor initializes the DOM element for
+ * the action.
+ *
+ * @param service The reference to the service in which
+ * the action will be contained
+ */
+ public SwitchAction(ESBService service) {
+ super(service, ESBActionFactory.getConversationAction(
+ SwitchAction.class));
+ }
+
+ /**
+ * This method initializes the links with the ESB service descriptors
+ * identified in each path of the action.
+ */
+ @Override
+ public void initializeLinks() {
+ super.initializeLinks();
+
+ org.w3c.dom.NodeList nl=getPropertyChildNodes(PATHS);
+
+ for (int i=0; i < nl.getLength(); i++) {
+
+ org.w3c.dom.Node n=nl.item(i);
+
+ if (n instanceof org.w3c.dom.Element &&
+ n.getNodeName().equals(CASE)) {
+ if (((org.w3c.dom.Element)n).hasAttribute(SERVICE_CATEGORY) &&
+ ((org.w3c.dom.Element)n).hasAttribute(SERVICE_NAME)) {
+ String category=((org.w3c.dom.Element)n).getAttribute(SERVICE_CATEGORY);
+ String name=((org.w3c.dom.Element)n).getAttribute(SERVICE_NAME);
+
+ // Lookup service associated with category and name
+ ESBService service=getService().getModel().getService(category, name);
+
+ // Initialize link, even if service is null - this will be
+ // reported as a validation error later
+ getLinks().add(new ESBLink(category, name, service, true));
+ }
+ }
+ }
+ }
+
+ /**
+ * This method returns the mandatory property names.
+ *
+ * @return The mandatory property names
+ */
+ @Override
+ protected java.util.List<String> getMandatoryProperties() {
+ java.util.List<String> ret=super.getMandatoryProperties();
+ ret.add(PATHS);
+ return(ret);
+ }
+
+ /**
+ * This method validates the ESB action and reports warnings or
+ * errors to the supplied model listener.
+ *
+ * @param l The model listener
+ */
+ @Override
+ public void validate(ModelListener l) {
+ super.validate(l);
+
+ org.w3c.dom.NodeList nl=getPropertyChildNodes(PATHS);
+ int pathCount=0;
+ boolean f_serviceDetailsMissing=false;
+
+ for (int i=0; nl != null && i < nl.getLength(); i++) {
+
+ org.w3c.dom.Node n=nl.item(i);
+
+ if (n instanceof org.w3c.dom.Element) {
+ if (n.getNodeName().equals(CASE)) {
+ pathCount++;
+
+ if (((org.w3c.dom.Element)n).hasAttribute(SERVICE_CATEGORY) == false ||
+ ((org.w3c.dom.Element)n).hasAttribute(SERVICE_NAME) == false) {
+ f_serviceDetailsMissing = true;
+ }
+ }
+ }
+ }
+
+ // Report any errors
+ if (nl != null && pathCount < 1) {
+ l.error(new ModelIssue(this, org.scribble.util.MessageUtil.format(
+ java.util.PropertyResourceBundle.getBundle(
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
+ "_SWITCH_ONE_OR_MORE_PATHS",
+ new String[]{})));
+ }
+
+ if (f_serviceDetailsMissing) {
+ l.error(new ModelIssue(this, org.scribble.util.MessageUtil.format(
+ java.util.PropertyResourceBundle.getBundle(
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
+ "_PATH_SERVICE_DETAILS_MISSING",
+ new String[]{})));
+ }
+ }
+
+ /**
+ * This method converts the ESB action into an equivalent
+ * behavioural description for conformance checking.
+ *
+ * @param activities The list of activities that will contain
+ * the converted action(s)
+ * @param context The conversion context
+ */
+ @Override
+ public void convert(java.util.List<Activity> activities,
+ ConversionContext context) {
+
+ org.w3c.dom.NodeList nl=getPropertyChildNodes(PATHS);
+
+ If choice=new If();
+ activities.add(choice);
+
+ for (int i=0; i < nl.getLength(); i++) {
+
+ org.w3c.dom.Node n=nl.item(i);
+
+ if (n instanceof org.w3c.dom.Element &&
+ n.getNodeName().equals(CASE)) {
+ String category=((org.w3c.dom.Element)n).getAttribute(SERVICE_CATEGORY);
+ String name=((org.w3c.dom.Element)n).getAttribute(SERVICE_NAME);
+
+ // Conditional block with no expression - i.e. the
+ // expression is non-observable, as the path will be
+ // selected based on the next message that arrives
+ ConditionalBlock block=new ConditionalBlock();
+ choice.getConditionalBlocks().add(block);
+
+ ESBService service=getService().getModel().getService(category, name);
+
+ if (service != null) {
+ service.convert(block.getContents(), context);
+ }
+ }
+ }
+ }
+
+ /**
+ * This method adds a path to the switch action.
+ *
+ * @param category The service category
+ * @param name The service name
+ * @param messageTypes The set of interactions
+ * @param position The position
+ */
+ public void addCase(String category, String name,
+ java.util.Set<Interaction> messageTypes, int position) {
+
+ org.w3c.dom.Element paths=getPropertyElement(PATHS);
+
+ org.w3c.dom.Element path=
+ getAction().getOwnerDocument().createElement(CASE);
+ path.setAttribute(SERVICE_CATEGORY, category);
+ path.setAttribute(SERVICE_NAME, name);
+
+ if (messageTypes != null) {
+ java.util.Iterator<Interaction> iter=messageTypes.iterator();
+
+ while (iter.hasNext()) {
+ Interaction interaction=iter.next();
+
+ //TODO: Only deals with single type for now
+ if (InteractionUtil.isSend(interaction) == false &&
+ interaction.getMessageSignature().getTypes().size()==1) {
+ org.w3c.dom.Element mt=
+ getAction().getOwnerDocument().createElement(MESSAGE_ELEMENT);
+
+ mt.setAttribute(TYPE_ATTR,
+ InteractionUtil.getTypeString(
+ interaction.getMessageSignature().
+ getTypes().get(0)));
+
+ path.appendChild(mt);
+ }
+ }
+ }
+
+ paths.appendChild(path);
+ }
+}
Modified: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/change/AbstractESBModelChangeRule.java
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/change/AbstractESBModelChangeRule.java 2009-01-08 13:25:36 UTC (rev 458)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/change/AbstractESBModelChangeRule.java 2009-01-12 21:15:25 UTC (rev 459)
@@ -18,7 +18,7 @@
package org.jboss.tools.overlord.cdl.runtime.jbossesb.model.change;
import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.*;
-import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.*;
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.*;
import org.scribble.conversation.model.ConversationInteraction;
import org.scribble.model.*;
import org.scribble.model.change.*;
@@ -46,8 +46,8 @@
if ((context.getParent() instanceof ESBService ||
(ref != null && ref.getSource().getObject()
- instanceof AbstractESBAction &&
- ((AbstractESBAction)ref.getSource().getObject()).getService() != null)) &&
+ instanceof AbstractStatefulESBAction &&
+ ((AbstractStatefulESBAction)ref.getSource().getObject()).getService() != null)) &&
model instanceof ESBLanguageModel) {
ret = true;
}
@@ -67,8 +67,8 @@
ModelObject ref) {
ESBService ret=(ESBService)context.getParent();
- if (ref != null && ref.getSource().getObject() instanceof AbstractESBAction) {
- ret = ((AbstractESBAction)ref.getSource().getObject()).getService();
+ if (ref != null && ref.getSource().getObject() instanceof AbstractStatefulESBAction) {
+ ret = ((AbstractStatefulESBAction)ref.getSource().getObject()).getService();
}
return(ret);
@@ -136,9 +136,9 @@
Model model, ModelObject mobj) {
boolean ret=false;
- if (mobj.getSource().getObject() instanceof AbstractESBAction &&
+ if (mobj.getSource().getObject() instanceof AbstractStatefulESBAction &&
(context.getParent() instanceof ESBService ||
- ((AbstractESBAction)mobj.getSource().getObject()).getService() != null) &&
+ ((AbstractStatefulESBAction)mobj.getSource().getObject()).getService() != null) &&
model instanceof ESBLanguageModel) {
ret = true;
}
Modified: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/change/ConversationInteractionModelChangeRule.java
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/change/ConversationInteractionModelChangeRule.java 2009-01-08 13:25:36 UTC (rev 458)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/change/ConversationInteractionModelChangeRule.java 2009-01-12 21:15:25 UTC (rev 459)
@@ -18,7 +18,7 @@
package org.jboss.tools.overlord.cdl.runtime.jbossesb.model.change;
import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.*;
-import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.*;
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.*;
import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.util.ConversationUtil;
import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.util.IdentityUtil;
import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.util.InteractionUtil;
Modified: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/change/ConversationModelChangeRule.java
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/change/ConversationModelChangeRule.java 2009-01-08 13:25:36 UTC (rev 458)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/change/ConversationModelChangeRule.java 2009-01-12 21:15:25 UTC (rev 459)
@@ -18,7 +18,7 @@
package org.jboss.tools.overlord.cdl.runtime.jbossesb.model.change;
import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.*;
-import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.*;
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.*;
import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.util.ConversationUtil;
import org.scribble.model.*;
import org.scribble.model.change.*;
Modified: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/change/IfModelChangeRule.java
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/change/IfModelChangeRule.java 2009-01-08 13:25:36 UTC (rev 458)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/change/IfModelChangeRule.java 2009-01-12 21:15:25 UTC (rev 459)
@@ -20,7 +20,7 @@
import java.util.logging.Logger;
import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.*;
-import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.*;
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.*;
import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.util.ConversationUtil;
import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.util.InteractionUtil;
import org.scribble.model.*;
Modified: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/change/LanguageToConversationModelChangeRule.java
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/change/LanguageToConversationModelChangeRule.java 2009-01-08 13:25:36 UTC (rev 458)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/change/LanguageToConversationModelChangeRule.java 2009-01-12 21:15:25 UTC (rev 459)
@@ -18,7 +18,7 @@
package org.jboss.tools.overlord.cdl.runtime.jbossesb.model.change;
import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.*;
-import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.*;
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.*;
import org.scribble.model.*;
import org.scribble.model.change.*;
import org.scribble.conversation.model.*;
Modified: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/change/MessageSignatureModelChangeRule.java
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/change/MessageSignatureModelChangeRule.java 2009-01-08 13:25:36 UTC (rev 458)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/change/MessageSignatureModelChangeRule.java 2009-01-12 21:15:25 UTC (rev 459)
@@ -18,7 +18,7 @@
package org.jboss.tools.overlord.cdl.runtime.jbossesb.model.change;
import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.*;
-import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.*;
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.*;
import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.util.InteractionUtil;
import org.scribble.model.*;
import org.scribble.model.change.*;
Modified: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/change/ParallelModelChangeRule.java
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/change/ParallelModelChangeRule.java 2009-01-08 13:25:36 UTC (rev 458)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/change/ParallelModelChangeRule.java 2009-01-12 21:15:25 UTC (rev 459)
@@ -20,7 +20,7 @@
import java.util.logging.Logger;
import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.*;
-import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.*;
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.*;
import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.util.*;
import org.scribble.model.*;
import org.scribble.model.change.*;
Modified: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/change/RunModelChangeRule.java
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/change/RunModelChangeRule.java 2009-01-08 13:25:36 UTC (rev 458)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/change/RunModelChangeRule.java 2009-01-12 21:15:25 UTC (rev 459)
@@ -20,7 +20,7 @@
import java.util.logging.Logger;
import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.*;
-import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.*;
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.*;
import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.util.*;
import org.scribble.model.*;
import org.scribble.model.change.*;
Modified: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/change/SpawnModelChangeRule.java
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/change/SpawnModelChangeRule.java 2009-01-08 13:25:36 UTC (rev 458)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/change/SpawnModelChangeRule.java 2009-01-12 21:15:25 UTC (rev 459)
@@ -20,7 +20,7 @@
//import java.util.logging.Logger;
import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.*;
-import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.*;
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.*;
import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.util.*;
import org.scribble.model.*;
import org.scribble.model.change.*;
Modified: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/change/TypeReferenceModelChangeRule.java
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/change/TypeReferenceModelChangeRule.java 2009-01-08 13:25:36 UTC (rev 458)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/change/TypeReferenceModelChangeRule.java 2009-01-12 21:15:25 UTC (rev 459)
@@ -18,7 +18,7 @@
package org.jboss.tools.overlord.cdl.runtime.jbossesb.model.change;
import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.*;
-import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.*;
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.*;
import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.util.InteractionUtil;
import org.scribble.model.*;
import org.scribble.model.change.*;
Modified: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/change/WhenModelChangeRule.java
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/change/WhenModelChangeRule.java 2009-01-08 13:25:36 UTC (rev 458)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/change/WhenModelChangeRule.java 2009-01-12 21:15:25 UTC (rev 459)
@@ -20,7 +20,7 @@
import java.util.logging.Logger;
import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.*;
-import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.*;
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.*;
import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.util.*;
import org.scribble.model.*;
import org.scribble.model.change.*;
Modified: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/change/WhileModelChangeRule.java
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/change/WhileModelChangeRule.java 2009-01-08 13:25:36 UTC (rev 458)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/java/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/change/WhileModelChangeRule.java 2009-01-12 21:15:25 UTC (rev 459)
@@ -20,7 +20,7 @@
import java.util.logging.Logger;
import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.*;
-import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.*;
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.*;
import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.util.*;
import org.scribble.model.*;
import org.scribble.model.change.*;
Modified: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/DefaultESBServiceTest.java
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/DefaultESBServiceTest.java 2009-01-08 13:25:36 UTC (rev 458)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/DefaultESBServiceTest.java 2009-01-12 21:15:25 UTC (rev 459)
@@ -21,7 +21,7 @@
import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.DefaultESBLanguageModel;
import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.DefaultESBService;
-import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.*;
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.*;
public class DefaultESBServiceTest extends TestCase {
Modified: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/TestESBAction.java
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/TestESBAction.java 2009-01-08 13:25:36 UTC (rev 458)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/TestESBAction.java 2009-01-12 21:15:25 UTC (rev 459)
@@ -97,6 +97,11 @@
return false;
}
+ public boolean isStateless() {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
public boolean hasProperty(String property) {
// TODO Auto-generated method stub
return false;
Modified: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/TestESBService.java
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/TestESBService.java 2009-01-08 13:25:36 UTC (rev 458)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/TestESBService.java 2009-01-12 21:15:25 UTC (rev 459)
@@ -143,6 +143,11 @@
return(m_root);
}
+ public boolean isStateless() {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
public void setCreateSession(boolean bool) {
m_createSession = bool;
}
Modified: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/CreateSessionActionTest.java
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/CreateSessionActionTest.java 2009-01-08 13:25:36 UTC (rev 458)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/CreateSessionActionTest.java 2009-01-12 21:15:25 UTC (rev 459)
@@ -20,8 +20,8 @@
import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.TestESBLanguageModel;
import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.TestESBService;
import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.TestModelListener;
-import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.CreateSessionAction;
-import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.UnsupportedAction;
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.CreateSessionAction;
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.UnsupportedAction;
import junit.framework.TestCase;
@@ -60,7 +60,7 @@
l.addExpectedError(org.scribble.util.MessageUtil.format(
java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.Messages"),
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
"_MUST_BE_FIRST_ACTION",
new String[]{"CreateSession"}));
@@ -87,7 +87,7 @@
l.addExpectedError(org.scribble.util.MessageUtil.format(
java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.Messages"),
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
"_NOT_SPECIFIED_CONVERSATION_TYPE",
new String[]{}));
@@ -156,7 +156,7 @@
l.addExpectedError(org.scribble.util.MessageUtil.format(
java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.Messages"),
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
"_NOT_SPECIFIED_CONVERSATION_TYPE_ROLE",
new String[]{convType}));
Modified: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/IfActionTest.java
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/IfActionTest.java 2009-01-08 13:25:36 UTC (rev 458)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/IfActionTest.java 2009-01-12 21:15:25 UTC (rev 459)
@@ -22,7 +22,7 @@
import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.TestESBLanguageModel;
import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.TestESBService;
import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.TestModelListener;
-import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.IfAction;
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.IfAction;
import org.scribble.model.*;
import org.scribble.conversation.model.*;
@@ -43,7 +43,7 @@
l.addExpectedError(org.scribble.util.MessageUtil.format(
java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.Messages"),
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
"_NOT_SPECIFIED_PROPERTY",
new String[]{"paths"}));
@@ -132,7 +132,7 @@
l.addExpectedError(org.scribble.util.MessageUtil.format(
java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.Messages"),
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
"_IF_ORDER_WRONG",
new String[]{}));
@@ -184,7 +184,7 @@
l.addExpectedError(org.scribble.util.MessageUtil.format(
java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.Messages"),
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
"_IF_ORDER_WRONG",
new String[]{}));
@@ -235,7 +235,7 @@
l.addExpectedError(org.scribble.util.MessageUtil.format(
java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.Messages"),
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
"_IF_ORDER_WRONG",
new String[]{}));
@@ -286,7 +286,7 @@
l.addExpectedError(org.scribble.util.MessageUtil.format(
java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.Messages"),
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
"_PATH_SERVICE_DETAILS_MISSING",
new String[]{}));
@@ -337,7 +337,7 @@
l.addExpectedError(org.scribble.util.MessageUtil.format(
java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.Messages"),
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
"_BOOLEAN",
new String[]{IfAction.IMMEDIATE}));
@@ -388,7 +388,7 @@
l.addExpectedError(org.scribble.util.MessageUtil.format(
java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.Messages"),
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
"_BOOLEAN",
new String[]{IfAction.IMMEDIATE}));
@@ -439,7 +439,7 @@
l.addExpectedError(org.scribble.util.MessageUtil.format(
java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.Messages"),
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
"_BOOLEAN",
new String[]{IfAction.IMMEDIATE}));
Modified: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/MessageRouterActionTest.java
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/MessageRouterActionTest.java 2009-01-08 13:25:36 UTC (rev 458)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/MessageRouterActionTest.java 2009-01-12 21:15:25 UTC (rev 459)
@@ -20,7 +20,7 @@
import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.TestESBLanguageModel;
import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.TestESBService;
import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.TestModelListener;
-import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.MessageRouterAction;
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.MessageRouterAction;
import junit.framework.TestCase;
@@ -41,7 +41,7 @@
l.addExpectedError(org.scribble.util.MessageUtil.format(
java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.Messages"),
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
"_NOT_SPECIFIED_PROPERTY",
new String[]{"paths"}));
@@ -70,7 +70,7 @@
l.addExpectedError(org.scribble.util.MessageUtil.format(
java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.Messages"),
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
"_CANNOT_SESSION_BASED_ACTIONS_WITH_ROUTER",
new String[]{}));
@@ -143,7 +143,7 @@
l.addExpectedError(org.scribble.util.MessageUtil.format(
java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.Messages"),
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
"_CANNOT_INITIATE_NON_ROOT",
new String[]{other.getCategory(),
other.getName()}));
@@ -184,7 +184,7 @@
l.addExpectedError(org.scribble.util.MessageUtil.format(
java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.Messages"),
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
"_MUST_INITIATE_ROOT",
new String[]{other.getCategory(),
other.getName()}));
@@ -212,7 +212,7 @@
l.addExpectedError(org.scribble.util.MessageUtil.format(
java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.Messages"),
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
"_ROUTER_ONE_OR_MORE_PATHS",
new String[]{}));
@@ -239,7 +239,7 @@
l.addExpectedError(org.scribble.util.MessageUtil.format(
java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.Messages"),
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
"_PATH_SERVICE_DETAILS_MISSING",
new String[]{}));
Modified: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/ParallelActionTest.java
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/ParallelActionTest.java 2009-01-08 13:25:36 UTC (rev 458)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/ParallelActionTest.java 2009-01-12 21:15:25 UTC (rev 459)
@@ -20,7 +20,7 @@
import org.scribble.conversation.model.*;
import org.scribble.model.Activity;
import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.*;
-import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.ParallelAction;
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.ParallelAction;
import junit.framework.TestCase;
@@ -41,7 +41,7 @@
l.addExpectedError(org.scribble.util.MessageUtil.format(
java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.Messages"),
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
"_NOT_SPECIFIED_PROPERTY",
new String[]{"paths"}));
@@ -132,7 +132,7 @@
l.addExpectedError(org.scribble.util.MessageUtil.format(
java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.Messages"),
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
"_PARALLEL_MORE_THAN_TWO_PATHS",
new String[]{}));
@@ -184,7 +184,7 @@
l.addExpectedError(org.scribble.util.MessageUtil.format(
java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.Messages"),
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
"_MULTIPLE_JOINS",
new String[]{}));
@@ -235,7 +235,7 @@
l.addExpectedError(org.scribble.util.MessageUtil.format(
java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.Messages"),
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
"_PARALLEL_PATH_AFTER_JOIN",
new String[]{}));
@@ -286,7 +286,7 @@
l.addExpectedError(org.scribble.util.MessageUtil.format(
java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.Messages"),
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
"_PATH_SERVICE_DETAILS_MISSING",
new String[]{}));
@@ -337,7 +337,7 @@
l.addExpectedError(org.scribble.util.MessageUtil.format(
java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.Messages"),
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
"_BOOLEAN",
new String[]{ParallelAction.IMMEDIATE}));
Modified: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/PerformActionTest.java
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/PerformActionTest.java 2009-01-08 13:25:36 UTC (rev 458)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/PerformActionTest.java 2009-01-12 21:15:25 UTC (rev 459)
@@ -20,7 +20,7 @@
import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.TestESBLanguageModel;
import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.TestESBService;
import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.TestModelListener;
-import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.PerformAction;
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.PerformAction;
import org.scribble.conversation.model.*;
import org.scribble.model.Activity;
@@ -45,7 +45,7 @@
l.addExpectedError(org.scribble.util.MessageUtil.format(
java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.Messages"),
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
"_NOT_SPECIFIED_PROPERTY",
new String[]{"serviceCategory"}));
@@ -73,7 +73,7 @@
l.addExpectedError(org.scribble.util.MessageUtil.format(
java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.Messages"),
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
"_NOT_SPECIFIED_PROPERTY",
new String[]{"serviceName"}));
@@ -199,7 +199,7 @@
l.addExpectedError(org.scribble.util.MessageUtil.format(
java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.Messages"),
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
"_NOT_FOUND_PERFORM_CREATE_SESSION",
new String[]{}));
@@ -241,7 +241,7 @@
l.addExpectedError(org.scribble.util.MessageUtil.format(
java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.Messages"),
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
"_NOT_FOUND_VARIABLE",
new String[]{"fred", Object.class.getName()}));
@@ -283,7 +283,7 @@
l.addExpectedError(org.scribble.util.MessageUtil.format(
java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.Messages"),
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
"_NOT_WRITABLE_PROPERTY",
new String[]{"class", Object.class.getName()}));
@@ -326,7 +326,7 @@
l.addExpectedError(org.scribble.util.MessageUtil.format(
java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.Messages"),
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
"_INVALID_PROPERTY_TYPE",
new String[]{"invalidParent",
ChildPojo.class.getName(),
@@ -449,7 +449,7 @@
l.addExpectedError(org.scribble.util.MessageUtil.format(
java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.Messages"),
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
"_NOT_FOUND_VARIABLE",
new String[]{varName, Object.class.getName()}));
@@ -496,7 +496,7 @@
l.addExpectedError(org.scribble.util.MessageUtil.format(
java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.Messages"),
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
"_NOT_WRITABLE_PROPERTY",
new String[]{varName, Object.class.getName()}));
Modified: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/ReceiveMessageActionTest.java
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/ReceiveMessageActionTest.java 2009-01-08 13:25:36 UTC (rev 458)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/ReceiveMessageActionTest.java 2009-01-12 21:15:25 UTC (rev 459)
@@ -19,7 +19,7 @@
import org.scribble.model.*;
import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.*;
-import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.ReceiveMessageAction;
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.ReceiveMessageAction;
import junit.framework.TestCase;
@@ -42,7 +42,7 @@
l.addExpectedError(org.scribble.util.MessageUtil.format(
java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.Messages"),
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
"_NOT_SPECIFIED_PROPERTY",
new String[]{"messageType"}));
@@ -70,7 +70,7 @@
l.addExpectedError(org.scribble.util.MessageUtil.format(
java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.Messages"),
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
"_NOT_SPECIFIED_PROPERTY",
new String[]{"identities"}));
Modified: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/RetrieveSessionActionTest.java
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/RetrieveSessionActionTest.java 2009-01-08 13:25:36 UTC (rev 458)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/RetrieveSessionActionTest.java 2009-01-12 21:15:25 UTC (rev 459)
@@ -19,8 +19,8 @@
import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.TestESBService;
import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.TestModelListener;
-import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.RetrieveSessionAction;
-import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.UnsupportedAction;
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.RetrieveSessionAction;
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.UnsupportedAction;
import junit.framework.TestCase;
@@ -69,7 +69,7 @@
l.addExpectedError(org.scribble.util.MessageUtil.format(
java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.Messages"),
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
"_MUST_BE_FIRST_ACTION",
new String[]{"RetrieveSession"}));
@@ -95,7 +95,7 @@
l.addExpectedError(org.scribble.util.MessageUtil.format(
java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.Messages"),
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
"_NOT_SPECIFIED_PROPERTY",
new String[]{"identities"}));
Modified: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/ScheduleStateActionTest.java
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/ScheduleStateActionTest.java 2009-01-08 13:25:36 UTC (rev 458)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/ScheduleStateActionTest.java 2009-01-12 21:15:25 UTC (rev 459)
@@ -19,7 +19,7 @@
import org.scribble.model.Activity;
import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.*;
-import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.ScheduleStateAction;
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.ScheduleStateAction;
import junit.framework.TestCase;
@@ -42,7 +42,7 @@
l.addExpectedError(org.scribble.util.MessageUtil.format(
java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.Messages"),
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
"_NOT_SPECIFIED_PROPERTY",
new String[]{"serviceCategory"}));
@@ -70,7 +70,7 @@
l.addExpectedError(org.scribble.util.MessageUtil.format(
java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.Messages"),
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
"_NOT_SPECIFIED_PROPERTY",
new String[]{"serviceName"}));
Modified: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/SendMessageActionTest.java
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/SendMessageActionTest.java 2009-01-08 13:25:36 UTC (rev 458)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/SendMessageActionTest.java 2009-01-12 21:15:25 UTC (rev 459)
@@ -21,7 +21,7 @@
import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.TestESBLanguageModel;
import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.TestESBService;
import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.TestModelListener;
-import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.SendMessageAction;
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.SendMessageAction;
import org.scribble.model.Activity;
import org.scribble.model.Interaction;
import org.scribble.model.TypeReference;
@@ -49,7 +49,7 @@
l.addExpectedError(org.scribble.util.MessageUtil.format(
java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.Messages"),
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
"_NOT_SPECIFIED_PROPERTY",
new String[]{"messageType"}));
@@ -78,7 +78,7 @@
l.addExpectedError(org.scribble.util.MessageUtil.format(
java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.Messages"),
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
"_NOT_SPECIFIED_PROPERTY",
new String[]{"identities"}));
@@ -107,7 +107,7 @@
l.addExpectedError(org.scribble.util.MessageUtil.format(
java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.Messages"),
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
"_NOT_SPECIFIED_REQ_RESP_EPR",
new String[]{}));
Modified: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/SetMessageActionTest.java
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/SetMessageActionTest.java 2009-01-08 13:25:36 UTC (rev 458)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/SetMessageActionTest.java 2009-01-12 21:15:25 UTC (rev 459)
@@ -19,7 +19,7 @@
import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.TestESBService;
import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.TestModelListener;
-import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.SetMessageAction;
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.SetMessageAction;
import junit.framework.TestCase;
@@ -41,7 +41,7 @@
l.addExpectedError(org.scribble.util.MessageUtil.format(
java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.Messages"),
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
"_NOT_SPECIFIED_PROPERTY",
new String[]{SetMessageAction.STATE_EXPRESSION}));
Modified: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/SetStateActionTest.java
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/SetStateActionTest.java 2009-01-08 13:25:36 UTC (rev 458)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/SetStateActionTest.java 2009-01-12 21:15:25 UTC (rev 459)
@@ -19,7 +19,7 @@
import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.TestESBService;
import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.TestModelListener;
-import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.SetStateAction;
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.SetStateAction;
import junit.framework.TestCase;
@@ -42,7 +42,7 @@
l.addExpectedError(org.scribble.util.MessageUtil.format(
java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.Messages"),
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
"_NOT_SPECIFIED_PROPERTY",
new String[]{SetStateAction.VARIABLE}));
@@ -76,7 +76,7 @@
l.addExpectedError(org.scribble.util.MessageUtil.format(
java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.Messages"),
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
"_NOT_FOUND_VARIABLE",
new String[]{varName, cls.getName()}));
@@ -166,7 +166,7 @@
l.addExpectedError(org.scribble.util.MessageUtil.format(
java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.Messages"),
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
"_NOT_WRITABLE_PROPERTY",
new String[]{"readableProperty", TestClass2.class.getName()}));
@@ -200,7 +200,7 @@
l.addExpectedError(org.scribble.util.MessageUtil.format(
java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.Messages"),
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
"_NOT_READABLE_PROPERTY",
new String[]{"testClass2", TestClass3.class.getName()}));
@@ -233,7 +233,7 @@
l.addExpectedError(org.scribble.util.MessageUtil.format(
java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.Messages"),
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
"_MUST_SPECIFY_STATE_OR_MESSAGE_EXPRESSION",
new String[]{}));
@@ -268,7 +268,7 @@
l.addExpectedError(org.scribble.util.MessageUtil.format(
java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.Messages"),
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
"_MUST_SPECIFY_STATE_OR_MESSAGE_EXPRESSION",
new String[]{}));
Modified: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/SwitchActionTest.java
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/SwitchActionTest.java 2009-01-08 13:25:36 UTC (rev 458)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/SwitchActionTest.java 2009-01-12 21:15:25 UTC (rev 459)
@@ -20,7 +20,7 @@
import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.TestESBLanguageModel;
import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.TestESBService;
import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.TestModelListener;
-import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.SwitchAction;
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.SwitchAction;
import org.scribble.conversation.model.If;
import org.scribble.model.Activity;
@@ -43,7 +43,7 @@
l.addExpectedError(org.scribble.util.MessageUtil.format(
java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.Messages"),
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
"_NOT_SPECIFIED_PROPERTY",
new String[]{"paths"}));
@@ -132,7 +132,7 @@
l.addExpectedError(org.scribble.util.MessageUtil.format(
java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.Messages"),
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
"_SWITCH_ONE_OR_MORE_PATHS",
new String[]{}));
@@ -183,7 +183,7 @@
l.addExpectedError(org.scribble.util.MessageUtil.format(
java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.Messages"),
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
"_PATH_SERVICE_DETAILS_MISSING",
new String[]{}));
Modified: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/WhenActionTest.java
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/WhenActionTest.java 2009-01-08 13:25:36 UTC (rev 458)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/WhenActionTest.java 2009-01-12 21:15:25 UTC (rev 459)
@@ -20,7 +20,7 @@
import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.TestESBLanguageModel;
import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.TestESBService;
import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.TestModelListener;
-import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.WhenAction;
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.WhenAction;
import org.scribble.conversation.model.*;
import org.scribble.model.*;
@@ -43,7 +43,7 @@
l.addExpectedError(org.scribble.util.MessageUtil.format(
java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.Messages"),
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
"_NOT_SPECIFIED_PROPERTY",
new String[]{"paths"}));
@@ -132,7 +132,7 @@
l.addExpectedError(org.scribble.util.MessageUtil.format(
java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.Messages"),
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
"_WHEN_ONE_OR_MORE_PATHS",
new String[]{}));
@@ -183,7 +183,7 @@
l.addExpectedError(org.scribble.util.MessageUtil.format(
java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.Messages"),
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
"_PATH_SERVICE_DETAILS_MISSING",
new String[]{}));
Modified: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/WhileActionTest.java
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/WhileActionTest.java 2009-01-08 13:25:36 UTC (rev 458)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/actions/WhileActionTest.java 2009-01-12 21:15:25 UTC (rev 459)
@@ -20,7 +20,7 @@
import org.scribble.conversation.model.*;
import org.scribble.model.*;
import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.*;
-import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.WhileAction;
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.WhileAction;
import junit.framework.TestCase;
@@ -41,7 +41,7 @@
l.addExpectedError(org.scribble.util.MessageUtil.format(
java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.Messages"),
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
"_NOT_SPECIFIED_PROPERTY",
new String[]{"paths"}));
@@ -125,7 +125,7 @@
l.addExpectedError(org.scribble.util.MessageUtil.format(
java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.Messages"),
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
"_MUST_DEFINE_SINGLE_WHILE_EXIT",
new String[]{}));
@@ -169,7 +169,7 @@
l.addExpectedError(org.scribble.util.MessageUtil.format(
java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.Messages"),
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
"_MUST_DEFINE_SINGLE_WHILE_PATH",
new String[]{}));
@@ -219,7 +219,7 @@
l.addExpectedError(org.scribble.util.MessageUtil.format(
java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.Messages"),
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
"_PATH_SERVICE_DETAILS_MISSING",
new String[]{}));
@@ -269,7 +269,7 @@
l.addExpectedError(org.scribble.util.MessageUtil.format(
java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.Messages"),
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
"_PATH_SERVICE_DETAILS_MISSING",
new String[]{}));
@@ -319,7 +319,7 @@
l.addExpectedError(org.scribble.util.MessageUtil.format(
java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.Messages"),
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
"_WHILE_PATH_AFTER_EXIT",
new String[]{}));
@@ -364,7 +364,7 @@
l.addExpectedError(org.scribble.util.MessageUtil.format(
java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.Messages"),
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
"_BOOLEAN",
new String[]{WhileAction.IMMEDIATE}));
@@ -409,7 +409,7 @@
l.addExpectedError(org.scribble.util.MessageUtil.format(
java.util.PropertyResourceBundle.getBundle(
- "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.Messages"),
+ "org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.Messages"),
"_BOOLEAN",
new String[]{WhileAction.IMMEDIATE}));
Modified: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/change/ConversationInteractionModelChangeRuleTest.java
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/change/ConversationInteractionModelChangeRuleTest.java 2009-01-08 13:25:36 UTC (rev 458)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/change/ConversationInteractionModelChangeRuleTest.java 2009-01-12 21:15:25 UTC (rev 459)
@@ -20,7 +20,7 @@
import junit.framework.TestCase;
import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.*;
-import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.*;
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.*;
import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.change.ConversationInteractionModelChangeRule;
import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.util.InteractionUtil;
import org.scribble.model.*;
Modified: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/change/IfModelChangeRuleTest.java
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/change/IfModelChangeRuleTest.java 2009-01-08 13:25:36 UTC (rev 458)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/change/IfModelChangeRuleTest.java 2009-01-12 21:15:25 UTC (rev 459)
@@ -20,7 +20,7 @@
import junit.framework.TestCase;
import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.*;
-import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.*;
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.*;
import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.change.IfModelChangeRule;
import org.scribble.model.*;
import org.scribble.model.change.*;
Modified: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/change/ParallelModelChangeRuleTest.java
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/change/ParallelModelChangeRuleTest.java 2009-01-08 13:25:36 UTC (rev 458)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/change/ParallelModelChangeRuleTest.java 2009-01-12 21:15:25 UTC (rev 459)
@@ -20,7 +20,7 @@
import junit.framework.TestCase;
import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.*;
-import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.*;
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.*;
import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.change.ParallelModelChangeRule;
import org.scribble.model.*;
import org.scribble.model.analysis.*;
Modified: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/change/RunModelChangeRuleTest.java
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/change/RunModelChangeRuleTest.java 2009-01-08 13:25:36 UTC (rev 458)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/change/RunModelChangeRuleTest.java 2009-01-12 21:15:25 UTC (rev 459)
@@ -20,7 +20,7 @@
import junit.framework.TestCase;
import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.*;
-import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.*;
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.*;
import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.change.RunModelChangeRule;
import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.util.ConversationUtil;
import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.util.InteractionUtil;
Modified: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/change/SpawnModelChangeRuleTest.java
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/change/SpawnModelChangeRuleTest.java 2009-01-08 13:25:36 UTC (rev 458)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/change/SpawnModelChangeRuleTest.java 2009-01-12 21:15:25 UTC (rev 459)
@@ -20,7 +20,7 @@
import junit.framework.TestCase;
import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.*;
-import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.*;
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.*;
import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.change.RunModelChangeRule;
import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.change.SpawnModelChangeRule;
import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.util.ConversationUtil;
Modified: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/change/WhenModelChangeRuleTest.java
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/change/WhenModelChangeRuleTest.java 2009-01-08 13:25:36 UTC (rev 458)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/change/WhenModelChangeRuleTest.java 2009-01-12 21:15:25 UTC (rev 459)
@@ -20,7 +20,7 @@
import junit.framework.TestCase;
import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.*;
-import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.*;
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.*;
import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.change.WhenModelChangeRule;
import org.scribble.model.*;
import org.scribble.model.change.*;
Modified: cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/change/WhileModelChangeRuleTest.java
===================================================================
--- cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/change/WhileModelChangeRuleTest.java 2009-01-08 13:25:36 UTC (rev 458)
+++ cdl/trunk/tools/plugins/org.jboss.tools.overlord.cdl.runtime.jbossesb/src/test/org/jboss/tools/overlord/cdl/runtime/jbossesb/model/change/WhileModelChangeRuleTest.java 2009-01-12 21:15:25 UTC (rev 459)
@@ -20,7 +20,7 @@
import junit.framework.TestCase;
import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.*;
-import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.*;
+import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.actions.stateful.*;
import org.jboss.tools.overlord.cdl.runtime.jbossesb.model.change.WhileModelChangeRule;
import org.scribble.model.*;
import org.scribble.model.analysis.TestLookaheadAnalyser;
15 years, 3 months
Overlord SVN: r458 - cdl/trunk/docs/docbook/gettingstartedguide/src/main/module.
by overlord-commits@lists.jboss.org
Author: objectiser
Date: 2009-01-08 08:25:36 -0500 (Thu, 08 Jan 2009)
New Revision: 458
Modified:
cdl/trunk/docs/docbook/gettingstartedguide/src/main/module/installation.xml
Log:
Separate out Overlord Eclipse plugin installation into separate step, to avoid misconfiguration if user already has pi4soa installed.
Modified: cdl/trunk/docs/docbook/gettingstartedguide/src/main/module/installation.xml
===================================================================
--- cdl/trunk/docs/docbook/gettingstartedguide/src/main/module/installation.xml 2008-12-22 07:01:18 UTC (rev 457)
+++ cdl/trunk/docs/docbook/gettingstartedguide/src/main/module/installation.xml 2009-01-08 13:25:36 UTC (rev 458)
@@ -92,6 +92,13 @@
</listitem>
+ </itemizedlist>
+ </para>
+ </listitem>
+ <listitem>
+ Install Overlord CDL Eclipse plugins
+ <para>
+ <itemizedlist>
<listitem>
Select the “Help - > Software Updates...” menu item
</listitem>
15 years, 4 months