summaryrefslogtreecommitdiffstats
path: root/java/sca/modules/binding-ws-xml/src
diff options
context:
space:
mode:
authornash <nash@13f79535-47bb-0310-9956-ffa450edef68>2008-06-30 21:45:25 +0000
committernash <nash@13f79535-47bb-0310-9956-ffa450edef68>2008-06-30 21:45:25 +0000
commitc766cbd2cd4b7310ee82be5cd3e0be19cda562c7 (patch)
treec8d550e74ca14f0e5c795bdf5cbabc9d1104f179 /java/sca/modules/binding-ws-xml/src
parentbdbd09ca71e17250d6092c6354452e902e379b74 (diff)
Fix TUSCANY-2446
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@672939 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/sca/modules/binding-ws-xml/src')
-rw-r--r--java/sca/modules/binding-ws-xml/src/main/java/org/apache/tuscany/sca/binding/ws/xml/BindingBuilderImpl.java51
-rw-r--r--java/sca/modules/binding-ws-xml/src/main/java/org/apache/tuscany/sca/binding/ws/xml/WebServiceBindingProcessor.java15
2 files changed, 64 insertions, 2 deletions
diff --git a/java/sca/modules/binding-ws-xml/src/main/java/org/apache/tuscany/sca/binding/ws/xml/BindingBuilderImpl.java b/java/sca/modules/binding-ws-xml/src/main/java/org/apache/tuscany/sca/binding/ws/xml/BindingBuilderImpl.java
new file mode 100644
index 0000000000..f2376231ab
--- /dev/null
+++ b/java/sca/modules/binding-ws-xml/src/main/java/org/apache/tuscany/sca/binding/ws/xml/BindingBuilderImpl.java
@@ -0,0 +1,51 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.binding.ws.xml;
+
+import org.apache.tuscany.sca.binding.ws.WebServiceBinding;
+import org.apache.tuscany.sca.binding.ws.wsdlgen.BindingWSDLGenerator;
+import org.apache.tuscany.sca.assembly.AbstractContract;
+import org.apache.tuscany.sca.assembly.Binding;
+import org.apache.tuscany.sca.assembly.Component;
+import org.apache.tuscany.sca.assembly.builder.BindingBuilder;
+import org.apache.tuscany.sca.core.ExtensionPointRegistry;
+import org.apache.tuscany.sca.monitor.Monitor;
+
+/**
+ * A factory for the calculated WSDL document needed by Web Service bindings.
+ *
+ * @version $Rev$ $Date$
+ */
+public class BindingBuilderImpl implements BindingBuilder {
+
+ private ExtensionPointRegistry extensionPoints;
+
+ public BindingBuilderImpl(ExtensionPointRegistry extensionPoints) {
+ this.extensionPoints = extensionPoints;
+ }
+
+ /**
+ * Create a calculated WSDL document and save it in the Web Service binding.
+ */
+ public void build(Component component, AbstractContract contract, Binding binding, Monitor monitor) {
+ BindingWSDLGenerator.generateWSDL(component, contract, (WebServiceBinding)binding, extensionPoints, monitor);
+ }
+
+}
diff --git a/java/sca/modules/binding-ws-xml/src/main/java/org/apache/tuscany/sca/binding/ws/xml/WebServiceBindingProcessor.java b/java/sca/modules/binding-ws-xml/src/main/java/org/apache/tuscany/sca/binding/ws/xml/WebServiceBindingProcessor.java
index a1b4a51c9f..c472caac3a 100644
--- a/java/sca/modules/binding-ws-xml/src/main/java/org/apache/tuscany/sca/binding/ws/xml/WebServiceBindingProcessor.java
+++ b/java/sca/modules/binding-ws-xml/src/main/java/org/apache/tuscany/sca/binding/ws/xml/WebServiceBindingProcessor.java
@@ -47,6 +47,8 @@ import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
import org.apache.tuscany.sca.contribution.service.ContributionReadException;
import org.apache.tuscany.sca.contribution.service.ContributionResolveException;
import org.apache.tuscany.sca.contribution.service.ContributionWriteException;
+import org.apache.tuscany.sca.core.ExtensionPointRegistry;
+import org.apache.tuscany.sca.core.UtilityExtensionPoint;
import org.apache.tuscany.sca.interfacedef.InvalidInterfaceException;
import org.apache.tuscany.sca.interfacedef.wsdl.WSDLDefinition;
import org.apache.tuscany.sca.interfacedef.wsdl.WSDLFactory;
@@ -54,6 +56,7 @@ import org.apache.tuscany.sca.interfacedef.wsdl.WSDLInterface;
import org.apache.tuscany.sca.interfacedef.wsdl.WSDLInterfaceContract;
import org.apache.tuscany.sca.interfacedef.wsdl.WSDLObject;
import org.apache.tuscany.sca.monitor.Monitor;
+import org.apache.tuscany.sca.monitor.MonitorFactory;
import org.apache.tuscany.sca.monitor.Problem;
import org.apache.tuscany.sca.monitor.Problem.Severity;
import org.apache.tuscany.sca.policy.IntentAttachPointTypeFactory;
@@ -66,6 +69,7 @@ import org.apache.tuscany.sca.policy.PolicyFactory;
*/
public class WebServiceBindingProcessor implements StAXArtifactProcessor<WebServiceBinding>, WebServiceConstants {
+ private ExtensionPointRegistry extensionPoints;
private WSDLFactory wsdlFactory;
private WebServiceBindingFactory wsFactory;
private PolicyFactory policyFactory;
@@ -74,13 +78,19 @@ public class WebServiceBindingProcessor implements StAXArtifactProcessor<WebServ
private ConfiguredOperationProcessor configuredOperationProcessor;
private Monitor monitor;
- public WebServiceBindingProcessor(ModelFactoryExtensionPoint modelFactories, Monitor monitor) {
+ public WebServiceBindingProcessor(ExtensionPointRegistry extensionPoints) {
+ this.extensionPoints = extensionPoints;
+ ModelFactoryExtensionPoint modelFactories = extensionPoints.getExtensionPoint(ModelFactoryExtensionPoint.class);
this.policyFactory = modelFactories.getFactory(PolicyFactory.class);
this.wsFactory = new DefaultWebServiceBindingFactory();
this.wsdlFactory = modelFactories.getFactory(WSDLFactory.class);
this.policyProcessor = new PolicyAttachPointProcessor(policyFactory);
this.intentAttachPointTypeFactory = modelFactories.getFactory(IntentAttachPointTypeFactory.class);
- this.monitor = monitor;
+ UtilityExtensionPoint utilities = extensionPoints.getExtensionPoint(UtilityExtensionPoint.class);
+ MonitorFactory monitorFactory = utilities.getUtility(MonitorFactory.class);
+ if (monitorFactory != null) {
+ this.monitor = monitorFactory.createMonitor();
+ }
this.configuredOperationProcessor = new ConfiguredOperationProcessor(modelFactories, this.monitor);
}
@@ -121,6 +131,7 @@ public class WebServiceBindingProcessor implements StAXArtifactProcessor<WebServ
bindingType.setUnresolved(true);
((PolicySetAttachPoint)wsBinding).setType(bindingType);*/
wsBinding.setUnresolved(true);
+ wsBinding.setBuilder(new BindingBuilderImpl(extensionPoints));
// Read policies
policyProcessor.readPolicies(wsBinding, reader);