diff options
Diffstat (limited to '')
6 files changed, 102 insertions, 10 deletions
diff --git a/java/sca/modules/extensibility-equinox/pom.xml b/java/sca/modules/extensibility-equinox/pom.xml index 915f3bd91f..25f78760b2 100644 --- a/java/sca/modules/extensibility-equinox/pom.xml +++ b/java/sca/modules/extensibility-equinox/pom.xml @@ -72,8 +72,9 @@ <configuration> <instructions> <Bundle-Version>${tuscany.version}</Bundle-Version> - <Bundle-SymbolicName>org.apache.tuscany.sca.extensibility.equinox - </Bundle-SymbolicName> + <Bundle-SymbolicName>org.apache.tuscany.sca.extensibility.equinox</Bundle-SymbolicName> + <Fragment-Host>org.eclipse.osgi</Fragment-Host> + <Import-Package></Import-Package> <Bundle-Description>${pom.name}</Bundle-Description> <Bundle-Activator>org.apache.tuscany.sca.extensibility.equinox.EquinoxServiceDiscoveryActivator</Bundle-Activator> <!-- This bundle will be the gateway to all exported packages --> diff --git a/java/sca/modules/extensibility-equinox/src/main/java/org/apache/tuscany/sca/extensibility/equinox/BundleFileWrapperFactory.java b/java/sca/modules/extensibility-equinox/src/main/java/org/apache/tuscany/sca/extensibility/equinox/BundleFileWrapperFactory.java new file mode 100644 index 0000000000..3b369bb54b --- /dev/null +++ b/java/sca/modules/extensibility-equinox/src/main/java/org/apache/tuscany/sca/extensibility/equinox/BundleFileWrapperFactory.java @@ -0,0 +1,49 @@ +/* + * 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.extensibility.equinox; + +import java.io.File; +import java.io.IOException; + +import org.eclipse.osgi.baseadaptor.BaseData; +import org.eclipse.osgi.baseadaptor.bundlefile.BundleFile; +import org.eclipse.osgi.baseadaptor.hooks.BundleFileFactoryHook; +import org.eclipse.osgi.baseadaptor.hooks.BundleFileWrapperFactoryHook; + +/** + * Bundle file wrapper factory that converts plain jars into OSGi bundles + */ +public class BundleFileWrapperFactory implements BundleFileWrapperFactoryHook, BundleFileFactoryHook { + + public BundleFile createBundleFile(Object content, BaseData data, boolean base) throws IOException { + return null; + } + + public BundleFile wrapBundleFile(BundleFile file, Object content, BaseData data, boolean base) throws IOException { + if (data.getBundleID() == 0) { + return null; + } + if (!(content instanceof File)) { + return null; + } + return null; + } + +} diff --git a/java/sca/modules/extensibility-equinox/src/main/java/org/apache/tuscany/sca/extensibility/equinox/EquinoxHookConfigurator.java b/java/sca/modules/extensibility-equinox/src/main/java/org/apache/tuscany/sca/extensibility/equinox/EquinoxHookConfigurator.java new file mode 100644 index 0000000000..d5027805c1 --- /dev/null +++ b/java/sca/modules/extensibility-equinox/src/main/java/org/apache/tuscany/sca/extensibility/equinox/EquinoxHookConfigurator.java @@ -0,0 +1,33 @@ +/* + * 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.extensibility.equinox; + +import org.eclipse.osgi.baseadaptor.HookConfigurator; +import org.eclipse.osgi.baseadaptor.HookRegistry; + +/** + * Hook Configurator for Equinox + */ +public class EquinoxHookConfigurator implements HookConfigurator { + public void addHooks(HookRegistry registry) { + registry.addBundleFileWrapperFactoryHook(new BundleFileWrapperFactory()); + } + +} diff --git a/java/sca/modules/extensibility-equinox/src/main/resources/hookconfigurators.properties b/java/sca/modules/extensibility-equinox/src/main/resources/hookconfigurators.properties new file mode 100644 index 0000000000..cec706c9c3 --- /dev/null +++ b/java/sca/modules/extensibility-equinox/src/main/resources/hookconfigurators.properties @@ -0,0 +1,16 @@ +# 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. +hook.configurators=org.apache.tuscany.sca.extensibility.equinox.EquinoxHookConfigurator
\ No newline at end of file diff --git a/java/sca/modules/node-launcher-equinox/pom.xml b/java/sca/modules/node-launcher-equinox/pom.xml index f118501508..0356d142d6 100644 --- a/java/sca/modules/node-launcher-equinox/pom.xml +++ b/java/sca/modules/node-launcher-equinox/pom.xml @@ -64,13 +64,6 @@ <dependency> <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-contribution-osgi</artifactId> - <version>1.4-SNAPSHOT</version> - <scope>test</scope> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> <artifactId>tuscany-domain-manager</artifactId> <version>1.4-SNAPSHOT</version> <scope>test</scope> diff --git a/java/sca/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/EquinoxOSGiHost.java b/java/sca/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/EquinoxOSGiHost.java index effe9b298d..f94dd8e166 100644 --- a/java/sca/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/EquinoxOSGiHost.java +++ b/java/sca/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/EquinoxOSGiHost.java @@ -95,7 +95,7 @@ public class EquinoxOSGiHost implements OSGiHost { Map<Object, Object> props = new HashMap<Object, Object>(); props.put("org.osgi.framework.system.packages", systemPackages); // Set the extension bundle - // props.put("osgi.framework.extensions", "org.apache.tuscany.sca.extensibility.equinox"); + props.put("osgi.framework.extensions", "org.apache.tuscany.sca.extensibility.equinox"); props.put(EclipseStarter.PROP_CLEAN, "true"); props.put(LocationManager.PROP_INSTANCE_AREA, new File("target/workspace").toURI().toString()); props.put(LocationManager.PROP_INSTALL_AREA, new File("target/eclipse/install").toURI().toString()); |