You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by jb...@apache.org on 2006/03/04 20:37:25 UTC
svn commit: r383189 [1/4] - in /incubator/tuscany/java/sca/binding.axis2/src:
main/java/org/apache/tuscany/binding/axis2/assembly/
main/java/org/apache/tuscany/binding/axis2/assembly/impl/
main/java/org/apache/tuscany/binding/axis2/builder/ main/java/o...
Author: jboynes
Date: Sat Mar 4 11:37:22 2006
New Revision: 383189
URL: http://svn.apache.org/viewcvs?rev=383189&view=rev
Log:
set svn properties on java files in binding.axis2
Modified:
incubator/tuscany/java/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/assembly/WebServiceAssemblyFactory.java (contents, props changed)
incubator/tuscany/java/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/assembly/WebServiceBinding.java (contents, props changed)
incubator/tuscany/java/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/assembly/impl/WebServiceAssemblyFactoryImpl.java (contents, props changed)
incubator/tuscany/java/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/assembly/impl/WebServiceBindingImpl.java (contents, props changed)
incubator/tuscany/java/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/builder/ExternalWebServiceConfigurationBuilder.java (contents, props changed)
incubator/tuscany/java/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/builder/ExternalWebServiceWireBuilder.java (contents, props changed)
incubator/tuscany/java/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/builder/WebServiceEntryPointConfigurationBuilder.java (contents, props changed)
incubator/tuscany/java/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/config/ExternalWebServiceRuntimeConfiguration.java (contents, props changed)
incubator/tuscany/java/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/config/WebServiceEntryPointRuntimeConfiguration.java (contents, props changed)
incubator/tuscany/java/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/handler/ExternalWebServiceClient.java (contents, props changed)
incubator/tuscany/java/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/handler/ExternalWebServiceTargetInvoker.java (contents, props changed)
incubator/tuscany/java/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/handler/WebServiceEntryPointInOutSyncMessageReceiver.java (contents, props changed)
incubator/tuscany/java/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/handler/WebServiceEntryPointServlet.java (contents, props changed)
incubator/tuscany/java/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/handler/WebServiceOperationMetaData.java (contents, props changed)
incubator/tuscany/java/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/handler/WebServicePortMetaData.java (contents, props changed)
incubator/tuscany/java/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/loader/WebServiceSCDLModelLoader.java (contents, props changed)
incubator/tuscany/java/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/util/AxiomHelper.java (contents, props changed)
incubator/tuscany/java/sca/binding.axis2/src/test/java/org/apache/tuscany/binding/axis2/assembly/tests/WebServiceAssemblyLoaderTestCase.java (contents, props changed)
incubator/tuscany/java/sca/binding.axis2/src/test/java/org/apache/tuscany/binding/axis2/assembly/tests/bigbank/account/services/account/AccountReport.java (contents, props changed)
incubator/tuscany/java/sca/binding.axis2/src/test/java/org/apache/tuscany/binding/axis2/assembly/tests/bigbank/account/services/account/AccountService.java (contents, props changed)
incubator/tuscany/java/sca/binding.axis2/src/test/java/org/apache/tuscany/binding/axis2/assembly/tests/bigbank/account/services/account/AccountServiceImpl.java (contents, props changed)
incubator/tuscany/java/sca/binding.axis2/src/test/java/org/apache/tuscany/binding/axis2/assembly/tests/bigbank/account/services/account/AccountSummary.java (contents, props changed)
incubator/tuscany/java/sca/binding.axis2/src/test/java/org/apache/tuscany/binding/axis2/assembly/tests/bigbank/account/services/accountdata/AccountDataService.java (contents, props changed)
incubator/tuscany/java/sca/binding.axis2/src/test/java/org/apache/tuscany/binding/axis2/assembly/tests/bigbank/account/services/accountdata/AccountDataServiceImpl.java (contents, props changed)
incubator/tuscany/java/sca/binding.axis2/src/test/java/org/apache/tuscany/binding/axis2/assembly/tests/bigbank/account/services/accountdata/CheckingAccount.java (contents, props changed)
incubator/tuscany/java/sca/binding.axis2/src/test/java/org/apache/tuscany/binding/axis2/assembly/tests/bigbank/account/services/accountdata/SavingsAccount.java (contents, props changed)
incubator/tuscany/java/sca/binding.axis2/src/test/java/org/apache/tuscany/binding/axis2/assembly/tests/bigbank/account/services/accountdata/StockAccount.java (contents, props changed)
incubator/tuscany/java/sca/binding.axis2/src/test/java/org/apache/tuscany/binding/axis2/assembly/tests/bigbank/account/services/stockquote/StockQuoteService.java (contents, props changed)
incubator/tuscany/java/sca/binding.axis2/src/test/java/org/apache/tuscany/binding/axis2/util/AxiomHelperTestCase.java (contents, props changed)
Modified: incubator/tuscany/java/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/assembly/WebServiceAssemblyFactory.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/assembly/WebServiceAssemblyFactory.java?rev=383189&r1=383188&r2=383189&view=diff
==============================================================================
--- incubator/tuscany/java/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/assembly/WebServiceAssemblyFactory.java (original)
+++ incubator/tuscany/java/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/assembly/WebServiceAssemblyFactory.java Sat Mar 4 11:37:22 2006
@@ -1,31 +1,31 @@
-/**
- *
- * 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.axis2.assembly;
-
-import org.apache.tuscany.model.assembly.AssemblyFactory;
-
-/**
- * The <b>Factory</b> for the model.
- */
-public interface WebServiceAssemblyFactory extends AssemblyFactory {
-
- /**
- * Returns a new WebServiceBinding.
- */
- WebServiceBinding createWebServiceBinding();
-
-}
+/**
+ *
+ * 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.axis2.assembly;
+
+import org.apache.tuscany.model.assembly.AssemblyFactory;
+
+/**
+ * The <b>Factory</b> for the model.
+ */
+public interface WebServiceAssemblyFactory extends AssemblyFactory {
+
+ /**
+ * Returns a new WebServiceBinding.
+ */
+ WebServiceBinding createWebServiceBinding();
+
+}
Propchange: incubator/tuscany/java/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/assembly/WebServiceAssemblyFactory.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/assembly/WebServiceAssemblyFactory.java
------------------------------------------------------------------------------
svn:keywords = Rev,Date
Modified: incubator/tuscany/java/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/assembly/WebServiceBinding.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/assembly/WebServiceBinding.java?rev=383189&r1=383188&r2=383189&view=diff
==============================================================================
--- incubator/tuscany/java/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/assembly/WebServiceBinding.java (original)
+++ incubator/tuscany/java/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/assembly/WebServiceBinding.java Sat Mar 4 11:37:22 2006
@@ -1,51 +1,51 @@
-/**
- *
- * 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.axis2.assembly;
-
-import javax.wsdl.Definition;
-import javax.wsdl.Port;
-
-import org.apache.tuscany.model.assembly.Binding;
-
-/**
- * Represents a Web service binding.
- */
-public interface WebServiceBinding extends Binding {
-
- /**
- * Returns the WSDL port defining this binding.
- */
- Port getWSDLPort();
-
- /**
- * Returns the WSDL definition containing the WSDL port.
- * @return
- */
- Definition getWSDLDefinition();
-
- /**
- * Sets the WSDL port defining this binding.
- */
- void setWSDLPort(Port value);
-
- /**
- * Sets the WSDL definition containing the WSDL port.
- * @param definition
- */
- void setWSDLDefinition(Definition definition);
-
-}
+/**
+ *
+ * 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.axis2.assembly;
+
+import javax.wsdl.Definition;
+import javax.wsdl.Port;
+
+import org.apache.tuscany.model.assembly.Binding;
+
+/**
+ * Represents a Web service binding.
+ */
+public interface WebServiceBinding extends Binding {
+
+ /**
+ * Returns the WSDL port defining this binding.
+ */
+ Port getWSDLPort();
+
+ /**
+ * Returns the WSDL definition containing the WSDL port.
+ * @return
+ */
+ Definition getWSDLDefinition();
+
+ /**
+ * Sets the WSDL port defining this binding.
+ */
+ void setWSDLPort(Port value);
+
+ /**
+ * Sets the WSDL definition containing the WSDL port.
+ * @param definition
+ */
+ void setWSDLDefinition(Definition definition);
+
+}
Propchange: incubator/tuscany/java/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/assembly/WebServiceBinding.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/assembly/WebServiceBinding.java
------------------------------------------------------------------------------
svn:keywords = Rev,Date
Modified: incubator/tuscany/java/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/assembly/impl/WebServiceAssemblyFactoryImpl.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/assembly/impl/WebServiceAssemblyFactoryImpl.java?rev=383189&r1=383188&r2=383189&view=diff
==============================================================================
--- incubator/tuscany/java/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/assembly/impl/WebServiceAssemblyFactoryImpl.java (original)
+++ incubator/tuscany/java/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/assembly/impl/WebServiceAssemblyFactoryImpl.java Sat Mar 4 11:37:22 2006
@@ -1,42 +1,42 @@
-/**
- *
- * 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.axis2.assembly.impl;
-
-import org.apache.tuscany.binding.axis2.assembly.WebServiceAssemblyFactory;
-import org.apache.tuscany.binding.axis2.assembly.WebServiceBinding;
-import org.apache.tuscany.model.assembly.impl.AssemblyFactoryImpl;
-
-/**
- * An implementation of the model <b>Factory</b>.
- */
-public class WebServiceAssemblyFactoryImpl extends AssemblyFactoryImpl implements WebServiceAssemblyFactory {
-
- /**
- * Creates an instance of the factory.
- */
- public WebServiceAssemblyFactoryImpl() {
- super();
- }
-
- /**
- * @see org.apache.tuscany.binding.axis2.assembly.WebServiceAssemblyFactory#createWebServiceBinding()
- */
- public WebServiceBinding createWebServiceBinding() {
- return new WebServiceBindingImpl();
- }
-
-}
+/**
+ *
+ * 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.axis2.assembly.impl;
+
+import org.apache.tuscany.binding.axis2.assembly.WebServiceAssemblyFactory;
+import org.apache.tuscany.binding.axis2.assembly.WebServiceBinding;
+import org.apache.tuscany.model.assembly.impl.AssemblyFactoryImpl;
+
+/**
+ * An implementation of the model <b>Factory</b>.
+ */
+public class WebServiceAssemblyFactoryImpl extends AssemblyFactoryImpl implements WebServiceAssemblyFactory {
+
+ /**
+ * Creates an instance of the factory.
+ */
+ public WebServiceAssemblyFactoryImpl() {
+ super();
+ }
+
+ /**
+ * @see org.apache.tuscany.binding.axis2.assembly.WebServiceAssemblyFactory#createWebServiceBinding()
+ */
+ public WebServiceBinding createWebServiceBinding() {
+ return new WebServiceBindingImpl();
+ }
+
+}
Propchange: incubator/tuscany/java/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/assembly/impl/WebServiceAssemblyFactoryImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/assembly/impl/WebServiceAssemblyFactoryImpl.java
------------------------------------------------------------------------------
svn:keywords = Rev,Date
Modified: incubator/tuscany/java/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/assembly/impl/WebServiceBindingImpl.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/assembly/impl/WebServiceBindingImpl.java?rev=383189&r1=383188&r2=383189&view=diff
==============================================================================
--- incubator/tuscany/java/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/assembly/impl/WebServiceBindingImpl.java (original)
+++ incubator/tuscany/java/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/assembly/impl/WebServiceBindingImpl.java Sat Mar 4 11:37:22 2006
@@ -1,116 +1,116 @@
-/**
- *
- * 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.axis2.assembly.impl;
-
-import java.util.Collection;
-import java.util.List;
-
-import javax.wsdl.Definition;
-import javax.wsdl.Port;
-import javax.wsdl.Service;
-
-import org.apache.tuscany.binding.axis2.assembly.WebServiceBinding;
-import org.apache.tuscany.model.assembly.AssemblyModelContext;
-import org.apache.tuscany.model.assembly.impl.BindingImpl;
-
-/**
- * An implementation of WebServiceBinding.
- */
-public class WebServiceBindingImpl extends BindingImpl implements WebServiceBinding {
-
- private Definition definition;
- private Port port;
- private String portURI;
-
- /**
- * Constructor
- */
- protected WebServiceBindingImpl() {
- }
-
- /**
- * @see org.apache.tuscany.binding.axis2.assembly.WebServiceBinding#getWSDLPort()
- */
- public Port getWSDLPort() {
- return port;
- }
-
- /**
- * @see org.apache.tuscany.binding.axis2.assembly.WebServiceBinding#setWSDLPort(javax.wsdl.Port)
- */
- public void setWSDLPort(Port value) {
- checkNotFrozen();
- this.port=value;
- }
-
- /**
- * @see org.apache.tuscany.binding.axis2.assembly.WebServiceBinding#getWSDLDefinition()
- */
- public Definition getWSDLDefinition() {
- return definition;
- }
-
- /**
- * @see org.apache.tuscany.binding.axis2.assembly.WebServiceBinding#setWSDLDefinition(javax.wsdl.Definition)
- */
- public void setWSDLDefinition(Definition definition) {
- checkNotFrozen();
- this.definition=definition;
- }
-
- /**
- * @param portURI The portURI to set.
- */
- public void setPortURI(String portURI) {
- this.portURI = portURI;
- }
-
- /**
- * @see org.apache.tuscany.model.assembly.impl.BindingImpl#initialize(org.apache.tuscany.model.assembly.AssemblyModelContext)
- */
- public void initialize(AssemblyModelContext modelContext) {
- if (isInitialized())
- return;
- super.initialize(modelContext);
-
- // Get the WSDL port namespace and name
- if (port==null && portURI!=null) {
- int h=portURI.indexOf('#');
- String portNamespace=portURI.substring(0,h);
- String portName=portURI.substring(h+1);
-
- // Load the WSDL definitions for the given namespace
- List<Definition> definitions=modelContext.getAssemblyLoader().loadDefinitions(portNamespace);
- if (definitions==null)
- throw new IllegalArgumentException("Cannot find WSDL definition for "+portNamespace);
- for (Definition definition: definitions) {
-
- // Find the port with the given name
- for (Service service : (Collection<Service>)definition.getServices().values()) {
- Port port=service.getPort(portName);
- if (port!=null) {
- this.definition=definition;
- this.port=port;
- return;
- }
- }
- }
- throw new IllegalArgumentException("Cannot find WSDL port "+portURI);
- }
- }
-
-}
+/**
+ *
+ * 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.axis2.assembly.impl;
+
+import java.util.Collection;
+import java.util.List;
+
+import javax.wsdl.Definition;
+import javax.wsdl.Port;
+import javax.wsdl.Service;
+
+import org.apache.tuscany.binding.axis2.assembly.WebServiceBinding;
+import org.apache.tuscany.model.assembly.AssemblyModelContext;
+import org.apache.tuscany.model.assembly.impl.BindingImpl;
+
+/**
+ * An implementation of WebServiceBinding.
+ */
+public class WebServiceBindingImpl extends BindingImpl implements WebServiceBinding {
+
+ private Definition definition;
+ private Port port;
+ private String portURI;
+
+ /**
+ * Constructor
+ */
+ protected WebServiceBindingImpl() {
+ }
+
+ /**
+ * @see org.apache.tuscany.binding.axis2.assembly.WebServiceBinding#getWSDLPort()
+ */
+ public Port getWSDLPort() {
+ return port;
+ }
+
+ /**
+ * @see org.apache.tuscany.binding.axis2.assembly.WebServiceBinding#setWSDLPort(javax.wsdl.Port)
+ */
+ public void setWSDLPort(Port value) {
+ checkNotFrozen();
+ this.port=value;
+ }
+
+ /**
+ * @see org.apache.tuscany.binding.axis2.assembly.WebServiceBinding#getWSDLDefinition()
+ */
+ public Definition getWSDLDefinition() {
+ return definition;
+ }
+
+ /**
+ * @see org.apache.tuscany.binding.axis2.assembly.WebServiceBinding#setWSDLDefinition(javax.wsdl.Definition)
+ */
+ public void setWSDLDefinition(Definition definition) {
+ checkNotFrozen();
+ this.definition=definition;
+ }
+
+ /**
+ * @param portURI The portURI to set.
+ */
+ public void setPortURI(String portURI) {
+ this.portURI = portURI;
+ }
+
+ /**
+ * @see org.apache.tuscany.model.assembly.impl.BindingImpl#initialize(org.apache.tuscany.model.assembly.AssemblyModelContext)
+ */
+ public void initialize(AssemblyModelContext modelContext) {
+ if (isInitialized())
+ return;
+ super.initialize(modelContext);
+
+ // Get the WSDL port namespace and name
+ if (port==null && portURI!=null) {
+ int h=portURI.indexOf('#');
+ String portNamespace=portURI.substring(0,h);
+ String portName=portURI.substring(h+1);
+
+ // Load the WSDL definitions for the given namespace
+ List<Definition> definitions=modelContext.getAssemblyLoader().loadDefinitions(portNamespace);
+ if (definitions==null)
+ throw new IllegalArgumentException("Cannot find WSDL definition for "+portNamespace);
+ for (Definition definition: definitions) {
+
+ // Find the port with the given name
+ for (Service service : (Collection<Service>)definition.getServices().values()) {
+ Port port=service.getPort(portName);
+ if (port!=null) {
+ this.definition=definition;
+ this.port=port;
+ return;
+ }
+ }
+ }
+ throw new IllegalArgumentException("Cannot find WSDL port "+portURI);
+ }
+ }
+
+}
Propchange: incubator/tuscany/java/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/assembly/impl/WebServiceBindingImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/assembly/impl/WebServiceBindingImpl.java
------------------------------------------------------------------------------
svn:keywords = Rev,Date
Modified: incubator/tuscany/java/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/builder/ExternalWebServiceConfigurationBuilder.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/builder/ExternalWebServiceConfigurationBuilder.java?rev=383189&r1=383188&r2=383189&view=diff
==============================================================================
--- incubator/tuscany/java/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/builder/ExternalWebServiceConfigurationBuilder.java (original)
+++ incubator/tuscany/java/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/builder/ExternalWebServiceConfigurationBuilder.java Sat Mar 4 11:37:22 2006
@@ -1,153 +1,153 @@
-/**
- *
- * 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.axis2.builder;
-
-import java.lang.reflect.Method;
-import java.util.Collection;
-import java.util.Map;
-import java.util.Set;
-
-import org.apache.tuscany.binding.axis2.assembly.WebServiceBinding;
-import org.apache.tuscany.binding.axis2.config.ExternalWebServiceRuntimeConfiguration;
-import org.apache.tuscany.binding.axis2.handler.ExternalWebServiceClient;
-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.Context;
-import org.apache.tuscany.core.context.QualifiedName;
-import org.apache.tuscany.core.injection.SingletonObjectFactory;
-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.ExternalService;
-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;
-
-import commonj.sdo.helper.TypeHelper;
-
-/**
- * Creates a <code>RuntimeConfigurationBuilder</code> for an external service configured with the {@link WebServiceBinding}
- *
- * @version $Rev$ $Date$
- */
-@Scope("MODULE")
-public class ExternalWebServiceConfigurationBuilder implements RuntimeConfigurationBuilder {
-
- private RuntimeContext runtimeContext;
-
- private ProxyFactoryFactory proxyFactoryFactory;
-
- private MessageFactory messageFactory;
-
- private RuntimeConfigurationBuilder policyBuilder;
-
- public ExternalWebServiceConfigurationBuilder() {
- }
-
- @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, Context context) throws BuilderException {
- if (!(object instanceof ExternalService)) {
- return;
- }
- ExternalService externalService = (ExternalService) object;
- if (externalService.getBindings().size() < 1 || !(externalService.getBindings().get(0) instanceof WebServiceBinding)) {
- return;
- }
-
- WebServiceBinding wsBinding=(WebServiceBinding)externalService.getBindings().get(0);
-
- TypeHelper typeHelper=externalService.getAggregate().getAssemblyModelContext().getTypeHelper();
- ExternalWebServiceClient externalWebServiceClient=new ExternalWebServiceClient(externalService, wsBinding, typeHelper);
- ExternalWebServiceRuntimeConfiguration config = new ExternalWebServiceRuntimeConfiguration(externalService.getName(), new SingletonObjectFactory<ExternalWebServiceClient>(externalWebServiceClient));
-
- ConfiguredService configuredService = externalService.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(externalService.getName() + "/" + service.getName());
- ProxyConfiguration pConfiguration = new ProxyConfiguration(qName, iConfigMap, serviceContract.getInterface().getClassLoader(), 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, context);
- }
- // add tail interceptor
- for (InvocationConfiguration iConfig : (Collection<InvocationConfiguration>) iConfigMap.values()) {
- iConfig.addTargetInterceptor(new InvokerInterceptor());
- }
-
- externalService.getConfiguredService().setRuntimeConfiguration(config);
- }
-
-}
+/**
+ *
+ * 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.axis2.builder;
+
+import java.lang.reflect.Method;
+import java.util.Collection;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.tuscany.binding.axis2.assembly.WebServiceBinding;
+import org.apache.tuscany.binding.axis2.config.ExternalWebServiceRuntimeConfiguration;
+import org.apache.tuscany.binding.axis2.handler.ExternalWebServiceClient;
+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.Context;
+import org.apache.tuscany.core.context.QualifiedName;
+import org.apache.tuscany.core.injection.SingletonObjectFactory;
+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.ExternalService;
+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;
+
+import commonj.sdo.helper.TypeHelper;
+
+/**
+ * Creates a <code>RuntimeConfigurationBuilder</code> for an external service configured with the {@link WebServiceBinding}
+ *
+ * @version $Rev$ $Date$
+ */
+@Scope("MODULE")
+public class ExternalWebServiceConfigurationBuilder implements RuntimeConfigurationBuilder {
+
+ private RuntimeContext runtimeContext;
+
+ private ProxyFactoryFactory proxyFactoryFactory;
+
+ private MessageFactory messageFactory;
+
+ private RuntimeConfigurationBuilder policyBuilder;
+
+ public ExternalWebServiceConfigurationBuilder() {
+ }
+
+ @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, Context context) throws BuilderException {
+ if (!(object instanceof ExternalService)) {
+ return;
+ }
+ ExternalService externalService = (ExternalService) object;
+ if (externalService.getBindings().size() < 1 || !(externalService.getBindings().get(0) instanceof WebServiceBinding)) {
+ return;
+ }
+
+ WebServiceBinding wsBinding=(WebServiceBinding)externalService.getBindings().get(0);
+
+ TypeHelper typeHelper=externalService.getAggregate().getAssemblyModelContext().getTypeHelper();
+ ExternalWebServiceClient externalWebServiceClient=new ExternalWebServiceClient(externalService, wsBinding, typeHelper);
+ ExternalWebServiceRuntimeConfiguration config = new ExternalWebServiceRuntimeConfiguration(externalService.getName(), new SingletonObjectFactory<ExternalWebServiceClient>(externalWebServiceClient));
+
+ ConfiguredService configuredService = externalService.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(externalService.getName() + "/" + service.getName());
+ ProxyConfiguration pConfiguration = new ProxyConfiguration(qName, iConfigMap, serviceContract.getInterface().getClassLoader(), 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, context);
+ }
+ // add tail interceptor
+ for (InvocationConfiguration iConfig : (Collection<InvocationConfiguration>) iConfigMap.values()) {
+ iConfig.addTargetInterceptor(new InvokerInterceptor());
+ }
+
+ externalService.getConfiguredService().setRuntimeConfiguration(config);
+ }
+
+}
Propchange: incubator/tuscany/java/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/builder/ExternalWebServiceConfigurationBuilder.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/builder/ExternalWebServiceConfigurationBuilder.java
------------------------------------------------------------------------------
svn:keywords = Rev,Date
Modified: incubator/tuscany/java/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/builder/ExternalWebServiceWireBuilder.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/builder/ExternalWebServiceWireBuilder.java?rev=383189&r1=383188&r2=383189&view=diff
==============================================================================
--- incubator/tuscany/java/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/builder/ExternalWebServiceWireBuilder.java (original)
+++ incubator/tuscany/java/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/builder/ExternalWebServiceWireBuilder.java Sat Mar 4 11:37:22 2006
@@ -1,61 +1,61 @@
-package org.apache.tuscany.binding.axis2.builder;
-
-import org.apache.tuscany.binding.axis2.config.ExternalWebServiceRuntimeConfiguration;
-import org.apache.tuscany.binding.axis2.handler.ExternalWebServiceTargetInvoker;
-import org.apache.tuscany.core.builder.BuilderConfigException;
-import org.apache.tuscany.core.builder.WireBuilder;
-import org.apache.tuscany.core.context.ScopeContext;
-import org.apache.tuscany.core.invocation.InvocationConfiguration;
-import org.apache.tuscany.core.invocation.spi.ProxyFactory;
-import org.apache.tuscany.core.runtime.RuntimeContext;
-import org.apache.tuscany.core.system.annotation.Autowire;
-import org.osoa.sca.annotations.Init;
-import org.osoa.sca.annotations.Scope;
-
-@Scope("MODULE")
-public class ExternalWebServiceWireBuilder implements WireBuilder {
-
- private RuntimeContext runtimeContext;
-
- /**
- * Constructs a new ExternalWebServiceWireBuilder.
- */
- public ExternalWebServiceWireBuilder() {
- super();
- }
-
- @Autowire
- public void setRuntimeContext(RuntimeContext context) {
- runtimeContext = context;
- }
-
- @Init(eager=true)
- public void init() {
- runtimeContext.addBuilder(this);
- }
-
- public void connect(ProxyFactory sourceFactory, ProxyFactory targetFactory, Class targetType, boolean downScope, ScopeContext targetScopeContext) throws BuilderConfigException {
- if (!(ExternalWebServiceRuntimeConfiguration.class.isAssignableFrom(targetType))) {
- return;
- }
- for (InvocationConfiguration sourceInvocationConfig : sourceFactory.getProxyConfiguration().getInvocationConfigurations().values()) {
-
- ExternalWebServiceTargetInvoker invoker = new ExternalWebServiceTargetInvoker(sourceFactory.getProxyConfiguration().getTargetName(), sourceInvocationConfig.getMethod(), targetScopeContext);
-
- // if (downScope) {
- // // the source scope is shorter than the target, so the invoker can cache the target instance
- // invoker.setCacheable(true);
- // } else {
- // invoker.setCacheable(false);
- // }
- sourceInvocationConfig.setTargetInvoker(invoker);
- }
-
- }
-
- public void completeTargetChain(ProxyFactory targetFactory, Class targetType, ScopeContext targetScopeContext)
- throws BuilderConfigException {
- //TODO implement
- }
-
-}
+package org.apache.tuscany.binding.axis2.builder;
+
+import org.apache.tuscany.binding.axis2.config.ExternalWebServiceRuntimeConfiguration;
+import org.apache.tuscany.binding.axis2.handler.ExternalWebServiceTargetInvoker;
+import org.apache.tuscany.core.builder.BuilderConfigException;
+import org.apache.tuscany.core.builder.WireBuilder;
+import org.apache.tuscany.core.context.ScopeContext;
+import org.apache.tuscany.core.invocation.InvocationConfiguration;
+import org.apache.tuscany.core.invocation.spi.ProxyFactory;
+import org.apache.tuscany.core.runtime.RuntimeContext;
+import org.apache.tuscany.core.system.annotation.Autowire;
+import org.osoa.sca.annotations.Init;
+import org.osoa.sca.annotations.Scope;
+
+@Scope("MODULE")
+public class ExternalWebServiceWireBuilder implements WireBuilder {
+
+ private RuntimeContext runtimeContext;
+
+ /**
+ * Constructs a new ExternalWebServiceWireBuilder.
+ */
+ public ExternalWebServiceWireBuilder() {
+ super();
+ }
+
+ @Autowire
+ public void setRuntimeContext(RuntimeContext context) {
+ runtimeContext = context;
+ }
+
+ @Init(eager=true)
+ public void init() {
+ runtimeContext.addBuilder(this);
+ }
+
+ public void connect(ProxyFactory sourceFactory, ProxyFactory targetFactory, Class targetType, boolean downScope, ScopeContext targetScopeContext) throws BuilderConfigException {
+ if (!(ExternalWebServiceRuntimeConfiguration.class.isAssignableFrom(targetType))) {
+ return;
+ }
+ for (InvocationConfiguration sourceInvocationConfig : sourceFactory.getProxyConfiguration().getInvocationConfigurations().values()) {
+
+ ExternalWebServiceTargetInvoker invoker = new ExternalWebServiceTargetInvoker(sourceFactory.getProxyConfiguration().getTargetName(), sourceInvocationConfig.getMethod(), targetScopeContext);
+
+ // if (downScope) {
+ // // the source scope is shorter than the target, so the invoker can cache the target instance
+ // invoker.setCacheable(true);
+ // } else {
+ // invoker.setCacheable(false);
+ // }
+ sourceInvocationConfig.setTargetInvoker(invoker);
+ }
+
+ }
+
+ public void completeTargetChain(ProxyFactory targetFactory, Class targetType, ScopeContext targetScopeContext)
+ throws BuilderConfigException {
+ //TODO implement
+ }
+
+}
Propchange: incubator/tuscany/java/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/builder/ExternalWebServiceWireBuilder.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/builder/ExternalWebServiceWireBuilder.java
------------------------------------------------------------------------------
svn:keywords = Rev,Date
Modified: incubator/tuscany/java/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/builder/WebServiceEntryPointConfigurationBuilder.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/builder/WebServiceEntryPointConfigurationBuilder.java?rev=383189&r1=383188&r2=383189&view=diff
==============================================================================
--- incubator/tuscany/java/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/builder/WebServiceEntryPointConfigurationBuilder.java (original)
+++ incubator/tuscany/java/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/builder/WebServiceEntryPointConfigurationBuilder.java Sat Mar 4 11:37:22 2006
@@ -1,170 +1,170 @@
-/**
- *
- * 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.axis2.builder;
-
-import java.lang.reflect.Method;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Set;
-
-import org.apache.tuscany.binding.axis2.assembly.WebServiceBinding;
-import org.apache.tuscany.binding.axis2.config.WebServiceEntryPointRuntimeConfiguration;
-import org.apache.tuscany.core.builder.BuilderException;
-import org.apache.tuscany.core.builder.RuntimeConfigurationBuilder;
-import org.apache.tuscany.core.builder.impl.EntryPointRuntimeConfiguration;
-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.Interceptor;
-import org.apache.tuscany.core.invocation.InvocationConfiguration;
-import org.apache.tuscany.core.invocation.InvocationRuntimeException;
-import org.apache.tuscany.core.invocation.ProxyConfiguration;
-import org.apache.tuscany.core.invocation.TargetInvoker;
-import org.apache.tuscany.core.invocation.spi.ProxyFactory;
-import org.apache.tuscany.core.invocation.spi.ProxyFactoryFactory;
-import org.apache.tuscany.core.message.Message;
-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;
- }
-
- EntryPointRuntimeConfiguration config = new WebServiceEntryPointRuntimeConfiguration(entryPoint.getName(), entryPoint.getConfiguredService().getService().getName(), messageFactory);
-
- ConfiguredService configuredService = entryPoint.getConfiguredService();
- Service service = configuredService.getService();
- ServiceContract serviceContract = service.getServiceContract();
- Map<Method, InvocationConfiguration> iConfigMap = new HashMap();
- 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.getConfiguredReference().getTargetConfiguredServices().get(0).getAggregatePart().getName() + "/" + service.getName());
- ProxyConfiguration pConfiguration = new ProxyConfiguration(qName, iConfigMap, serviceContract.getInterface().getClassLoader(), messageFactory);
- proxyFactory.setBusinessInterface(serviceContract.getInterface());
- proxyFactory.setProxyConfiguration(pConfiguration);
- config.addSourceProxyFactory(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 EntryPointInvokerInterceptor());
- }
- entryPoint.getConfiguredReference().setRuntimeConfiguration(config);
- }
-
- //FIXME same as the InvokerInterceptor except that it doesn't throw an exception in setNext
- // For some reason another InvokerInterceptor is added after this one, need Jim to look into it
- // and figure out why.
- public class EntryPointInvokerInterceptor implements Interceptor {
-
- public EntryPointInvokerInterceptor() {
- }
-
- public Message invoke(Message msg) throws InvocationRuntimeException {
- TargetInvoker invoker = msg.getTargetInvoker();
- if (invoker == null) {
- throw new InvocationRuntimeException("No target invoker specified on message");
- }
- return invoker.invoke(msg);
- }
-
- public void setNext(Interceptor next) {
- }
-
- }
-
-
-}
+/**
+ *
+ * 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.axis2.builder;
+
+import java.lang.reflect.Method;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.tuscany.binding.axis2.assembly.WebServiceBinding;
+import org.apache.tuscany.binding.axis2.config.WebServiceEntryPointRuntimeConfiguration;
+import org.apache.tuscany.core.builder.BuilderException;
+import org.apache.tuscany.core.builder.RuntimeConfigurationBuilder;
+import org.apache.tuscany.core.builder.impl.EntryPointRuntimeConfiguration;
+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.Interceptor;
+import org.apache.tuscany.core.invocation.InvocationConfiguration;
+import org.apache.tuscany.core.invocation.InvocationRuntimeException;
+import org.apache.tuscany.core.invocation.ProxyConfiguration;
+import org.apache.tuscany.core.invocation.TargetInvoker;
+import org.apache.tuscany.core.invocation.spi.ProxyFactory;
+import org.apache.tuscany.core.invocation.spi.ProxyFactoryFactory;
+import org.apache.tuscany.core.message.Message;
+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;
+ }
+
+ EntryPointRuntimeConfiguration config = new WebServiceEntryPointRuntimeConfiguration(entryPoint.getName(), entryPoint.getConfiguredService().getService().getName(), messageFactory);
+
+ ConfiguredService configuredService = entryPoint.getConfiguredService();
+ Service service = configuredService.getService();
+ ServiceContract serviceContract = service.getServiceContract();
+ Map<Method, InvocationConfiguration> iConfigMap = new HashMap();
+ 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.getConfiguredReference().getTargetConfiguredServices().get(0).getAggregatePart().getName() + "/" + service.getName());
+ ProxyConfiguration pConfiguration = new ProxyConfiguration(qName, iConfigMap, serviceContract.getInterface().getClassLoader(), messageFactory);
+ proxyFactory.setBusinessInterface(serviceContract.getInterface());
+ proxyFactory.setProxyConfiguration(pConfiguration);
+ config.addSourceProxyFactory(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 EntryPointInvokerInterceptor());
+ }
+ entryPoint.getConfiguredReference().setRuntimeConfiguration(config);
+ }
+
+ //FIXME same as the InvokerInterceptor except that it doesn't throw an exception in setNext
+ // For some reason another InvokerInterceptor is added after this one, need Jim to look into it
+ // and figure out why.
+ public class EntryPointInvokerInterceptor implements Interceptor {
+
+ public EntryPointInvokerInterceptor() {
+ }
+
+ public Message invoke(Message msg) throws InvocationRuntimeException {
+ TargetInvoker invoker = msg.getTargetInvoker();
+ if (invoker == null) {
+ throw new InvocationRuntimeException("No target invoker specified on message");
+ }
+ return invoker.invoke(msg);
+ }
+
+ public void setNext(Interceptor next) {
+ }
+
+ }
+
+
+}
Propchange: incubator/tuscany/java/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/builder/WebServiceEntryPointConfigurationBuilder.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/builder/WebServiceEntryPointConfigurationBuilder.java
------------------------------------------------------------------------------
svn:keywords = Rev,Date
Modified: incubator/tuscany/java/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/config/ExternalWebServiceRuntimeConfiguration.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/config/ExternalWebServiceRuntimeConfiguration.java?rev=383189&r1=383188&r2=383189&view=diff
==============================================================================
--- incubator/tuscany/java/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/config/ExternalWebServiceRuntimeConfiguration.java (original)
+++ incubator/tuscany/java/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/config/ExternalWebServiceRuntimeConfiguration.java Sat Mar 4 11:37:22 2006
@@ -1,32 +1,32 @@
-/**
- *
- * 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.axis2.config;
-
-import org.apache.tuscany.core.builder.ObjectFactory;
-import org.apache.tuscany.core.builder.impl.BaseExternalServiceRuntimeConfiguration;
-
-/**
- * Creates instances of {@link org.apache.tuscany.core.context.ExternalServiceContext} configured with the appropriate
- * invocation chains and bindings. This implementation serves as a marker for
- * {@link org.apache.tuscany.binding.axis2.builder.ExternalWebServiceWireBuilder}
- *
- * @version $Rev$ $Date$
- */
-public class ExternalWebServiceRuntimeConfiguration extends BaseExternalServiceRuntimeConfiguration {
-
- public ExternalWebServiceRuntimeConfiguration(String name, ObjectFactory objectFactory) {
- super(name, objectFactory);
- }
-
-}
+/**
+ *
+ * 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.axis2.config;
+
+import org.apache.tuscany.core.builder.ObjectFactory;
+import org.apache.tuscany.core.builder.impl.BaseExternalServiceRuntimeConfiguration;
+
+/**
+ * Creates instances of {@link org.apache.tuscany.core.context.ExternalServiceContext} configured with the appropriate
+ * invocation chains and bindings. This implementation serves as a marker for
+ * {@link org.apache.tuscany.binding.axis2.builder.ExternalWebServiceWireBuilder}
+ *
+ * @version $Rev$ $Date$
+ */
+public class ExternalWebServiceRuntimeConfiguration extends BaseExternalServiceRuntimeConfiguration {
+
+ public ExternalWebServiceRuntimeConfiguration(String name, ObjectFactory objectFactory) {
+ super(name, objectFactory);
+ }
+
+}
Propchange: incubator/tuscany/java/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/config/ExternalWebServiceRuntimeConfiguration.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/config/ExternalWebServiceRuntimeConfiguration.java
------------------------------------------------------------------------------
svn:keywords = Rev,Date
Modified: incubator/tuscany/java/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/config/WebServiceEntryPointRuntimeConfiguration.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/config/WebServiceEntryPointRuntimeConfiguration.java?rev=383189&r1=383188&r2=383189&view=diff
==============================================================================
--- incubator/tuscany/java/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/config/WebServiceEntryPointRuntimeConfiguration.java (original)
+++ incubator/tuscany/java/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/config/WebServiceEntryPointRuntimeConfiguration.java Sat Mar 4 11:37:22 2006
@@ -1,32 +1,32 @@
-/**
- *
- * 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.axis2.config;
-
-import org.apache.tuscany.core.builder.impl.EntryPointRuntimeConfiguration;
-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.axis2.builder.WebServiceEntryPointWireBuilder}
- *
- * @version $Rev$ $Date$
- */
-public class WebServiceEntryPointRuntimeConfiguration extends EntryPointRuntimeConfiguration {
-
- public WebServiceEntryPointRuntimeConfiguration(String name, String serviceName, MessageFactory messageFactory) {
- super(name, serviceName, messageFactory);
- }
-
-}
+/**
+ *
+ * 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.axis2.config;
+
+import org.apache.tuscany.core.builder.impl.EntryPointRuntimeConfiguration;
+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.axis2.builder.WebServiceEntryPointWireBuilder}
+ *
+ * @version $Rev$ $Date$
+ */
+public class WebServiceEntryPointRuntimeConfiguration extends EntryPointRuntimeConfiguration {
+
+ public WebServiceEntryPointRuntimeConfiguration(String name, String serviceName, MessageFactory messageFactory) {
+ super(name, serviceName, messageFactory);
+ }
+
+}
Propchange: incubator/tuscany/java/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/config/WebServiceEntryPointRuntimeConfiguration.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/config/WebServiceEntryPointRuntimeConfiguration.java
------------------------------------------------------------------------------
svn:keywords = Rev,Date
Modified: incubator/tuscany/java/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/handler/ExternalWebServiceClient.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/handler/ExternalWebServiceClient.java?rev=383189&r1=383188&r2=383189&view=diff
==============================================================================
--- incubator/tuscany/java/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/handler/ExternalWebServiceClient.java (original)
+++ incubator/tuscany/java/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/handler/ExternalWebServiceClient.java Sat Mar 4 11:37:22 2006
@@ -1,143 +1,143 @@
-/**
- *
- * 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.axis2.handler;
-
-import java.lang.reflect.Method;
-
-import javax.xml.namespace.QName;
-import javax.xml.parsers.FactoryConfigurationError;
-
-import org.apache.axis2.AxisFault;
-import org.apache.axis2.Constants;
-import org.apache.axis2.addressing.EndpointReference;
-import org.apache.axis2.client.Options;
-import org.apache.axis2.client.ServiceClient;
-import org.apache.axis2.context.MessageContextConstants;
-import org.apache.axis2.om.OMElement;
-import org.apache.tuscany.binding.axis2.assembly.WebServiceBinding;
-import org.apache.tuscany.binding.axis2.util.AxiomHelper;
-import org.apache.tuscany.model.assembly.ExternalService;
-import org.osoa.sca.ServiceRuntimeException;
-
-import commonj.sdo.helper.TypeHelper;
-
-/**
- * An ExternalWebServiceClient using Axis2
- */
-public class ExternalWebServiceClient {
-
- private ExternalService externalService;
- private TypeHelper typeHelper;
- private WebServicePortMetaData wsPortMetaData;
-
- /**
- * Constructs a new ExternalWebServiceClient.
- *
- * @param externalService
- * @param wsBinding
- */
- public ExternalWebServiceClient(ExternalService externalService, WebServiceBinding wsBinding, TypeHelper typeHelper) {
- this.externalService = externalService;
- this.typeHelper=typeHelper;
- this.wsPortMetaData = new WebServicePortMetaData(wsBinding.getWSDLDefinition(), wsBinding.getWSDLPort(), wsBinding.getURI(), false);
- }
-
- /**
- * Invoke an operation on the external Web service.
- *
- * @param method
- * @param args
- * @return
- */
- public Object invoke(Method method, Object[] args) {
-
- ServiceClient serviceClient;
- ClassLoader ccl=Thread.currentThread().getContextClassLoader();
- try {
- Thread.currentThread().setContextClassLoader(ExternalWebServiceClient.class.getClassLoader());
-
- serviceClient = createServiceClient(method);
-
- } finally {
- Thread.currentThread().setContextClassLoader(ccl);
- }
-
- String typeName = method.getName();
- String typeNS = wsPortMetaData.getPortType().getQName().getNamespaceURI();
-
- OMElement requestOM = AxiomHelper.toOMElement(typeHelper, args, new QName(typeNS, typeName));
-
- OMElement responseOM;
- ccl=Thread.currentThread().getContextClassLoader();
- try {
- Thread.currentThread().setContextClassLoader(ExternalWebServiceClient.class.getClassLoader());
-
- responseOM = serviceClient.sendReceive(requestOM);
-
- } catch (AxisFault e) {
- throw new ServiceRuntimeException(e);
- } finally {
- Thread.currentThread().setContextClassLoader(ccl);
- }
-
- Object[] os = AxiomHelper.toObjects(typeHelper, responseOM);
- Object response;
- if (os == null || os.length < 1) {
- response = null;
- } else {
- response = os[0];
- }
-
- return response;
- }
-
- private ServiceClient createServiceClient(Method method) throws FactoryConfigurationError {
-
- /*
- * TODO: Simlistic impl for now, needs to be redone. Should cache our ConfigurationContext and pass in on ServiceClient constructor, should
- * probably use WSDL configured Axis2 OperationClient
- */
-
- Options options = new Options();
-
- options.setProperty(Constants.Configuration.DISABLE_ADDRESSING_FOR_OUT_MESSAGES, Boolean.TRUE);
-
- WebServiceOperationMetaData operationMetaData = wsPortMetaData.getOperationMetaData(method.getName());
-
- EndpointReference targetEPR = new EndpointReference(wsPortMetaData.getEndpoint());
- options.setTo(targetEPR);
-
- String soapAction = operationMetaData.getSOAPAction();
- if (soapAction != null) {
- options.setSoapAction(soapAction);
- }
-
- // If use is encoded assume its an old style service and wont understand chunking
- if ("encoded".equals(operationMetaData.getUse())) {
- options.setProperty(MessageContextConstants.CHUNKED, Boolean.FALSE);
- }
-
- ServiceClient serviceClient;
- try {
- serviceClient = new ServiceClient();
- } catch (org.apache.axis2.AxisFault e) {
- throw new RuntimeException(e);
- }
-
- serviceClient.setOptions(options);
-
- return serviceClient;
- }
-
-}
+/**
+ *
+ * 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.axis2.handler;
+
+import java.lang.reflect.Method;
+
+import javax.xml.namespace.QName;
+import javax.xml.parsers.FactoryConfigurationError;
+
+import org.apache.axis2.AxisFault;
+import org.apache.axis2.Constants;
+import org.apache.axis2.addressing.EndpointReference;
+import org.apache.axis2.client.Options;
+import org.apache.axis2.client.ServiceClient;
+import org.apache.axis2.context.MessageContextConstants;
+import org.apache.axis2.om.OMElement;
+import org.apache.tuscany.binding.axis2.assembly.WebServiceBinding;
+import org.apache.tuscany.binding.axis2.util.AxiomHelper;
+import org.apache.tuscany.model.assembly.ExternalService;
+import org.osoa.sca.ServiceRuntimeException;
+
+import commonj.sdo.helper.TypeHelper;
+
+/**
+ * An ExternalWebServiceClient using Axis2
+ */
+public class ExternalWebServiceClient {
+
+ private ExternalService externalService;
+ private TypeHelper typeHelper;
+ private WebServicePortMetaData wsPortMetaData;
+
+ /**
+ * Constructs a new ExternalWebServiceClient.
+ *
+ * @param externalService
+ * @param wsBinding
+ */
+ public ExternalWebServiceClient(ExternalService externalService, WebServiceBinding wsBinding, TypeHelper typeHelper) {
+ this.externalService = externalService;
+ this.typeHelper=typeHelper;
+ this.wsPortMetaData = new WebServicePortMetaData(wsBinding.getWSDLDefinition(), wsBinding.getWSDLPort(), wsBinding.getURI(), false);
+ }
+
+ /**
+ * Invoke an operation on the external Web service.
+ *
+ * @param method
+ * @param args
+ * @return
+ */
+ public Object invoke(Method method, Object[] args) {
+
+ ServiceClient serviceClient;
+ ClassLoader ccl=Thread.currentThread().getContextClassLoader();
+ try {
+ Thread.currentThread().setContextClassLoader(ExternalWebServiceClient.class.getClassLoader());
+
+ serviceClient = createServiceClient(method);
+
+ } finally {
+ Thread.currentThread().setContextClassLoader(ccl);
+ }
+
+ String typeName = method.getName();
+ String typeNS = wsPortMetaData.getPortType().getQName().getNamespaceURI();
+
+ OMElement requestOM = AxiomHelper.toOMElement(typeHelper, args, new QName(typeNS, typeName));
+
+ OMElement responseOM;
+ ccl=Thread.currentThread().getContextClassLoader();
+ try {
+ Thread.currentThread().setContextClassLoader(ExternalWebServiceClient.class.getClassLoader());
+
+ responseOM = serviceClient.sendReceive(requestOM);
+
+ } catch (AxisFault e) {
+ throw new ServiceRuntimeException(e);
+ } finally {
+ Thread.currentThread().setContextClassLoader(ccl);
+ }
+
+ Object[] os = AxiomHelper.toObjects(typeHelper, responseOM);
+ Object response;
+ if (os == null || os.length < 1) {
+ response = null;
+ } else {
+ response = os[0];
+ }
+
+ return response;
+ }
+
+ private ServiceClient createServiceClient(Method method) throws FactoryConfigurationError {
+
+ /*
+ * TODO: Simlistic impl for now, needs to be redone. Should cache our ConfigurationContext and pass in on ServiceClient constructor, should
+ * probably use WSDL configured Axis2 OperationClient
+ */
+
+ Options options = new Options();
+
+ options.setProperty(Constants.Configuration.DISABLE_ADDRESSING_FOR_OUT_MESSAGES, Boolean.TRUE);
+
+ WebServiceOperationMetaData operationMetaData = wsPortMetaData.getOperationMetaData(method.getName());
+
+ EndpointReference targetEPR = new EndpointReference(wsPortMetaData.getEndpoint());
+ options.setTo(targetEPR);
+
+ String soapAction = operationMetaData.getSOAPAction();
+ if (soapAction != null) {
+ options.setSoapAction(soapAction);
+ }
+
+ // If use is encoded assume its an old style service and wont understand chunking
+ if ("encoded".equals(operationMetaData.getUse())) {
+ options.setProperty(MessageContextConstants.CHUNKED, Boolean.FALSE);
+ }
+
+ ServiceClient serviceClient;
+ try {
+ serviceClient = new ServiceClient();
+ } catch (org.apache.axis2.AxisFault e) {
+ throw new RuntimeException(e);
+ }
+
+ serviceClient.setOptions(options);
+
+ return serviceClient;
+ }
+
+}
Propchange: incubator/tuscany/java/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/handler/ExternalWebServiceClient.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/sca/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/handler/ExternalWebServiceClient.java
------------------------------------------------------------------------------
svn:keywords = Rev,Date