You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by rf...@apache.org on 2009/10/27 00:45:08 UTC
svn commit: r830026 [3/6] - in /tuscany/branches/sca-java-1.x: ./
demos/alert-aggregator-webapp/ distribution/bundle/ distribution/manifest/
distribution/src/main/assembly/ distribution/src/main/release/
distribution/src/main/release/bin/ distribution/...
Modified: tuscany/branches/sca-java-1.x/modules/binding-jsonrpc-js/NOTICE
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.x/modules/binding-jsonrpc-js/NOTICE?rev=830026&r1=830025&r2=830026&view=diff
==============================================================================
--- tuscany/branches/sca-java-1.x/modules/binding-jsonrpc-js/NOTICE (original)
+++ tuscany/branches/sca-java-1.x/modules/binding-jsonrpc-js/NOTICE Mon Oct 26 23:44:59 2009
@@ -4,6 +4,3 @@
This product includes software developed by
The Apache Software Foundation (http://www.apache.org/).
-This product includes/uses JSON-RPC JavaScript client (jsonrpc.js)
- Copyright (c) 2003-2004 Jan-Klaas Kollhof
- Copyright (c) 2005 Michael Clark, Metaparadigm Pte Ltd
Modified: tuscany/branches/sca-java-1.x/modules/binding-jsonrpc-runtime/NOTICE
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.x/modules/binding-jsonrpc-runtime/NOTICE?rev=830026&r1=830025&r2=830026&view=diff
==============================================================================
--- tuscany/branches/sca-java-1.x/modules/binding-jsonrpc-runtime/NOTICE (original)
+++ tuscany/branches/sca-java-1.x/modules/binding-jsonrpc-runtime/NOTICE Mon Oct 26 23:44:59 2009
@@ -4,7 +4,3 @@
This product includes software developed by
The Apache Software Foundation (http://www.apache.org/).
-This product includes/uses JSON-RPC JavaScript client (jsonrpc.js)
- Copyright (c) 2003-2004 Jan-Klaas Kollhof
- Copyright (c) 2005 Michael Clark, Metaparadigm Pte Ltd
-
Added: tuscany/branches/sca-java-1.x/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/pojo/Data.java
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.x/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/pojo/Data.java?rev=830026&view=auto
==============================================================================
--- tuscany/branches/sca-java-1.x/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/pojo/Data.java (added)
+++ tuscany/branches/sca-java-1.x/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/pojo/Data.java Mon Oct 26 23:44:59 2009
@@ -0,0 +1,53 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sca.binding.ws.axis2.itests.pojo;
+
+//import java.io.Serializable;
+
+public class Data {
+
+ private Data2[] a = null;
+ private int b = 0;
+ private float c = 0.0f;
+
+ public Data2[] getA() {
+ return this.a;
+ }
+
+ public void setA(Data2[] a) {
+ this.a = a;
+ }
+
+ public int getB() {
+ return this.b;
+ }
+
+ public void setB(int b) {
+ this.b = b;
+ }
+
+ public float getC() {
+ return this.c;
+ }
+
+ public void setC(float c) {
+ this.c = c;
+ }
+
+}
Propchange: tuscany/branches/sca-java-1.x/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/pojo/Data.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: tuscany/branches/sca-java-1.x/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/pojo/Data.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: tuscany/branches/sca-java-1.x/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/pojo/Data2.java
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.x/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/pojo/Data2.java?rev=830026&view=auto
==============================================================================
--- tuscany/branches/sca-java-1.x/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/pojo/Data2.java (added)
+++ tuscany/branches/sca-java-1.x/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/pojo/Data2.java Mon Oct 26 23:44:59 2009
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.binding.ws.axis2.itests.pojo;
+
+public class Data2 {
+
+ private String[] asdf = null;
+
+ public String[] getAsdf() {
+ return this.asdf;
+ }
+
+ public void setAsdf(String[] asdf) {
+ this.asdf = asdf;
+ }
+
+
+}
Propchange: tuscany/branches/sca-java-1.x/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/pojo/Data2.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: tuscany/branches/sca-java-1.x/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/pojo/Data2.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: tuscany/branches/sca-java-1.x/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/pojo/POJOWSTestCase.java
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.x/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/pojo/POJOWSTestCase.java?rev=830026&view=auto
==============================================================================
--- tuscany/branches/sca-java-1.x/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/pojo/POJOWSTestCase.java (added)
+++ tuscany/branches/sca-java-1.x/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/pojo/POJOWSTestCase.java Mon Oct 26 23:44:59 2009
@@ -0,0 +1,48 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sca.binding.ws.axis2.itests.pojo;
+
+import org.apache.tuscany.sca.node.SCAContribution;
+import org.apache.tuscany.sca.node.SCANode;
+import org.apache.tuscany.sca.node.SCANodeFactory;
+import org.junit.Test;
+
+public class POJOWSTestCase {
+
+ @Test
+ public void testWS() throws Exception {
+
+ SCAContribution contrib = new SCAContribution("c1", "target/test-classes");
+ SCANode node = SCANodeFactory.newInstance().createSCANode("org/apache/tuscany/sca/binding/ws/axis2/itests/pojo/test.composite", contrib);
+ node.start();
+
+// try {
+// System.out.println("Test server started (press enter to shutdown)");
+// System.in.read();
+// }
+// catch (IOException e) {
+// System.err.println(e);
+// e.printStackTrace();
+// }
+
+ node.stop();
+ System.out.println("Test server stopped");
+ }
+
+}
Propchange: tuscany/branches/sca-java-1.x/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/pojo/POJOWSTestCase.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: tuscany/branches/sca-java-1.x/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/pojo/POJOWSTestCase.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: tuscany/branches/sca-java-1.x/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/pojo/TestService.java
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.x/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/pojo/TestService.java?rev=830026&view=auto
==============================================================================
--- tuscany/branches/sca-java-1.x/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/pojo/TestService.java (added)
+++ tuscany/branches/sca-java-1.x/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/pojo/TestService.java Mon Oct 26 23:44:59 2009
@@ -0,0 +1,29 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sca.binding.ws.axis2.itests.pojo;
+
+import org.osoa.sca.annotations.Remotable;
+
+
+@Remotable
+public interface TestService {
+
+ public boolean printData(Data data);
+
+}
Propchange: tuscany/branches/sca-java-1.x/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/pojo/TestService.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: tuscany/branches/sca-java-1.x/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/pojo/TestService.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: tuscany/branches/sca-java-1.x/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/pojo/TestServiceImpl.java
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.x/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/pojo/TestServiceImpl.java?rev=830026&view=auto
==============================================================================
--- tuscany/branches/sca-java-1.x/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/pojo/TestServiceImpl.java (added)
+++ tuscany/branches/sca-java-1.x/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/pojo/TestServiceImpl.java Mon Oct 26 23:44:59 2009
@@ -0,0 +1,59 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sca.binding.ws.axis2.itests.pojo;
+
+import java.util.Arrays;
+
+import org.osoa.sca.annotations.Service;
+
+@Service(TestService.class)
+public class TestServiceImpl implements TestService {
+
+ public boolean printData(Data data) {
+ if (data == null) {
+ System.out.println("data is null");
+ return false;
+ }
+
+ StringBuilder sb = new StringBuilder(256);
+ sb.append("Data:\n");
+ Data2[] a = data.getA();
+ if (a != null) {
+ for (int i = 0; i < a.length; i++) {
+ sb.append(" a[");
+ sb.append(i);
+ sb.append("] = ");
+ sb.append(Arrays.asList(a[i].getAsdf()));
+ sb.append("\n");
+ }
+ } else {
+ sb.append(" a = null");
+ }
+ sb.append("\n b = ");
+ sb.append(data.getB());
+ sb.append("\n c = ");
+ sb.append(data.getC());
+ sb.append("\n");
+
+ System.out.println(sb.toString());
+
+ return true;
+ }
+
+}
Propchange: tuscany/branches/sca-java-1.x/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/pojo/TestServiceImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: tuscany/branches/sca-java-1.x/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/pojo/TestServiceImpl.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: tuscany/branches/sca-java-1.x/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/pojo/package-info.java
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.x/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/pojo/package-info.java?rev=830026&view=auto
==============================================================================
--- tuscany/branches/sca-java-1.x/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/pojo/package-info.java (added)
+++ tuscany/branches/sca-java-1.x/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/pojo/package-info.java Mon Oct 26 23:44:59 2009
@@ -0,0 +1,21 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+// @javax.xml.bind.annotation.XmlSchema(namespace="http://test/server")
+package org.apache.tuscany.sca.binding.ws.axis2.itests.pojo;
+
Propchange: tuscany/branches/sca-java-1.x/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/pojo/package-info.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: tuscany/branches/sca-java-1.x/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/pojo/package-info.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: tuscany/branches/sca-java-1.x/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/pojo/test.composite
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.x/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/pojo/test.composite?rev=830026&view=auto
==============================================================================
--- tuscany/branches/sca-java-1.x/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/pojo/test.composite (added)
+++ tuscany/branches/sca-java-1.x/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/pojo/test.composite Mon Oct 26 23:44:59 2009
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
+ targetNamespace="http://test"
+ xmlns:hw="http://helloworld"
+ name="test">
+ <component name="TestServiceComponent">
+ <implementation.java class="org.apache.tuscany.sca.binding.ws.axis2.itests.pojo.TestServiceImpl" />
+ <service name="TestService">
+ <interface.java interface="org.apache.tuscany.sca.binding.ws.axis2.itests.pojo.TestService" />
+ <binding.ws uri="http://localhost:8085/testService"/>
+ </service>
+ </component>
+</composite>
+
Propchange: tuscany/branches/sca-java-1.x/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/pojo/test.composite
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: tuscany/branches/sca-java-1.x/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/pojo/test.composite
------------------------------------------------------------------------------
svn:keywords = Rev Date
Modified: tuscany/branches/sca-java-1.x/modules/contribution-java/src/main/java/org/apache/tuscany/sca/contribution/java/impl/ClassLoaderModelResolver.java
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.x/modules/contribution-java/src/main/java/org/apache/tuscany/sca/contribution/java/impl/ClassLoaderModelResolver.java?rev=830026&r1=830025&r2=830026&view=diff
==============================================================================
--- tuscany/branches/sca-java-1.x/modules/contribution-java/src/main/java/org/apache/tuscany/sca/contribution/java/impl/ClassLoaderModelResolver.java (original)
+++ tuscany/branches/sca-java-1.x/modules/contribution-java/src/main/java/org/apache/tuscany/sca/contribution/java/impl/ClassLoaderModelResolver.java Mon Oct 26 23:44:59 2009
@@ -6,25 +6,22 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
- * under the License.
+ * under the License.
*/
package org.apache.tuscany.sca.contribution.java.impl;
import java.io.IOException;
-import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLClassLoader;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Enumeration;
@@ -49,12 +46,12 @@
public class ClassLoaderModelResolver extends URLClassLoader implements ModelResolver {
private Contribution contribution;
private Map<String, ModelResolver> importResolvers = new HashMap<String, ModelResolver>();
-
+
private static ClassLoader parentClassLoader() {
- ClassLoader parentClassLoader = ServiceDiscovery.getInstance().getServiceDiscoverer().getClass().getClassLoader();
+ ClassLoader parentClassLoader = ServiceDiscovery.class.getClassLoader();
return parentClassLoader;
}
-
+
private static URL[] getContributionURLs(final Contribution contribution) throws IOException {
List<URL> urls = new ArrayList<URL>();
urls.add(new URL(contribution.getLocation()));
@@ -65,7 +62,7 @@
public ClassLoaderModelResolver(final Contribution contribution, ModelFactoryExtensionPoint modelFactories) throws IOException {
super(getContributionURLs(contribution), parentClassLoader());
this.contribution = contribution;
-
+
// Index Java import resolvers by package name
Map<String, List<ModelResolver>> resolverMap = new HashMap<String, List<ModelResolver>>();
for (Import import_: this.contribution.getImports()) {
@@ -79,7 +76,7 @@
resolvers.add(javaImport.getModelResolver());
}
}
-
+
// Create a delegating model resolver for each imported package
for (Map.Entry<String, List<ModelResolver>> entry: resolverMap.entrySet()) {
importResolvers.put(entry.getKey(), new DefaultDelegatingModelResolver(entry.getValue()));
@@ -98,38 +95,38 @@
if (!(unresolved instanceof ClassReference)) {
return unresolved;
}
-
+
try {
-
+
// Load the class and return a class reference for it
String className = ((ClassReference)unresolved).getClassName();
Class<?> clazz = Class.forName(className, true, this);
return modelClass.cast(new ClassReference(clazz));
-
+
} catch (ClassNotFoundException e) {
return unresolved;
} catch (NoClassDefFoundError e) {
return unresolved;
}
}
-
+
@Override
public URL findResource(String name) {
-
+
//TODO delegate to the Java import resolvers
-
+
URL url = super.findResource(name);
return url;
}
@Override
public Enumeration<URL> findResources(String name) throws IOException {
-
+
//TODO delegate to the Java import resolvers
//Enumeration<URL> importedResources;
-
+
Enumeration<URL> resources = super.findResources(name);
- List<URL> allResources = new ArrayList<URL>();
+ List<URL> allResources = new ArrayList<URL>();
//for (; importedResources.hasMoreElements(); ) {
// allResources.add(importedResources.nextElement());
//}
@@ -138,10 +135,10 @@
}
return Collections.enumeration(allResources);
}
-
+
@Override
protected Class<?> findClass(String name) throws ClassNotFoundException {
-
+
// Extract the package name
int d = name.lastIndexOf('.');
String packageName;
@@ -150,7 +147,7 @@
} else {
packageName = null;
}
-
+
// First try to load the class using the Java import resolvers
ModelResolver importResolver = importResolvers.get(packageName);
if (importResolver != null) {
@@ -164,5 +161,5 @@
Class<?> clazz = super.findClass(name);
return clazz;
}
-
+
}
Modified: tuscany/branches/sca-java-1.x/modules/contribution-jee-impl/pom.xml
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.x/modules/contribution-jee-impl/pom.xml?rev=830026&r1=830025&r2=830026&view=diff
==============================================================================
--- tuscany/branches/sca-java-1.x/modules/contribution-jee-impl/pom.xml (original)
+++ tuscany/branches/sca-java-1.x/modules/contribution-jee-impl/pom.xml Mon Oct 26 23:44:59 2009
@@ -63,19 +63,35 @@
<version>1.6-SNAPSHOT</version>
</dependency>
+ <!-- TUSCANY-3165 Waiting for 3.0.2 to be released so
+ reverting to 3.0.1 for now. JEE itest will no work on
+ windows due to this
<dependency>
<groupId>org.apache.openejb</groupId>
<artifactId>openejb-core</artifactId>
- <version>3.0.1</version>
+ <version>3.0.2-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.openejb</groupId>
<artifactId>openejb-jee</artifactId>
+ <version>3.0.2-SNAPSHOT</version>
+ </dependency>
+ -->
+
+ <dependency>
+ <groupId>org.apache.openejb</groupId>
+ <artifactId>openejb-core</artifactId>
<version>3.0.1</version>
</dependency>
<dependency>
+ <groupId>org.apache.openejb</groupId>
+ <artifactId>openejb-jee</artifactId>
+ <version>3.0.1</version>
+ </dependency>
+
+ <dependency>
<groupId>org.codehaus.woodstox</groupId>
<artifactId>wstx-asl</artifactId>
<version>3.2.4</version>
Modified: tuscany/branches/sca-java-1.x/modules/core-databinding/src/main/java/org/apache/tuscany/sca/core/databinding/module/DataBindingModuleActivator.java
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.x/modules/core-databinding/src/main/java/org/apache/tuscany/sca/core/databinding/module/DataBindingModuleActivator.java?rev=830026&r1=830025&r2=830026&view=diff
==============================================================================
--- tuscany/branches/sca-java-1.x/modules/core-databinding/src/main/java/org/apache/tuscany/sca/core/databinding/module/DataBindingModuleActivator.java (original)
+++ tuscany/branches/sca-java-1.x/modules/core-databinding/src/main/java/org/apache/tuscany/sca/core/databinding/module/DataBindingModuleActivator.java Mon Oct 26 23:44:59 2009
@@ -43,7 +43,6 @@
import org.apache.tuscany.sca.databinding.jaxb.XMLAdapterExtensionPoint;
import org.apache.tuscany.sca.interfacedef.FaultExceptionMapper;
import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceFactory;
-import org.apache.tuscany.sca.interfacedef.java.jaxws.JAXWSFaultExceptionMapper;
import org.apache.tuscany.sca.interfacedef.java.jaxws.JAXWSJavaInterfaceProcessor;
import org.apache.tuscany.sca.interfacedef.java.jaxws.WebServiceInterfaceProcessor;
import org.apache.tuscany.sca.runtime.RuntimeWireProcessorExtensionPoint;
@@ -61,9 +60,8 @@
XMLAdapterExtensionPoint xmlAdapterExtensionPoint = registry.getExtensionPoint(XMLAdapterExtensionPoint.class);
xmlAdapterExtensionPoint.addAdapter(CallableReference.class, CallableReferenceXMLAdapter.class);
xmlAdapterExtensionPoint.addAdapter(OMElement.class, OMElementXMLAdapter.class);
- FaultExceptionMapper faultExceptionMapper = new JAXWSFaultExceptionMapper(dataBindings, xmlAdapterExtensionPoint);
- registry.getExtensionPoint(UtilityExtensionPoint.class).addUtility(faultExceptionMapper);
-
+ FaultExceptionMapper faultExceptionMapper = registry.getExtensionPoint(UtilityExtensionPoint.class).getUtility(FaultExceptionMapper.class);
+
Mediator mediator = registry.getExtensionPoint(UtilityExtensionPoint.class).getUtility(Mediator.class);
Input2InputTransformer input2InputTransformer = new Input2InputTransformer();
Modified: tuscany/branches/sca-java-1.x/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/CglibProxyFactory.java
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.x/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/CglibProxyFactory.java?rev=830026&r1=830025&r2=830026&view=diff
==============================================================================
--- tuscany/branches/sca-java-1.x/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/CglibProxyFactory.java (original)
+++ tuscany/branches/sca-java-1.x/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/CglibProxyFactory.java Mon Oct 26 23:44:59 2009
@@ -56,6 +56,25 @@
return createProxy(serviceReference);
}
+ private class CglibClassLoader extends ClassLoader {
+ private ClassLoader appLoader;
+ private ClassLoader bundleLoader;
+
+ @Override
+ public Class<?> loadClass(String className)
+ throws ClassNotFoundException {
+ try {
+ return appLoader.loadClass(className);
+ } catch (ClassNotFoundException ex ) {
+ return bundleLoader.loadClass(className);
+ }
+ }
+
+ CglibClassLoader(ClassLoader app, ClassLoader bundle) {
+ this.appLoader = app;
+ this.bundleLoader = bundle;
+ }
+ }
/**
* create the proxy with cglib. use the same JDKInvocationHandler as
* JDKProxyService.
@@ -63,6 +82,8 @@
public <T> T createProxy(CallableReference<T> callableReference) throws ProxyCreationException {
Enhancer enhancer = new Enhancer();
Class<T> interfaze = callableReference.getBusinessInterface();
+ ClassLoader cl = new CglibClassLoader(interfaze.getClassLoader(), getClass().getClassLoader());
+ enhancer.setClassLoader(cl);
enhancer.setSuperclass(interfaze);
enhancer.setCallback(new CglibMethodInterceptor<T>(callableReference));
Object proxy = enhancer.create();
Modified: tuscany/branches/sca-java-1.x/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/SCAProxy.java
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.x/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/SCAProxy.java?rev=830026&r1=830025&r2=830026&view=diff
==============================================================================
--- tuscany/branches/sca-java-1.x/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/SCAProxy.java (original)
+++ tuscany/branches/sca-java-1.x/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/SCAProxy.java Mon Oct 26 23:44:59 2009
@@ -33,7 +33,7 @@
// This is a cache containing the proxy class constructor for each business interface.
// This improves performance compared to calling Proxy.newProxyInstance()
// every time that a proxy is needed.
- private static WeakHashMap cache = new WeakHashMap<Class, Object>();
+ private static WeakHashMap cache = new WeakHashMap<String, Object>();
public static Object newProxyInstance(ClassLoader classloader, Class aclass[], InvocationHandler invocationhandler)
throws IllegalArgumentException
@@ -44,13 +44,13 @@
// Lookup cached constructor. aclass[0] is the reference's business interface.
Constructor proxyCTOR;
synchronized(cache) {
- proxyCTOR = (Constructor) cache.get(aclass[0]);
+ proxyCTOR = (Constructor) cache.get(aclass[0].hashCode());
}
if(proxyCTOR == null) {
Class proxyClass = getProxyClass(classloader, aclass);
proxyCTOR = proxyClass.getConstructor(constructorParams);
synchronized(cache){
- cache.put(aclass[0],proxyCTOR);
+ cache.put(aclass[0].hashCode(),proxyCTOR);
}
}
return proxyCTOR.newInstance(new Object[] { invocationhandler });
Modified: tuscany/branches/sca-java-1.x/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/SDOContextHelper.java
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.x/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/SDOContextHelper.java?rev=830026&r1=830025&r2=830026&view=diff
==============================================================================
--- tuscany/branches/sca-java-1.x/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/SDOContextHelper.java (original)
+++ tuscany/branches/sca-java-1.x/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/SDOContextHelper.java Mon Oct 26 23:44:59 2009
@@ -138,16 +138,26 @@
}
try {
Type type = helperContext.getTypeHelper().getType(javaType);
- if (type != null && (!type.isDataType())) {
+ return register(helperContext, type);
+ } catch (Exception e) {
+ throw new TransformationException(e);
+ }
+ }
+
+ public static boolean register(HelperContext helperContext, Type type) {
+ if (type != null && (!type.isDataType())) {
+ try {
Method method = type.getClass().getMethod("getEPackage");
Object factory = method.invoke(type, new Object[] {});
method = factory.getClass().getMethod("register", HelperContext.class);
method.invoke(factory, new Object[] {helperContext});
return true;
+ } catch (Exception e) {
+ e.printStackTrace();
+ return false;
}
+ } else {
return false;
- } catch (Exception e) {
- throw new TransformationException(e);
}
}
Modified: tuscany/branches/sca-java-1.x/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/SDODataBinding.java
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.x/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/SDODataBinding.java?rev=830026&r1=830025&r2=830026&view=diff
==============================================================================
--- tuscany/branches/sca-java-1.x/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/SDODataBinding.java (original)
+++ tuscany/branches/sca-java-1.x/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/SDODataBinding.java Mon Oct 26 23:44:59 2009
@@ -69,7 +69,7 @@
}
});
- Type type = context.getTypeHelper().getType(javaType);
+ final Type type = context.getTypeHelper().getType(javaType);
if (type == null) {
// FIXME: Need a better to test dynamic SDO
if (DataObject.class.isAssignableFrom(javaType)) {
@@ -92,10 +92,12 @@
public Object run() {
if (context == SDOContextHelper.getDefaultHelperContext()) {
HelperContext newContext = SDOUtil.createHelperContext();
- SDOContextHelper.register(newContext, javaType);
+ SDOContextHelper.register(newContext, type);
if (operation != null) {
operation.getInputType().setMetaData(HelperContext.class, newContext);
}
+ } else {
+ SDOContextHelper.register(context, type);
}
return null;
}
Modified: tuscany/branches/sca-java-1.x/modules/endpoint/pom.xml
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.x/modules/endpoint/pom.xml?rev=830026&r1=830025&r2=830026&view=diff
==============================================================================
--- tuscany/branches/sca-java-1.x/modules/endpoint/pom.xml (original)
+++ tuscany/branches/sca-java-1.x/modules/endpoint/pom.xml Mon Oct 26 23:44:59 2009
@@ -50,27 +50,22 @@
<version>1.6-SNAPSHOT</version>
</dependency>
- <dependency>
+ <dependency>
<groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-contribution-impl</artifactId>
+ <artifactId>tuscany-core</artifactId>
<version>1.6-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-contribution-xml</artifactId>
- <version>1.6-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-core</artifactId>
+ <artifactId>tuscany-binding-sca</artifactId>
<version>1.6-SNAPSHOT</version>
+ <scope>test</scope>
</dependency>
- <dependency>
+ <dependency>
<groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-sca</artifactId>
+ <artifactId>tuscany-workspace-impl</artifactId>
<version>1.6-SNAPSHOT</version>
<scope>test</scope>
</dependency>
@@ -94,14 +89,7 @@
<artifactId>tuscany-monitor</artifactId>
<version>1.6-SNAPSHOT</version>
<scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-workspace-impl</artifactId>
- <version>1.6-SNAPSHOT</version>
- <scope>test</scope>
- </dependency>
+ </dependency>
<dependency>
<groupId>org.easymock</groupId>
Modified: tuscany/branches/sca-java-1.x/modules/extensibility-equinox/src/main/java/org/apache/tuscany/sca/extensibility/equinox/EquinoxServiceDiscoveryActivator.java
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.x/modules/extensibility-equinox/src/main/java/org/apache/tuscany/sca/extensibility/equinox/EquinoxServiceDiscoveryActivator.java?rev=830026&r1=830025&r2=830026&view=diff
==============================================================================
--- tuscany/branches/sca-java-1.x/modules/extensibility-equinox/src/main/java/org/apache/tuscany/sca/extensibility/equinox/EquinoxServiceDiscoveryActivator.java (original)
+++ tuscany/branches/sca-java-1.x/modules/extensibility-equinox/src/main/java/org/apache/tuscany/sca/extensibility/equinox/EquinoxServiceDiscoveryActivator.java Mon Oct 26 23:44:59 2009
@@ -28,7 +28,7 @@
/**
* The Bundle Activator that creates the Equinox-based service discoverer
*
- * @version $Rev: $ $Date: $
+ * @version $Rev$ $Date$
*/
public class EquinoxServiceDiscoveryActivator implements BundleActivator {
private static Logger logger = Logger.getLogger(EquinoxServiceDiscoveryActivator.class.getName());
Modified: tuscany/branches/sca-java-1.x/modules/host-corba-jse/src/main/java/org/apache/tuscany/sca/host/corba/naming/TransientNameService.java
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.x/modules/host-corba-jse/src/main/java/org/apache/tuscany/sca/host/corba/naming/TransientNameService.java?rev=830026&r1=830025&r2=830026&view=diff
==============================================================================
--- tuscany/branches/sca-java-1.x/modules/host-corba-jse/src/main/java/org/apache/tuscany/sca/host/corba/naming/TransientNameService.java (original)
+++ tuscany/branches/sca-java-1.x/modules/host-corba-jse/src/main/java/org/apache/tuscany/sca/host/corba/naming/TransientNameService.java Mon Oct 26 23:44:59 2009
@@ -188,10 +188,10 @@
} catch (Throwable e) {
// Ignore
}
-
+
// Call destroy after close the acceptors
// In JDK 1.6u14 or later, destroy clean up the acceptors but it doesn't close them
- createdOrb.destroy();
+ createdOrb.destroy();
createdOrb = null;
}
}
Modified: tuscany/branches/sca-java-1.x/modules/host-embedded/pom.xml
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.x/modules/host-embedded/pom.xml?rev=830026&r1=830025&r2=830026&view=diff
==============================================================================
--- tuscany/branches/sca-java-1.x/modules/host-embedded/pom.xml (original)
+++ tuscany/branches/sca-java-1.x/modules/host-embedded/pom.xml Mon Oct 26 23:44:59 2009
@@ -105,7 +105,14 @@
<artifactId>tuscany-host-http</artifactId>
<version>1.6-SNAPSHOT</version>
<scope>compile</scope>
- </dependency>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-endpoint</artifactId>
+ <version>1.6-SNAPSHOT</version>
+ <scope>runtime</scope>
+ </dependency>
</dependencies>
Modified: tuscany/branches/sca-java-1.x/modules/host-webapp/pom.xml
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.x/modules/host-webapp/pom.xml?rev=830026&r1=830025&r2=830026&view=diff
==============================================================================
--- tuscany/branches/sca-java-1.x/modules/host-webapp/pom.xml (original)
+++ tuscany/branches/sca-java-1.x/modules/host-webapp/pom.xml Mon Oct 26 23:44:59 2009
@@ -49,6 +49,22 @@
</dependency>
<dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ <version>1.1.1</version>
+ <exclusions>
+ <exclusion>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>avalon-framework</groupId>
+ <artifactId>avalon-framework</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.4</version> <!-- to keep compatible with older servlet containers -->
@@ -62,22 +78,6 @@
<scope>provided</scope>
</dependency>
- <dependency>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- <version>1.1.1</version>
- <exclusions>
- <exclusion>
- <groupId>javax.servlet</groupId>
- <artifactId>servlet-api</artifactId>
- </exclusion>
- <exclusion>
- <groupId>avalon-framework</groupId>
- <artifactId>avalon-framework</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
</dependencies>
<build>
Modified: tuscany/branches/sca-java-1.x/modules/implementation-bpel-ode/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/provider/BPELInvoker.java
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.x/modules/implementation-bpel-ode/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/provider/BPELInvoker.java?rev=830026&r1=830025&r2=830026&view=diff
==============================================================================
--- tuscany/branches/sca-java-1.x/modules/implementation-bpel-ode/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/provider/BPELInvoker.java (original)
+++ tuscany/branches/sca-java-1.x/modules/implementation-bpel-ode/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/provider/BPELInvoker.java Mon Oct 26 23:44:59 2009
@@ -21,7 +21,6 @@
import java.lang.reflect.InvocationTargetException;
import java.util.concurrent.Future;
-import java.util.concurrent.TimeUnit;
import javax.transaction.SystemException;
import javax.transaction.TransactionManager;
@@ -56,11 +55,8 @@
* @version $Rev$ $Date$
*/
public class BPELInvoker implements Invoker {
- private final static long TIME_OUT = 2000L;
-
protected final Log __log = LogFactory.getLog(getClass());
-
private EmbeddedODEServer odeServer;
private TransactionManager txMgr;
@@ -155,8 +151,7 @@
// Waiting until the reply is ready in case the engine needs to continue in a different thread
if (onhold != null) {
try {
- //add timeout to avoid blocking when there is a exception/failure
- onhold.get(TIME_OUT, TimeUnit.MILLISECONDS);
+ onhold.get();
} catch (Exception e) {
throw new InvocationTargetException(e,"Error invoking BPEL process : " + e.getMessage());
}
Modified: tuscany/branches/sca-java-1.x/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/impl/JavaElementImpl.java
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.x/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/impl/JavaElementImpl.java?rev=830026&r1=830025&r2=830026&view=diff
==============================================================================
--- tuscany/branches/sca-java-1.x/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/impl/JavaElementImpl.java (original)
+++ tuscany/branches/sca-java-1.x/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/impl/JavaElementImpl.java Mon Oct 26 23:44:59 2009
@@ -21,6 +21,7 @@
import java.lang.annotation.Annotation;
import java.lang.annotation.ElementType;
+import java.lang.ref.WeakReference;
import java.lang.reflect.AnnotatedElement;
import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
@@ -36,8 +37,8 @@
public class JavaElementImpl {
private AnnotatedElement anchor;
private ElementType elementType;
- private Class<?> type;
- private Type genericType;
+ private WeakReference<Class<?>> type;
+ private WeakReference<Type> genericType;
private int index = -1;
private String name;
private Class<? extends Annotation> classifer;
@@ -51,24 +52,24 @@
public JavaElementImpl(Class<?> cls) {
this.anchor = cls;
this.elementType = ElementType.TYPE;
- this.type = cls;
- this.genericType = cls;
+ this.type = new WeakReference<Class<?>>(cls);
+ this.genericType = new WeakReference<Type>(cls);
this.name = cls.getName();
}
public JavaElementImpl(Field field) {
this.anchor = field;
this.elementType = ElementType.FIELD;
- this.type = field.getType();
- this.genericType = field.getGenericType();
+ this.type = new WeakReference<Class<?>>(field.getType());
+ this.genericType = new WeakReference<Type>(field.getGenericType());
this.name = field.getName();
}
public JavaElementImpl(Constructor<?> constructor, int index) {
this.anchor = constructor;
this.elementType = ElementType.PARAMETER;
- this.type = constructor.getParameterTypes()[index];
- this.genericType = constructor.getGenericParameterTypes()[index];
+ this.type = new WeakReference<Class<?>>(constructor.getParameterTypes()[index]);
+ this.genericType = new WeakReference<Type>(constructor.getGenericParameterTypes()[index]);
this.index = index;
this.name = "";
}
@@ -76,8 +77,8 @@
public JavaElementImpl(Method method, int index) {
this.anchor = method;
this.elementType = ElementType.PARAMETER;
- this.type = method.getParameterTypes()[index];
- this.genericType = method.getGenericParameterTypes()[index];
+ this.type = new WeakReference<Class<?>>(method.getParameterTypes()[index]);
+ this.genericType = new WeakReference<Type>(method.getGenericParameterTypes()[index]);
this.index = index;
this.name = "";
}
@@ -92,7 +93,7 @@
*/
public JavaElementImpl(String name, Class<?> type, Class<? extends Annotation> classifer) {
super();
- this.type = type;
+ this.type = new WeakReference<Class<?>>(type);
this.name = name;
this.classifer = classifer;
}
@@ -115,7 +116,7 @@
* @return the genericType
*/
public Type getGenericType() {
- return genericType;
+ return genericType.get();
}
/**
@@ -129,7 +130,7 @@
* @return the type
*/
public Class<?> getType() {
- return type;
+ return type.get();
}
public Annotation[] getAnnotations() {
Modified: tuscany/branches/sca-java-1.x/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/runtime/context/SpringContextTie.java
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.x/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/runtime/context/SpringContextTie.java?rev=830026&r1=830025&r2=830026&view=diff
==============================================================================
--- tuscany/branches/sca-java-1.x/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/runtime/context/SpringContextTie.java (original)
+++ tuscany/branches/sca-java-1.x/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/runtime/context/SpringContextTie.java Mon Oct 26 23:44:59 2009
@@ -20,6 +20,7 @@
package org.apache.tuscany.sca.implementation.spring.runtime.context;
import java.net.URL;
+import java.util.Iterator;
import java.util.List;
import org.apache.tuscany.sca.implementation.spring.processor.ComponentNameAnnotationProcessor;
@@ -30,11 +31,17 @@
import org.apache.tuscany.sca.implementation.spring.processor.PropertyValueStub;
import org.apache.tuscany.sca.implementation.spring.processor.ReferenceAnnotationProcessor;
import org.springframework.beans.BeansException;
+import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.beans.factory.config.BeanPostProcessor;
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
+import org.springframework.beans.factory.config.ConstructorArgumentValues;
+import org.springframework.beans.factory.config.TypedStringValue;
+import org.springframework.beans.factory.support.DefaultListableBeanFactory;
+import org.springframework.beans.factory.support.ManagedList;
import org.springframework.beans.factory.xml.XmlBeanFactory;
-import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;
+import org.springframework.context.ApplicationContext;
import org.springframework.context.support.AbstractApplicationContext;
+import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.context.support.GenericApplicationContext;
import org.springframework.core.io.UrlResource;
import org.springframework.core.SpringVersion;
@@ -51,11 +58,35 @@
private SpringImplementationStub implementation;
private boolean isAnnotationSupported;
private String versionSupported;
+ private boolean isMultipleContextSupport;
- public SpringContextTie(SpringImplementationStub implementation, List<URL> resource, boolean annotationSupport, String versionSupported) throws Exception {
+ // TUSCANY-3128
+ // extension of the generic application context just to force the classloader
+ // on the bean factory to stay set to the contribution classloader
+ // instead of being set back to the application classloader
+ private class LocalGenericApplicationContext extends GenericApplicationContext{
+
+ ClassLoader classloader = null;
+
+ public LocalGenericApplicationContext(DefaultListableBeanFactory beanFactory,
+ ApplicationContext parent,
+ ClassLoader classloader) {
+ super(beanFactory, parent);
+ this.classloader = classloader;
+ }
+
+ @Override
+ protected void postProcessBeanFactory(
+ ConfigurableListableBeanFactory beanFactory) {
+ beanFactory.setBeanClassLoader(classloader);
+ }
+ }
+
+ public SpringContextTie(SpringImplementationStub implementation, URL resource, boolean annotationSupport, String versionSupported, boolean multipleContextSupport) throws Exception {
this.implementation = implementation;
this.isAnnotationSupported = annotationSupport;
this.versionSupported = versionSupported;
+ this.isMultipleContextSupport = multipleContextSupport;
if (! this.versionSupported.equals("ANY")) {
if ((SpringVersion.getVersion()!= null) && (! SpringVersion.getVersion().equals(versionSupported)))
throw new RuntimeException("Unsupported version: Use only Spring Framework Version " + versionSupported);
@@ -81,36 +112,63 @@
/**
* Create appropriate ApplicationContext by reading the bean definitions.
*/
- private AbstractApplicationContext createApplicationContext(SCAParentApplicationContext scaParentContext, List<URL> resources) {
+ private AbstractApplicationContext createApplicationContext(SCAParentApplicationContext scaParentContext, URL resource) {
- XmlBeanFactory beanFactory = null;
- AbstractApplicationContext appContext = null;
-
- if (resources.size() > 1)
- {
- GenericApplicationContext appCtx =
- new SCAGenericApplicationContext(scaParentContext, implementation.getClassLoader());
- XmlBeanDefinitionReader xmlReader = new XmlBeanDefinitionReader(appCtx);
- for (URL resource : resources) {
- xmlReader.loadBeanDefinitions(new UrlResource(resource));
- }
- xmlReader.setBeanClassLoader(implementation.getClassLoader());
- if (isAnnotationSupported)
- includeAnnotationProcessors(appCtx.getBeanFactory());
- return appCtx;
-
- } else {
- beanFactory = new XmlBeanFactory(new UrlResource(resources.get(0)));
- beanFactory.setBeanClassLoader(implementation.getClassLoader());
- }
+ XmlBeanFactory beanFactory = new XmlBeanFactory(new UrlResource(resource));
+ beanFactory.setBeanClassLoader(implementation.getClassLoader());
+ AbstractApplicationContext appContext = null;
+
+ if (isMultipleContextSupport) {
+ for (String bean : beanFactory.getBeanDefinitionNames()) {
+ String beanClassName = (beanFactory.getType(bean)).getName();
+ // Using FileSystemXmlApplicationContext is not supported, as the
+ // SCA runtime does not support paths relative to current VM working directory.
+ /*if (beanClassName.indexOf(".FileSystemXmlApplicationContext") != -1) {
+ throw new RuntimeException("Usage of FileSystemXmlApplicationContext Bean is not supported");
+ }*/
+
+ if (beanClassName.indexOf(".ClassPathXmlApplicationContext") != -1) {
+ BeanDefinition beanDef = beanFactory.getBeanDefinition(bean);
+ String[] configLocations = null;
+ List<ConstructorArgumentValues.ValueHolder> conArgs =
+ beanDef.getConstructorArgumentValues().getGenericArgumentValues();
+ for (ConstructorArgumentValues.ValueHolder conArg : conArgs) {
+ if (conArg.getValue() instanceof TypedStringValue) {
+ TypedStringValue value = (TypedStringValue) conArg.getValue();
+ if (value.getValue().indexOf(".xml") != -1)
+ configLocations = new String[]{value.getValue()};
+ }
+ if (conArg.getValue() instanceof ManagedList) {
+ Iterator itml = ((ManagedList)conArg.getValue()).iterator();
+ StringBuffer values = new StringBuffer();
+ while (itml.hasNext()) {
+ TypedStringValue next = (TypedStringValue)itml.next();
+ if (next.getValue().indexOf(".xml") != -1) {
+ values.append(implementation.getClassLoader().getResource(next.getValue()).toString());
+ values.append("~");
+ }
+ }
+ configLocations = (values.toString()).split("~");
+ }
+ }
+
+ appContext = new ClassPathXmlApplicationContext(configLocations, true, scaParentContext);
+ if (isAnnotationSupported)
+ includeAnnotationProcessors(appContext.getBeanFactory());
+ return appContext;
+ }
+ }
+ }
// use the generic application context as default
- if (isAnnotationSupported) {
+ if (isAnnotationSupported)
+ {
includeAnnotationProcessors(beanFactory);
- }
- appContext = new SCAGenericApplicationContext(beanFactory,
- scaParentContext,
- implementation.getClassLoader());
+ }
+
+ appContext = new LocalGenericApplicationContext(beanFactory,
+ scaParentContext,
+ implementation.getClassLoader());
return appContext;
}
Modified: tuscany/branches/sca-java-1.x/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SpringImplementation.java
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.x/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SpringImplementation.java?rev=830026&r1=830025&r2=830026&view=diff
==============================================================================
--- tuscany/branches/sca-java-1.x/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SpringImplementation.java (original)
+++ tuscany/branches/sca-java-1.x/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SpringImplementation.java Mon Oct 26 23:44:59 2009
@@ -44,7 +44,7 @@
// The location attribute which points to the Spring application-context XML file
private String location;
// The application-context file as a Spring Resource
- private List<URL> resource;
+ private URL resource;
private ComponentType componentType;
// Mapping of Services to Beans
private Hashtable<String, SpringBeanElement> serviceMap;
@@ -78,11 +78,11 @@
return;
}
- public void setResource(List<URL> resource) {
+ public void setResource(URL resource) {
this.resource = resource;
}
- public List<URL> getResource() {
+ public URL getResource() {
return resource;
}
Modified: tuscany/branches/sca-java-1.x/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/introspect/SpringXMLComponentTypeLoader.java
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.x/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/introspect/SpringXMLComponentTypeLoader.java?rev=830026&r1=830025&r2=830026&view=diff
==============================================================================
--- tuscany/branches/sca-java-1.x/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/introspect/SpringXMLComponentTypeLoader.java (original)
+++ tuscany/branches/sca-java-1.x/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/introspect/SpringXMLComponentTypeLoader.java Mon Oct 26 23:44:59 2009
@@ -90,19 +90,22 @@
private AssemblyFactory assemblyFactory;
private JavaInterfaceFactory javaFactory;
private PolicyFactory policyFactory;
+ private boolean isMultipleContextSupported;
private SpringBeanIntrospector beanIntrospector;
public SpringXMLComponentTypeLoader(ModelFactoryExtensionPoint factories,
AssemblyFactory assemblyFactory,
JavaInterfaceFactory javaFactory,
- PolicyFactory policyFactory) {
+ PolicyFactory policyFactory,
+ boolean multipleContextSupport) {
super();
this.assemblyFactory = assemblyFactory;
this.javaFactory = javaFactory;
this.policyFactory = policyFactory;
this.contributionFactory = factories.getFactory(ContributionFactory.class);
this.xmlInputFactory = factories.getFactory(XMLInputFactory.class);
+ this.isMultipleContextSupported = multipleContextSupport;
}
protected Class<SpringImplementation> getImplementationClass() {
@@ -156,25 +159,23 @@
List<SpringSCAPropertyElement> scaproperties = new ArrayList<SpringSCAPropertyElement>();
URL resource;
- List<URL> contextResources = new ArrayList<URL>();
+
String contextPath = implementation.getLocation();
try {
resource = resolveLocation(resolver, contextPath);
- contextResources = getApplicationContextResource(resource);
+ resource = getApplicationContextResource(resource);
implementation.setClassLoader(new ContextClassLoader(resolver));
- implementation.setResource(contextResources);
+ implementation.setResource(resource);
// The URI is used to uniquely identify the Implementation
implementation.setURI(resource.toString());
+ reader = xmlInputFactory.createXMLStreamReader(resource.openStream());
+
+ // System.out.println("Spring TypeLoader - starting to read context file");
+ readContextDefinition(resolver, reader, contextPath, beans, services, references, scaproperties);
- for (URL contextResource : contextResources) {
- reader = xmlInputFactory.createXMLStreamReader(contextResource.openStream());
- // System.out.println("Spring TypeLoader - starting to read context file");
- readContextDefinition(resolver, reader, contextPath, beans, services, references, scaproperties);
-
- reader.close();
- }
+ reader.close();
} catch (IOException e) {
throw new ContributionReadException(e);
@@ -218,7 +219,7 @@
private XMLStreamReader getApplicationContextReader(ModelResolver resolver, String location) throws ContributionReadException {
try {
- URL resource = getApplicationContextResource(resolveLocation(resolver, location)).get(0);
+ URL resource = getApplicationContextResource(resolveLocation(resolver, location));
XMLStreamReader reader =
xmlInputFactory.createXMLStreamReader(resource.openStream());
return reader;
@@ -341,6 +342,13 @@
if (reader.getAttributeValue(null, "value") != null) {
String value = reader.getAttributeValue(null, "value");
constructorArg.addValue(value);
+ if ((isMultipleContextSupported) && (value.indexOf(".xml") != -1)) {
+ if (bean.getClassName().indexOf(".ClassPathXmlApplicationContext") != -1) {
+ XMLStreamReader creader = getApplicationContextReader(resolver, value);
+ // Read the context definition for the constructor-arg resources
+ readContextDefinition(resolver, creader, contextPath, beans, services, references, scaproperties);
+ }
+ }
}
bean.addCustructorArgs(constructorArg);
} else if (SpringImplementationConstants.REF_ELEMENT.equals(qname)) {
@@ -352,8 +360,17 @@
} else if (SpringImplementationConstants.VALUE_ELEMENT.equals(qname)) {
String value = reader.getElementText();
// Check if the parent element is a constructor-arg
- if (constructorArg != null)
+ if (constructorArg != null) {
constructorArg.addValue(value);
+ // Identify the XML resource specified for the constructor-arg element
+ if ((isMultipleContextSupported) && (value.indexOf(".xml") != -1)) {
+ if (bean.getClassName().indexOf(".ClassPathXmlApplicationContext") != -1) {
+ XMLStreamReader creader = getApplicationContextReader(resolver, value);
+ // Read the context definition for the constructor-arg resources
+ readContextDefinition(resolver, creader, contextPath, beans, services, references, scaproperties);
+ }
+ }
+ }
} // end if
break;
case END_ELEMENT:
@@ -555,9 +572,9 @@
Class<?> interfaze = resolveClass(resolver, paramType);
// Create a component type reference/property if the constructor-arg element has a
// type attribute OR index attribute declared...
- if ((conArgElement.getType() != null && paramType.equals(conArgElement.getType())) ||
+ if ((conArgElement.getType() != null && paramType.equals(conArgElement.getType())) ||
(conArgElement.getIndex() != -1 && (conArgElement.getIndex() == parameter.getIndex())))
- {
+ {
if (parameter.getClassifer().getName().equals("org.osoa.sca.annotations.Reference")) {
Reference theReference = createReference(interfaze, conArgElement.getRef());
componentType.getReferences().add(theReference);
@@ -653,19 +670,19 @@
* @param locationAttr - the location attribute from the <implementation.spring../> element
* @param cl - the ClassLoader for the Spring implementation
*/
- protected List<URL> getApplicationContextResource(URL url)
+ protected URL getApplicationContextResource(URL url)
throws ContributionReadException {
File manifestFile = null;
File appXmlFile;
File locationFile = null;
- List<URL> appCtxResources = new ArrayList<URL>();
if (url != null) {
String path = url.getPath();
locationFile = new File(path);
} else {
- throw new ContributionReadException("SpringXMLComponentTypeLoader getApplicationContextResource: "
- + "unable to find resource file " + url);
+ throw new ContributionReadException(
+ "SpringXMLLoader getApplicationContextResource: " + "unable to find resource file "
+ + url);
}
if (locationFile.isDirectory()) {
@@ -675,26 +692,21 @@
Manifest mf = new Manifest(new FileInputStream(manifestFile));
Attributes mainAttrs = mf.getMainAttributes();
String appCtxPath = mainAttrs.getValue("Spring-Context");
- if (appCtxPath != null) {
- String[] cxtPaths = appCtxPath.split(";");
- for (String path : cxtPaths) {
- appXmlFile = new File(locationFile, path);
- if (appXmlFile.exists()) {
- appCtxResources.add(appXmlFile.toURI().toURL());
- }
- }
- return appCtxResources;
+ if (appCtxPath != null) {
+ appXmlFile = new File(locationFile, appCtxPath);
+ if (appXmlFile.exists()) {
+ return appXmlFile.toURL();
+ }
}
}
// no manifest-specified Spring context, use default
appXmlFile = new File(locationFile, "META-INF" + File.separator + "spring"
+ File.separator + SpringImplementationConstants.APPLICATION_CONTEXT);
if (appXmlFile.exists()) {
- appCtxResources.add(appXmlFile.toURI().toURL());
- return appCtxResources;
+ return appXmlFile.toURL();
}
} catch (IOException e) {
- throw new ContributionReadException("Error reading manifest " + manifestFile);
+ throw new ContributionReadException("Error reading manifest inside the folder: ", e);
}
} else {
if (locationFile.isFile() && locationFile.getName().endsWith(".jar")) {
@@ -706,22 +718,18 @@
Attributes mainAttrs = mf.getMainAttributes();
String appCtxPath = mainAttrs.getValue("Spring-Context");
if (appCtxPath != null) {
- String[] cxtPaths = appCtxPath.split(";");
- for (String path : cxtPaths) {
- je = jf.getJarEntry(path);
- if (je != null) {
- appCtxResources.add(new URL("jar:" + locationFile.toURI().toURL() + "!/" + appCtxPath));
- }
- }
- return appCtxResources;
+ je = jf.getJarEntry(appCtxPath);
+ if (je != null) {
+ // TODO return a Spring specific Resource type for jars
+ return new URL("jar:" + locationFile.toURI().toURL() + "!/" + appCtxPath);
+ }
}
}
// Look for the default applicaiton-context.xml file, when MANIFEST.MF is absent.
je = jf.getJarEntry("META-INF" + "/" + "spring" + "/" + SpringImplementationConstants.APPLICATION_CONTEXT);
if (je != null) {
- appCtxResources.add(new URL("jar:" + locationFile.toURI().toURL() + "!/" +
- "META-INF" + "/" + "spring" + "/" + SpringImplementationConstants.APPLICATION_CONTEXT));
- return appCtxResources;
+ return new URL("jar:" + locationFile.toURI().toURL() + "!/" +
+ "META-INF" + "/" + "spring" + "/" + SpringImplementationConstants.APPLICATION_CONTEXT);
}
} catch (IOException e) {
// TODO: create a more appropriate exception type
@@ -731,14 +739,13 @@
}
else {
if (locationFile.getName().endsWith(".xml")) {
- appCtxResources.add(url);
- return appCtxResources;
+ return url;
}
else {
// Deal with the directory inside a jar file, in case the contribution itself is a JAR file.
try {
if (locationFile.getPath().indexOf(".jar") > 0) {
- String jarPath = url.getPath().substring(6, url.getPath().indexOf("!"));
+ String jarPath = url.getPath().substring(5, url.getPath().indexOf("!"));
JarFile jf = new JarFile(jarPath);
JarEntry je = jf.getJarEntry(url.getPath().substring(url.getPath().indexOf("!/")+2)
+ "/" + "META-INF" + "/" + "MANIFEST.MF");
@@ -747,34 +754,29 @@
Attributes mainAttrs = mf.getMainAttributes();
String appCtxPath = mainAttrs.getValue("Spring-Context");
if (appCtxPath != null) {
- String[] cxtPaths = appCtxPath.split(";");
- for (String path : cxtPaths) {
- je = jf.getJarEntry(url.getPath().substring(url.getPath().indexOf("!/")+2) + "/" + path);
- if (je != null) {
- appCtxResources.add(new URL("jar:" + url.getPath() + "/" + path));
- return appCtxResources;
- }
- }
+ je = jf.getJarEntry(url.getPath().substring(url.getPath().indexOf("!/")+2) + "/" + appCtxPath);
+ if (je != null) {
+ return new URL("jar:" + url.getPath() + "/" + appCtxPath);
+ }
}
}
// Look for the default applicaiton-context.xml file, when MANIFEST.MF is absent.
je = jf.getJarEntry(url.getPath().substring(url.getPath().indexOf("!/")+2) + "/" +
"META-INF" + "/" + "spring" + "/" + SpringImplementationConstants.APPLICATION_CONTEXT);
if (je != null) {
- appCtxResources.add(new URL("jar:" + url.getPath() + "/" +
- "META-INF" + "/" + "spring" + "/" + SpringImplementationConstants.APPLICATION_CONTEXT));
- return appCtxResources;
+ return new URL("jar:" + url.getPath() + "/" +
+ "META-INF" + "/" + "spring" + "/" + SpringImplementationConstants.APPLICATION_CONTEXT);
}
}
} catch (IOException e) {
- throw new ContributionReadException("Error reading manifest " + manifestFile);
+ throw new ContributionReadException("Error reading manifest inside the jar folder: ", e);
}
}
}
}
- throw new ContributionReadException("SpringXMLComponentTypeLoader getApplicationContextResource: "
- + "unable to read resource file " + url);
+ throw new ContributionReadException("SpringXMLLoader getApplicationContextResource: "
+ + "META-INF/spring/" + SpringImplementationConstants.APPLICATION_CONTEXT + " not found");
} // end method getApplicationContextResource
/**
Modified: tuscany/branches/sca-java-1.x/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/invocation/ConfigurationPropertiesExtensionPoint.java
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.x/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/invocation/ConfigurationPropertiesExtensionPoint.java?rev=830026&r1=830025&r2=830026&view=diff
==============================================================================
--- tuscany/branches/sca-java-1.x/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/invocation/ConfigurationPropertiesExtensionPoint.java (original)
+++ tuscany/branches/sca-java-1.x/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/invocation/ConfigurationPropertiesExtensionPoint.java Mon Oct 26 23:44:59 2009
@@ -4,6 +4,8 @@
boolean isAnnotationSupported();
+ boolean isMultipleContextSupported();
+
String getSupportedVersion();
}
Modified: tuscany/branches/sca-java-1.x/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/invocation/DefaultConfigurationPropertiesExtensionPoint.java
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.x/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/invocation/DefaultConfigurationPropertiesExtensionPoint.java?rev=830026&r1=830025&r2=830026&view=diff
==============================================================================
--- tuscany/branches/sca-java-1.x/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/invocation/DefaultConfigurationPropertiesExtensionPoint.java (original)
+++ tuscany/branches/sca-java-1.x/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/invocation/DefaultConfigurationPropertiesExtensionPoint.java Mon Oct 26 23:44:59 2009
@@ -8,11 +8,17 @@
}
// By default SCA annotations for implementation.spring
- // will be supproted.
+ // will be supproted for Tuscany.
public boolean isAnnotationSupported() {
return true;
}
+ // By default multiple application context implementation.spring
+ // will be supproted for Tuscany.
+ public boolean isMultipleContextSupported() {
+ return true;
+ }
+
// By defauly all the Spring version are supported for
// Tuscany.
public String getSupportedVersion() {
Modified: tuscany/branches/sca-java-1.x/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/invocation/SpringContextStub.java
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.x/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/invocation/SpringContextStub.java?rev=830026&r1=830025&r2=830026&view=diff
==============================================================================
--- tuscany/branches/sca-java-1.x/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/invocation/SpringContextStub.java (original)
+++ tuscany/branches/sca-java-1.x/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/invocation/SpringContextStub.java Mon Oct 26 23:44:59 2009
@@ -22,7 +22,7 @@
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
-import java.util.List;
+import java.net.URL;
import org.apache.tuscany.sca.core.invocation.ProxyFactory;
import org.apache.tuscany.sca.implementation.java.injection.JavaPropertyValueObjectFactory;
@@ -47,9 +47,10 @@
ProxyFactory proxyService,
JavaPropertyValueObjectFactory propertyValueObjectFactory,
boolean annotationSupport,
- String versionSupported) {
+ String versionSupported,
+ boolean multipleContextSupport) {
- initTie(component, implementation, propertyValueObjectFactory, annotationSupport, versionSupported);
+ initTie(component, implementation, propertyValueObjectFactory, annotationSupport, versionSupported, multipleContextSupport);
}
@@ -57,7 +58,8 @@
SpringImplementation implementation,
JavaPropertyValueObjectFactory propertyValueObjectFactory,
boolean annotationSupport,
- String versionSupported) {
+ String versionSupported,
+ boolean multipleContextSupport) {
// TODO: what class loader to use?
ClassLoader cl = Thread.currentThread().getContextClassLoader();
@@ -69,8 +71,8 @@
Object stub = stubConstructor.newInstance(new SpringImplementationTie(implementation, component, propertyValueObjectFactory));
Class<?> tieClass = Class.forName("org.apache.tuscany.sca.implementation.spring.runtime.context.SpringContextTie", true, cl);
- Constructor<?> tieConstructor = tieClass.getConstructor(new Class<?>[]{stubClass, List.class, boolean.class, String.class});
- this.tie = tieConstructor.newInstance(stub, implementation.getResource(), annotationSupport, versionSupported);
+ Constructor<?> tieConstructor = tieClass.getConstructor(new Class<?>[]{stubClass, URL.class, boolean.class, String.class, boolean.class});
+ this.tie = tieConstructor.newInstance(stub, implementation.getResource(), annotationSupport, versionSupported, multipleContextSupport);
this.startMethod = tieClass.getMethod("start");
this.closeMethod = tieClass.getMethod("close");
Modified: tuscany/branches/sca-java-1.x/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/invocation/SpringImplementationProvider.java
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.x/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/invocation/SpringImplementationProvider.java?rev=830026&r1=830025&r2=830026&view=diff
==============================================================================
--- tuscany/branches/sca-java-1.x/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/invocation/SpringImplementationProvider.java (original)
+++ tuscany/branches/sca-java-1.x/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/invocation/SpringImplementationProvider.java Mon Oct 26 23:44:59 2009
@@ -52,13 +52,14 @@
ProxyFactory proxyService,
JavaPropertyValueObjectFactory propertyValueObjectFactory,
boolean annotationSupport,
- String versionSupported) {
+ String versionSupported,
+ boolean multipleContextSupport) {
super();
this.implementation = implementation;
this.component = component;
this.propertyValueObjectFactory = propertyValueObjectFactory;
- springContext = new SpringContextStub(component, implementation, proxyService, propertyValueObjectFactory, annotationSupport, versionSupported);
+ springContext = new SpringContextStub(component, implementation, proxyService, propertyValueObjectFactory, annotationSupport, versionSupported, multipleContextSupport);
} // end constructor
Modified: tuscany/branches/sca-java-1.x/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/invocation/SpringImplementationProviderFactory.java
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.x/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/invocation/SpringImplementationProviderFactory.java?rev=830026&r1=830025&r2=830026&view=diff
==============================================================================
--- tuscany/branches/sca-java-1.x/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/invocation/SpringImplementationProviderFactory.java (original)
+++ tuscany/branches/sca-java-1.x/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/invocation/SpringImplementationProviderFactory.java Mon Oct 26 23:44:59 2009
@@ -41,6 +41,7 @@
private ConfigurationPropertiesExtensionPoint configProperties;
private boolean annotationSupport;
private String versionSupported;
+ private boolean multipleContextSupport;
/**
* Simple constructor
@@ -58,6 +59,7 @@
}
annotationSupport = configProperties.isAnnotationSupported();
versionSupported = configProperties.getSupportedVersion();
+ multipleContextSupport = configProperties.isMultipleContextSupported();
// TODO: could the runtime have a default PropertyValueObjectFactory?
propertyFactory = new JavaPropertyValueObjectFactory(new MediatorImpl(extensionPoints));
@@ -77,7 +79,8 @@
proxyFactory,
propertyFactory,
annotationSupport,
- versionSupported);
+ versionSupported,
+ multipleContextSupport);
}
/**