[savara-commits] savara SVN: r539 - in branches/experimental/2.0.x: bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/rules and 17 other directories.
do-not-reply at jboss.org
do-not-reply at jboss.org
Fri Jan 7 10:57:55 EST 2011
Author: objectiser
Date: 2011-01-07 10:57:52 -0500 (Fri, 07 Jan 2011)
New Revision: 539
Added:
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/util/BPELInteractionUtil.java
branches/experimental/2.0.x/bundles/org.savara.core/src/main/java/org/savara/model/util/
branches/experimental/2.0.x/bundles/org.savara.core/src/main/java/org/savara/model/util/InteractionUtil.java
branches/experimental/2.0.x/bundles/org.savara.core/src/main/java/org/savara/model/util/PropertyNames.java
Removed:
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/util/InteractionUtil.java
branches/experimental/2.0.x/bundles/org.savara.core/src/main/java/org/savara/util/PropertyNames.java
branches/experimental/2.0.x/tools/features/org.scribble.protocol.feature/
Modified:
branches/experimental/2.0.x/bundles/org.savara.bpel.tests/src/test/java/org/savara/bpel/generator/GeneratorTest.java
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/change/ChoiceModelChangeRule.java
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/change/InteractionModelChangeRule.java
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/change/InteractionPatterns.java
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/rules/InvokeParserRule.java
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/rules/PickParserRule.java
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/rules/ProcessParserRule.java
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/rules/ReceiveParserRule.java
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/rules/ReplyParserRule.java
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/rules/ScopeParserRule.java
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/util/ActivityUtil.java
branches/experimental/2.0.x/bundles/org.savara.contract.model/META-INF/MANIFEST.MF
branches/experimental/2.0.x/bundles/org.savara.core/META-INF/MANIFEST.MF
branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/main/java/org/savara/pi4soa/cdm/parser/rules/ProtocolModelConverterRuleImpl.java
branches/experimental/2.0.x/bundles/org.savara.wsdl/META-INF/MANIFEST.MF
branches/experimental/2.0.x/tools/features/org.savara.tools.feature/feature.xml
branches/experimental/2.0.x/tools/features/org.savara.tools.feature/pom.xml
branches/experimental/2.0.x/tools/features/pom.xml
branches/experimental/2.0.x/tools/plugins/org.savara.protocol.contract/META-INF/MANIFEST.MF
branches/experimental/2.0.x/tools/plugins/org.savara.protocol.contract/src/java/org/savara/protocol/contract/ContractGenerator.java
branches/experimental/2.0.x/tools/plugins/org.savara.protocol.contract/src/java/org/savara/protocol/contract/impl/ContractGeneratorImpl.java
branches/experimental/2.0.x/tools/plugins/org.savara.protocol.contract/src/java/org/savara/protocol/contract/impl/ContractIntrospector.java
branches/experimental/2.0.x/tools/plugins/org.savara.tap.eclipse/META-INF/MANIFEST.MF
branches/experimental/2.0.x/tools/plugins/org.savara.tap.model/META-INF/MANIFEST.MF
branches/experimental/2.0.x/tools/plugins/org.savara.tap.validation/META-INF/MANIFEST.MF
Log:
Intermediate update.
Modified: branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/change/ChoiceModelChangeRule.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/change/ChoiceModelChangeRule.java 2011-01-05 23:01:21 UTC (rev 538)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/change/ChoiceModelChangeRule.java 2011-01-07 15:57:52 UTC (rev 539)
@@ -35,12 +35,12 @@
import org.savara.bpel.model.TScope;
import org.savara.bpel.model.TSequence;
import org.savara.bpel.model.TVariable;
-import org.savara.bpel.util.InteractionUtil;
import org.savara.bpel.util.PartnerLinkUtil;
import org.savara.bpel.util.VariableUtil;
import org.savara.contract.model.Contract;
import org.savara.contract.model.Interface;
import org.savara.model.change.ModelChangeContext;
+import org.savara.model.util.InteractionUtil;
import org.savara.wsdl.util.WSDLGeneratorUtil;
import org.scribble.protocol.model.*;
Modified: branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/change/InteractionModelChangeRule.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/change/InteractionModelChangeRule.java 2011-01-05 23:01:21 UTC (rev 538)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/change/InteractionModelChangeRule.java 2011-01-07 15:57:52 UTC (rev 539)
@@ -31,12 +31,12 @@
import org.savara.bpel.model.TScope;
import org.savara.bpel.model.TSequence;
import org.savara.bpel.model.TVariable;
-import org.savara.bpel.util.InteractionUtil;
import org.savara.bpel.util.PartnerLinkUtil;
import org.savara.bpel.util.VariableUtil;
import org.savara.contract.model.Contract;
import org.savara.contract.model.Interface;
import org.savara.model.change.ModelChangeContext;
+import org.savara.model.util.InteractionUtil;
import org.savara.wsdl.util.WSDLGeneratorUtil;
import org.scribble.protocol.model.*;
Modified: branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/change/InteractionPatterns.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/change/InteractionPatterns.java 2011-01-05 23:01:21 UTC (rev 538)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/change/InteractionPatterns.java 2011-01-07 15:57:52 UTC (rev 539)
@@ -17,7 +17,8 @@
*/
package org.savara.bpel.model.change;
-import org.savara.bpel.util.InteractionUtil;
+import org.savara.bpel.util.BPELInteractionUtil;
+import org.savara.model.util.InteractionUtil;
import org.scribble.protocol.model.*;
/**
@@ -46,7 +47,7 @@
// by a choice representing a normal and multiple
// fault responses
if (InteractionUtil.isRequest(interaction) &&
- getRequestLabel(interaction) != null) {
+ InteractionUtil.getRequestLabel(interaction) != null) {
if (interaction.getParent() instanceof
org.scribble.protocol.model.Block) {
@@ -111,14 +112,14 @@
When path=choice.getWhens().get(i);
if (i == 0) {
- label = getReplyToLabel(path);
+ label = InteractionUtil.getReplyToLabel(path);
if (label == null || InteractionUtil.isRequest(path)
|| InteractionUtil.isSend(path)) {
ret = false;
}
} else {
- String replyTo=getReplyToLabel(path);
+ String replyTo=InteractionUtil.getReplyToLabel(path);
if (replyTo == null ||
replyTo.equals(label) == false ||
@@ -292,7 +293,7 @@
Interaction ret=null;
if (InteractionUtil.isRequest(interaction) == false &&
- getReplyToLabel(interaction) != null) {
+ InteractionUtil.getReplyToLabel(interaction) != null) {
// Find if contained in 'if' path
if (interaction.getParent() instanceof Block &&
@@ -314,9 +315,9 @@
if (act instanceof Interaction &&
InteractionUtil.isRequest((Interaction)act) &&
- getRequestLabel((Interaction)act) != null &&
- getReplyToLabel(interaction).equals(
- getRequestLabel((Interaction)act))) {
+ InteractionUtil.getRequestLabel((Interaction)act) != null &&
+ InteractionUtil.getReplyToLabel(interaction).equals(
+ InteractionUtil.getRequestLabel((Interaction)act))) {
ret = (Interaction)act;
}
}
@@ -423,27 +424,11 @@
if (InteractionUtil.isRequest(req) &&
InteractionUtil.isResponse(resp) &&
- getReplyToLabel(resp).equals(
- getRequestLabel(req))) {
+ InteractionUtil.getReplyToLabel(resp).equals(
+ InteractionUtil.getRequestLabel(req))) {
ret = true;
}
return(ret);
}
-
- public static String getRequestLabel(Interaction interaction) {
- return((String)interaction.getProperties().get("RequestLabel"));
- }
-
- public static String getReplyToLabel(Interaction interaction) {
- return((String)interaction.getProperties().get("ReplyToLabel"));
- }
-
- public static String getRequestLabel(When interaction) {
- return((String)interaction.getProperties().get("RequestLabel"));
- }
-
- public static String getReplyToLabel(When interaction) {
- return((String)interaction.getProperties().get("ReplyToLabel"));
- }
}
Modified: branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/rules/InvokeParserRule.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/rules/InvokeParserRule.java 2011-01-05 23:01:21 UTC (rev 538)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/rules/InvokeParserRule.java 2011-01-07 15:57:52 UTC (rev 539)
@@ -25,7 +25,7 @@
import org.savara.bpel.model.TInvoke;
import org.savara.bpel.model.TScope;
import org.savara.bpel.model.TVariable;
-import org.savara.bpel.util.InteractionUtil;
+import org.savara.bpel.util.BPELInteractionUtil;
import org.savara.bpel.util.PartnerLinkUtil;
import org.savara.bpel.util.TypeReferenceUtil;
import org.scribble.common.logging.Journal;
@@ -126,7 +126,7 @@
TVariable var=context.getVariable(invoke.getInputVariable());
- String xmlType=InteractionUtil.getXMLType(context.getProcess(), var.getMessageType(),
+ String xmlType=BPELInteractionUtil.getXMLType(context.getProcess(), var.getMessageType(),
context.getResourceLocator());
TypeReference tref=TypeReferenceUtil.createTypeReference(xmlType, context);
@@ -159,7 +159,7 @@
TVariable var=context.getVariable(invoke.getOutputVariable());
- String xmlType=InteractionUtil.getXMLType(context.getProcess(), var.getMessageType(),
+ String xmlType=BPELInteractionUtil.getXMLType(context.getProcess(), var.getMessageType(),
context.getResourceLocator());
TypeReference tref=TypeReferenceUtil.createTypeReference(xmlType, context);
@@ -200,7 +200,7 @@
TVariable var=context.getVariable(faultVar);
if (var != null) {
- String xmlType=InteractionUtil.getXMLType(context.getProcess(), var.getMessageType(),
+ String xmlType=BPELInteractionUtil.getXMLType(context.getProcess(), var.getMessageType(),
context.getResourceLocator());
tref = TypeReferenceUtil.createTypeReference(xmlType, context);
Modified: branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/rules/PickParserRule.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/rules/PickParserRule.java 2011-01-05 23:01:21 UTC (rev 538)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/rules/PickParserRule.java 2011-01-07 15:57:52 UTC (rev 539)
@@ -25,7 +25,7 @@
import org.savara.bpel.model.TReply;
import org.savara.bpel.model.TVariable;
import org.savara.bpel.util.ActivityUtil;
-import org.savara.bpel.util.InteractionUtil;
+import org.savara.bpel.util.BPELInteractionUtil;
import org.savara.bpel.util.PartnerLinkUtil;
import org.savara.bpel.util.TypeReferenceUtil;
import org.scribble.common.logging.Journal;
@@ -81,7 +81,7 @@
TVariable var=context.getVariable(onMessageElem.getVariable());
- String xmlType=InteractionUtil.getXMLType(context.getProcess(), var.getMessageType(),
+ String xmlType=BPELInteractionUtil.getXMLType(context.getProcess(), var.getMessageType(),
context.getResourceLocator());
TypeReference tref=TypeReferenceUtil.createTypeReference(xmlType, context);
Modified: branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/rules/ProcessParserRule.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/rules/ProcessParserRule.java 2011-01-05 23:01:21 UTC (rev 538)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/rules/ProcessParserRule.java 2011-01-07 15:57:52 UTC (rev 539)
@@ -28,7 +28,7 @@
import org.savara.bpel.model.TSequence;
import org.savara.bpel.model.TVariable;
import org.savara.bpel.util.ActivityUtil;
-import org.savara.bpel.util.InteractionUtil;
+import org.savara.bpel.util.BPELInteractionUtil;
import org.scribble.common.logging.Journal;
import org.scribble.protocol.model.*;
@@ -53,7 +53,7 @@
}
// Count number of invoke activities
- int invokeCount=InteractionUtil.countInvokes(process);
+ int invokeCount=BPELInteractionUtil.countInvokes(process);
// Check whether scope has been defined to represent
// an interaction with one or more fault responses and
@@ -66,7 +66,7 @@
process.getFaultHandlers().getCatchAll() != null) &&
(process.getEventHandlers() == null || (process.getEventHandlers().getOnEvent().size() == 0 &&
process.getEventHandlers().getOnAlarm().size() == 0)) &&
- (invoke = InteractionUtil.getInvoke(act)) != null) {
+ (invoke = BPELInteractionUtil.getInvoke(act)) != null) {
InvokeParserRule.convertRequest(invoke, activities, context);
Modified: branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/rules/ReceiveParserRule.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/rules/ReceiveParserRule.java 2011-01-05 23:01:21 UTC (rev 538)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/rules/ReceiveParserRule.java 2011-01-07 15:57:52 UTC (rev 539)
@@ -21,7 +21,7 @@
import org.savara.bpel.model.TReceive;
import org.savara.bpel.model.TVariable;
-import org.savara.bpel.util.InteractionUtil;
+import org.savara.bpel.util.BPELInteractionUtil;
import org.savara.bpel.util.PartnerLinkUtil;
import org.savara.bpel.util.TypeReferenceUtil;
import org.scribble.common.logging.Journal;
@@ -50,7 +50,7 @@
TVariable var=context.getVariable(elem.getVariable());
- String xmlType=InteractionUtil.getXMLType(context.getProcess(), var.getMessageType(),
+ String xmlType=BPELInteractionUtil.getXMLType(context.getProcess(), var.getMessageType(),
context.getResourceLocator());
TypeReference tref=TypeReferenceUtil.createTypeReference(xmlType, context);
Modified: branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/rules/ReplyParserRule.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/rules/ReplyParserRule.java 2011-01-05 23:01:21 UTC (rev 538)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/rules/ReplyParserRule.java 2011-01-07 15:57:52 UTC (rev 539)
@@ -21,7 +21,7 @@
import org.savara.bpel.model.TReply;
import org.savara.bpel.model.TVariable;
-import org.savara.bpel.util.InteractionUtil;
+import org.savara.bpel.util.BPELInteractionUtil;
import org.savara.bpel.util.PartnerLinkUtil;
import org.savara.bpel.util.TypeReferenceUtil;
import org.scribble.common.logging.Journal;
@@ -49,7 +49,7 @@
TVariable var=context.getVariable(reply.getVariable());
- String xmlType=InteractionUtil.getXMLType(context.getProcess(), var.getMessageType(),
+ String xmlType=BPELInteractionUtil.getXMLType(context.getProcess(), var.getMessageType(),
context.getResourceLocator());
TypeReference tref=TypeReferenceUtil.createTypeReference(xmlType, context);
Modified: branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/rules/ScopeParserRule.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/rules/ScopeParserRule.java 2011-01-05 23:01:21 UTC (rev 538)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/rules/ScopeParserRule.java 2011-01-07 15:57:52 UTC (rev 539)
@@ -28,7 +28,7 @@
import org.savara.bpel.model.TSequence;
import org.savara.bpel.model.TVariable;
import org.savara.bpel.util.ActivityUtil;
-import org.savara.bpel.util.InteractionUtil;
+import org.savara.bpel.util.BPELInteractionUtil;
import org.scribble.common.logging.Journal;
import org.scribble.protocol.model.*;
@@ -57,7 +57,7 @@
}
// Count number of invoke activities
- int invokeCount=InteractionUtil.countInvokes(scope);
+ int invokeCount=BPELInteractionUtil.countInvokes(scope);
// Check whether scope has been defined to represent
// an interaction with one or more fault responses and
@@ -69,7 +69,7 @@
scope.getFaultHandlers().getCatchAll() != null) &&
(scope.getEventHandlers() == null || (scope.getEventHandlers().getOnEvent().size() == 0 &&
scope.getEventHandlers().getOnAlarm().size() == 0)) &&
- (invoke = InteractionUtil.getInvoke(ActivityUtil.getActivity(scope))) != null) {
+ (invoke = BPELInteractionUtil.getInvoke(ActivityUtil.getActivity(scope))) != null) {
InvokeParserRule.convertRequest(invoke, activities, context);
Modified: branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/util/ActivityUtil.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/util/ActivityUtil.java 2011-01-05 23:01:21 UTC (rev 538)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/util/ActivityUtil.java 2011-01-07 15:57:52 UTC (rev 539)
@@ -26,7 +26,7 @@
public class ActivityUtil {
- private static Log logger = LogFactory.getLog(InteractionUtil.class);
+ private static Log logger = LogFactory.getLog(BPELInteractionUtil.class);
public static TActivity getActivity(TExtensibleElements container) {
TActivity ret=null;
Copied: branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/util/BPELInteractionUtil.java (from rev 521, branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/util/InteractionUtil.java)
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/util/BPELInteractionUtil.java (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/util/BPELInteractionUtil.java 2011-01-07 15:57:52 UTC (rev 539)
@@ -0,0 +1,209 @@
+/*
+ * 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.savara.bpel.util;
+
+import java.io.IOException;
+
+import javax.wsdl.xml.WSDLReader;
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.Marshaller;
+import javax.xml.namespace.QName;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.savara.bpel.model.TActivity;
+import org.savara.bpel.model.TExtensibleElements;
+import org.savara.bpel.model.TImport;
+import org.savara.bpel.model.TInvoke;
+import org.savara.bpel.model.TProcess;
+import org.savara.bpel.model.TScope;
+import org.savara.bpel.model.TSequence;
+import org.scribble.common.resource.ResourceLocator;
+import org.savara.util.XMLUtils;
+
+/**
+ * This class contains utility functions for dealing with Interactions.
+ */
+public class BPELInteractionUtil {
+
+ private static Log logger = LogFactory.getLog(BPELInteractionUtil.class);
+
+ /**
+ * This method determines whether the supplied activity
+ * is either an invoke, or a sequence that has an
+ * invoke as its first element.
+ *
+ * @param act The activity
+ * @return The invoke, or null if not found
+ */
+ public static TInvoke getInvoke(TActivity act) {
+ TInvoke ret=null;
+
+ if (act instanceof TInvoke) {
+ ret = (TInvoke)act;
+ } else if (act instanceof TSequence &&
+ ((TSequence)act).getActivity().size() > 0 &&
+ ((TSequence)act).getActivity().get(0) instanceof TInvoke) {
+ ret = (TInvoke)((TSequence)act).getActivity().get(0);
+ }
+
+ return(ret);
+ }
+
+ public static int countInvokes(TExtensibleElements scope) {
+ org.w3c.dom.Element elem=null;
+
+ try {
+ elem = convertScopeToDOM(scope);
+ } catch(Exception e) {
+ e.printStackTrace();
+ }
+
+ int ret=0;
+
+ if (elem != null) {
+ ret = countInvokes(elem);
+ }
+
+ return(ret);
+ }
+
+ /**
+ * This method recursively counts the number of 'invoke' activities
+ * contained within a DOM element.
+ *
+ * @param elem The current element
+ * @return The number of invokes contained within the element
+ */
+ public static int countInvokes(org.w3c.dom.Element elem) {
+ int ret=0;
+
+ if (elem.getLocalName().equals("invoke")) {
+ ret = 1;
+ } else {
+ org.w3c.dom.NodeList nl=elem.getChildNodes();
+
+ for (int i=0; i < nl.getLength(); i++) {
+ if (nl.item(i) instanceof org.w3c.dom.Element) {
+ ret += countInvokes((org.w3c.dom.Element)nl.item(i));
+ }
+ }
+ }
+
+ return(ret);
+ }
+
+ protected static org.w3c.dom.Element convertScopeToDOM(TExtensibleElements desc) throws IOException {
+ org.w3c.dom.Element ret=null;
+
+ try {
+ org.savara.bpel.model.ObjectFactory factory=
+ new org.savara.bpel.model.ObjectFactory();
+
+ JAXBContext context = JAXBContext.newInstance(desc.getClass());
+ Marshaller marshaller = context.createMarshaller();
+ marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
+
+ java.io.ByteArrayOutputStream baos=new java.io.ByteArrayOutputStream();
+
+ if (desc instanceof TProcess) {
+ marshaller.marshal(factory.createProcess((TProcess)desc), baos);
+ } else if (desc instanceof TScope) {
+ marshaller.marshal(factory.createScope((TScope)desc), baos);
+ }
+
+ baos.close();
+
+ ret = (org.w3c.dom.Element)XMLUtils.getNode(baos.toString());
+
+ } catch(Exception e) {
+ throw new IOException("Failed to serialize scope", e);
+ }
+
+ return(ret);
+ }
+
+ /**
+ * This method searches the defined WSDL definitions to identify
+ * the underlying XML element/type associated with the supplied
+ * WSDL message type.
+ *
+ * @param wsdlMessageType The WSDL message type
+ * @param locator The resource locator
+ * @return The underlying XML element/type, or null if not found
+ */
+ public static String getXMLType(TProcess process, QName wsdlMessageType, ResourceLocator locator) {
+ String ret=null;
+
+ String namespace=wsdlMessageType.getNamespaceURI();
+
+ for (TImport imp : process.getImport()) {
+
+ // Check if import relates to the correct namespace
+ if (imp.getNamespace() != null &&
+ imp.getNamespace().equals(namespace) &&
+ imp.getLocation() != null &&
+ imp.getLocation().endsWith(".wsdl")) {
+
+ java.net.URI uri=
+ locator.getResourceURI(imp.getLocation());
+
+ if (uri != null) {
+ ret = getXMLType(wsdlMessageType, uri);
+
+ if (ret != null) {
+ break;
+ }
+ }
+ }
+ }
+
+ return(ret);
+ }
+
+ public static String getXMLType(QName wsdlMessageType, java.net.URI uri) {
+ String ret=null;
+
+ try {
+ WSDLReader reader=javax.wsdl.factory.WSDLFactory.newInstance().newWSDLReader();
+
+ javax.wsdl.Definition defn=reader.readWSDL(uri.toString());
+
+ if (defn != null) {
+ javax.wsdl.Message mesg=defn.getMessage(wsdlMessageType);
+
+ if (mesg != null && mesg.getParts().size() == 1) {
+ javax.wsdl.Part part=(javax.wsdl.Part)
+ mesg.getParts().values().iterator().next();
+
+ if (part.getElementName() != null) {
+ ret = part.getElementName().toString();
+ } else if (part.getTypeName() != null) {
+ ret = part.getTypeName().toString();
+ }
+ }
+ }
+
+ } catch(Exception e) {
+ logger.error("Failed to read WSDL", e);
+ }
+
+ return(ret);
+ }
+
+}
Deleted: branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/util/InteractionUtil.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/util/InteractionUtil.java 2011-01-05 23:01:21 UTC (rev 538)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/util/InteractionUtil.java 2011-01-07 15:57:52 UTC (rev 539)
@@ -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.savara.bpel.util;
-
-import java.io.IOException;
-
-import javax.wsdl.xml.WSDLReader;
-import javax.xml.bind.JAXBContext;
-import javax.xml.bind.Marshaller;
-import javax.xml.namespace.QName;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.savara.bpel.model.TActivity;
-import org.savara.bpel.model.TExtensibleElements;
-import org.savara.bpel.model.TImport;
-import org.savara.bpel.model.TInvoke;
-import org.savara.bpel.model.TProcess;
-import org.savara.bpel.model.TScope;
-import org.savara.bpel.model.TSequence;
-import org.savara.bpel.model.change.InteractionPatterns;
-import org.scribble.common.resource.ResourceLocator;
-import org.savara.util.XMLUtils;
-import org.scribble.protocol.model.*;
-
-/**
- * This class contains utility functions for dealing with Interactions.
- */
-public class InteractionUtil {
-
- private static Log logger = LogFactory.getLog(InteractionUtil.class);
-
- /**
- * This method returns the name associated with the interaction.
- *
- * @param interaction The interaction
- * @return The name
- */
- public static String getName(Interaction interaction) {
- String ret=null;
-
- if (isSend(interaction)) {
- ret = "Send";
- } else {
- ret = "Receive";
- }
-
- for (TypeReference ref : interaction.getMessageSignature().getTypeReferences()) {
- ret += "_"+ref.getName();
- }
-
- return(ret);
- }
-
- /**
- * This method returns the name associated with the interaction.
- *
- * @param when The when
- * @return The name
- */
- public static String getName(When when) {
- String ret=null;
-
- if (isSend(when)) {
- ret = "Send";
- } else {
- ret = "Receive";
- }
-
- for (TypeReference ref : when.getMessageSignature().getTypeReferences()) {
- ret += "_"+ref.getName();
- }
-
- return(ret);
- }
-
- /**
- * This method determines whether the supplied interaction
- * is a send.
- *
- * @param interaction The interaction
- * @return Whether the interaction is a send
- */
- public static boolean isSend(Interaction interaction) {
- boolean ret=false;
- Role role=null;
-
- if (interaction.enclosingProtocol() != null) {
- role = interaction.enclosingProtocol().getRole();
- }
-
- if (role != null && ((interaction.getFromRole() != null &&
- interaction.getFromRole().equals(
- role)) ||
- (interaction.getToRoles().size() > 0 &&
- interaction.getToRoles().contains(
- role) == false))) {
- ret = true;
- }
-
- return(ret);
- }
-
- /**
- * This method determines whether the supplied interaction
- * is a send.
- *
- * @param interaction The interaction
- * @return Whether the interaction is a send
- */
- public static boolean isSend(When when) {
- boolean ret=false;
- Role role=null;
-
- if (((Choice)when.getParent()).enclosingProtocol() != null) {
- role = ((Choice)when.getParent()).enclosingProtocol().getRole();
- }
-
- if (role != null && ((((Choice)when.getParent()).getFromRole() != null &&
- ((Choice)when.getParent()).getFromRole().equals(
- role)) ||
- (((Choice)when.getParent()).getToRole() != null &&
- ((Choice)when.getParent()).getToRole().equals(
- role) == false))) {
- ret = true;
- }
-
- return(ret);
- }
-
- /**
- * This method determines whether the supplied interaction
- * is a request.
- *
- * @param interaction The interaction
- * @return Whether the interaction is a request
- */
- public static boolean isRequest(Interaction interaction) {
- boolean ret=false;
-
- if (InteractionPatterns.getRequestLabel(interaction) != null ||
- InteractionPatterns.getReplyToLabel(interaction) == null) {
- ret = true;
- }
-
- return(ret);
- }
-
- /**
- * This method determines whether the supplied interaction
- * is a request.
- *
- * @param interaction The interaction
- * @return Whether the interaction is a request
- */
- public static boolean isRequest(When interaction) {
- boolean ret=false;
-
- if (InteractionPatterns.getRequestLabel(interaction) != null ||
- InteractionPatterns.getReplyToLabel(interaction) == null) {
- ret = true;
- }
-
- return(ret);
- }
-
- /**
- * This method determines whether the supplied interaction
- * is a response.
- *
- * @param interaction The interaction
- * @return Whether the interaction is a response
- */
- public static boolean isResponse(Interaction interaction) {
- boolean ret=false;
-
- if (InteractionPatterns.getReplyToLabel(interaction) != null) {
- ret = true;
- }
-
- return(ret);
- }
-
- /**
- * This method determines whether the supplied interaction
- * is a response.
- *
- * @param interaction The interaction
- * @return Whether the interaction is a response
- */
- public static boolean isResponse(When interaction) {
- boolean ret=false;
-
- if (InteractionPatterns.getReplyToLabel(interaction) != null) {
- ret = true;
- }
-
- return(ret);
- }
-
- /**
- * This method determines whether this is the first interaction
- * associated with the conversation.
- *
- * @param interaction The interaction
- * @return Whether the interaction is the first in the conversation
- */
- /**
- * This method determines whether the supplied activity
- * is either an invoke, or a sequence that has an
- * invoke as its first element.
- *
- * @param act The activity
- * @return The invoke, or null if not found
- */
- public static TInvoke getInvoke(TActivity act) {
- TInvoke ret=null;
-
- if (act instanceof TInvoke) {
- ret = (TInvoke)act;
- } else if (act instanceof TSequence &&
- ((TSequence)act).getActivity().size() > 0 &&
- ((TSequence)act).getActivity().get(0) instanceof TInvoke) {
- ret = (TInvoke)((TSequence)act).getActivity().get(0);
- }
-
- return(ret);
- }
-
- public static int countInvokes(TExtensibleElements scope) {
- org.w3c.dom.Element elem=null;
-
- try {
- elem = convertScopeToDOM(scope);
- } catch(Exception e) {
- e.printStackTrace();
- }
-
- int ret=0;
-
- if (elem != null) {
- ret = countInvokes(elem);
- }
-
- return(ret);
- }
-
- /**
- * This method recursively counts the number of 'invoke' activities
- * contained within a DOM element.
- *
- * @param elem The current element
- * @return The number of invokes contained within the element
- */
- public static int countInvokes(org.w3c.dom.Element elem) {
- int ret=0;
-
- if (elem.getLocalName().equals("invoke")) {
- ret = 1;
- } else {
- org.w3c.dom.NodeList nl=elem.getChildNodes();
-
- for (int i=0; i < nl.getLength(); i++) {
- if (nl.item(i) instanceof org.w3c.dom.Element) {
- ret += countInvokes((org.w3c.dom.Element)nl.item(i));
- }
- }
- }
-
- return(ret);
- }
-
- protected static org.w3c.dom.Element convertScopeToDOM(TExtensibleElements desc) throws IOException {
- org.w3c.dom.Element ret=null;
-
- try {
- org.savara.bpel.model.ObjectFactory factory=
- new org.savara.bpel.model.ObjectFactory();
-
- JAXBContext context = JAXBContext.newInstance(desc.getClass());
- Marshaller marshaller = context.createMarshaller();
- marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
-
- java.io.ByteArrayOutputStream baos=new java.io.ByteArrayOutputStream();
-
- if (desc instanceof TProcess) {
- marshaller.marshal(factory.createProcess((TProcess)desc), baos);
- } else if (desc instanceof TScope) {
- marshaller.marshal(factory.createScope((TScope)desc), baos);
- }
-
- baos.close();
-
- ret = (org.w3c.dom.Element)XMLUtils.getNode(baos.toString());
-
- } catch(Exception e) {
- throw new IOException("Failed to serialize scope", e);
- }
-
- return(ret);
- }
-
- /**
- * This method searches the defined WSDL definitions to identify
- * the underlying XML element/type associated with the supplied
- * WSDL message type.
- *
- * @param wsdlMessageType The WSDL message type
- * @param locator The resource locator
- * @return The underlying XML element/type, or null if not found
- */
- public static String getXMLType(TProcess process, QName wsdlMessageType, ResourceLocator locator) {
- String ret=null;
-
- String namespace=wsdlMessageType.getNamespaceURI();
-
- for (TImport imp : process.getImport()) {
-
- // Check if import relates to the correct namespace
- if (imp.getNamespace() != null &&
- imp.getNamespace().equals(namespace) &&
- imp.getLocation() != null &&
- imp.getLocation().endsWith(".wsdl")) {
-
- java.net.URI uri=
- locator.getResourceURI(imp.getLocation());
-
- if (uri != null) {
- ret = getXMLType(wsdlMessageType, uri);
-
- if (ret != null) {
- break;
- }
- }
- }
- }
-
- return(ret);
- }
-
- public static String getXMLType(QName wsdlMessageType, java.net.URI uri) {
- String ret=null;
-
- try {
- WSDLReader reader=javax.wsdl.factory.WSDLFactory.newInstance().newWSDLReader();
-
- javax.wsdl.Definition defn=reader.readWSDL(uri.toString());
-
- if (defn != null) {
- javax.wsdl.Message mesg=defn.getMessage(wsdlMessageType);
-
- if (mesg != null && mesg.getParts().size() == 1) {
- javax.wsdl.Part part=(javax.wsdl.Part)
- mesg.getParts().values().iterator().next();
-
- if (part.getElementName() != null) {
- ret = part.getElementName().toString();
- } else if (part.getTypeName() != null) {
- ret = part.getTypeName().toString();
- }
- }
- }
-
- } catch(Exception e) {
- logger.error("Failed to read WSDL", e);
- }
-
- return(ret);
- }
-
-}
Modified: branches/experimental/2.0.x/bundles/org.savara.bpel.tests/src/test/java/org/savara/bpel/generator/GeneratorTest.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel.tests/src/test/java/org/savara/bpel/generator/GeneratorTest.java 2011-01-05 23:01:21 UTC (rev 538)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel.tests/src/test/java/org/savara/bpel/generator/GeneratorTest.java 2011-01-07 15:57:52 UTC (rev 539)
@@ -22,10 +22,10 @@
import junit.framework.TestResult;
import junit.framework.TestSuite;
-import org.savara.util.PropertyNames;
import org.savara.bpel.model.TProcess;
import org.savara.bpel.util.BPELModelUtil;
import org.savara.model.generator.ModelGenerator;
+import org.savara.model.util.PropertyNames;
import org.scribble.common.logging.CachedJournal;
import org.savara.pi4soa.cdm.parser.CDMProtocolParser;
Modified: branches/experimental/2.0.x/bundles/org.savara.contract.model/META-INF/MANIFEST.MF
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.contract.model/META-INF/MANIFEST.MF 2011-01-05 23:01:21 UTC (rev 538)
+++ branches/experimental/2.0.x/bundles/org.savara.contract.model/META-INF/MANIFEST.MF 2011-01-07 15:57:52 UTC (rev 539)
@@ -2,7 +2,7 @@
Bundle-ManifestVersion: 2
Bundle-Name: SAVARA Contract Model
Bundle-SymbolicName: org.savara.contract.model
-Bundle-Version: 1.2.0.qualifier
+Bundle-Version: 2.0.0.qualifier
Bundle-Activator: org.savara.contract.model.osgi.Activator
Bundle-Vendor: www.savara.org
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Modified: branches/experimental/2.0.x/bundles/org.savara.core/META-INF/MANIFEST.MF
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.core/META-INF/MANIFEST.MF 2011-01-05 23:01:21 UTC (rev 538)
+++ branches/experimental/2.0.x/bundles/org.savara.core/META-INF/MANIFEST.MF 2011-01-07 15:57:52 UTC (rev 539)
@@ -11,5 +11,6 @@
org.scribble.protocol
Export-Package: org.savara.model.change,
org.savara.model.generator,
+ org.savara.model.util,
org.savara.util
Bundle-ActivationPolicy: lazy
Added: branches/experimental/2.0.x/bundles/org.savara.core/src/main/java/org/savara/model/util/InteractionUtil.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.core/src/main/java/org/savara/model/util/InteractionUtil.java (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.core/src/main/java/org/savara/model/util/InteractionUtil.java 2011-01-07 15:57:52 UTC (rev 539)
@@ -0,0 +1,215 @@
+/*
+ * 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.savara.model.util;
+
+import java.util.logging.Logger;
+
+import org.scribble.protocol.model.*;
+
+/**
+ * This class contains utility functions for dealing with Interactions.
+ */
+public class InteractionUtil {
+
+ private static Logger logger = Logger.getLogger(InteractionUtil.class.getName());
+
+ /**
+ * This method returns the name associated with the interaction.
+ *
+ * @param interaction The interaction
+ * @return The name
+ */
+ public static String getName(Interaction interaction) {
+ String ret=null;
+
+ if (isSend(interaction)) {
+ ret = "Send";
+ } else {
+ ret = "Receive";
+ }
+
+ for (TypeReference ref : interaction.getMessageSignature().getTypeReferences()) {
+ ret += "_"+ref.getName();
+ }
+
+ return(ret);
+ }
+
+ /**
+ * This method returns the name associated with the interaction.
+ *
+ * @param when The when
+ * @return The name
+ */
+ public static String getName(When when) {
+ String ret=null;
+
+ if (isSend(when)) {
+ ret = "Send";
+ } else {
+ ret = "Receive";
+ }
+
+ for (TypeReference ref : when.getMessageSignature().getTypeReferences()) {
+ ret += "_"+ref.getName();
+ }
+
+ return(ret);
+ }
+
+ /**
+ * This method determines whether the supplied interaction
+ * is a send.
+ *
+ * @param interaction The interaction
+ * @return Whether the interaction is a send
+ */
+ public static boolean isSend(Interaction interaction) {
+ boolean ret=false;
+ Role role=null;
+
+ if (interaction.enclosingProtocol() != null) {
+ role = interaction.enclosingProtocol().getRole();
+ }
+
+ if (role != null && ((interaction.getFromRole() != null &&
+ interaction.getFromRole().equals(
+ role)) ||
+ (interaction.getToRoles().size() > 0 &&
+ interaction.getToRoles().contains(
+ role) == false))) {
+ ret = true;
+ }
+
+ return(ret);
+ }
+
+ /**
+ * This method determines whether the supplied interaction
+ * is a send.
+ *
+ * @param interaction The interaction
+ * @return Whether the interaction is a send
+ */
+ public static boolean isSend(When when) {
+ boolean ret=false;
+ Role role=null;
+
+ if (((Choice)when.getParent()).enclosingProtocol() != null) {
+ role = ((Choice)when.getParent()).enclosingProtocol().getRole();
+ }
+
+ if (role != null && ((((Choice)when.getParent()).getFromRole() != null &&
+ ((Choice)when.getParent()).getFromRole().equals(
+ role)) ||
+ (((Choice)when.getParent()).getToRole() != null &&
+ ((Choice)when.getParent()).getToRole().equals(
+ role) == false))) {
+ ret = true;
+ }
+
+ return(ret);
+ }
+
+ public static String getRequestLabel(Interaction interaction) {
+ return((String)interaction.getProperties().get("RequestLabel"));
+ }
+
+ public static String getReplyToLabel(Interaction interaction) {
+ return((String)interaction.getProperties().get("ReplyToLabel"));
+ }
+
+ public static String getRequestLabel(When interaction) {
+ return((String)interaction.getProperties().get("RequestLabel"));
+ }
+
+ public static String getReplyToLabel(When interaction) {
+ return((String)interaction.getProperties().get("ReplyToLabel"));
+ }
+
+ /**
+ * This method determines whether the supplied interaction
+ * is a request.
+ *
+ * @param interaction The interaction
+ * @return Whether the interaction is a request
+ */
+ public static boolean isRequest(Interaction interaction) {
+ boolean ret=false;
+
+ if (getRequestLabel(interaction) != null ||
+ getReplyToLabel(interaction) == null) {
+ ret = true;
+ }
+
+ return(ret);
+ }
+
+ /**
+ * This method determines whether the supplied interaction
+ * is a request.
+ *
+ * @param interaction The interaction
+ * @return Whether the interaction is a request
+ */
+ public static boolean isRequest(When interaction) {
+ boolean ret=false;
+
+ if (getRequestLabel(interaction) != null ||
+ getReplyToLabel(interaction) == null) {
+ ret = true;
+ }
+
+ return(ret);
+ }
+
+ /**
+ * This method determines whether the supplied interaction
+ * is a response.
+ *
+ * @param interaction The interaction
+ * @return Whether the interaction is a response
+ */
+ public static boolean isResponse(Interaction interaction) {
+ boolean ret=false;
+
+ if (getReplyToLabel(interaction) != null) {
+ ret = true;
+ }
+
+ return(ret);
+ }
+
+ /**
+ * This method determines whether the supplied interaction
+ * is a response.
+ *
+ * @param interaction The interaction
+ * @return Whether the interaction is a response
+ */
+ public static boolean isResponse(When interaction) {
+ boolean ret=false;
+
+ if (getReplyToLabel(interaction) != null) {
+ ret = true;
+ }
+
+ return(ret);
+ }
+
+}
Copied: branches/experimental/2.0.x/bundles/org.savara.core/src/main/java/org/savara/model/util/PropertyNames.java (from rev 520, branches/experimental/2.0.x/bundles/org.savara.core/src/main/java/org/savara/util/PropertyNames.java)
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.core/src/main/java/org/savara/model/util/PropertyNames.java (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.core/src/main/java/org/savara/model/util/PropertyNames.java 2011-01-07 15:57:52 UTC (rev 539)
@@ -0,0 +1,26 @@
+/*
+ * 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.savara.model.util;
+
+public class PropertyNames {
+
+ public static final String NAMESPACE_PREFIXES="NamespacePrefixes";
+
+ public static final String SCHEMA_LOCATIONS="SchemaLocations";
+
+}
Deleted: branches/experimental/2.0.x/bundles/org.savara.core/src/main/java/org/savara/util/PropertyNames.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.core/src/main/java/org/savara/util/PropertyNames.java 2011-01-05 23:01:21 UTC (rev 538)
+++ branches/experimental/2.0.x/bundles/org.savara.core/src/main/java/org/savara/util/PropertyNames.java 2011-01-07 15:57:52 UTC (rev 539)
@@ -1,26 +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.savara.util;
-
-public class PropertyNames {
-
- public static final String NAMESPACE_PREFIXES="NamespacePrefixes";
-
- public static final String SCHEMA_LOCATIONS="SchemaLocations";
-
-}
Modified: branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/main/java/org/savara/pi4soa/cdm/parser/rules/ProtocolModelConverterRuleImpl.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/main/java/org/savara/pi4soa/cdm/parser/rules/ProtocolModelConverterRuleImpl.java 2011-01-05 23:01:21 UTC (rev 538)
+++ branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/main/java/org/savara/pi4soa/cdm/parser/rules/ProtocolModelConverterRuleImpl.java 2011-01-07 15:57:52 UTC (rev 539)
@@ -23,7 +23,7 @@
import org.pi4soa.cdl.*;
import org.pi4soa.cdl.util.CDLTypeUtil;
-import org.savara.util.PropertyNames;
+import org.savara.model.util.PropertyNames;
import org.scribble.protocol.model.*;
public class ProtocolModelConverterRuleImpl implements ConverterRule {
Modified: branches/experimental/2.0.x/bundles/org.savara.wsdl/META-INF/MANIFEST.MF
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.wsdl/META-INF/MANIFEST.MF 2011-01-05 23:01:21 UTC (rev 538)
+++ branches/experimental/2.0.x/bundles/org.savara.wsdl/META-INF/MANIFEST.MF 2011-01-07 15:57:52 UTC (rev 539)
@@ -2,7 +2,7 @@
Bundle-ManifestVersion: 2
Bundle-Name: SAVARA WSDL
Bundle-SymbolicName: org.savara.wsdl
-Bundle-Version: 1.2.0.qualifier
+Bundle-Version: 2.0.0.qualifier
Bundle-Activator: org.savara.wsdl.osgi.Activator
Bundle-Vendor: www.savara.org
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Modified: branches/experimental/2.0.x/tools/features/org.savara.tools.feature/feature.xml
===================================================================
--- branches/experimental/2.0.x/tools/features/org.savara.tools.feature/feature.xml 2011-01-05 23:01:21 UTC (rev 538)
+++ branches/experimental/2.0.x/tools/features/org.savara.tools.feature/feature.xml 2011-01-07 15:57:52 UTC (rev 539)
@@ -277,18 +277,4 @@
version="0.0.0"
unpack="false"/>
- <plugin
- id="org.scribble.conformance"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.scribble.conversation.comparator"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
</feature>
Modified: branches/experimental/2.0.x/tools/features/org.savara.tools.feature/pom.xml
===================================================================
--- branches/experimental/2.0.x/tools/features/org.savara.tools.feature/pom.xml 2011-01-05 23:01:21 UTC (rev 538)
+++ branches/experimental/2.0.x/tools/features/org.savara.tools.feature/pom.xml 2011-01-07 15:57:52 UTC (rev 539)
@@ -35,6 +35,11 @@
<version>${savara.version}</version>
</dependency>
<dependency>
+ <groupId>org.savara.bundles</groupId>
+ <artifactId>org.savara.pi4soa.cdm</artifactId>
+ <version>${savara.version}</version>
+ </dependency>
+ <dependency>
<groupId>org.scribble.bundles</groupId>
<artifactId>org.scribble.protocol.projection</artifactId>
<version>${scribble.version}</version>
@@ -49,6 +54,11 @@
<artifactId>org.savara.tools.wsdl</artifactId>
<version>${savara.version}</version>
</dependency>
+ <dependency>
+ <groupId>org.savara.tools</groupId>
+ <artifactId>org.savara.protocol.contract</artifactId>
+ <version>${savara.version}</version>
+ </dependency>
</dependencies>
</project>
Modified: branches/experimental/2.0.x/tools/features/pom.xml
===================================================================
--- branches/experimental/2.0.x/tools/features/pom.xml 2011-01-05 23:01:21 UTC (rev 538)
+++ branches/experimental/2.0.x/tools/features/pom.xml 2011-01-07 15:57:52 UTC (rev 539)
@@ -14,7 +14,6 @@
</parent>
<modules>
- <module>org.scribble.protocol.feature</module>
<module>org.savara.tools.feature</module>
<module>org.jboss.savara.tools.feature</module>
</modules>
Modified: branches/experimental/2.0.x/tools/plugins/org.savara.protocol.contract/META-INF/MANIFEST.MF
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.protocol.contract/META-INF/MANIFEST.MF 2011-01-05 23:01:21 UTC (rev 538)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.protocol.contract/META-INF/MANIFEST.MF 2011-01-07 15:57:52 UTC (rev 539)
@@ -2,13 +2,14 @@
Bundle-ManifestVersion: 2
Bundle-Name: SAVARA Protocol Contract Plugin
Bundle-SymbolicName: org.savara.protocol.contract
-Bundle-Version: 1.2.0.qualifier
+Bundle-Version: 2.0.0.qualifier
Bundle-Activator: org.savara.protocol.contract.osgi.Activator
Bundle-Vendor: www.savara.org
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Import-Package: org.osgi.framework;version="1.3.0"
Require-Bundle: org.scribble.common,
org.scribble.protocol,
+ org.savara.core,
org.savara.contract.model
Export-Package: org.savara.protocol.contract,
org.savara.protocol.contract.impl;x-friends:="org.savara.protocol.contract.tests"
Modified: branches/experimental/2.0.x/tools/plugins/org.savara.protocol.contract/src/java/org/savara/protocol/contract/ContractGenerator.java
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.protocol.contract/src/java/org/savara/protocol/contract/ContractGenerator.java 2011-01-05 23:01:21 UTC (rev 538)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.protocol.contract/src/java/org/savara/protocol/contract/ContractGenerator.java 2011-01-07 15:57:52 UTC (rev 539)
@@ -18,7 +18,7 @@
package org.savara.protocol.contract;
import org.savara.contract.model.Contract;
-import org.scribble.conversation.model.Conversation;
+import org.scribble.protocol.model.Protocol;
/**
* This interface represents the capability that generates a contract
@@ -34,6 +34,6 @@
* @param cm The protocol
* @return The contract
*/
- public Contract generate(Conversation cm) throws IllegalArgumentException;
+ public Contract generate(Protocol cm) throws IllegalArgumentException;
}
Modified: branches/experimental/2.0.x/tools/plugins/org.savara.protocol.contract/src/java/org/savara/protocol/contract/impl/ContractGeneratorImpl.java
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.protocol.contract/src/java/org/savara/protocol/contract/impl/ContractGeneratorImpl.java 2011-01-05 23:01:21 UTC (rev 538)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.protocol.contract/src/java/org/savara/protocol/contract/impl/ContractGeneratorImpl.java 2011-01-07 15:57:52 UTC (rev 539)
@@ -21,7 +21,7 @@
import org.savara.contract.model.Contract;
import org.savara.protocol.contract.ContractGenerator;
-import org.scribble.conversation.model.Conversation;
+import org.scribble.protocol.model.Protocol;
/**
* This class generates a contract from a protocol defining the behaviour of
@@ -37,7 +37,7 @@
* @param cm The protocol
* @return The contract
*/
- public Contract generate(Conversation cm) throws IllegalArgumentException {
+ public Contract generate(Protocol cm) throws IllegalArgumentException {
// Check parameters
if (cm == null) {
@@ -46,7 +46,7 @@
"org.savara.protocol.contract.Messages").
getString("SAVARAPC-00001"), (Object)null));
- } else if (cm.getLocatedName() == null || cm.getLocatedName().getRole() == null) {
+ } else if (cm.getRole() == null) {
throw new IllegalArgumentException(MessageFormat.format(
java.util.PropertyResourceBundle.getBundle(
"org.savara.protocol.contract.Messages").
Modified: branches/experimental/2.0.x/tools/plugins/org.savara.protocol.contract/src/java/org/savara/protocol/contract/impl/ContractIntrospector.java
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.protocol.contract/src/java/org/savara/protocol/contract/impl/ContractIntrospector.java 2011-01-05 23:01:21 UTC (rev 538)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.protocol.contract/src/java/org/savara/protocol/contract/impl/ContractIntrospector.java 2011-01-07 15:57:52 UTC (rev 539)
@@ -31,24 +31,26 @@
import org.savara.contract.model.RequestResponseMEP;
import org.savara.contract.model.Type;
import org.savara.contract.model.TypeDefinition;
-import org.scribble.conversation.model.Conversation;
-import org.scribble.conversation.model.ConversationInteraction;
-import org.scribble.conversation.model.Run;
-import org.scribble.model.ModelObject;
-import org.scribble.model.Role;
-import org.scribble.model.TypeReference;
+import org.savara.model.util.InteractionUtil;
+import org.scribble.protocol.model.AbstractModelObjectVisitor;
+import org.scribble.protocol.model.Protocol;
+import org.scribble.protocol.model.Interaction;
+import org.scribble.protocol.model.Run;
+import org.scribble.protocol.model.ModelObject;
+import org.scribble.protocol.model.Role;
+import org.scribble.protocol.model.TypeReference;
/**
* This class examines a protocol to determine the contract that represents
* the static functional interface to the role's behaviour.
*
*/
-public class ContractIntrospector implements org.scribble.model.Visitor {
+public class ContractIntrospector extends AbstractModelObjectVisitor {
private Contract m_contract=new Contract();
- private java.util.Set<Conversation> m_processedProtocols=null;
+ private java.util.Set<Protocol> m_processedProtocols=null;
private Role m_role=null;
- private Conversation m_protocol=null;
+ private Protocol m_protocol=null;
private static Logger logger = Logger.getLogger(ContractIntrospector.class.getName());
@@ -57,7 +59,7 @@
*
* @param protocol The protocol to introspect
*/
- public ContractIntrospector(Conversation protocol) {
+ public ContractIntrospector(Protocol protocol) {
this(protocol, null, null);
}
@@ -68,8 +70,8 @@
* @param contract The optional contract being derived
* @param processed The optional set of protocols currently processed
*/
- public ContractIntrospector(Conversation protocol, Contract contract,
- java.util.Set<Conversation> processed) {
+ public ContractIntrospector(Protocol protocol, Contract contract,
+ java.util.Set<Protocol> processed) {
m_contract = contract;
if (m_contract == null) {
@@ -79,13 +81,13 @@
if (processed != null) {
m_processedProtocols = processed;
} else {
- m_processedProtocols = new java.util.HashSet<Conversation>();
+ m_processedProtocols = new java.util.HashSet<Protocol>();
}
m_protocol = protocol;
if (protocol != null) {
- m_role = protocol.getLocatedName().getRole();
+ m_role = protocol.getRole();
}
}
@@ -122,7 +124,7 @@
*
* @return The processed protocols
*/
- public java.util.Set<Conversation> getProcessedProtocols() {
+ public java.util.Set<Protocol> getProcessedProtocols() {
return(m_processedProtocols);
}
@@ -145,10 +147,10 @@
m_protocol.visit(this);
}
- public boolean visit(ModelObject obj) {
+ public boolean process(ModelObject obj) {
boolean f_visitChildren=true;
- if (obj.getClass() == Conversation.class) {
+ if (obj.getClass() == Protocol.class) {
// Only visit children if same protocol that is being visited
f_visitChildren = (obj == m_protocol);
@@ -156,7 +158,7 @@
} else if (obj.getClass() == Run.class) {
Run run=(Run)obj;
- Conversation toProtocol=run.getDefinition();
+ Protocol toProtocol=run.getProtocol();
// Check if protocol already processed to avoid stack overflow
if (m_processedProtocols.contains(toProtocol) == false) {
@@ -167,10 +169,10 @@
ci.process();
} else {
- logger.fine("Invoked definition not found for "+run.getReference());
+ logger.fine("Invoked definition not found for "+run.getProtocolReference());
}
- } else if (obj.getClass() == ConversationInteraction.class) {
- visitInteraction((ConversationInteraction)obj);
+ } else if (obj.getClass() == Interaction.class) {
+ accept((Interaction)obj);
}
return(f_visitChildren);
@@ -182,7 +184,7 @@
*
* @param interaction The interaction
*/
- public void visitInteraction(ConversationInteraction interaction) {
+ public void accept(Interaction interaction) {
// Check if the interacton is being received
if (interaction.getFromRole() != null &&
@@ -190,8 +192,8 @@
// Received by the role, but need to check if its replyTo
// has been set, indicating it is receiving a response
- if (interaction.getReplyToLabel() == null ||
- interaction.getReplyToLabel().trim().length() == 0) {
+ if (InteractionUtil.getReplyToLabel(interaction) == null ||
+ InteractionUtil.getReplyToLabel(interaction).trim().length() == 0) {
// Receiving a request - so record this in the contract
Interface intf=getInterface();
@@ -204,7 +206,7 @@
if (mep == null) {
// Create new MEP
- if (interaction.getRequestLabel() != null) {
+ if (InteractionUtil.getRequestLabel(interaction) != null) {
mep = new RequestResponseMEP();
} else {
mep = new OneWayRequestMEP();
@@ -212,8 +214,8 @@
mep.setOperation(interaction.getMessageSignature().getOperation());
- for (int i=0; i < interaction.getMessageSignature().getTypes().size(); i++) {
- mep.getTypes().add(convertType(interaction.getMessageSignature().getTypes().get(i)));
+ for (int i=0; i < interaction.getMessageSignature().getTypeReferences().size(); i++) {
+ mep.getTypes().add(convertType(interaction.getMessageSignature().getTypeReferences().get(i)));
}
intf.getMessageExchangePatterns().add(mep);
Modified: branches/experimental/2.0.x/tools/plugins/org.savara.tap.eclipse/META-INF/MANIFEST.MF
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tap.eclipse/META-INF/MANIFEST.MF 2011-01-05 23:01:21 UTC (rev 538)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tap.eclipse/META-INF/MANIFEST.MF 2011-01-07 15:57:52 UTC (rev 539)
@@ -2,7 +2,7 @@
Bundle-ManifestVersion: 2
Bundle-Name: SAVARA TAP Eclipse integration
Bundle-SymbolicName: org.savara.tap.eclipse; singleton:=true
-Bundle-Version: 1.2.0.qualifier
+Bundle-Version: 2.0.0.qualifier
Bundle-Activator: org.savara.tap.eclipse.Activator
Bundle-Vendor: www.savara.org
Service-Component: OSGI-INF/eclipse-resource-loader.xml
Modified: branches/experimental/2.0.x/tools/plugins/org.savara.tap.model/META-INF/MANIFEST.MF
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tap.model/META-INF/MANIFEST.MF 2011-01-05 23:01:21 UTC (rev 538)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tap.model/META-INF/MANIFEST.MF 2011-01-07 15:57:52 UTC (rev 539)
@@ -2,7 +2,7 @@
Bundle-ManifestVersion: 2
Bundle-Name: SAVARA TAP Model
Bundle-SymbolicName: org.savara.tap.model
-Bundle-Version: 1.2.0.qualifier
+Bundle-Version: 2.0.0.qualifier
Bundle-Activator: org.savara.tap.model.osgi.Activator
Bundle-Vendor: www.savara.org
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Modified: branches/experimental/2.0.x/tools/plugins/org.savara.tap.validation/META-INF/MANIFEST.MF
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tap.validation/META-INF/MANIFEST.MF 2011-01-05 23:01:21 UTC (rev 538)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tap.validation/META-INF/MANIFEST.MF 2011-01-07 15:57:52 UTC (rev 539)
@@ -2,7 +2,7 @@
Bundle-ManifestVersion: 2
Bundle-Name: SAVARA TAP Validation
Bundle-SymbolicName: org.savara.tap.validation;singleton:=true
-Bundle-Version: 1.2.0.qualifier
+Bundle-Version: 2.0.0.qualifier
Bundle-Activator: org.savara.tap.validation.osgi.Activator
Bundle-Vendor: www.savara.org
Service-Component: OSGI-INF/bpel-cdm-relationship-validator.xml,
More information about the savara-commits
mailing list