You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by js...@apache.org on 2006/02/27 11:37:05 UTC
svn commit: r381313 - in /incubator/tuscany/java/sca/binding.axis/src/main:
java/org/apache/tuscany/binding/axis/builder/
java/org/apache/tuscany/binding/axis/config/
java/org/apache/tuscany/binding/axis/engine/config/ resources/
resources/META-INF/ re...
Author: jsdelfino
Date: Mon Feb 27 02:37:04 2006
New Revision: 381313
URL: http://svn.apache.org/viewcvs?rev=381313&view=rev
Log:
Fixed wsdd name in AxisEngineConfigurationFactory - added entry point configuration and configuration builder
Added:
incubator/tuscany/java/sca/binding.axis/src/main/java/org/apache/tuscany/binding/axis/builder/WebServiceEntryPointConfigurationBuilder.java (with props)
incubator/tuscany/java/sca/binding.axis/src/main/java/org/apache/tuscany/binding/axis/config/WebServiceEntryPointRuntimeConfiguration.java (with props)
incubator/tuscany/java/sca/binding.axis/src/main/resources/org/apache/tuscany/binding/axis/engine/
incubator/tuscany/java/sca/binding.axis/src/main/resources/org/apache/tuscany/binding/axis/engine/config/
incubator/tuscany/java/sca/binding.axis/src/main/resources/org/apache/tuscany/binding/axis/engine/config/server-config.wsdd
Removed:
incubator/tuscany/java/sca/binding.axis/src/main/resources/META-INF/
incubator/tuscany/java/sca/binding.axis/src/main/resources/org/apache/tuscany/binding/axis/config/
Modified:
incubator/tuscany/java/sca/binding.axis/src/main/java/org/apache/tuscany/binding/axis/builder/ExternalWebServiceConfigurationBuilder.java
incubator/tuscany/java/sca/binding.axis/src/main/java/org/apache/tuscany/binding/axis/engine/config/AxisEngineConfigurationFactory.java
incubator/tuscany/java/sca/binding.axis/src/main/resources/system.fragment
Modified: incubator/tuscany/java/sca/binding.axis/src/main/java/org/apache/tuscany/binding/axis/builder/ExternalWebServiceConfigurationBuilder.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/binding.axis/src/main/java/org/apache/tuscany/binding/axis/builder/ExternalWebServiceConfigurationBuilder.java?rev=381313&r1=381312&r2=381313&view=diff
==============================================================================
--- incubator/tuscany/java/sca/binding.axis/src/main/java/org/apache/tuscany/binding/axis/builder/ExternalWebServiceConfigurationBuilder.java (original)
+++ incubator/tuscany/java/sca/binding.axis/src/main/java/org/apache/tuscany/binding/axis/builder/ExternalWebServiceConfigurationBuilder.java Mon Feb 27 02:37:04 2006
@@ -45,7 +45,7 @@
import org.osoa.sca.annotations.Scope;
/**
- * Creates a <code>RuntimeConfigurationBuilder</code> for an external service configured with the {@link FooBinding}
+ * Creates a <code>RuntimeConfigurationBuilder</code> for an external service configured with the {@link WebServiceBinding}
*
* @version $Rev$ $Date$
*/
Added: incubator/tuscany/java/sca/binding.axis/src/main/java/org/apache/tuscany/binding/axis/builder/WebServiceEntryPointConfigurationBuilder.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/binding.axis/src/main/java/org/apache/tuscany/binding/axis/builder/WebServiceEntryPointConfigurationBuilder.java?rev=381313&view=auto
==============================================================================
--- incubator/tuscany/java/sca/binding.axis/src/main/java/org/apache/tuscany/binding/axis/builder/WebServiceEntryPointConfigurationBuilder.java (added)
+++ incubator/tuscany/java/sca/binding.axis/src/main/java/org/apache/tuscany/binding/axis/builder/WebServiceEntryPointConfigurationBuilder.java Mon Feb 27 02:37:04 2006
@@ -0,0 +1,147 @@
+/**
+ *
+ * Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ * Licensed 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.binding.axis.builder;
+
+import java.lang.reflect.Method;
+import java.util.Collection;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.tuscany.binding.axis.assembly.WebServiceBinding;
+import org.apache.tuscany.binding.axis.config.WebServiceEntryPointRuntimeConfiguration;
+import org.apache.tuscany.core.builder.BuilderException;
+import org.apache.tuscany.core.builder.RuntimeConfigurationBuilder;
+import org.apache.tuscany.core.config.JavaIntrospectionHelper;
+import org.apache.tuscany.core.context.AggregateContext;
+import org.apache.tuscany.core.context.QualifiedName;
+import org.apache.tuscany.core.invocation.InvocationConfiguration;
+import org.apache.tuscany.core.invocation.MethodHashMap;
+import org.apache.tuscany.core.invocation.ProxyConfiguration;
+import org.apache.tuscany.core.invocation.impl.InvokerInterceptor;
+import org.apache.tuscany.core.invocation.spi.ProxyFactory;
+import org.apache.tuscany.core.invocation.spi.ProxyFactoryFactory;
+import org.apache.tuscany.core.message.MessageFactory;
+import org.apache.tuscany.core.runtime.RuntimeContext;
+import org.apache.tuscany.core.system.annotation.Autowire;
+import org.apache.tuscany.model.assembly.AssemblyModelObject;
+import org.apache.tuscany.model.assembly.ConfiguredService;
+import org.apache.tuscany.model.assembly.EntryPoint;
+import org.apache.tuscany.model.assembly.Service;
+import org.apache.tuscany.model.assembly.ServiceContract;
+import org.osoa.sca.annotations.Init;
+import org.osoa.sca.annotations.Scope;
+
+/**
+ * Creates a <code>RuntimeConfigurationBuilder</code> for an entry point configured with the {@link WebServiceBinding}
+ *
+ * @version $Rev$ $Date$
+ */
+@Scope("MODULE")
+public class WebServiceEntryPointConfigurationBuilder implements RuntimeConfigurationBuilder<AggregateContext> {
+
+ private RuntimeContext runtimeContext;
+
+ private ProxyFactoryFactory proxyFactoryFactory;
+
+ private MessageFactory messageFactory;
+
+ private RuntimeConfigurationBuilder policyBuilder;
+
+ public WebServiceEntryPointConfigurationBuilder() {
+ }
+
+ @Init(eager = true)
+ public void init() {
+ runtimeContext.addBuilder(this);
+ }
+
+ /**
+ * @param runtimeContext The runtimeContext to set.
+ */
+ @Autowire
+ public void setRuntimeContext(RuntimeContext runtimeContext) {
+ this.runtimeContext = runtimeContext;
+ }
+
+ /**
+ * Sets the factory used to construct proxies implmementing the business interface required by a reference
+ */
+ @Autowire
+ public void setProxyFactoryFactory(ProxyFactoryFactory factory) {
+ this.proxyFactoryFactory = factory;
+ }
+
+ /**
+ * Sets the factory used to construct invocation messages
+ *
+ * @param msgFactory
+ */
+ @Autowire
+ public void setMessageFactory(MessageFactory msgFactory) {
+ this.messageFactory = msgFactory;
+ }
+
+ /**
+ * Sets a builder responsible for creating source-side and target-side invocation chains for a reference. The
+ * reference builder may be hierarchical, containing other child reference builders that operate on specific
+ * metadata used to construct and invocation chain.
+ *
+ * @see org.apache.tuscany.core.builder.impl.HierarchicalBuilder
+ */
+ public void setPolicyBuilder(RuntimeConfigurationBuilder builder) {
+ policyBuilder = builder;
+ }
+
+ public void build(AssemblyModelObject object, AggregateContext parentContext) throws BuilderException {
+ if (!(object instanceof EntryPoint)) {
+ return;
+ }
+ EntryPoint entryPoint = (EntryPoint) object;
+ if (entryPoint.getBindings().size() < 1 || !(entryPoint.getBindings().get(0) instanceof WebServiceBinding)) {
+ return;
+ }
+
+ WebServiceBinding wsBinding=(WebServiceBinding)entryPoint.getBindings().get(0);
+
+ WebServiceEntryPointRuntimeConfiguration config = new WebServiceEntryPointRuntimeConfiguration(entryPoint.getName(), parentContext, messageFactory);
+
+ ConfiguredService configuredService = entryPoint.getConfiguredService();
+ Service service = configuredService.getService();
+ ServiceContract serviceContract = service.getServiceContract();
+ Map<Method, InvocationConfiguration> iConfigMap = new MethodHashMap();
+ ProxyFactory proxyFactory = proxyFactoryFactory.createProxyFactory();
+ Set<Method> javaMethods = JavaIntrospectionHelper.getAllUniqueMethods(serviceContract.getInterface());
+ for (Method method : javaMethods) {
+ InvocationConfiguration iConfig = new InvocationConfiguration(method);
+ iConfigMap.put(method, iConfig);
+ }
+ QualifiedName qName = new QualifiedName(entryPoint.getName() + "/" + service.getName());
+ ProxyConfiguration pConfiguration = new ProxyConfiguration(qName, iConfigMap, null, messageFactory);
+ proxyFactory.setBusinessInterface(serviceContract.getInterface());
+ proxyFactory.setProxyConfiguration(pConfiguration);
+ config.addTargetProxyFactory(service.getName(), proxyFactory);
+ configuredService.setProxyFactory(proxyFactory);
+ if (policyBuilder != null) {
+ // invoke the reference builder to handle additional policy metadata
+ policyBuilder.build(configuredService, parentContext);
+ }
+ // add tail interceptor
+ for (InvocationConfiguration iConfig : (Collection<InvocationConfiguration>) iConfigMap.values()) {
+ iConfig.addTargetInterceptor(new InvokerInterceptor());
+ }
+
+ entryPoint.getConfiguredReference().setRuntimeConfiguration(config);
+ }
+
+}
Propchange: incubator/tuscany/java/sca/binding.axis/src/main/java/org/apache/tuscany/binding/axis/builder/WebServiceEntryPointConfigurationBuilder.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/sca/binding.axis/src/main/java/org/apache/tuscany/binding/axis/builder/WebServiceEntryPointConfigurationBuilder.java
------------------------------------------------------------------------------
svn:keywords = Rev,Date
Added: incubator/tuscany/java/sca/binding.axis/src/main/java/org/apache/tuscany/binding/axis/config/WebServiceEntryPointRuntimeConfiguration.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/binding.axis/src/main/java/org/apache/tuscany/binding/axis/config/WebServiceEntryPointRuntimeConfiguration.java?rev=381313&view=auto
==============================================================================
--- incubator/tuscany/java/sca/binding.axis/src/main/java/org/apache/tuscany/binding/axis/config/WebServiceEntryPointRuntimeConfiguration.java (added)
+++ incubator/tuscany/java/sca/binding.axis/src/main/java/org/apache/tuscany/binding/axis/config/WebServiceEntryPointRuntimeConfiguration.java Mon Feb 27 02:37:04 2006
@@ -0,0 +1,33 @@
+/**
+ *
+ * Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ * Licensed 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.binding.axis.config;
+
+import org.apache.tuscany.core.builder.impl.BaseEntryPointRuntimeConfiguration;
+import org.apache.tuscany.core.context.AggregateContext;
+import org.apache.tuscany.core.message.MessageFactory;
+
+/**
+ * Creates instances of {@link org.apache.tuscany.core.context.EntryPointContext} configured with the appropriate
+ * invocation chains and bindings. This implementation serves as a marker for
+ * {@link org.apache.tuscany.binding.axis.builder.WebServiceEntryPointWireBuilder}
+ *
+ * @version $Rev$ $Date$
+ */
+public class WebServiceEntryPointRuntimeConfiguration extends BaseEntryPointRuntimeConfiguration {
+
+ public WebServiceEntryPointRuntimeConfiguration(String name, AggregateContext parentContext, MessageFactory messageFactory) {
+ super(name, parentContext, messageFactory);
+ }
+
+}
Propchange: incubator/tuscany/java/sca/binding.axis/src/main/java/org/apache/tuscany/binding/axis/config/WebServiceEntryPointRuntimeConfiguration.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/sca/binding.axis/src/main/java/org/apache/tuscany/binding/axis/config/WebServiceEntryPointRuntimeConfiguration.java
------------------------------------------------------------------------------
svn:keywords = Rev,Date
Modified: incubator/tuscany/java/sca/binding.axis/src/main/java/org/apache/tuscany/binding/axis/engine/config/AxisEngineConfigurationFactory.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/binding.axis/src/main/java/org/apache/tuscany/binding/axis/engine/config/AxisEngineConfigurationFactory.java?rev=381313&r1=381312&r2=381313&view=diff
==============================================================================
--- incubator/tuscany/java/sca/binding.axis/src/main/java/org/apache/tuscany/binding/axis/engine/config/AxisEngineConfigurationFactory.java (original)
+++ incubator/tuscany/java/sca/binding.axis/src/main/java/org/apache/tuscany/binding/axis/engine/config/AxisEngineConfigurationFactory.java Mon Feb 27 02:37:04 2006
@@ -118,7 +118,7 @@
ResourceLoader bundleContext = modelContext.getResourceLoader();
InputStream wsdd;
try {
- URL url = bundleContext.getResource("org/apache/tuscany/binding/axis/config/impl/server-config.wsdd");
+ URL url = bundleContext.getResource("org/apache/tuscany/binding/axis/engine/config/server-config.wsdd");
wsdd = url.openStream();
} catch (IOException e1) {
throw new ServiceRuntimeException(e1);
Added: incubator/tuscany/java/sca/binding.axis/src/main/resources/org/apache/tuscany/binding/axis/engine/config/server-config.wsdd
URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/binding.axis/src/main/resources/org/apache/tuscany/binding/axis/engine/config/server-config.wsdd?rev=381313&view=auto
==============================================================================
--- incubator/tuscany/java/sca/binding.axis/src/main/resources/org/apache/tuscany/binding/axis/engine/config/server-config.wsdd (added)
+++ incubator/tuscany/java/sca/binding.axis/src/main/resources/org/apache/tuscany/binding/axis/engine/config/server-config.wsdd Mon Feb 27 02:37:04 2006
@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Copyright (c) 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ * Licensed 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.
+ -->
+<deployment name="defaultClientConfig"
+ xmlns="http://xml.apache.org/axis/wsdd/"
+ xmlns:java="http://xml.apache.org/axis/wsdd/providers/java"
+ xmlns:handler="http://xml.apache.org/axis/wsdd/providers/handler">
+
+ <globalConfiguration>
+ <parameter name="disablePrettyXML" value="false"/>
+ <parameter name="dotNetSoapEncFix" value="true"/>
+ <parameter name="axis.servicesPath" value="/sca/"/>
+ <parameter name="axis.disableServiceList" value="true"/>
+
+ <requestFlow>
+ <handler type="java:org.apache.axis.handlers.SOAPMonitorHandler"/>
+ </requestFlow>
+ <responseFlow>
+ <handler type="java:org.apache.axis.handlers.SOAPMonitorHandler"/>
+ </responseFlow>
+
+ </globalConfiguration>
+
+ <handler type="java:org.apache.axis.handlers.http.URLMapper" name="URLMapper"/>
+ <handler type="java:org.apache.axis.transport.local.LocalResponder" name="LocalResponder"/>
+ <handler type="java:org.apache.axis.handlers.SimpleAuthenticationHandler" name="Authenticate"/>
+
+ <transport name="http">
+ <parameter name="qs:list"
+ value="org.apache.axis.transport.http.QSListHandler"/>
+ <parameter name="qs:method"
+ value="org.apache.axis.transport.http.QSMethodHandler"/>
+ <parameter name="qs:wsdl"
+ value="org.apache.axis.transport.http.QSWSDLHandler"/>
+ <requestFlow>
+ <handler type="URLMapper"/>
+ <handler type="java:org.apache.axis.handlers.http.HTTPAuthHandler"/>
+ </requestFlow>
+ </transport>
+
+ <transport name="local">
+ <responseFlow>
+ <handler type="LocalResponder"/>
+ </responseFlow>
+ </transport>
+
+</deployment>
Modified: incubator/tuscany/java/sca/binding.axis/src/main/resources/system.fragment
URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/binding.axis/src/main/resources/system.fragment?rev=381313&r1=381312&r2=381313&view=diff
==============================================================================
--- incubator/tuscany/java/sca/binding.axis/src/main/resources/system.fragment (original)
+++ incubator/tuscany/java/sca/binding.axis/src/main/resources/system.fragment Mon Feb 27 02:37:04 2006
@@ -30,4 +30,8 @@
<system:implementation.system class="org.apache.tuscany.binding.axis.loader.WebServiceSCDLModelLoader"/>
</component>
+ <component name="org.apache.tuscany.binding.axis.builder.WebServiceEntryPointConfigurationBuilder">
+ <system:implementation.system class="org.apache.tuscany.binding.axis.builder.WebServiceEntryPointConfigurationBuilder"/>
+ </component>
+
</moduleFragment>