[jboss-osgi-commits] JBoss-OSGI SVN: r99942 - in projects/jboss-osgi/projects/bundles: serviceloader and 6 other directories.

jboss-osgi-commits at lists.jboss.org jboss-osgi-commits at lists.jboss.org
Tue Jan 26 10:25:36 EST 2010


Author: thomas.diesler at jboss.com
Date: 2010-01-26 10:25:35 -0500 (Tue, 26 Jan 2010)
New Revision: 99942

Added:
   projects/jboss-osgi/projects/bundles/serviceloader/
   projects/jboss-osgi/projects/bundles/serviceloader/trunk/
   projects/jboss-osgi/projects/bundles/serviceloader/trunk/pom.xml
   projects/jboss-osgi/projects/bundles/serviceloader/trunk/src/main/java/org/jboss/osgi/serviceloader/
   projects/jboss-osgi/projects/bundles/serviceloader/trunk/src/main/java/org/jboss/osgi/serviceloader/ServiceLoaderCapability.java
   projects/jboss-osgi/projects/bundles/serviceloader/trunk/src/main/java/org/jboss/osgi/serviceloader/ServiceLoaderService.java
   projects/jboss-osgi/projects/bundles/serviceloader/trunk/src/main/java/org/jboss/osgi/serviceloader/internal/
   projects/jboss-osgi/projects/bundles/serviceloader/trunk/src/main/java/org/jboss/osgi/serviceloader/internal/ServiceLoaderActivator.java
   projects/jboss-osgi/projects/bundles/serviceloader/trunk/src/main/java/org/jboss/osgi/serviceloader/internal/ServiceLoaderInterceptor.java
Removed:
   projects/jboss-osgi/projects/bundles/serviceloader/trunk/pom.xml
   projects/jboss-osgi/projects/bundles/serviceloader/trunk/src/main/java/org/jboss/osgi/common/internal/
   projects/jboss-osgi/projects/bundles/serviceloader/trunk/src/main/java/org/jboss/osgi/common/log/
Modified:
   projects/jboss-osgi/projects/bundles/serviceloader/trunk/.settings/org.eclipse.jdt.core.prefs
Log:
Add the jboss-osgi-serviceloader bundle

Copied: projects/jboss-osgi/projects/bundles/serviceloader/trunk (from rev 97207, projects/jboss-osgi/projects/bundles/common/trunk)

Modified: projects/jboss-osgi/projects/bundles/serviceloader/trunk/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- projects/jboss-osgi/projects/bundles/common/trunk/.settings/org.eclipse.jdt.core.prefs	2009-12-01 08:46:33 UTC (rev 97207)
+++ projects/jboss-osgi/projects/bundles/serviceloader/trunk/.settings/org.eclipse.jdt.core.prefs	2010-01-26 15:25:35 UTC (rev 99942)
@@ -1,5 +1,6 @@
-#Tue Apr 14 17:48:49 CEST 2009
+#Tue Jan 26 15:12:03 CET 2010
 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.problem.forbiddenReference=warning
 org.eclipse.jdt.core.compiler.source=1.5

Deleted: projects/jboss-osgi/projects/bundles/serviceloader/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/projects/bundles/common/trunk/pom.xml	2009-12-01 08:46:33 UTC (rev 97207)
+++ projects/jboss-osgi/projects/bundles/serviceloader/trunk/pom.xml	2010-01-26 15:25:35 UTC (rev 99942)
@@ -1,141 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-  <!-- ====================================================================== -->
-  <!--                                                                        -->
-  <!--  JBoss, the OpenSource J2EE webOS                                      -->
-  <!--                                                                        -->
-  <!--  Distributable under LGPL license.                                     -->
-  <!--  See terms of license at http://www.gnu.org.                           -->
-  <!--                                                                        -->
-  <!-- ====================================================================== -->
-
-  <!-- $Id$ -->
-  
-<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 Bundles - Common</name>
-  <description>The JBossOSGi common services</description>
-  
-  <groupId>org.jboss.osgi.bundles</groupId>
-  <artifactId>jboss-osgi-common</artifactId>
-  <packaging>bundle</packaging>
-  
-  <version>1.0.4-SNAPSHOT</version>
-  
-  <!-- Parent -->
-  <parent>
-    <groupId>org.jboss.osgi</groupId>
-    <artifactId>jboss-osgi-parent</artifactId>
-    <version>1.0.4</version>
-  </parent>
-  
-  <!-- SCM -->
-  <scm>
-    <connection>scm:svn:http://anonsvn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/bundles/common/trunk</connection>
-    <developerConnection>scm:svn:https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/bundles/common/trunk</developerConnection>
-    <url>http://fisheye.jboss.com/qsearch/JBossOSGi</url>
-  </scm>
-
-  <!-- Properties -->  
-  <properties>
-    <version.jboss.osgi.spi>1.0.3</version.jboss.osgi.spi>
-    <version.osgi>4.2.0</version.osgi>
-  </properties>
-  
-  <!-- Dependencies -->
-  <dependencies>
-    <dependency>
-      <groupId>org.jboss.osgi</groupId>
-      <artifactId>jboss-osgi-spi</artifactId>
-      <version>${version.jboss.osgi.spi}</version>
-    </dependency>
-    <dependency>
-      <groupId>org.slf4j</groupId>
-      <artifactId>slf4j-api</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.slf4j</groupId>
-      <artifactId>slf4j-log4j12</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.slf4j</groupId>
-      <artifactId>jcl-over-slf4j</artifactId>
-      <version>${version.slf4j}</version>
-    </dependency>
-    
-    <!-- Provided Dependencies -->
-    <dependency>
-      <groupId>org.osgi</groupId>
-      <artifactId>org.osgi.core</artifactId>
-      <version>${version.osgi}</version>
-      <scope>provided</scope>
-    </dependency>
-    <dependency>
-      <groupId>org.osgi</groupId>
-      <artifactId>org.osgi.compendium</artifactId>
-      <version>${version.osgi}</version>
-      <scope>provided</scope>
-    </dependency>
-  </dependencies>
-
-  <build>
-    <plugins>
-      <plugin>
-        <groupId>org.apache.felix</groupId>
-        <artifactId>maven-bundle-plugin</artifactId>
-        <extensions>true</extensions>
-        <configuration>
-          <instructions>
-            <Bundle-SymbolicName>${artifactId}</Bundle-SymbolicName>
-            <Bundle-Activator>org.jboss.osgi.common.internal.CommonServicesActivator</Bundle-Activator>
-            <Export-Package>
-              org.jboss.osgi.common.log;version=${version}
-            </Export-Package>
-            <Import-Package>
-               javax.management,
-               org.apache.log4j;version=1.2;resolution:=optional, 
-               org.jboss.osgi.spi.capability;version=1.0,
-               org.jboss.osgi.spi.util;version=1.0,
-               org.osgi.framework;version=1.4,
-               org.osgi.service.log;version=1.3,
-               org.osgi.util.tracker
-            </Import-Package>
-            <Embed-Dependency>
-              jcl-over-slf4j;inline=false,
-              slf4j-api;inline=false,
-              slf4j-log4j12;inline=false,
-            </Embed-Dependency>
-            <_exportcontents>
-              org.apache.commons.logging;version=1.1.1,
-              org.slf4j;version=1.5.8,
-            </_exportcontents>
-          </instructions>
-        </configuration>
-      </plugin>
-      <plugin>
-        <groupId>org.codehaus.mojo</groupId>
-        <artifactId>build-helper-maven-plugin</artifactId>
-        <executions>
-          <execution>
-            <id>attach-artifacts</id>
-            <phase>package</phase>
-            <goals>
-              <goal>attach-artifact</goal>
-            </goals>
-            <configuration>
-              <artifacts>
-                <artifact>
-                  <!-- For some reason the distribution javadoc module needs this -->
-                  <file>target/${artifactId}-${version}-sources.jar</file>
-                  <classifier>sources</classifier>
-                  <type>jar</type>
-                </artifact>
-              </artifacts>
-            </configuration>
-          </execution>
-        </executions>
-      </plugin>
-    </plugins>
-  </build>
-</project>

Copied: projects/jboss-osgi/projects/bundles/serviceloader/trunk/pom.xml (from rev 97292, projects/jboss-osgi/projects/bundles/common/trunk/pom.xml)
===================================================================
--- projects/jboss-osgi/projects/bundles/serviceloader/trunk/pom.xml	                        (rev 0)
+++ projects/jboss-osgi/projects/bundles/serviceloader/trunk/pom.xml	2010-01-26 15:25:35 UTC (rev 99942)
@@ -0,0 +1,86 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+  <!-- ====================================================================== -->
+  <!--                                                                        -->
+  <!--  JBoss, the OpenSource J2EE webOS                                      -->
+  <!--                                                                        -->
+  <!--  Distributable under LGPL license.                                     -->
+  <!--  See terms of license at http://www.gnu.org.                           -->
+  <!--                                                                        -->
+  <!-- ====================================================================== -->
+
+  <!-- $Id$ -->
+  
+<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 Bundles - Service Loader</name>
+  <description>The JBossOSGi META-INF/services Loader</description>
+  
+  <groupId>org.jboss.osgi.bundles</groupId>
+  <artifactId>jboss-osgi-serviceloader</artifactId>
+  <packaging>bundle</packaging>
+  
+  <version>1.0.0-SNAPSHOT</version>
+  
+  <!-- Parent -->
+  <parent>
+    <groupId>org.jboss.osgi</groupId>
+    <artifactId>jboss-osgi-parent</artifactId>
+    <version>1.0.4</version>
+  </parent>
+  
+  <!-- Properties -->  
+  <properties>
+    <version.jboss.osgi.deployment>1.0.1-SNAPSHOT</version.jboss.osgi.deployment>
+    <version.jboss.osgi.spi>1.0.4-SNAPSHOT</version.jboss.osgi.spi>
+    <version.osgi>4.2.0</version.osgi>
+  </properties>
+  
+  <!-- Dependencies -->
+  <dependencies>
+    <dependency>
+      <groupId>org.jboss.osgi.runtime</groupId>
+      <artifactId>jboss-osgi-deployment</artifactId>
+      <version>${version.jboss.osgi.deployment}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.jboss.osgi</groupId>
+      <artifactId>jboss-osgi-spi</artifactId>
+      <version>${version.jboss.osgi.spi}</version>
+    </dependency>
+    
+    <!-- Provided Dependencies -->
+    <dependency>
+      <groupId>org.osgi</groupId>
+      <artifactId>org.osgi.core</artifactId>
+      <version>${version.osgi}</version>
+      <scope>provided</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.osgi</groupId>
+      <artifactId>org.osgi.compendium</artifactId>
+      <version>${version.osgi}</version>
+      <scope>provided</scope>
+    </dependency>
+  </dependencies>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.felix</groupId>
+        <artifactId>maven-bundle-plugin</artifactId>
+        <extensions>true</extensions>
+        <configuration>
+          <instructions>
+            <Bundle-SymbolicName>${artifactId}</Bundle-SymbolicName>
+            <Bundle-Activator>org.jboss.osgi.serviceloader.internal.ServiceLoaderActivator</Bundle-Activator>
+            <Export-Package>
+              org.jboss.osgi.serviceloader;version=${version}
+            </Export-Package>
+          </instructions>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+</project>

Added: projects/jboss-osgi/projects/bundles/serviceloader/trunk/src/main/java/org/jboss/osgi/serviceloader/ServiceLoaderCapability.java
===================================================================
--- projects/jboss-osgi/projects/bundles/serviceloader/trunk/src/main/java/org/jboss/osgi/serviceloader/ServiceLoaderCapability.java	                        (rev 0)
+++ projects/jboss-osgi/projects/bundles/serviceloader/trunk/src/main/java/org/jboss/osgi/serviceloader/ServiceLoaderCapability.java	2010-01-26 15:25:35 UTC (rev 99942)
@@ -0,0 +1,46 @@
+/*
+ * 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.serviceloader;
+
+//$Id$
+
+import org.jboss.osgi.spi.capability.Capability;
+
+/**
+ * Adds the Blueprint capability to the {@link OSGiRuntime}
+ * under test. 
+ * 
+ * It is ignored if the {@link ServiceLoaderService} is already registered.
+ * 
+ * Installed bundles: jboss-osgi-serviceloader  
+ * 
+ * @author thomas.diesler at jboss.com
+ * @since 26-Jan-2010
+ */
+public class ServiceLoaderCapability extends Capability
+{
+   public ServiceLoaderCapability()
+   {
+      super(ServiceLoaderService.class.getName());
+      addBundle("bundles/jboss-osgi-serviceloader.jar");
+   }
+}
\ No newline at end of file


Property changes on: projects/jboss-osgi/projects/bundles/serviceloader/trunk/src/main/java/org/jboss/osgi/serviceloader/ServiceLoaderCapability.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Added: projects/jboss-osgi/projects/bundles/serviceloader/trunk/src/main/java/org/jboss/osgi/serviceloader/ServiceLoaderService.java
===================================================================
--- projects/jboss-osgi/projects/bundles/serviceloader/trunk/src/main/java/org/jboss/osgi/serviceloader/ServiceLoaderService.java	                        (rev 0)
+++ projects/jboss-osgi/projects/bundles/serviceloader/trunk/src/main/java/org/jboss/osgi/serviceloader/ServiceLoaderService.java	2010-01-26 15:25:35 UTC (rev 99942)
@@ -0,0 +1,34 @@
+/*
+ * 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.serviceloader;
+
+//$Id$
+
+/**
+ * A marker service that is registered by jboss-osgi-serviceloader
+ * 
+ * @author thomas.diesler at jboss.com
+ * @since 26-Jan-2010
+ */
+public interface ServiceLoaderService
+{
+}
\ No newline at end of file


Property changes on: projects/jboss-osgi/projects/bundles/serviceloader/trunk/src/main/java/org/jboss/osgi/serviceloader/ServiceLoaderService.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Added: projects/jboss-osgi/projects/bundles/serviceloader/trunk/src/main/java/org/jboss/osgi/serviceloader/internal/ServiceLoaderActivator.java
===================================================================
--- projects/jboss-osgi/projects/bundles/serviceloader/trunk/src/main/java/org/jboss/osgi/serviceloader/internal/ServiceLoaderActivator.java	                        (rev 0)
+++ projects/jboss-osgi/projects/bundles/serviceloader/trunk/src/main/java/org/jboss/osgi/serviceloader/internal/ServiceLoaderActivator.java	2010-01-26 15:25:35 UTC (rev 99942)
@@ -0,0 +1,52 @@
+/*
+ * 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.serviceloader.internal;
+
+//$Id$
+
+import org.jboss.osgi.deployment.interceptor.LifecycleInterceptor;
+import org.jboss.osgi.serviceloader.ServiceLoaderService;
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+
+/**
+ * A bundle activator that registers the {@link ServiceLoaderInterceptor}.
+ * 
+ * @author thomas.diesler at jboss.com
+ * @since 26-Jan-2010
+ */
+public class ServiceLoaderActivator implements BundleActivator
+{
+   public void start(BundleContext context)
+   {
+      // Register marker service
+      context.registerService(ServiceLoaderService.class.getName(), new ServiceLoaderService(){}, null);
+      
+      // Register lifecycle interceptor
+      ServiceLoaderInterceptor interceptor = new ServiceLoaderInterceptor();
+      context.registerService(LifecycleInterceptor.class.getName(), interceptor, null);
+   }
+
+   public void stop(BundleContext context)
+   {
+   }
+}
\ No newline at end of file


Property changes on: projects/jboss-osgi/projects/bundles/serviceloader/trunk/src/main/java/org/jboss/osgi/serviceloader/internal/ServiceLoaderActivator.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Added: projects/jboss-osgi/projects/bundles/serviceloader/trunk/src/main/java/org/jboss/osgi/serviceloader/internal/ServiceLoaderInterceptor.java
===================================================================
--- projects/jboss-osgi/projects/bundles/serviceloader/trunk/src/main/java/org/jboss/osgi/serviceloader/internal/ServiceLoaderInterceptor.java	                        (rev 0)
+++ projects/jboss-osgi/projects/bundles/serviceloader/trunk/src/main/java/org/jboss/osgi/serviceloader/internal/ServiceLoaderInterceptor.java	2010-01-26 15:25:35 UTC (rev 99942)
@@ -0,0 +1,121 @@
+/*
+ * 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.serviceloader.internal;
+
+//$Id$
+
+import java.io.BufferedReader;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.util.Enumeration;
+
+import org.jboss.osgi.deployment.interceptor.AbstractLifecycleInterceptor;
+import org.jboss.osgi.deployment.interceptor.InvocationContext;
+import org.jboss.virtual.VirtualFile;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * An interceptor that registeres service defained in META-INF/services.
+ * 
+ * @author thomas.diesler at jboss.com
+ * @since 26-Jan-2010
+ */
+public class ServiceLoaderInterceptor extends AbstractLifecycleInterceptor
+{
+   // Provide logging
+   private Logger log = LoggerFactory.getLogger(ServiceLoaderInterceptor.class);
+
+   @SuppressWarnings("unchecked")
+   public void invoke(int state, InvocationContext context)
+   {
+      // Parse and create metadta on STARTING
+      if (state == Bundle.STARTING)
+      {
+         Bundle bundle = context.getBundle();
+         if (bundle.getEntry("META-INF/services") == null)
+            return;
+
+         Enumeration<String> entryPaths = bundle.getEntryPaths("META-INF/services");
+         while (entryPaths.hasMoreElements())
+         {
+            String entryPath = entryPaths.nextElement();
+            processServicesEntryPath(context, entryPath);
+         }
+      }
+   }
+
+   private void processServicesEntryPath(InvocationContext context, String entryPath)
+   {
+      Bundle bundle = context.getBundle();
+      VirtualFile root = context.getRoot();
+
+      try
+      {
+         String serviceName = entryPath.substring("META-INF/services/".length());
+         Class<?> serviceClass = bundle.loadClass(serviceName);
+
+         VirtualFile child = root.getChild(entryPath);
+         InputStream inStream = child.openStream();
+
+         BufferedReader br = new BufferedReader(new InputStreamReader(inStream, "UTF-8"));
+         String implClassName = br.readLine();
+         while (implClassName != null)
+         {
+            int hashIndex = implClassName.indexOf("#");
+            if (hashIndex > 0)
+               implClassName = implClassName.substring(0, hashIndex);
+
+            implClassName = implClassName.trim();
+
+            if (implClassName.length() > 0)
+            {
+               // Load the service class
+               Class<?> implClass = (Class<?>)bundle.loadClass(implClassName);
+               if (serviceClass.isAssignableFrom(implClass) == false)
+               {
+                  log.warn("Not assignable: " + implClassName);
+                  continue;
+               }
+
+               // Register the service instance
+               Object serviceInstance = implClass.newInstance();
+               BundleContext bundleContext = bundle.getBundleContext();
+               bundleContext.registerService(serviceName, serviceInstance, null);
+            }
+
+            implClassName = br.readLine();
+         }
+         br.close();
+      }
+      catch (RuntimeException rte)
+      {
+         throw rte;
+      }
+      catch (Exception ex)
+      {
+         log.error("Cannot process: " + entryPath, ex);
+      }
+   }
+}


Property changes on: projects/jboss-osgi/projects/bundles/serviceloader/trunk/src/main/java/org/jboss/osgi/serviceloader/internal/ServiceLoaderInterceptor.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF



More information about the jboss-osgi-commits mailing list