[jboss-osgi-commits] JBoss-OSGI SVN: r86585 - in projects/jboss-osgi/trunk: build/distribution/scripts and 15 other directories.

jboss-osgi-commits at lists.jboss.org jboss-osgi-commits at lists.jboss.org
Wed Apr 1 08:55:58 EDT 2009


Author: thomas.diesler at jboss.com
Date: 2009-04-01 08:55:57 -0400 (Wed, 01 Apr 2009)
New Revision: 86585

Added:
   projects/jboss-osgi/trunk/runtime/equinox/.classpath
   projects/jboss-osgi/trunk/runtime/equinox/.project
   projects/jboss-osgi/trunk/runtime/equinox/.settings/
   projects/jboss-osgi/trunk/runtime/equinox/.settings/org.eclipse.jdt.core.prefs
   projects/jboss-osgi/trunk/runtime/equinox/.settings/org.maven.ide.eclipse.prefs
   projects/jboss-osgi/trunk/runtime/equinox/pom.xml
   projects/jboss-osgi/trunk/runtime/equinox/src/
   projects/jboss-osgi/trunk/runtime/equinox/src/main/java/org/jboss/osgi/equinox/
   projects/jboss-osgi/trunk/runtime/equinox/src/main/java/org/jboss/osgi/equinox/framework/EquinoxIntegration.java
   projects/jboss-osgi/trunk/runtime/equinox/src/test/java/org/jboss/test/osgi/equinox/
   projects/jboss-osgi/trunk/runtime/equinox/src/test/java/org/jboss/test/osgi/equinox/SystemBundleTestCase.java
   projects/jboss-osgi/trunk/runtime/felix/src/test/java/org/jboss/test/osgi/felix/SystemBundleTestCase.java
Removed:
   projects/jboss-osgi/trunk/runtime/equinox/src/main/java/org/jboss/osgi/equinox/framework/FelixIntegration.java
   projects/jboss-osgi/trunk/runtime/equinox/src/main/java/org/jboss/osgi/equinox/framework/FelixLogger.java
   projects/jboss-osgi/trunk/runtime/equinox/src/main/java/org/jboss/osgi/felix/
   projects/jboss-osgi/trunk/runtime/equinox/src/main/resources/osgi-jboss-beans.xml
   projects/jboss-osgi/trunk/runtime/equinox/src/test/java/org/jboss/osgi/
   projects/jboss-osgi/trunk/runtime/equinox/src/test/java/org/jboss/test/osgi/equinox/microcontainer/
   projects/jboss-osgi/trunk/runtime/equinox/src/test/java/org/jboss/test/osgi/equinox/system/
   projects/jboss-osgi/trunk/runtime/equinox/src/test/java/org/jboss/test/osgi/felix/
   projects/jboss-osgi/trunk/runtime/equinox/src/test/resources/microcontainer/
   projects/jboss-osgi/trunk/runtime/felix/scripts/
   projects/jboss-osgi/trunk/runtime/felix/src/main/resources/osgi-jboss-beans.xml
   projects/jboss-osgi/trunk/runtime/felix/src/test/java/org/jboss/osgi/
   projects/jboss-osgi/trunk/runtime/felix/src/test/java/org/jboss/test/osgi/felix/system/
Modified:
   projects/jboss-osgi/trunk/build/distribution/pom.xml
   projects/jboss-osgi/trunk/build/distribution/scripts/assembly-deploy-artifacts.xml
   projects/jboss-osgi/trunk/runtime/equinox/
   projects/jboss-osgi/trunk/runtime/equinox/src/test/resources/jboss-osgi-beans.xml
   projects/jboss-osgi/trunk/runtime/felix/pom.xml
   projects/jboss-osgi/trunk/runtime/pom.xml
Log:
[JBOSGI-36] Add basic Equinox integration

Modified: projects/jboss-osgi/trunk/build/distribution/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/build/distribution/pom.xml	2009-04-01 10:55:17 UTC (rev 86584)
+++ projects/jboss-osgi/trunk/build/distribution/pom.xml	2009-04-01 12:55:57 UTC (rev 86585)
@@ -59,12 +59,6 @@
     <dependency>
       <groupId>org.jboss.osgi</groupId>
       <artifactId>jboss-osgi-runtime-felix</artifactId>
-      <classifier>config</classifier>
-      <version>${version}</version>
-    </dependency>
-    <dependency>
-      <groupId>org.jboss.osgi</groupId>
-      <artifactId>jboss-osgi-runtime-felix</artifactId>
       <classifier>sources</classifier>
       <version>${version}</version>
     </dependency>

Modified: projects/jboss-osgi/trunk/build/distribution/scripts/assembly-deploy-artifacts.xml
===================================================================
--- projects/jboss-osgi/trunk/build/distribution/scripts/assembly-deploy-artifacts.xml	2009-04-01 10:55:17 UTC (rev 86584)
+++ projects/jboss-osgi/trunk/build/distribution/scripts/assembly-deploy-artifacts.xml	2009-04-01 12:55:57 UTC (rev 86585)
@@ -37,14 +37,6 @@
       </includes>
       <unpack>true</unpack>
     </dependencySet>
-    <dependencySet>
-      <outputDirectory>resources/jboss-osgi-runtime-felix-config</outputDirectory>
-      <useStrictFiltering>true</useStrictFiltering>
-      <includes>
-        <include>*:jboss-osgi-runtime-felix:jar:config</include>
-      </includes>
-      <unpack>true</unpack>
-    </dependencySet>
     
     <!-- source -->
     <dependencySet>


Property changes on: projects/jboss-osgi/trunk/runtime/equinox
___________________________________________________________________
Name: svn:ignore
   + target


Added: projects/jboss-osgi/trunk/runtime/equinox/.classpath
===================================================================
--- projects/jboss-osgi/trunk/runtime/equinox/.classpath	                        (rev 0)
+++ projects/jboss-osgi/trunk/runtime/equinox/.classpath	2009-04-01 12:55:57 UTC (rev 86585)
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="src" output="target/classes" path="src/main/java"/>
+	<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"/>
+	<classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
+	<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources"/>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+	<classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
+	<classpathentry kind="output" path="target/classes"/>
+</classpath>

Added: projects/jboss-osgi/trunk/runtime/equinox/.project
===================================================================
--- projects/jboss-osgi/trunk/runtime/equinox/.project	                        (rev 0)
+++ projects/jboss-osgi/trunk/runtime/equinox/.project	2009-04-01 12:55:57 UTC (rev 86585)
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>jboss-osgi-runtime-equinox</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.maven.ide.eclipse.maven2Builder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.maven.ide.eclipse.maven2Nature</nature>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+	</natures>
+</projectDescription>

Added: projects/jboss-osgi/trunk/runtime/equinox/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- projects/jboss-osgi/trunk/runtime/equinox/.settings/org.eclipse.jdt.core.prefs	                        (rev 0)
+++ projects/jboss-osgi/trunk/runtime/equinox/.settings/org.eclipse.jdt.core.prefs	2009-04-01 12:55:57 UTC (rev 86585)
@@ -0,0 +1,5 @@
+#Wed Apr 01 10:32:07 CEST 2009
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.source=1.5

Added: projects/jboss-osgi/trunk/runtime/equinox/.settings/org.maven.ide.eclipse.prefs
===================================================================
--- projects/jboss-osgi/trunk/runtime/equinox/.settings/org.maven.ide.eclipse.prefs	                        (rev 0)
+++ projects/jboss-osgi/trunk/runtime/equinox/.settings/org.maven.ide.eclipse.prefs	2009-04-01 12:55:57 UTC (rev 86585)
@@ -0,0 +1,9 @@
+#Wed Apr 01 10:32:06 CEST 2009
+activeProfiles=
+eclipse.preferences.version=1
+fullBuildGoals=process-test-resources
+includeModules=false
+resolveWorkspaceProjects=true
+resourceFilterGoals=process-resources resources\:testResources
+skipCompilerPlugin=true
+version=1

Added: projects/jboss-osgi/trunk/runtime/equinox/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/runtime/equinox/pom.xml	                        (rev 0)
+++ projects/jboss-osgi/trunk/runtime/equinox/pom.xml	2009-04-01 12:55:57 UTC (rev 86585)
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+
+  <name>JBossOSGi - Runtime Equinox</name>
+  <description>JBossOSGi - Equinox Runtime</description>
+
+  <groupId>org.jboss.osgi</groupId>
+  <artifactId>jboss-osgi-runtime-equinox</artifactId>
+  <packaging>jar</packaging>
+
+  <parent>
+    <groupId>org.jboss.osgi</groupId>
+    <artifactId>jboss-osgi-runtime</artifactId>
+    <version>1.0.0.Beta1</version>
+  </parent>
+
+  <!-- Properties -->
+  <properties>
+  </properties>
+  
+  <!-- Dependencies -->
+  <dependencies>
+    <dependency>
+      <groupId>org.jboss.osgi</groupId>
+      <artifactId>jboss-osgi-runtime-spi</artifactId>
+      <version>${version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.eclipse</groupId>
+      <artifactId>osgi</artifactId>
+      <version>3.4.3.R34x_v20081215-1030</version>
+    </dependency>
+    
+    <!-- Test Dependencies -->
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>log4j</groupId>
+      <artifactId>log4j</artifactId>
+      <scope>test</scope>
+    </dependency>
+  </dependencies>
+
+  <!-- Build -->
+  <build>
+    <plugins>
+    </plugins>
+  </build>
+
+</project>


Property changes on: projects/jboss-osgi/trunk/runtime/equinox/pom.xml
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Copied: projects/jboss-osgi/trunk/runtime/equinox/src (from rev 86569, projects/jboss-osgi/trunk/runtime/felix/src)


Property changes on: projects/jboss-osgi/trunk/runtime/equinox/src
___________________________________________________________________
Name: svn:mergeinfo
   + 

Copied: projects/jboss-osgi/trunk/runtime/equinox/src/main/java/org/jboss/osgi/equinox (from rev 86569, projects/jboss-osgi/trunk/runtime/felix/src/main/java/org/jboss/osgi/felix)

Copied: projects/jboss-osgi/trunk/runtime/equinox/src/main/java/org/jboss/osgi/equinox/framework/EquinoxIntegration.java (from rev 86569, projects/jboss-osgi/trunk/runtime/felix/src/main/java/org/jboss/osgi/felix/framework/FelixIntegration.java)
===================================================================
--- projects/jboss-osgi/trunk/runtime/equinox/src/main/java/org/jboss/osgi/equinox/framework/EquinoxIntegration.java	                        (rev 0)
+++ projects/jboss-osgi/trunk/runtime/equinox/src/main/java/org/jboss/osgi/equinox/framework/EquinoxIntegration.java	2009-04-01 12:55:57 UTC (rev 86585)
@@ -0,0 +1,184 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.osgi.equinox.framework;
+
+//$Id$
+
+import java.net.URI;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+
+import org.eclipse.core.runtime.adaptor.LocationManager;
+import org.eclipse.osgi.framework.internal.core.Framework;
+import org.eclipse.osgi.framework.internal.core.FrameworkProperties;
+import org.jboss.logging.Logger;
+import org.jboss.osgi.spi.FrameworkException;
+import org.jboss.osgi.spi.framework.OSGiFramework;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.BundleException;
+
+/**
+ * The OSGiFramework for Eclipse Equinox
+ * 
+ * @author thomas.diesler at jboss.com
+ * @since 01-Apr-2009
+ */
+public class EquinoxIntegration implements OSGiFramework
+{
+   // Provide logging
+   final Logger log = Logger.getLogger(EquinoxIntegration.class);
+
+   private Map<String, Object> frameworkProperties = new HashMap<String, Object>();
+   private List<URI> autoInstall = new ArrayList<URI>();
+   private List<URI> autoStart = new ArrayList<URI>();
+
+   private Framework framework;
+
+   public Map<String, Object> getFrameworkProperties()
+   {
+      return frameworkProperties;
+   }
+
+   public void setFrameworkProperties(Map<String, Object> props)
+   {
+      this.frameworkProperties = props;
+   }
+
+   public List<URI> getAutoInstall()
+   {
+      return autoInstall;
+   }
+
+   public void setAutoInstall(List<URI> autoInstall)
+   {
+      this.autoInstall = autoInstall;
+   }
+
+   public List<URI> getAutoStart()
+   {
+      return autoStart;
+   }
+
+   public void setAutoStart(List<URI> autoStart)
+   {
+      this.autoStart = autoStart;
+   }
+
+   public Bundle getSystemBundle()
+   {
+      return framework.getBundle(0);
+   }
+
+   public BundleContext getSystemBundleContext()
+   {
+      return getSystemBundle().getBundleContext();
+   }
+
+   public void create()
+   {
+      String implVersion = getClass().getPackage().getImplementationVersion();
+      log.info("OSGi Integration Equinox - " + implVersion);
+
+      // Push configured props to FrameworkProperties 
+      System.setProperty("osgi.framework.useSystemProperties", "false");
+      Iterator<String> itKeys = frameworkProperties.keySet().iterator();
+      while (itKeys.hasNext())
+      {
+         String key = itKeys.next();
+         Object value = frameworkProperties.get(key);
+         if (value instanceof String)
+         {
+            FrameworkProperties.setProperty(key, (String)value);
+         }
+      }
+
+      // Prevent a NPE when the config area is not set
+      if (FrameworkProperties.getProperty(LocationManager.PROP_INSTALL_AREA) == null)
+      {
+         String userHome = FrameworkProperties.getProperty("user.home");
+         FrameworkProperties.setProperty(LocationManager.PROP_INSTALL_AREA, userHome + "/equinox");
+      }
+      
+      // Init & Start the Framework
+      framework = new Framework(new FrameworkAdaptorImpl());
+      framework.launch();
+   }
+
+   public void start()
+   {
+      // Get system bundle context
+      BundleContext context = getSystemBundleContext();
+      if (context == null)
+         throw new FrameworkException("Cannot obtain system context");
+
+      Map<URI, Bundle> autoBundles = new HashMap<URI, Bundle>();
+
+      // Add the autoStart bundles to autoInstall
+      for (URI bundleURI : autoStart)
+      {
+         autoInstall.add(bundleURI);
+      }
+
+      // Install autoInstall bundles
+      for (URI bundleURI : autoInstall)
+      {
+         try
+         {
+            Bundle bundle = context.installBundle(bundleURI.toString());
+            log.info("Installed bundle: " + bundle.getSymbolicName());
+            autoBundles.put(bundleURI, bundle);
+         }
+         catch (BundleException ex)
+         {
+            log.error("Cannot install bundle: " + bundleURI, ex);
+         }
+      }
+
+      // Start autoStart bundles
+      for (URI bundleURI : autoStart)
+      {
+         try
+         {
+            Bundle bundle = autoBundles.get(bundleURI);
+            bundle.start();
+            log.info("Started bundle: " + bundle.getSymbolicName());
+         }
+         catch (BundleException ex)
+         {
+            log.error("Cannot start bundle: " + bundleURI, ex);
+         }
+      }
+   }
+
+   public void stop()
+   {
+      if (framework != null)
+      {
+         framework.shutdown();
+      }
+   }
+}
\ No newline at end of file

Deleted: projects/jboss-osgi/trunk/runtime/equinox/src/main/java/org/jboss/osgi/equinox/framework/FelixIntegration.java
===================================================================
--- projects/jboss-osgi/trunk/runtime/felix/src/main/java/org/jboss/osgi/felix/framework/FelixIntegration.java	2009-04-01 05:26:19 UTC (rev 86569)
+++ projects/jboss-osgi/trunk/runtime/equinox/src/main/java/org/jboss/osgi/equinox/framework/FelixIntegration.java	2009-04-01 12:55:57 UTC (rev 86585)
@@ -1,181 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.osgi.felix.framework;
-
-//$Id$
-
-import java.net.URI;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.felix.framework.Felix;
-import org.jboss.logging.Logger;
-import org.jboss.osgi.spi.FrameworkException;
-import org.jboss.osgi.spi.framework.OSGiFramework;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.BundleException;
-
-/**
- * An abstraction of an OSGi Framework
- * 
- * @author thomas.diesler at jboss.com
- * @since 23-Jan-2009
- */
-public class FelixIntegration implements OSGiFramework
-{
-   // Provide logging
-   final Logger log = Logger.getLogger(FelixIntegration.class);
-
-   private Map<String, Object> felixProperties = new HashMap<String, Object>();
-   private List<URI> autoInstall = new ArrayList<URI>();
-   private List<URI> autoStart = new ArrayList<URI>();
-
-   private Felix felix;
-
-   public Map<String, Object> getFelixProperties()
-   {
-      return felixProperties;
-   }
-
-   public void setFelixProperties(Map<String, Object> props)
-   {
-      this.felixProperties = props;
-   }
-
-   public List<URI> getAutoInstall()
-   {
-      return autoInstall;
-   }
-
-   public void setAutoInstall(List<URI> autoInstall)
-   {
-      this.autoInstall = autoInstall;
-   }
-
-   public List<URI> getAutoStart()
-   {
-      return autoStart;
-   }
-
-   public void setAutoStart(List<URI> autoStart)
-   {
-      this.autoStart = autoStart;
-   }
-
-   public Bundle getSystemBundle()
-   {
-      return felix;
-   }
-
-   public BundleContext getSystemBundleContext()
-   {
-      return getSystemBundle().getBundleContext();
-   }
-
-   public void create()
-   {
-      String implVersion = getClass().getPackage().getImplementationVersion();
-      log.info("OSGi Integration Felix - " + implVersion);
-
-      // When a Felix instance is embedded in a host application,
-      // the host application must inform the Felix instance that it is embedded
-      felixProperties.put("felix.embedded.execution", "true");
-
-      // An instance of Logger that the framework uses as its default logger
-      felixProperties.put("felix.log.logger", new FelixLogger());
-
-      // Init & Start the System Bundle
-      try
-      {
-         felix = new Felix(felixProperties);
-         felix.start();
-      }
-      catch (BundleException ex)
-      {
-         throw new FrameworkException("Cannot initialze system bundle", ex);
-      }
-   }
-
-   public void start()
-  {
-    // Get system bundle context
-    BundleContext context = felix.getBundleContext();
-    if (context == null)
-      throw new FrameworkException("Cannot obtain system context");
-    
-    Map<URI, Bundle> autoBundles = new HashMap<URI, Bundle>();
-
-    // Add the autoStart bundles to autoInstall
-    for (URI bundleURI : autoStart)
-    {
-      autoInstall.add(bundleURI);
-    }
-
-    // Install autoInstall bundles
-    for (URI bundleURI : autoInstall)
-    {
-      try
-      {
-        Bundle bundle = context.installBundle(bundleURI.toString());
-        log.info("Installed bundle: " + bundle.getSymbolicName());
-        autoBundles.put(bundleURI, bundle);
-      }
-      catch (BundleException ex)
-      {
-        log.error("Cannot install bundle: " + bundleURI, ex);
-      }
-    }
-
-    // Start autoStart bundles
-    for (URI bundleURI : autoStart)
-    {
-      try
-      {
-        Bundle bundle = autoBundles.get(bundleURI);
-        bundle.start();
-        log.info("Started bundle: " + bundle.getSymbolicName());
-      }
-      catch (BundleException ex)
-      {
-        log.error("Cannot start bundle: " + bundleURI, ex);
-      }
-    }
-  }
-
-   public void stop()
-   {
-      if (felix != null)
-      {
-         try
-         {
-            felix.stop();
-         }
-         catch (BundleException ex)
-         {
-            log.error("Cannot stop Felix", ex);
-         }
-      }
-   }
-}
\ No newline at end of file

Deleted: projects/jboss-osgi/trunk/runtime/equinox/src/main/java/org/jboss/osgi/equinox/framework/FelixLogger.java
===================================================================
--- projects/jboss-osgi/trunk/runtime/felix/src/main/java/org/jboss/osgi/felix/framework/FelixLogger.java	2009-04-01 05:26:19 UTC (rev 86569)
+++ projects/jboss-osgi/trunk/runtime/equinox/src/main/java/org/jboss/osgi/equinox/framework/FelixLogger.java	2009-04-01 12:55:57 UTC (rev 86585)
@@ -1,76 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.osgi.felix.framework;
-
-//$Id: FelixIntegration.java 84730 2009-02-25 12:57:23Z thomas.diesler at jboss.com $
-
-import org.jboss.logging.Logger;
-import org.osgi.framework.ServiceReference;
-
-/**
- * An integration with the Felix Logger.
- * 
- * This Logger gets registered with the Felix framework and 
- * delegates framework log messages to the JBoss logger.
- * 
- * @author thomas.diesler at jboss.com
- * @since 04-Mar-2009
- */
-public class FelixLogger extends org.apache.felix.framework.Logger
-{
-   // Provide logging
-   final Logger log = Logger.getLogger(FelixLogger.class);
-
-   public FelixLogger()
-   {
-      setLogLevel(LOG_DEBUG);
-   }
-
-   @Override
-   protected void doLog(ServiceReference sref, int level, String msg, Throwable throwable)
-   {
-      if (sref != null)
-         msg = sref + ": " + msg;
-
-      // An unresolved bundle causes a WARNING that comes with an exception
-      // Currently we log WARNING exceptions at DEBUG level      
-      
-      if (level == LOG_DEBUG)
-      {
-         log.debug(msg, throwable);
-      }
-      else if (level == LOG_INFO)
-      {
-         log.info(msg, throwable);
-      }
-      else if (level == LOG_WARNING)
-      {
-         log.warn(msg);
-         if (throwable != null)
-            log.debug(msg, throwable);
-      }
-      else if (level == LOG_ERROR)
-      {
-         log.error(msg, throwable);
-      }
-   }
-}
\ No newline at end of file

Deleted: projects/jboss-osgi/trunk/runtime/equinox/src/main/resources/osgi-jboss-beans.xml
===================================================================
--- projects/jboss-osgi/trunk/runtime/felix/src/main/resources/osgi-jboss-beans.xml	2009-04-01 05:26:19 UTC (rev 86569)
+++ projects/jboss-osgi/trunk/runtime/equinox/src/main/resources/osgi-jboss-beans.xml	2009-04-01 12:55:57 UTC (rev 86585)
@@ -1,25 +0,0 @@
-<!--
-  $Id$ 
--->
-<deployment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:jboss:bean-deployer:2.0 bean-deployer_2_0.xsd" xmlns="urn:jboss:bean-deployer:2.0">
-
-  <!-- The OSGiFramework -->
-  <bean name="jboss.osgi:service=Framework" class="org.jboss.osgi.felix.framework.FelixIntegration">
-    <property name="felixProperties">
-      <map keyClass="java.lang.String" valueClass="java.lang.String">
-        <entry>
-          <key>org.osgi.framework.system.packages</key>
-          <value>
-          </value>
-        </entry>
-      </map>
-    </property>
-  </bean>
-  
- <!-- A Service that gives access to the Microcontainer Kernel -->
- <bean name="jboss.osgi:service=Microcontainer" class="org.jboss.osgi.service.MicrocontainerService">
-  <property name="bundleContext"><inject bean="jboss.osgi:service=Framework" property="systemBundleContext"/></property>
-  <property name="kernel"><inject bean="jboss.kernel:service=Kernel" /></property>
- </bean>
- 
-</deployment>

Copied: projects/jboss-osgi/trunk/runtime/equinox/src/test/java/org/jboss/test/osgi/equinox (from rev 86569, projects/jboss-osgi/trunk/runtime/felix/src/test/java/org/jboss/test/osgi/felix)

Copied: projects/jboss-osgi/trunk/runtime/equinox/src/test/java/org/jboss/test/osgi/equinox/SystemBundleTestCase.java (from rev 86569, projects/jboss-osgi/trunk/runtime/felix/src/test/java/org/jboss/test/osgi/felix/system/SystemBundleTestCase.java)
===================================================================
--- projects/jboss-osgi/trunk/runtime/equinox/src/test/java/org/jboss/test/osgi/equinox/SystemBundleTestCase.java	                        (rev 0)
+++ projects/jboss-osgi/trunk/runtime/equinox/src/test/java/org/jboss/test/osgi/equinox/SystemBundleTestCase.java	2009-04-01 12:55:57 UTC (rev 86585)
@@ -0,0 +1,62 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.osgi.equinox;
+
+//$Id$
+
+import org.jboss.osgi.equinox.framework.EquinoxIntegration;
+import org.jboss.osgi.spi.framework.OSGiBootstrap;
+import org.jboss.osgi.spi.framework.OSGiBootstrapProvider;
+import org.jboss.osgi.spi.framework.OSGiFramework;
+import org.jboss.osgi.spi.junit.OSGiTest;
+import org.osgi.framework.Bundle;
+
+/**
+ * Test OSGi System bundle access
+ * 
+ * @author thomas.diesler at jboss.com
+ * @since 23-Jan-2009
+ */
+public class SystemBundleTestCase extends OSGiTest
+{
+   public void testEquinoxIntegration()
+   {
+      EquinoxIntegration framework = new EquinoxIntegration();
+      framework.create();
+      framework.start();
+      
+      Bundle bundle = framework.getSystemBundle();
+
+      assertEquals("BundleId == 0", 0, bundle.getBundleId());
+      assertEquals("SymbolicName == org.eclipse.osgi", "org.eclipse.osgi", bundle.getSymbolicName());
+   }
+   
+   public void testSystemBundle()
+   {
+      OSGiBootstrapProvider configProvider = OSGiBootstrap.getBootstrapProvider();
+      OSGiFramework framework = configProvider.getFramework();
+      Bundle bundle = framework.getSystemBundle();
+
+      assertEquals("BundleId == 0", 0, bundle.getBundleId());
+      assertEquals("SymbolicName == org.eclipse.osgi", "org.eclipse.osgi", bundle.getSymbolicName());
+   }
+}
\ No newline at end of file

Modified: projects/jboss-osgi/trunk/runtime/equinox/src/test/resources/jboss-osgi-beans.xml
===================================================================
--- projects/jboss-osgi/trunk/runtime/felix/src/test/resources/jboss-osgi-beans.xml	2009-04-01 05:26:19 UTC (rev 86569)
+++ projects/jboss-osgi/trunk/runtime/equinox/src/test/resources/jboss-osgi-beans.xml	2009-04-01 12:55:57 UTC (rev 86585)
@@ -4,17 +4,12 @@
 <deployment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:jboss:bean-deployer:2.0 bean-deployer_2_0.xsd" xmlns="urn:jboss:bean-deployer:2.0">
 
  <!-- The OSGiFramework -->
- <bean name="jboss.osgi:service=Framework" class="org.jboss.osgi.felix.framework.FelixIntegration">
-  <property name="felixProperties">
+ <bean name="jboss.osgi:service=Framework" class="org.jboss.osgi.equinox.framework.EquinoxIntegration">
+  <property name="frameworkProperties">
    <map keyClass="java.lang.String" valueClass="java.lang.String">
     <entry><key>org.osgi.framework.storage.clean</key><value>onFirstInit</value></entry>
    </map>
   </property>
  </bean>
 
- <bean name="jboss.osgi:service=Microcontainer" class="org.jboss.osgi.service.MicrocontainerService">
-  <property name="systemContext"><inject bean="jboss.osgi:service=Framework" property="systemBundleContext"/></property>
-  <property name="kernel"><inject bean="jboss.kernel:service=Kernel" /></property>
- </bean>
-
 </deployment>

Modified: projects/jboss-osgi/trunk/runtime/felix/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/runtime/felix/pom.xml	2009-04-01 10:55:17 UTC (rev 86584)
+++ projects/jboss-osgi/trunk/runtime/felix/pom.xml	2009-04-01 12:55:57 UTC (rev 86585)
@@ -47,32 +47,6 @@
   <!-- Build -->
   <build>
     <plugins>
-      <plugin>
-        <artifactId>maven-assembly-plugin</artifactId>
-        <executions>
-          <execution>
-            <phase>package</phase>
-            <goals>
-              <goal>single</goal>
-            </goals>
-            <configuration>
-              <finalName>${project.build.finalName}</finalName>
-              <appendAssemblyId>true</appendAssemblyId>
-              <descriptors>
-                <descriptor>scripts/assembly-config.xml</descriptor>
-              </descriptors>
-            </configuration>
-          </execution>
-        </executions>
-      </plugin>
-      <plugin>
-        <artifactId>maven-jar-plugin</artifactId>
-        <configuration>
-          <excludes>
-            <exclude>*beans.xml</exclude>
-          </excludes>
-        </configuration>
-      </plugin>
     </plugins>
   </build>
 

Deleted: projects/jboss-osgi/trunk/runtime/felix/src/main/resources/osgi-jboss-beans.xml
===================================================================
--- projects/jboss-osgi/trunk/runtime/felix/src/main/resources/osgi-jboss-beans.xml	2009-04-01 10:55:17 UTC (rev 86584)
+++ projects/jboss-osgi/trunk/runtime/felix/src/main/resources/osgi-jboss-beans.xml	2009-04-01 12:55:57 UTC (rev 86585)
@@ -1,25 +0,0 @@
-<!--
-  $Id$ 
--->
-<deployment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:jboss:bean-deployer:2.0 bean-deployer_2_0.xsd" xmlns="urn:jboss:bean-deployer:2.0">
-
-  <!-- The OSGiFramework -->
-  <bean name="jboss.osgi:service=Framework" class="org.jboss.osgi.felix.framework.FelixIntegration">
-    <property name="felixProperties">
-      <map keyClass="java.lang.String" valueClass="java.lang.String">
-        <entry>
-          <key>org.osgi.framework.system.packages</key>
-          <value>
-          </value>
-        </entry>
-      </map>
-    </property>
-  </bean>
-  
- <!-- A Service that gives access to the Microcontainer Kernel -->
- <bean name="jboss.osgi:service=Microcontainer" class="org.jboss.osgi.service.MicrocontainerService">
-  <property name="bundleContext"><inject bean="jboss.osgi:service=Framework" property="systemBundleContext"/></property>
-  <property name="kernel"><inject bean="jboss.kernel:service=Kernel" /></property>
- </bean>
- 
-</deployment>

Copied: projects/jboss-osgi/trunk/runtime/felix/src/test/java/org/jboss/test/osgi/felix/SystemBundleTestCase.java (from rev 86569, projects/jboss-osgi/trunk/runtime/felix/src/test/java/org/jboss/test/osgi/felix/system/SystemBundleTestCase.java)
===================================================================
--- projects/jboss-osgi/trunk/runtime/felix/src/test/java/org/jboss/test/osgi/felix/SystemBundleTestCase.java	                        (rev 0)
+++ projects/jboss-osgi/trunk/runtime/felix/src/test/java/org/jboss/test/osgi/felix/SystemBundleTestCase.java	2009-04-01 12:55:57 UTC (rev 86585)
@@ -0,0 +1,62 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.osgi.felix;
+
+//$Id$
+
+import org.jboss.osgi.felix.framework.FelixIntegration;
+import org.jboss.osgi.spi.framework.OSGiBootstrap;
+import org.jboss.osgi.spi.framework.OSGiBootstrapProvider;
+import org.jboss.osgi.spi.framework.OSGiFramework;
+import org.jboss.osgi.spi.junit.OSGiTest;
+import org.osgi.framework.Bundle;
+
+/**
+ * Test OSGi System bundle access
+ * 
+ * @author thomas.diesler at jboss.com
+ * @since 23-Jan-2009
+ */
+public class SystemBundleTestCase extends OSGiTest
+{
+   public void testFelixIntegration()
+   {
+      FelixIntegration framework = new FelixIntegration();
+      framework.create();
+      framework.start();
+      
+      Bundle bundle = framework.getSystemBundle();
+
+      assertEquals("BundleId == 0", 0, bundle.getBundleId());
+      assertEquals("SymbolicName == system.bundle", "system.bundle", bundle.getSymbolicName());
+   }
+   
+   public void testSystemBundle()
+   {
+      OSGiBootstrapProvider configProvider = OSGiBootstrap.getBootstrapProvider();
+      OSGiFramework framework = configProvider.getFramework();
+      Bundle bundle = framework.getSystemBundle();
+
+      assertEquals("BundleId == 0", 0, bundle.getBundleId());
+      assertEquals("SymbolicName == system.bundle", "system.bundle", bundle.getSymbolicName());
+   }
+}
\ No newline at end of file

Modified: projects/jboss-osgi/trunk/runtime/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/runtime/pom.xml	2009-04-01 10:55:17 UTC (rev 86584)
+++ projects/jboss-osgi/trunk/runtime/pom.xml	2009-04-01 12:55:57 UTC (rev 86585)
@@ -14,6 +14,7 @@
   <modules>
     <module>spi</module>
     <module>deployer</module>
+    <module>equinox</module>
     <module>felix</module>
   </modules>
 




More information about the jboss-osgi-commits mailing list