From 52ce7df1c3f1076410836b444d95b9da2eb14c28 Mon Sep 17 00:00:00 2001 From: rfeng Date: Mon, 27 Oct 2008 16:38:16 +0000 Subject: Bring up calculator-osgi using equinox run config git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@708234 13f79535-47bb-0310-9956-ffa450edef68 --- .../sca-equinox/distribution/pdetarget/pom.xml | 371 +++++++++++---------- ...ontribution.processor.ValidatingXMLInputFactory | 17 + branches/sca-equinox/modules/extensibility/pom.xml | 1 + .../sca/core/DefaultFactoryExtensionPoint.java | 40 ++- .../sca/extensibility/ServiceDiscovery.java | 19 +- .../org/apache/tuscany/sca/node/impl/NodeImpl.java | 9 +- .../org.apache.tuscany.sca.node.NodeFactory | 17 + .../org.apache.tuscany.sca.node.SCANode2Factory | 17 - .../org.apache.tuscany.sca.node.SCANodeFactory | 17 - .../sca/node/equinox/launcher/EquinoxHost.java | 16 +- .../sca/node/equinox/launcher/J2SE-1.5.profile | 150 +++++++++ .../sca/node/equinox/launcher/JavaSE-1.6.profile | 185 ++++++++++ .../main/java/calculator/CalculatorActivator.java | 14 +- .../bundle/plugin/ModuleBundlesBuildMojo.java | 2 +- 14 files changed, 639 insertions(+), 236 deletions(-) create mode 100644 branches/sca-equinox/modules/contribution/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.ValidatingXMLInputFactory create mode 100644 branches/sca-equinox/modules/node-impl/src/main/resources/META-INF/services/org.apache.tuscany.sca.node.NodeFactory delete mode 100644 branches/sca-equinox/modules/node-impl/src/main/resources/META-INF/services/org.apache.tuscany.sca.node.SCANode2Factory delete mode 100644 branches/sca-equinox/modules/node-impl/src/main/resources/META-INF/services/org.apache.tuscany.sca.node.SCANodeFactory create mode 100644 branches/sca-equinox/modules/node-launcher-equinox/src/main/resources/org/apache/tuscany/sca/node/equinox/launcher/J2SE-1.5.profile create mode 100644 branches/sca-equinox/modules/node-launcher-equinox/src/main/resources/org/apache/tuscany/sca/node/equinox/launcher/JavaSE-1.6.profile (limited to 'branches') diff --git a/branches/sca-equinox/distribution/pdetarget/pom.xml b/branches/sca-equinox/distribution/pdetarget/pom.xml index 622b2e2d05..683d2db3b1 100644 --- a/branches/sca-equinox/distribution/pdetarget/pom.xml +++ b/branches/sca-equinox/distribution/pdetarget/pom.xml @@ -1,185 +1,186 @@ - - - - 4.0.0 - - org.apache.tuscany.sca - tuscany-distribution - 1.4-SNAPSHOT - ../pom.xml - - - tuscany-distribution-pdetarget - Apache Tuscany SCA PDE Target Platform Distribution - pom - - - - org.apache.tuscany.sca - tuscany-distribution-all - pom - 1.4-SNAPSHOT - - - - - - - - eclipse - - - - org.apache.tuscany.sca - tuscany-maven-bundle-plugin - - - distribution-modules - generate-resources - - generate-modules - - - target/modules - - org.apache.tuscany.sca - - - - - - - - - - - - modules - - ../../../modules/assembly - ../../../modules/assembly-xml - ../../../modules/assembly-xsd - ../../../modules/binding-atom - ../../../modules/binding-atom-abdera - ../../../modules/binding-corba - ../../../modules/binding-corba-runtime - ../../../modules/binding-ejb - ../../../modules/binding-ejb-runtime - ../../../modules/binding-gdata - ../../../modules/binding-gdata-gsoc - ../../../modules/binding-gdata-runtime - ../../../modules/binding-gdata-runtime-gsoc - ../../../modules/binding-http - ../../../modules/binding-http-runtime - ../../../modules/binding-jms - ../../../modules/binding-jms-runtime - ../../../modules/binding-jsonrpc - ../../../modules/binding-jsonrpc-runtime - ../../../modules/binding-rmi - ../../../modules/binding-rmi-runtime - ../../../modules/binding-rss - ../../../modules/binding-rss-rome - ../../../modules/binding-sca - ../../../modules/binding-sca-axis2 - ../../../modules/binding-sca-xml - ../../../modules/binding-ws - ../../../modules/binding-ws-axis2 - ../../../modules/binding-ws-axis2-policy - ../../../modules/binding-ws-wsdlgen - ../../../modules/binding-ws-xml - ../../../modules/contribution - ../../../modules/contribution-java - ../../../modules/contribution-namespace - ../../../modules/contribution-resource - ../../../modules/contribution-xml - ../../../modules/core - ../../../modules/core-databinding - ../../../modules/core-spi - ../../../modules/data-api - ../../../modules/databinding - ../../../modules/databinding-axiom - ../../../modules/databinding-fastinfoset - ../../../modules/databinding-jaxb - ../../../modules/databinding-jaxb-axiom - ../../../modules/databinding-json - ../../../modules/databinding-saxon - ../../../modules/databinding-sdo - ../../../modules/databinding-sdo-axiom - ../../../modules/databinding-xmlbeans - ../../../modules/definitions - ../../../modules/definitions-xml - ../../../modules/domain-manager - ../../../modules/endpoint - ../../../modules/extensibility - ../../../modules/extensibility-equinox - ../../../modules/host-corba - ../../../modules/host-corba-jee - ../../../modules/host-corba-jse - ../../../modules/host-http - ../../../modules/host-jetty - ../../../modules/host-rmi - ../../../modules/implementation-bpel - ../../../modules/implementation-bpel-ode - ../../../modules/implementation-ejb - ../../../modules/implementation-java - ../../../modules/implementation-java-runtime - ../../../modules/implementation-java-xml - ../../../modules/implementation-node - ../../../modules/implementation-node-runtime - ../../../modules/implementation-resource - ../../../modules/implementation-resource-runtime - ../../../modules/implementation-script - ../../../modules/implementation-script-runtime - ../../../modules/implementation-spring - ../../../modules/implementation-widget - ../../../modules/implementation-widget-runtime - ../../../modules/implementation-xquery - ../../../modules/interface - ../../../modules/interface-java - ../../../modules/interface-java-jaxws - ../../../modules/interface-java-xml - ../../../modules/interface-wsdl - ../../../modules/interface-wsdl-xml - ../../../modules/monitor - ../../../modules/node-api - ../../../modules/node-impl - ../../../modules/node-launcher - ../../../modules/node-launcher-equinox - ../../../modules/node-launcher-webapp - ../../../modules/node-manager - ../../../modules/policy - ../../../modules/policy-security - ../../../modules/policy-security-jsr250 - ../../../modules/policy-security-ws - ../../../modules/policy-transaction - ../../../modules/policy-xml - ../../../modules/policy-xml-ws - ../../../modules/sca-api - ../../../modules/tracing-aspectj - ../../../modules/workspace - ../../../modules/workspace-impl - ../../../modules/workspace-xml - ../../../modules/xsd - ../../../modules/xsd-xml - - - - - + + + + 4.0.0 + + org.apache.tuscany.sca + tuscany-distribution + 1.4-SNAPSHOT + ../pom.xml + + + tuscany-distribution-pdetarget + Apache Tuscany SCA PDE Target Platform Distribution + jar + + + + org.apache.tuscany.sca + tuscany-distribution-all + pom + 1.4-SNAPSHOT + + + + + + + + eclipse + + + + org.apache.tuscany.sca + tuscany-maven-bundle-plugin + + + distribution-modules + generate-resources + + generate-modules + + + target/modules + true + + org.apache.tuscany.sca + + + + + + + + + + + + modules + + ../../../modules/assembly + ../../../modules/assembly-xml + ../../../modules/assembly-xsd + ../../../modules/binding-atom + ../../../modules/binding-atom-abdera + ../../../modules/binding-corba + ../../../modules/binding-corba-runtime + ../../../modules/binding-ejb + ../../../modules/binding-ejb-runtime + ../../../modules/binding-gdata + ../../../modules/binding-gdata-gsoc + ../../../modules/binding-gdata-runtime + ../../../modules/binding-gdata-runtime-gsoc + ../../../modules/binding-http + ../../../modules/binding-http-runtime + ../../../modules/binding-jms + ../../../modules/binding-jms-runtime + ../../../modules/binding-jsonrpc + ../../../modules/binding-jsonrpc-runtime + ../../../modules/binding-rmi + ../../../modules/binding-rmi-runtime + ../../../modules/binding-rss + ../../../modules/binding-rss-rome + ../../../modules/binding-sca + ../../../modules/binding-sca-axis2 + ../../../modules/binding-sca-xml + ../../../modules/binding-ws + ../../../modules/binding-ws-axis2 + ../../../modules/binding-ws-axis2-policy + ../../../modules/binding-ws-wsdlgen + ../../../modules/binding-ws-xml + ../../../modules/contribution + ../../../modules/contribution-java + ../../../modules/contribution-namespace + ../../../modules/contribution-resource + ../../../modules/contribution-xml + ../../../modules/core + ../../../modules/core-databinding + ../../../modules/core-spi + ../../../modules/data-api + ../../../modules/databinding + ../../../modules/databinding-axiom + ../../../modules/databinding-fastinfoset + ../../../modules/databinding-jaxb + ../../../modules/databinding-jaxb-axiom + ../../../modules/databinding-json + ../../../modules/databinding-saxon + ../../../modules/databinding-sdo + ../../../modules/databinding-sdo-axiom + ../../../modules/databinding-xmlbeans + ../../../modules/definitions + ../../../modules/definitions-xml + ../../../modules/domain-manager + ../../../modules/endpoint + ../../../modules/extensibility + ../../../modules/extensibility-equinox + ../../../modules/host-corba + ../../../modules/host-corba-jee + ../../../modules/host-corba-jse + ../../../modules/host-http + ../../../modules/host-jetty + ../../../modules/host-rmi + ../../../modules/implementation-bpel + ../../../modules/implementation-bpel-ode + ../../../modules/implementation-ejb + ../../../modules/implementation-java + ../../../modules/implementation-java-runtime + ../../../modules/implementation-java-xml + ../../../modules/implementation-node + ../../../modules/implementation-node-runtime + ../../../modules/implementation-resource + ../../../modules/implementation-resource-runtime + ../../../modules/implementation-script + ../../../modules/implementation-script-runtime + ../../../modules/implementation-spring + ../../../modules/implementation-widget + ../../../modules/implementation-widget-runtime + ../../../modules/implementation-xquery + ../../../modules/interface + ../../../modules/interface-java + ../../../modules/interface-java-jaxws + ../../../modules/interface-java-xml + ../../../modules/interface-wsdl + ../../../modules/interface-wsdl-xml + ../../../modules/monitor + ../../../modules/node-api + ../../../modules/node-impl + ../../../modules/node-launcher + ../../../modules/node-launcher-equinox + ../../../modules/node-launcher-webapp + ../../../modules/node-manager + ../../../modules/policy + ../../../modules/policy-security + ../../../modules/policy-security-jsr250 + ../../../modules/policy-security-ws + ../../../modules/policy-transaction + ../../../modules/policy-xml + ../../../modules/policy-xml-ws + ../../../modules/sca-api + ../../../modules/tracing-aspectj + ../../../modules/workspace + ../../../modules/workspace-impl + ../../../modules/workspace-xml + ../../../modules/xsd + ../../../modules/xsd-xml + + + + + diff --git a/branches/sca-equinox/modules/contribution/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.ValidatingXMLInputFactory b/branches/sca-equinox/modules/contribution/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.ValidatingXMLInputFactory new file mode 100644 index 0000000000..f2856cb259 --- /dev/null +++ b/branches/sca-equinox/modules/contribution/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.ValidatingXMLInputFactory @@ -0,0 +1,17 @@ +# 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. +org.apache.tuscany.sca.contribution.processor.DefaultValidatingXMLInputFactory \ No newline at end of file diff --git a/branches/sca-equinox/modules/extensibility/pom.xml b/branches/sca-equinox/modules/extensibility/pom.xml index 93e2694971..991a9f0b02 100644 --- a/branches/sca-equinox/modules/extensibility/pom.xml +++ b/branches/sca-equinox/modules/extensibility/pom.xml @@ -44,6 +44,7 @@ org.apache.tuscany.sca.core, org.apache.tuscany.sca.extensibility + org.apache.tuscany.sca.extensibility.equinox diff --git a/branches/sca-equinox/modules/extensibility/src/main/java/org/apache/tuscany/sca/core/DefaultFactoryExtensionPoint.java b/branches/sca-equinox/modules/extensibility/src/main/java/org/apache/tuscany/sca/core/DefaultFactoryExtensionPoint.java index c1221aad7a..f5041866ee 100644 --- a/branches/sca-equinox/modules/extensibility/src/main/java/org/apache/tuscany/sca/core/DefaultFactoryExtensionPoint.java +++ b/branches/sca-equinox/modules/extensibility/src/main/java/org/apache/tuscany/sca/core/DefaultFactoryExtensionPoint.java @@ -20,6 +20,10 @@ package org.apache.tuscany.sca.core; import java.lang.reflect.Constructor; +import java.lang.reflect.Method; +import java.lang.reflect.Modifier; +import java.security.AccessController; +import java.security.PrivilegedAction; import java.util.HashMap; import org.apache.tuscany.sca.extensibility.ServiceDeclaration; @@ -81,6 +85,24 @@ public class DefaultFactoryExtensionPoint implements FactoryExtensionPoint { } } + private ClassLoader getContextClassLoader() { + return AccessController.doPrivileged(new PrivilegedAction() { + public ClassLoader run() { + return Thread.currentThread().getContextClassLoader(); + } + }); + } + + private ClassLoader setContextClassLoader(final ClassLoader classLoader) { + return AccessController.doPrivileged(new PrivilegedAction() { + public ClassLoader run() { + ClassLoader tccl = Thread.currentThread().getContextClassLoader(); + Thread.currentThread().setContextClassLoader(classLoader); + return tccl; + } + }); + } + /** * Get a factory implementing the given interface. * @param factoryInterface The lookup key (factory interface) @@ -96,8 +118,22 @@ public class DefaultFactoryExtensionPoint implements FactoryExtensionPoint { ServiceDiscovery.getInstance().getFirstServiceDeclaration(factoryInterface.getName()); if (factoryDeclaration != null) { Class factoryClass = factoryDeclaration.loadClass(); - try { + if (!factoryInterface.isInterface() && Modifier.isAbstract(factoryInterface.getModifiers())) { + try { + Method newInstanceMethod = factoryInterface.getDeclaredMethod("newInstance"); + ClassLoader tccl = setContextClassLoader(factoryClass.getClassLoader()); + try { + factory = newInstanceMethod.invoke(null); + factories.put(factoryInterface, factory); + return factoryInterface.cast(factory); + } finally { + setContextClassLoader(tccl); + } + } catch (NoSuchMethodException e) { + // Ignore + } + } // Default empty constructor Constructor constructor = factoryClass.getConstructor(); factory = constructor.newInstance(); @@ -114,7 +150,7 @@ public class DefaultFactoryExtensionPoint implements FactoryExtensionPoint { } // Cache the loaded factory - addFactory(factory); + factories.put(factoryInterface, factory); } } catch (Exception e) { throw new IllegalArgumentException(e); diff --git a/branches/sca-equinox/modules/extensibility/src/main/java/org/apache/tuscany/sca/extensibility/ServiceDiscovery.java b/branches/sca-equinox/modules/extensibility/src/main/java/org/apache/tuscany/sca/extensibility/ServiceDiscovery.java index ff8f2399df..bb4f23a00c 100644 --- a/branches/sca-equinox/modules/extensibility/src/main/java/org/apache/tuscany/sca/extensibility/ServiceDiscovery.java +++ b/branches/sca-equinox/modules/extensibility/src/main/java/org/apache/tuscany/sca/extensibility/ServiceDiscovery.java @@ -37,7 +37,10 @@ public class ServiceDiscovery implements ServiceDiscoverer { private final static ServiceDiscovery INSTANCE = new ServiceDiscovery(); private ServiceDiscoverer discoverer; - + + private ServiceDiscovery() { + super(); + } /** * Get an instance of Service discovery, one instance is created per * ClassLoader that this class is loaded from @@ -49,9 +52,19 @@ public class ServiceDiscovery implements ServiceDiscoverer { } public ServiceDiscoverer getServiceDiscoverer() { - if (discoverer == null) { - discoverer = new ContextClassLoaderServiceDiscoverer(); + if (discoverer != null) { + return discoverer; + } + try { + Class cls = Class.forName("org.apache.tuscany.sca.extensibility.equinox.EquinoxServiceDiscoverer"); + System.out.println(cls); + if (discoverer != null) { + return discoverer; + } + } catch (Throwable e) { + e.printStackTrace(); } + discoverer = new ContextClassLoaderServiceDiscoverer(); return discoverer; } diff --git a/branches/sca-equinox/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeImpl.java b/branches/sca-equinox/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeImpl.java index e1f56e598b..effccd0f4d 100644 --- a/branches/sca-equinox/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeImpl.java +++ b/branches/sca-equinox/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeImpl.java @@ -263,8 +263,13 @@ public class NodeImpl implements Node, Client { // Initialize the Tuscany module activators ModuleActivatorExtensionPoint activators = extensionPoints.getExtensionPoint(ModuleActivatorExtensionPoint.class); for (ModuleActivator moduleActivator: activators.getModuleActivators()) { - moduleActivator.start(extensionPoints); - moduleActivators.add(moduleActivator); + try { + moduleActivator.start(extensionPoints); + moduleActivators.add(moduleActivator); + } catch (Throwable e) { + // Ignore the failing module for now + logger.log(Level.SEVERE, e.getMessage(), e); + } } // Get XML input/output factories diff --git a/branches/sca-equinox/modules/node-impl/src/main/resources/META-INF/services/org.apache.tuscany.sca.node.NodeFactory b/branches/sca-equinox/modules/node-impl/src/main/resources/META-INF/services/org.apache.tuscany.sca.node.NodeFactory new file mode 100644 index 0000000000..800bdd84cc --- /dev/null +++ b/branches/sca-equinox/modules/node-impl/src/main/resources/META-INF/services/org.apache.tuscany.sca.node.NodeFactory @@ -0,0 +1,17 @@ +# 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. +org.apache.tuscany.sca.node.impl.NodeFactoryImpl \ No newline at end of file diff --git a/branches/sca-equinox/modules/node-impl/src/main/resources/META-INF/services/org.apache.tuscany.sca.node.SCANode2Factory b/branches/sca-equinox/modules/node-impl/src/main/resources/META-INF/services/org.apache.tuscany.sca.node.SCANode2Factory deleted file mode 100644 index 4215855ac9..0000000000 --- a/branches/sca-equinox/modules/node-impl/src/main/resources/META-INF/services/org.apache.tuscany.sca.node.SCANode2Factory +++ /dev/null @@ -1,17 +0,0 @@ -# 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. -org.apache.tuscany.sca.node.impl.Node2FactoryImpl \ No newline at end of file diff --git a/branches/sca-equinox/modules/node-impl/src/main/resources/META-INF/services/org.apache.tuscany.sca.node.SCANodeFactory b/branches/sca-equinox/modules/node-impl/src/main/resources/META-INF/services/org.apache.tuscany.sca.node.SCANodeFactory deleted file mode 100644 index 800bdd84cc..0000000000 --- a/branches/sca-equinox/modules/node-impl/src/main/resources/META-INF/services/org.apache.tuscany.sca.node.SCANodeFactory +++ /dev/null @@ -1,17 +0,0 @@ -# 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. -org.apache.tuscany.sca.node.impl.NodeFactoryImpl \ No newline at end of file diff --git a/branches/sca-equinox/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/EquinoxHost.java b/branches/sca-equinox/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/EquinoxHost.java index f16d607a80..6007c0dac2 100644 --- a/branches/sca-equinox/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/EquinoxHost.java +++ b/branches/sca-equinox/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/EquinoxHost.java @@ -36,6 +36,7 @@ import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.Properties; import java.util.Set; import java.util.logging.Level; import java.util.logging.Logger; @@ -122,12 +123,19 @@ class EquinoxHost { try { if (!EclipseStarter.isRunning()) { + String version = System.getProperty("java.specification.version"); + String profile = "J2SE-1.5.profile"; + if (version.startsWith("1.6")) { + profile = "JavaSE-1.6.profile"; + } + Properties props = new Properties(); + InputStream is = getClass().getResourceAsStream(profile); + if (is != null) { + props.load(is); + is.close(); + } // Configure Eclipse properties - Map props = new HashMap(); - // Set system packages - props.put("org.osgi.framework.system.packages", systemPackages); - // Use the boot classloader as the parent classloader props.put("osgi.contextClassLoaderParent", "boot"); diff --git a/branches/sca-equinox/modules/node-launcher-equinox/src/main/resources/org/apache/tuscany/sca/node/equinox/launcher/J2SE-1.5.profile b/branches/sca-equinox/modules/node-launcher-equinox/src/main/resources/org/apache/tuscany/sca/node/equinox/launcher/J2SE-1.5.profile new file mode 100644 index 0000000000..3814b42d00 --- /dev/null +++ b/branches/sca-equinox/modules/node-launcher-equinox/src/main/resources/org/apache/tuscany/sca/node/equinox/launcher/J2SE-1.5.profile @@ -0,0 +1,150 @@ +# 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. +org.osgi.framework.system.packages = \ + javax.accessibility,\ + javax.activity,\ + javax.crypto,\ + javax.crypto.interfaces,\ + javax.crypto.spec,\ + javax.imageio,\ + javax.imageio.event,\ + javax.imageio.metadata,\ + javax.imageio.plugins.bmp,\ + javax.imageio.plugins.jpeg,\ + javax.imageio.spi,\ + javax.imageio.stream,\ + javax.management,\ + javax.management.loading,\ + javax.management.modelmbean,\ + javax.management.monitor,\ + javax.management.openmbean,\ + javax.management.relation,\ + javax.management.remote,\ + javax.management.remote.rmi,\ + javax.management.timer,\ + javax.naming,\ + javax.naming.directory,\ + javax.naming.event,\ + javax.naming.ldap,\ + javax.naming.spi,\ + javax.net,\ + javax.net.ssl,\ + javax.print,\ + javax.print.attribute,\ + javax.print.attribute.standard,\ + javax.print.event,\ + javax.rmi,\ + javax.rmi.CORBA,\ + javax.rmi.ssl,\ + javax.security.auth,\ + javax.security.auth.callback,\ + javax.security.auth.kerberos,\ + javax.security.auth.login,\ + javax.security.auth.spi,\ + javax.security.auth.x500,\ + javax.security.cert,\ + javax.security.sasl,\ + javax.sound.midi,\ + javax.sound.midi.spi,\ + javax.sound.sampled,\ + javax.sound.sampled.spi,\ + javax.sql,\ + javax.sql.rowset,\ + javax.sql.rowset.serial,\ + javax.sql.rowset.spi,\ + javax.swing,\ + javax.swing.border,\ + javax.swing.colorchooser,\ + javax.swing.event,\ + javax.swing.filechooser,\ + javax.swing.plaf,\ + javax.swing.plaf.basic,\ + javax.swing.plaf.metal,\ + javax.swing.plaf.multi,\ + javax.swing.plaf.synth,\ + javax.swing.table,\ + javax.swing.text,\ + javax.swing.text.html,\ + javax.swing.text.html.parser,\ + javax.swing.text.rtf,\ + javax.swing.tree,\ + javax.swing.undo,\ + javax.transaction,\ + javax.transaction.xa,\ + javax.xml,\ + javax.xml.datatype,\ + javax.xml.namespace,\ + javax.xml.parsers,\ + javax.xml.transform,\ + javax.xml.transform.dom,\ + javax.xml.transform.sax,\ + javax.xml.transform.stream,\ + javax.xml.validation,\ + javax.xml.xpath,\ + org.ietf.jgss,\ + org.omg.CORBA,\ + org.omg.CORBA_2_3,\ + org.omg.CORBA_2_3.portable,\ + org.omg.CORBA.DynAnyPackage,\ + org.omg.CORBA.ORBPackage,\ + org.omg.CORBA.portable,\ + org.omg.CORBA.TypeCodePackage,\ + org.omg.CosNaming,\ + org.omg.CosNaming.NamingContextExtPackage,\ + org.omg.CosNaming.NamingContextPackage,\ + org.omg.Dynamic,\ + org.omg.DynamicAny,\ + org.omg.DynamicAny.DynAnyFactoryPackage,\ + org.omg.DynamicAny.DynAnyPackage,\ + org.omg.IOP,\ + org.omg.IOP.CodecFactoryPackage,\ + org.omg.IOP.CodecPackage,\ + org.omg.Messaging,\ + org.omg.PortableInterceptor,\ + org.omg.PortableInterceptor.ORBInitInfoPackage,\ + org.omg.PortableServer,\ + org.omg.PortableServer.CurrentPackage,\ + org.omg.PortableServer.POAManagerPackage,\ + org.omg.PortableServer.POAPackage,\ + org.omg.PortableServer.portable,\ + org.omg.PortableServer.ServantLocatorPackage,\ + org.omg.SendingContext,\ + org.omg.stub.java.rmi,\ + org.w3c.dom,\ + org.w3c.dom.bootstrap,\ + org.w3c.dom.events,\ + org.w3c.dom.ls,\ + org.xml.sax,\ + org.xml.sax.ext,\ + org.xml.sax.helpers +org.osgi.framework.bootdelegation = \ + javax.*,\ + org.ietf.jgss,\ + org.omg.*,\ + org.w3c.*,\ + org.xml.*,\ + sun.*,\ + com.sun.* +org.osgi.framework.executionenvironment = \ + OSGi/Minimum-1.0,\ + OSGi/Minimum-1.1,\ + JRE-1.1,\ + J2SE-1.2,\ + J2SE-1.3,\ + J2SE-1.4,\ + J2SE-1.5 +osgi.java.profile.name = J2SE-1.5 diff --git a/branches/sca-equinox/modules/node-launcher-equinox/src/main/resources/org/apache/tuscany/sca/node/equinox/launcher/JavaSE-1.6.profile b/branches/sca-equinox/modules/node-launcher-equinox/src/main/resources/org/apache/tuscany/sca/node/equinox/launcher/JavaSE-1.6.profile new file mode 100644 index 0000000000..816e7c44f4 --- /dev/null +++ b/branches/sca-equinox/modules/node-launcher-equinox/src/main/resources/org/apache/tuscany/sca/node/equinox/launcher/JavaSE-1.6.profile @@ -0,0 +1,185 @@ +# 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. +org.osgi.framework.system.packages = \ + javax.accessibility,\ + javax.activation,\ + javax.activity,\ + javax.annotation,\ + javax.annotation.processing,\ + javax.crypto,\ + javax.crypto.interfaces,\ + javax.crypto.spec,\ + javax.imageio,\ + javax.imageio.event,\ + javax.imageio.metadata,\ + javax.imageio.plugins.bmp,\ + javax.imageio.plugins.jpeg,\ + javax.imageio.spi,\ + javax.imageio.stream,\ + javax.jws,\ + javax.jws.soap,\ + javax.lang.model,\ + javax.lang.model.element,\ + javax.lang.model.type,\ + javax.lang.model.util,\ + javax.management,\ + javax.management.loading,\ + javax.management.modelmbean,\ + javax.management.monitor,\ + javax.management.openmbean,\ + javax.management.relation,\ + javax.management.remote,\ + javax.management.remote.rmi,\ + javax.management.timer,\ + javax.naming,\ + javax.naming.directory,\ + javax.naming.event,\ + javax.naming.ldap,\ + javax.naming.spi,\ + javax.net,\ + javax.net.ssl,\ + javax.print,\ + javax.print.attribute,\ + javax.print.attribute.standard,\ + javax.print.event,\ + javax.rmi,\ + javax.rmi.CORBA,\ + javax.rmi.ssl,\ + javax.script,\ + javax.security.auth,\ + javax.security.auth.callback,\ + javax.security.auth.kerberos,\ + javax.security.auth.login,\ + javax.security.auth.spi,\ + javax.security.auth.x500,\ + javax.security.cert,\ + javax.security.sasl,\ + javax.sound.midi,\ + javax.sound.midi.spi,\ + javax.sound.sampled,\ + javax.sound.sampled.spi,\ + javax.sql,\ + javax.sql.rowset,\ + javax.sql.rowset.serial,\ + javax.sql.rowset.spi,\ + javax.swing,\ + javax.swing.border,\ + javax.swing.colorchooser,\ + javax.swing.event,\ + javax.swing.filechooser,\ + javax.swing.plaf,\ + javax.swing.plaf.basic,\ + javax.swing.plaf.metal,\ + javax.swing.plaf.multi,\ + javax.swing.plaf.synth,\ + javax.swing.table,\ + javax.swing.text,\ + javax.swing.text.html,\ + javax.swing.text.html.parser,\ + javax.swing.text.rtf,\ + javax.swing.tree,\ + javax.swing.undo,\ + javax.tools,\ + javax.transaction,\ + javax.transaction.xa,\ + javax.xml,\ + javax.xml.bind,\ + javax.xml.bind.annotation,\ + javax.xml.bind.annotation.adapters,\ + javax.xml.bind.attachment,\ + javax.xml.bind.helpers,\ + javax.xml.bind.util,\ + javax.xml.crypto,\ + javax.xml.crypto.dom,\ + javax.xml.crypto.dsig,\ + javax.xml.crypto.dsig.dom,\ + javax.xml.crypto.dsig.keyinfo,\ + javax.xml.crypto.dsig.spec,\ + javax.xml.datatype,\ + javax.xml.namespace,\ + javax.xml.parsers,\ + javax.xml.soap,\ + javax.xml.stream,\ + javax.xml.stream.events,\ + javax.xml.stream.util,\ + javax.xml.transform,\ + javax.xml.transform.dom,\ + javax.xml.transform.sax,\ + javax.xml.transform.stax,\ + javax.xml.transform.stream,\ + javax.xml.validation,\ + javax.xml.ws,\ + javax.xml.ws.handler,\ + javax.xml.ws.handler.soap,\ + javax.xml.ws.http,\ + javax.xml.ws.soap,\ + javax.xml.ws.spi,\ + javax.xml.xpath,\ + org.ietf.jgss,\ + org.omg.CORBA,\ + org.omg.CORBA_2_3,\ + org.omg.CORBA_2_3.portable,\ + org.omg.CORBA.DynAnyPackage,\ + org.omg.CORBA.ORBPackage,\ + org.omg.CORBA.portable,\ + org.omg.CORBA.TypeCodePackage,\ + org.omg.CosNaming,\ + org.omg.CosNaming.NamingContextExtPackage,\ + org.omg.CosNaming.NamingContextPackage,\ + org.omg.Dynamic,\ + org.omg.DynamicAny,\ + org.omg.DynamicAny.DynAnyFactoryPackage,\ + org.omg.DynamicAny.DynAnyPackage,\ + org.omg.IOP,\ + org.omg.IOP.CodecFactoryPackage,\ + org.omg.IOP.CodecPackage,\ + org.omg.Messaging,\ + org.omg.PortableInterceptor,\ + org.omg.PortableInterceptor.ORBInitInfoPackage,\ + org.omg.PortableServer,\ + org.omg.PortableServer.CurrentPackage,\ + org.omg.PortableServer.POAManagerPackage,\ + org.omg.PortableServer.POAPackage,\ + org.omg.PortableServer.portable,\ + org.omg.PortableServer.ServantLocatorPackage,\ + org.omg.SendingContext,\ + org.omg.stub.java.rmi,\ + org.w3c.dom,\ + org.w3c.dom.bootstrap,\ + org.w3c.dom.events,\ + org.w3c.dom.ls,\ + org.xml.sax,\ + org.xml.sax.ext,\ + org.xml.sax.helpers +org.osgi.framework.bootdelegation = \ + javax.*,\ + org.ietf.jgss,\ + org.omg.*,\ + org.w3c.*,\ + org.xml.*,\ + sun.*,\ + com.sun.* +org.osgi.framework.executionenvironment = \ + OSGi/Minimum-1.0,\ + OSGi/Minimum-1.1,\ + JRE-1.1,\ + J2SE-1.2,\ + J2SE-1.3,\ + J2SE-1.4,\ + J2SE-1.5,\ + JavaSE-1.6 +osgi.java.profile.name = JavaSE-1.6 diff --git a/branches/sca-equinox/samples/calculator-osgi/src/main/java/calculator/CalculatorActivator.java b/branches/sca-equinox/samples/calculator-osgi/src/main/java/calculator/CalculatorActivator.java index 384ae99fff..4408568629 100644 --- a/branches/sca-equinox/samples/calculator-osgi/src/main/java/calculator/CalculatorActivator.java +++ b/branches/sca-equinox/samples/calculator-osgi/src/main/java/calculator/CalculatorActivator.java @@ -33,11 +33,15 @@ public class CalculatorActivator implements BundleActivator { private Node node; public void start(BundleContext context) throws Exception { - NodeFactory factory = NodeFactory.newInstance(); - String url = ContributionLocationHelper.getContributionLocation(getClass()); - Contribution contrib = new Contribution("c1", url); - node = factory.createNode("Calculator.composite", contrib); - node.start(); + try { + NodeFactory factory = NodeFactory.newInstance(); + String url = ContributionLocationHelper.getContributionLocation(getClass()); + Contribution contrib = new Contribution("c1", url); + node = factory.createNode("Calculator.composite", contrib); + node.start(); + } catch (Throwable e) { + e.printStackTrace(); + } } public void stop(BundleContext context) throws Exception { diff --git a/branches/sca-equinox/tools/maven/maven-bundle-plugin/src/main/java/org/apache/tuscany/sca/tools/bundle/plugin/ModuleBundlesBuildMojo.java b/branches/sca-equinox/tools/maven/maven-bundle-plugin/src/main/java/org/apache/tuscany/sca/tools/bundle/plugin/ModuleBundlesBuildMojo.java index f813a2d096..cc25869e5d 100644 --- a/branches/sca-equinox/tools/maven/maven-bundle-plugin/src/main/java/org/apache/tuscany/sca/tools/bundle/plugin/ModuleBundlesBuildMojo.java +++ b/branches/sca-equinox/tools/maven/maven-bundle-plugin/src/main/java/org/apache/tuscany/sca/tools/bundle/plugin/ModuleBundlesBuildMojo.java @@ -249,7 +249,7 @@ public class ModuleBundlesBuildMojo extends AbstractMojo { // Generate a PDE target if (generateTargetPlatform) { - File target = new File(project.getBasedir(), "tuscany.target"); + File target = new File(project.getBuild().getDirectory(), "tuscany.target"); FileOutputStream targetFile = new FileOutputStream(target); writeTarget(new PrintStream(targetFile), bundleSymbolicNames, eclipseFeatures); targetFile.close(); -- cgit v1.2.3