summaryrefslogtreecommitdiffstats
path: root/java/sca/modules/extensibility-equinox
diff options
context:
space:
mode:
Diffstat (limited to 'java/sca/modules/extensibility-equinox')
-rw-r--r--java/sca/modules/extensibility-equinox/pom.xml5
-rw-r--r--java/sca/modules/extensibility-equinox/src/main/java/org/apache/tuscany/sca/extensibility/equinox/BundleFileWrapperFactory.java49
-rw-r--r--java/sca/modules/extensibility-equinox/src/main/java/org/apache/tuscany/sca/extensibility/equinox/EquinoxHookConfigurator.java33
-rw-r--r--java/sca/modules/extensibility-equinox/src/main/resources/hookconfigurators.properties16
4 files changed, 101 insertions, 2 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