[jboss-osgi-commits] JBoss-OSGI SVN: r101886 - in projects/jboss-osgi/projects/runtime/framework/trunk: vfs30/src/main/java/org/jboss/osgi/framework/deployers and 1 other directory.

jboss-osgi-commits at lists.jboss.org jboss-osgi-commits at lists.jboss.org
Thu Mar 4 14:45:54 EST 2010


Author: thomas.diesler at jboss.com
Date: 2010-03-04 14:45:53 -0500 (Thu, 04 Mar 2010)
New Revision: 101886

Added:
   projects/jboss-osgi/projects/runtime/framework/trunk/vfs30/src/main/java/org/jboss/osgi/framework/deployers/DeploymentAdaptor30.java
Removed:
   projects/jboss-osgi/projects/runtime/framework/trunk/vfs30/src/main/java/org/jboss/osgi/framework/deployers/DeploymentAdaptor21.java
Modified:
   projects/jboss-osgi/projects/runtime/framework/trunk/core/src/main/java/org/jboss/osgi/framework/deployers/AbstractDeployment.java
Log:
Fall back to DeploymentAdaptor30

Modified: projects/jboss-osgi/projects/runtime/framework/trunk/core/src/main/java/org/jboss/osgi/framework/deployers/AbstractDeployment.java
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/trunk/core/src/main/java/org/jboss/osgi/framework/deployers/AbstractDeployment.java	2010-03-04 19:40:30 UTC (rev 101885)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/core/src/main/java/org/jboss/osgi/framework/deployers/AbstractDeployment.java	2010-03-04 19:45:53 UTC (rev 101886)
@@ -61,8 +61,26 @@
          }
          catch (Exception e)
          {
+            // ignore
+         }
+
+         if (adaptor == null)
+         {
+            try
+            {
+               String classname = "org.jboss.osgi.framework.deployers.DeploymentAdaptor30";
+               ClassLoader classLoader = AbstractDeployment.class.getClassLoader();
+               Class<DeploymentAdaptor> clazz = (Class<DeploymentAdaptor>)classLoader.loadClass(classname);
+               adaptor = clazz.newInstance();
+            }
+            catch (Exception e)
+            {
+               // ignore
+            }
+         }
+         
+         if (adaptor == null)
             throw new IllegalStateException("Cannot load DeploymentAdaptor");
-         }
       }
       return adaptor;
    }

Deleted: projects/jboss-osgi/projects/runtime/framework/trunk/vfs30/src/main/java/org/jboss/osgi/framework/deployers/DeploymentAdaptor21.java
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/trunk/vfs30/src/main/java/org/jboss/osgi/framework/deployers/DeploymentAdaptor21.java	2010-03-04 19:40:30 UTC (rev 101885)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/vfs30/src/main/java/org/jboss/osgi/framework/deployers/DeploymentAdaptor21.java	2010-03-04 19:45:53 UTC (rev 101886)
@@ -1,52 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2009, 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.framework.deployers;
-
-// $Id: AbstractOSGiClassLoadingDeployer.java 101391 2010-02-24 12:58:50Z thomas.diesler at jboss.com $
-
-import org.jboss.deployers.client.spi.Deployment;
-import org.jboss.deployers.structure.spi.DeploymentUnit;
-import org.jboss.deployers.vfs.spi.client.VFSDeploymentFactory;
-import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
-import org.jboss.osgi.vfs.AbstractVFS;
-import org.jboss.osgi.vfs.VirtualFile;
-
-/**
- * An abstraction of the VFSDeploymentFactory for jboss-vfs-2.1.x 
- * 
- * @author Thomas.Diesler at jboss.com
- * @since 03-Mar-2010
- */
-public class DeploymentAdaptor21 implements DeploymentAdaptor 
-{
-   public Deployment createDeployment(VirtualFile root)
-   {
-      VFSDeploymentFactory factory = VFSDeploymentFactory.getInstance();
-      return factory.createVFSDeployment((org.jboss.vfs.VirtualFile)AbstractVFS.adapt(root));
-   }
-
-   public VirtualFile getRoot(DeploymentUnit unit)
-   {
-      VFSDeploymentUnit vfsUnit = (VFSDeploymentUnit)unit;
-      return AbstractVFS.adapt(vfsUnit.getRoot());
-   }
-}

Copied: projects/jboss-osgi/projects/runtime/framework/trunk/vfs30/src/main/java/org/jboss/osgi/framework/deployers/DeploymentAdaptor30.java (from rev 101875, projects/jboss-osgi/projects/runtime/framework/trunk/vfs30/src/main/java/org/jboss/osgi/framework/deployers/DeploymentAdaptor21.java)
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/trunk/vfs30/src/main/java/org/jboss/osgi/framework/deployers/DeploymentAdaptor30.java	                        (rev 0)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/vfs30/src/main/java/org/jboss/osgi/framework/deployers/DeploymentAdaptor30.java	2010-03-04 19:45:53 UTC (rev 101886)
@@ -0,0 +1,52 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2009, 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.framework.deployers;
+
+// $Id: AbstractOSGiClassLoadingDeployer.java 101391 2010-02-24 12:58:50Z thomas.diesler at jboss.com $
+
+import org.jboss.deployers.client.spi.Deployment;
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+import org.jboss.deployers.vfs.spi.client.VFSDeploymentFactory;
+import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
+import org.jboss.osgi.vfs.AbstractVFS;
+import org.jboss.osgi.vfs.VirtualFile;
+
+/**
+ * An abstraction of the VFSDeploymentFactory for jboss-vfs-3.0.x 
+ * 
+ * @author Thomas.Diesler at jboss.com
+ * @since 03-Mar-2010
+ */
+public class DeploymentAdaptor30 implements DeploymentAdaptor 
+{
+   public Deployment createDeployment(VirtualFile root)
+   {
+      VFSDeploymentFactory factory = VFSDeploymentFactory.getInstance();
+      return factory.createVFSDeployment((org.jboss.vfs.VirtualFile)AbstractVFS.adapt(root));
+   }
+
+   public VirtualFile getRoot(DeploymentUnit unit)
+   {
+      VFSDeploymentUnit vfsUnit = (VFSDeploymentUnit)unit;
+      return AbstractVFS.adapt(vfsUnit.getRoot());
+   }
+}



More information about the jboss-osgi-commits mailing list