[jboss-osgi-commits] JBoss-OSGI SVN: r90739 - in projects/jboss-osgi/projects/integration/deployers/trunk: src/main/java/org/jboss/osgi/deployer and 1 other directories.

jboss-osgi-commits at lists.jboss.org jboss-osgi-commits at lists.jboss.org
Wed Jul 1 06:21:17 EDT 2009


Author: thomas.diesler at jboss.com
Date: 2009-07-01 06:21:17 -0400 (Wed, 01 Jul 2009)
New Revision: 90739

Removed:
   projects/jboss-osgi/projects/integration/deployers/trunk/src/main/java/org/jboss/osgi/deployer/helpers/BundleClassLoader.java
Modified:
   projects/jboss-osgi/projects/integration/deployers/trunk/pom.xml
   projects/jboss-osgi/projects/integration/deployers/trunk/src/main/java/org/jboss/osgi/deployer/BundleClassLoaderDeployer.java
Log:
Move BundleClassLoader to SPI

Modified: projects/jboss-osgi/projects/integration/deployers/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/projects/integration/deployers/trunk/pom.xml	2009-07-01 09:38:09 UTC (rev 90738)
+++ projects/jboss-osgi/projects/integration/deployers/trunk/pom.xml	2009-07-01 10:21:17 UTC (rev 90739)
@@ -17,7 +17,7 @@
   </parent>
 
   <properties>
-    <version.jboss.osgi.spi>1.0.0.Beta2</version.jboss.osgi.spi>
+    <version.jboss.osgi.spi>1.0.0-SNAPSHOT</version.jboss.osgi.spi>
     <version.osgi>r4v41</version.osgi>
   </properties>
   

Modified: projects/jboss-osgi/projects/integration/deployers/trunk/src/main/java/org/jboss/osgi/deployer/BundleClassLoaderDeployer.java
===================================================================
--- projects/jboss-osgi/projects/integration/deployers/trunk/src/main/java/org/jboss/osgi/deployer/BundleClassLoaderDeployer.java	2009-07-01 09:38:09 UTC (rev 90738)
+++ projects/jboss-osgi/projects/integration/deployers/trunk/src/main/java/org/jboss/osgi/deployer/BundleClassLoaderDeployer.java	2009-07-01 10:21:17 UTC (rev 90739)
@@ -29,10 +29,10 @@
 import org.jboss.deployers.structure.spi.ClassLoaderFactory;
 import org.jboss.deployers.structure.spi.DeploymentUnit;
 import org.jboss.deployers.structure.spi.DeploymentUnitFilter;
-import org.jboss.osgi.deployer.helpers.BundleClassLoader;
 import org.jboss.osgi.deployer.helpers.BundleDeploymentUnitFilter;
 import org.jboss.osgi.deployer.helpers.PackageAdminDependencyItem;
 import org.jboss.osgi.spi.Constants;
+import org.jboss.osgi.spi.framework.BundleClassLoader;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.BundleContext;
 

Deleted: projects/jboss-osgi/projects/integration/deployers/trunk/src/main/java/org/jboss/osgi/deployer/helpers/BundleClassLoader.java
===================================================================
--- projects/jboss-osgi/projects/integration/deployers/trunk/src/main/java/org/jboss/osgi/deployer/helpers/BundleClassLoader.java	2009-07-01 09:38:09 UTC (rev 90738)
+++ projects/jboss-osgi/projects/integration/deployers/trunk/src/main/java/org/jboss/osgi/deployer/helpers/BundleClassLoader.java	2009-07-01 10:21:17 UTC (rev 90739)
@@ -1,115 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file 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.deployer.helpers;
-
-// $Id: $
-
-import java.io.IOException;
-import java.net.URL;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.util.Dictionary;
-import java.util.Enumeration;
-
-import org.osgi.framework.Bundle;
-import org.osgi.framework.Constants;
-
-/**
- * A BundleClassLoader delegates all classloading concerns to the underlying Bundle.
- * 
- * @author Ales.Justin at jboss.org
- * @author thomas.Diesler at jboss.org
- * @since 03-Feb-2009
- */
-public class BundleClassLoader extends ClassLoader
-{
-   private final Bundle bundle;
-
-   public static BundleClassLoader createBundleClassLoader(final Bundle bundle)
-   {
-      if (bundle == null)
-         throw new IllegalArgumentException("Null bundle");
-
-      return AccessController.doPrivileged(new PrivilegedAction<BundleClassLoader>()
-      {
-         public BundleClassLoader run()
-         {
-            return new BundleClassLoader(bundle);
-         }
-      });
-   }
-
-   private BundleClassLoader(Bundle bundle)
-   {
-      this.bundle = bundle;
-   }
-
-   protected Class<?> findClass(String name) throws ClassNotFoundException
-   {
-      return bundle.loadClass(name);
-   }
-
-   protected URL findResource(String name)
-   {
-      return bundle.getResource(name);
-   }
-
-   @SuppressWarnings("unchecked")
-   protected Enumeration<URL> findResources(String name) throws IOException
-   {
-      return bundle.getResources(name);
-   }
-
-   public URL getResource(String name)
-   {
-      return findResource(name);
-   }
-
-   public Class<?> loadClass(String name) throws ClassNotFoundException
-   {
-      return findClass(name);
-   }
-
-   public boolean equals(Object o)
-   {
-      if (this == o)
-         return true;
-
-      if (o instanceof BundleClassLoader == false)
-         return false;
-
-      final BundleClassLoader bundleClassLoader = (BundleClassLoader)o;
-      return bundle.equals(bundleClassLoader.bundle);
-   }
-
-   public int hashCode()
-   {
-      return bundle.hashCode();
-   }
-
-   public String toString()
-   {
-      Dictionary<?, ?> dictionary = bundle.getHeaders();
-      String bname = dictionary.get(Constants.BUNDLE_NAME) + "(" + dictionary.get(Constants.BUNDLE_SYMBOLICNAME) + ")";
-      return "BundleClassLoader for [" + bname + "]";
-   }
-}




More information about the jboss-osgi-commits mailing list