summaryrefslogtreecommitdiffstats
path: root/java
diff options
context:
space:
mode:
authoredwardsmj <edwardsmj@13f79535-47bb-0310-9956-ffa450edef68>2009-08-17 12:03:30 +0000
committeredwardsmj <edwardsmj@13f79535-47bb-0310-9956-ffa450edef68>2009-08-17 12:03:30 +0000
commit718e75b8a5b90dfe3dd7db6a31776335f764a42b (patch)
tree7b70916db267ab6260d6107216fd839dbd3c3986 /java
parentbcc56f14a42c7173af5dd242826a02d9b6225fd8 (diff)
Adjusted handling of WSDL interfaces for Callback cases as part of adding Callback support - TUSCANY-3216
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@804947 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java')
-rw-r--r--java/sca/modules/implementation-bpel/src/main/java/org/apache/tuscany/sca/implementation/bpel/xml/BPELDocumentModelResolver.java6
-rw-r--r--java/sca/modules/implementation-bpel/src/main/java/org/apache/tuscany/sca/implementation/bpel/xml/BPELDocumentProcessor.java18
-rw-r--r--java/sca/modules/implementation-bpel/src/main/java/org/apache/tuscany/sca/implementation/bpel/xml/BPELImplementationProcessor.java26
-rw-r--r--java/sca/modules/implementation-bpel/src/main/java/org/apache/tuscany/sca/implementation/bpel/xml/BPELPartnerLinkElement.java3
-rw-r--r--java/sca/modules/implementation-bpel/src/main/java/org/apache/tuscany/sca/implementation/bpel/xml/BPELPartnerLinkTypeElement.java7
5 files changed, 30 insertions, 30 deletions
diff --git a/java/sca/modules/implementation-bpel/src/main/java/org/apache/tuscany/sca/implementation/bpel/xml/BPELDocumentModelResolver.java b/java/sca/modules/implementation-bpel/src/main/java/org/apache/tuscany/sca/implementation/bpel/xml/BPELDocumentModelResolver.java
index 733deece70..fbb1c0c39c 100644
--- a/java/sca/modules/implementation-bpel/src/main/java/org/apache/tuscany/sca/implementation/bpel/xml/BPELDocumentModelResolver.java
+++ b/java/sca/modules/implementation-bpel/src/main/java/org/apache/tuscany/sca/implementation/bpel/xml/BPELDocumentModelResolver.java
@@ -191,17 +191,13 @@ public class BPELDocumentModelResolver implements ModelResolver {
theImport.getNamespace(), resolver );
if( theWSDL != null ) {
theImport.setWSDLDefinition( theWSDL );
-
+
// Find all the WSDL definitions matching the imported namespace
if( wsdlDefinitions == null ) {
wsdlDefinitions = new HashSet<Definition>();
} // end if
wsdlDefinitions.add(theWSDL.getDefinition());
- // Fetch any definitions that are imported
- for (WSDLDefinition importedWSDL: theWSDL.getImportedDefinitions()) {
- wsdlDefinitions.add(importedWSDL.getDefinition());
- } // end for
} // end if
} // end if
} // end for
diff --git a/java/sca/modules/implementation-bpel/src/main/java/org/apache/tuscany/sca/implementation/bpel/xml/BPELDocumentProcessor.java b/java/sca/modules/implementation-bpel/src/main/java/org/apache/tuscany/sca/implementation/bpel/xml/BPELDocumentProcessor.java
index 17f6fea5e9..06f801c30b 100644
--- a/java/sca/modules/implementation-bpel/src/main/java/org/apache/tuscany/sca/implementation/bpel/xml/BPELDocumentProcessor.java
+++ b/java/sca/modules/implementation-bpel/src/main/java/org/apache/tuscany/sca/implementation/bpel/xml/BPELDocumentProcessor.java
@@ -50,16 +50,10 @@ import org.apache.tuscany.sca.monitor.Problem.Severity;
/**
* BPEL document processor responsible for reading a BPEL file and producing necessary model info about it
*
- * TODO: The namespaces for WS-BPEL include 2 versions - only the earlier BPEL 1.1 versions are
- * supported at present - the BPEL 2.0 namespaces also need support. This will require inspection
- * of both BPEL process files and of WSDL files for their BPEL namespaces
+ * Handles both BPEL 1.1 documents and BPEL 2.0 documents
* @version $Rev$ $Date$
*/
public class BPELDocumentProcessor extends BaseStAXArtifactProcessor implements URLArtifactProcessor<BPELProcessDefinition> {
-// public final static QName BPEL_PROCESS_DEFINITION = new QName("http://schemas.xmlsoap.org/ws/2004/03/business-process/", "process");
-// public final static QName BPEL_EXECUTABLE_DEFINITION = new QName("http://docs.oasis-open.org/wsbpel/2.0/process/executable", "process");
-
-
private final static XMLInputFactory inputFactory = XMLInputFactory.newInstance();
@@ -83,12 +77,16 @@ public class BPELDocumentProcessor extends BaseStAXArtifactProcessor implements
return BPELProcessDefinition.class;
}
+ /**
+ * Read the BPEL Process definition file from the location identified by an artifact URL
+ * @param contributionURL - URL of the Contribution containing the Process definition
+ * @param artifactURI - URI of the artifact containing the BPEL Process definition
+ * @param artifactURL - URL of the artifact containing the BPEL Process definition
+ * @return BPELProcessDefinition - SCA model of the BPEL Process
+ */
public BPELProcessDefinition read(URL contributionURL, URI artifactURI, URL artifactURL) throws ContributionReadException {
BPELProcessDefinition processDefinition = null;
try {
- // for now we are just using process name
- // and relying on componentType file for service definition
- // so it's OK to set resolved for now
processDefinition = readProcessDefinition(artifactURL);
processDefinition.setURI(artifactURI.toString());
processDefinition.setUnresolved(true);
diff --git a/java/sca/modules/implementation-bpel/src/main/java/org/apache/tuscany/sca/implementation/bpel/xml/BPELImplementationProcessor.java b/java/sca/modules/implementation-bpel/src/main/java/org/apache/tuscany/sca/implementation/bpel/xml/BPELImplementationProcessor.java
index dade598631..0a3c713ae6 100644
--- a/java/sca/modules/implementation-bpel/src/main/java/org/apache/tuscany/sca/implementation/bpel/xml/BPELImplementationProcessor.java
+++ b/java/sca/modules/implementation-bpel/src/main/java/org/apache/tuscany/sca/implementation/bpel/xml/BPELImplementationProcessor.java
@@ -255,20 +255,19 @@ public class BPELImplementationProcessor extends BaseStAXArtifactProcessor imple
WSDLInterfaceContract interfaceContract = wsdlFactory.createWSDLInterfaceContract();
reference.setInterfaceContract(interfaceContract);
- // Establish whether there is just a call interface or a call + callback
- // interface
+ // Establish whether there is just a call interface or a call + callback interface
PortType callPT = null;
PortType callbackPT = null;
- if (myRolePT != null) {
- callPT = myRolePT;
+ if (partnerRolePT != null) {
+ callPT = partnerRolePT;
// If the 2 port types are not the same one, there is a callback...
- if (partnerRolePT != null) {
+ if (myRolePT != null) {
if (!myRolePT.getQName().equals(partnerRolePT.getQName())) {
- callbackPT = partnerRolePT;
+ callbackPT = myRolePT;
} // end if
} // end if
- } else if (partnerRolePT != null) {
- callPT = partnerRolePT;
+ } else if (myRolePT != null) {
+ callPT = myRolePT;
} // end if
// No interfaces mean an error
@@ -277,8 +276,7 @@ public class BPELImplementationProcessor extends BaseStAXArtifactProcessor imple
} // end if
// Set the name of the reference to the supplied name and the
- // multiplicity of the reference
- // to 1..1
+ // multiplicity of the reference to 1..1
// TODO: support other multiplicities
reference.setName(name);
reference.setMultiplicity(Multiplicity.ONE_ONE);
@@ -294,11 +292,10 @@ public class BPELImplementationProcessor extends BaseStAXArtifactProcessor imple
error("NoInterfaceForPortType", theInterfaces, callPT.getQName().toString());
} else
reference.getInterfaceContract().setInterface(callInterface);
- }
+ } // end if
// There is a callback if the partner role is not null and if the
- // partner role port type
- // is not the same as the port type for my role
+ // partner role port type is not the same as the port type for my role
if (callbackPT != null) {
WSDLInterface callbackInterface = null;
for (WSDLInterface anInterface : theInterfaces) {
@@ -367,8 +364,7 @@ public class BPELImplementationProcessor extends BaseStAXArtifactProcessor imple
} // end if
// There is a callback if the partner role is not null and if the
- // partner role port type
- // is not the same as the port type for my role
+ // partner role port type is not the same as the port type for my role
if (callbackPT != null) {
WSDLInterface callbackInterface = null;
for (WSDLInterface anInterface : theInterfaces) {
diff --git a/java/sca/modules/implementation-bpel/src/main/java/org/apache/tuscany/sca/implementation/bpel/xml/BPELPartnerLinkElement.java b/java/sca/modules/implementation-bpel/src/main/java/org/apache/tuscany/sca/implementation/bpel/xml/BPELPartnerLinkElement.java
index 4781e8ef93..ea645e1304 100644
--- a/java/sca/modules/implementation-bpel/src/main/java/org/apache/tuscany/sca/implementation/bpel/xml/BPELPartnerLinkElement.java
+++ b/java/sca/modules/implementation-bpel/src/main/java/org/apache/tuscany/sca/implementation/bpel/xml/BPELPartnerLinkElement.java
@@ -80,6 +80,9 @@ public class BPELPartnerLinkElement {
if (theRole == null || theRole.length() == 0) {
return null;
} // end if
+ if( pLinkType == null ) {
+ throw new IllegalStateException("BPELPartnerLinkElement: " + this.name + " has no Partner Link type object set");
+ } // end if
if (theRole.equals(pLinkType.getRole1Name())) {
return pLinkType.getRole1pType();
} else if (theRole.equals(pLinkType.getRole2Name())) {
diff --git a/java/sca/modules/implementation-bpel/src/main/java/org/apache/tuscany/sca/implementation/bpel/xml/BPELPartnerLinkTypeElement.java b/java/sca/modules/implementation-bpel/src/main/java/org/apache/tuscany/sca/implementation/bpel/xml/BPELPartnerLinkTypeElement.java
index 3ae9ef19c0..8786837e97 100644
--- a/java/sca/modules/implementation-bpel/src/main/java/org/apache/tuscany/sca/implementation/bpel/xml/BPELPartnerLinkTypeElement.java
+++ b/java/sca/modules/implementation-bpel/src/main/java/org/apache/tuscany/sca/implementation/bpel/xml/BPELPartnerLinkTypeElement.java
@@ -107,5 +107,12 @@ public class BPELPartnerLinkTypeElement implements ExtensibilityElement {
public void setRequired(java.lang.Boolean required) {
this.required = required;
}
+
+ /**
+ * toString method to return a description of this BPELPartnerLinkType useful for debugging
+ */
+ public String toString() {
+ return "BPELPartnerLinkType: " + name.toString();
+ } // end method toString
} // end BPELPartnerLinkType