diff options
author | nash <nash@13f79535-47bb-0310-9956-ffa450edef68> | 2008-06-30 16:02:54 +0000 |
---|---|---|
committer | nash <nash@13f79535-47bb-0310-9956-ffa450edef68> | 2008-06-30 16:02:54 +0000 |
commit | 79c8907bf3b86c58ee515a355361a2f42ebc4776 (patch) | |
tree | e5c79c98ede4ea2bf2c735441897a14db89aca4c /branches/sca-java-1.3/modules/binding-ws-xml/src/main/java/org/apache/tuscany/sca/binding/ws/xml | |
parent | eb340a208f49de11848fb3c667279ca106ec3ff3 (diff) |
Fix TUSCANY-2446
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@672803 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to '')
2 files changed, 64 insertions, 2 deletions
diff --git a/branches/sca-java-1.3/modules/binding-ws-xml/src/main/java/org/apache/tuscany/sca/binding/ws/xml/BindingBuilderImpl.java b/branches/sca-java-1.3/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/branches/sca-java-1.3/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/branches/sca-java-1.3/modules/binding-ws-xml/src/main/java/org/apache/tuscany/sca/binding/ws/xml/WebServiceBindingProcessor.java b/branches/sca-java-1.3/modules/binding-ws-xml/src/main/java/org/apache/tuscany/sca/binding/ws/xml/WebServiceBindingProcessor.java index a1b4a51c9f..c472caac3a 100644 --- a/branches/sca-java-1.3/modules/binding-ws-xml/src/main/java/org/apache/tuscany/sca/binding/ws/xml/WebServiceBindingProcessor.java +++ b/branches/sca-java-1.3/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); |