You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by js...@apache.org on 2008/09/05 02:14:49 UTC

svn commit: r692308 - in /tuscany/java/sca/modules: extensibility-equinox/ extensibility-equinox/src/main/java/org/apache/tuscany/sca/extensibility/equinox/ extensibility-equinox/src/main/resources/ node-launcher-equinox/ node-launcher-equinox/src/main...

Author: jsdelfino
Date: Thu Sep  4 17:14:49 2008
New Revision: 692308

URL: http://svn.apache.org/viewvc?rev=692308&view=rev
Log:
Added a BundleFileWrapperFactory hook as it'll help provide the required Bundle manifest information when not present in the original JARs.

Added:
    tuscany/java/sca/modules/extensibility-equinox/src/main/java/org/apache/tuscany/sca/extensibility/equinox/BundleFileWrapperFactory.java
    tuscany/java/sca/modules/extensibility-equinox/src/main/java/org/apache/tuscany/sca/extensibility/equinox/EquinoxHookConfigurator.java
    tuscany/java/sca/modules/extensibility-equinox/src/main/resources/
    tuscany/java/sca/modules/extensibility-equinox/src/main/resources/hookconfigurators.properties
Modified:
    tuscany/java/sca/modules/extensibility-equinox/pom.xml
    tuscany/java/sca/modules/node-launcher-equinox/pom.xml
    tuscany/java/sca/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/EquinoxOSGiHost.java

Modified: tuscany/java/sca/modules/extensibility-equinox/pom.xml
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/extensibility-equinox/pom.xml?rev=692308&r1=692307&r2=692308&view=diff
==============================================================================
--- tuscany/java/sca/modules/extensibility-equinox/pom.xml (original)
+++ tuscany/java/sca/modules/extensibility-equinox/pom.xml Thu Sep  4 17:14:49 2008
@@ -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 -->

Added: tuscany/java/sca/modules/extensibility-equinox/src/main/java/org/apache/tuscany/sca/extensibility/equinox/BundleFileWrapperFactory.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/extensibility-equinox/src/main/java/org/apache/tuscany/sca/extensibility/equinox/BundleFileWrapperFactory.java?rev=692308&view=auto
==============================================================================
--- tuscany/java/sca/modules/extensibility-equinox/src/main/java/org/apache/tuscany/sca/extensibility/equinox/BundleFileWrapperFactory.java (added)
+++ tuscany/java/sca/modules/extensibility-equinox/src/main/java/org/apache/tuscany/sca/extensibility/equinox/BundleFileWrapperFactory.java Thu Sep  4 17:14:49 2008
@@ -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;
+    }
+
+}

Added: tuscany/java/sca/modules/extensibility-equinox/src/main/java/org/apache/tuscany/sca/extensibility/equinox/EquinoxHookConfigurator.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/extensibility-equinox/src/main/java/org/apache/tuscany/sca/extensibility/equinox/EquinoxHookConfigurator.java?rev=692308&view=auto
==============================================================================
--- tuscany/java/sca/modules/extensibility-equinox/src/main/java/org/apache/tuscany/sca/extensibility/equinox/EquinoxHookConfigurator.java (added)
+++ tuscany/java/sca/modules/extensibility-equinox/src/main/java/org/apache/tuscany/sca/extensibility/equinox/EquinoxHookConfigurator.java Thu Sep  4 17:14:49 2008
@@ -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());
+    }
+
+}

Added: tuscany/java/sca/modules/extensibility-equinox/src/main/resources/hookconfigurators.properties
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/extensibility-equinox/src/main/resources/hookconfigurators.properties?rev=692308&view=auto
==============================================================================
--- tuscany/java/sca/modules/extensibility-equinox/src/main/resources/hookconfigurators.properties (added)
+++ tuscany/java/sca/modules/extensibility-equinox/src/main/resources/hookconfigurators.properties Thu Sep  4 17:14:49 2008
@@ -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

Modified: tuscany/java/sca/modules/node-launcher-equinox/pom.xml
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/node-launcher-equinox/pom.xml?rev=692308&r1=692307&r2=692308&view=diff
==============================================================================
--- tuscany/java/sca/modules/node-launcher-equinox/pom.xml (original)
+++ tuscany/java/sca/modules/node-launcher-equinox/pom.xml Thu Sep  4 17:14:49 2008
@@ -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>

Modified: tuscany/java/sca/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/EquinoxOSGiHost.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/EquinoxOSGiHost.java?rev=692308&r1=692307&r2=692308&view=diff
==============================================================================
--- tuscany/java/sca/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/EquinoxOSGiHost.java (original)
+++ tuscany/java/sca/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/EquinoxOSGiHost.java Thu Sep  4 17:14:49 2008
@@ -95,7 +95,7 @@
         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());