[jboss-cvs] JBossAS SVN: r59519 - in projects/osgi/trunk/deployment/src/main/org/jboss/osgi: metadata/plugins and 1 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Jan 11 06:01:57 EST 2007


Author: alesj
Date: 2007-01-11 06:01:39 -0500 (Thu, 11 Jan 2007)
New Revision: 59519

Added:
   projects/osgi/trunk/deployment/src/main/org/jboss/osgi/deployers/BundleDeployer.java
   projects/osgi/trunk/deployment/src/main/org/jboss/osgi/deployers/BundleManifestDeployer.java
Removed:
   projects/osgi/trunk/deployment/src/main/org/jboss/osgi/deployers/BundleLifecycleDeployer.java
   projects/osgi/trunk/deployment/src/main/org/jboss/osgi/deployers/BundleMetaDataDeployer.java
   projects/osgi/trunk/deployment/src/main/org/jboss/osgi/metadata/plugins/AbstractBundleMetaData.java
   projects/osgi/trunk/deployment/src/main/org/jboss/osgi/metadata/spi/BundleMetaData.java
Modified:
   projects/osgi/trunk/deployment/src/main/org/jboss/osgi/deployers/BundleActivatorDeployer.java
   projects/osgi/trunk/deployment/src/main/org/jboss/osgi/deployers/BundleClassLoaderDeployer.java
   projects/osgi/trunk/deployment/src/main/org/jboss/osgi/deployers/OSGiPluginDeployer.java
   projects/osgi/trunk/deployment/src/main/org/jboss/osgi/metadata/plugins/AbstractBundleActivatorMetadata.java
   projects/osgi/trunk/deployment/src/main/org/jboss/osgi/metadata/plugins/AbstractListenerMetaData.java
   projects/osgi/trunk/deployment/src/main/org/jboss/osgi/metadata/plugins/AbstractOSGiMetaData.java
   projects/osgi/trunk/deployment/src/main/org/jboss/osgi/metadata/plugins/AbstractReferenceMetaData.java
   projects/osgi/trunk/deployment/src/main/org/jboss/osgi/metadata/plugins/AbstractServiceMetaData.java
Log:
bundle deployer rewrite, serializable meta data

Modified: projects/osgi/trunk/deployment/src/main/org/jboss/osgi/deployers/BundleActivatorDeployer.java
===================================================================
--- projects/osgi/trunk/deployment/src/main/org/jboss/osgi/deployers/BundleActivatorDeployer.java	2007-01-11 10:41:36 UTC (rev 59518)
+++ projects/osgi/trunk/deployment/src/main/org/jboss/osgi/deployers/BundleActivatorDeployer.java	2007-01-11 11:01:39 UTC (rev 59519)
@@ -21,8 +21,6 @@
 */
 package org.jboss.osgi.deployers;
 
-import java.util.Set;
-
 import org.jboss.beans.metadata.plugins.BeanMetaDataBuilder;
 import org.jboss.deployers.plugins.deployer.AbstractSimpleDeployer;
 import org.jboss.deployers.spi.DeploymentException;
@@ -34,7 +32,7 @@
 import org.jboss.util.id.GUID;
 
 /**
- * Install each BundleActivatorMetaData.
+ * Install BundleActivatorMetaData.
  *
  * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
  */
@@ -46,7 +44,7 @@
    private final KernelController controller;
 
    /**
-    * The GUID, used to create unique activator names
+    * The GUID, used to create unique activator name
     */
    private GUID guid;
 
@@ -66,18 +64,18 @@
    }
 
    /**
-    * Deploy / install all activators as new BeanMD
+    * Deploy / install activator as new BeanMD
     *
     * @param unit
     * @throws DeploymentException
     */
    public void deploy(DeploymentUnit unit) throws DeploymentException
    {
-      BundleAdapter bundleAdapter = unit.getAttachment(BundleAdapter.class);
+      BundleAdapter bundleAdapter = unit.getTransientManagedObjects().getAttachment(BundleAdapter.class);
       if (bundleAdapter != null)
       {
-         Set<? extends BundleActivatorMetaData> activators = unit.getAllMetaData(BundleActivatorMetaData.class);
-         for (BundleActivatorMetaData bamd : activators)
+         BundleActivatorMetaData bamd = unit.getAttachment(BundleActivatorMetaData.class.getName(), BundleActivatorMetaData.class);
+         if (bamd != null)
          {
             registerBundleActivator(bamd, bundleAdapter);
          }

Modified: projects/osgi/trunk/deployment/src/main/org/jboss/osgi/deployers/BundleClassLoaderDeployer.java
===================================================================
--- projects/osgi/trunk/deployment/src/main/org/jboss/osgi/deployers/BundleClassLoaderDeployer.java	2007-01-11 10:41:36 UTC (rev 59518)
+++ projects/osgi/trunk/deployment/src/main/org/jboss/osgi/deployers/BundleClassLoaderDeployer.java	2007-01-11 11:01:39 UTC (rev 59519)
@@ -23,7 +23,6 @@
 
 import org.jboss.deployers.plugins.deployers.helpers.AbstractTopLevelClassLoaderDeployer;
 import org.jboss.deployers.spi.structure.DeploymentContext;
-import org.jboss.osgi.metadata.spi.BundleMetaData;
 import org.jboss.osgi.core.platform.spi.BundleAdapter;
 
 /**
@@ -36,14 +35,24 @@
 
    public ClassLoader createTopLevelClassLoader(DeploymentContext context) throws Exception
    {
-      BundleMetaData bundleMD = context.getTransientAttachments().getAttachment(BundleMetaData.class);
-      if (bundleMD != null)
+      ClassLoader loader = context.getClassLoader();
+      BundleAdapter bundleAdapter = context.getTransientAttachments().getAttachment(BundleAdapter.class);
+      if (bundleAdapter != null)
       {
-         BundleAdapter bundleAdapter = bundleMD.getBundleAdapter();
-         // TODO - create CL
-         return null;
+         ClassLoader bundleClassLoader = createClassLoader(bundleAdapter);
+         if (bundleClassLoader != null)
+         {
+            context.setClassLoader(bundleClassLoader);
+            loader = bundleClassLoader;
+         }
       }
-      return context.getClassLoader();
+      return loader;
    }
 
+   protected ClassLoader createClassLoader(BundleAdapter bundleAdapter)
+   {
+      // todo
+      return null;
+   }
+
 }

Added: projects/osgi/trunk/deployment/src/main/org/jboss/osgi/deployers/BundleDeployer.java
===================================================================
--- projects/osgi/trunk/deployment/src/main/org/jboss/osgi/deployers/BundleDeployer.java	2007-01-11 10:41:36 UTC (rev 59518)
+++ projects/osgi/trunk/deployment/src/main/org/jboss/osgi/deployers/BundleDeployer.java	2007-01-11 11:01:39 UTC (rev 59519)
@@ -0,0 +1,90 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, 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.deployers;
+
+import org.jboss.deployers.plugins.deployer.AbstractSimpleDeployer;
+import org.jboss.deployers.spi.DeploymentException;
+import org.jboss.deployers.spi.deployer.DeploymentUnit;
+import org.jboss.osgi.core.platform.spi.OSGiPlatform;
+import org.jboss.osgi.core.platform.spi.BundleAdapter;
+import org.jboss.virtual.VirtualFile;
+
+/**
+ * Installs/Uninstalls OSGi Bundle - from a .jar file.
+ *
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class BundleDeployer extends AbstractSimpleDeployer
+{
+   private OSGiPlatform platform;
+
+   public BundleDeployer(OSGiPlatform platform)
+   {
+      this.platform = platform;
+      setRelativeOrder(PARSER_DEPLOYER - 1);
+   }
+
+   public void deploy(DeploymentUnit unit) throws DeploymentException
+   {
+      try
+      {
+         if (isBundle(unit))
+         {
+            VirtualFile root = unit.getFile("");
+            BundleAdapter bundleAdapter = platform.installBundle(root.getPathName(), null);
+            unit.getTransientManagedObjects().addAttachment(BundleAdapter.class, bundleAdapter);
+         }
+      }
+      catch (Exception e)
+      {
+         throw DeploymentException.rethrowAsDeploymentException("Exception while deploying bundle.", e);
+      }
+   }
+
+   protected boolean isBundle(DeploymentUnit unit)
+   {
+      // todo - determine better what is a Bundle
+      VirtualFile root = unit.getFile("");
+      VirtualFile manifest = unit.getMetaDataFile("MANIFEST.MF");
+      return (root != null && root.getName().endsWith(".jar")) && manifest != null;
+   }
+
+   public void undeploy(DeploymentUnit unit)
+   {
+      BundleAdapter bundleAdapter = unit.getTransientManagedObjects().getAttachment(BundleAdapter.class);
+      if (bundleAdapter != null)
+      {
+         try
+         {
+            platform.uninstallBundle(bundleAdapter.getBundleId());
+         }
+         catch(Exception e)
+         {
+            log.warn("Exception while uninstalling bundle: " + bundleAdapter, e);
+         }
+         finally {
+            unit.getTransientManagedObjects().removeAttachment(BundleAdapter.class);
+         }
+      }
+   }
+
+}

Deleted: projects/osgi/trunk/deployment/src/main/org/jboss/osgi/deployers/BundleLifecycleDeployer.java
===================================================================
--- projects/osgi/trunk/deployment/src/main/org/jboss/osgi/deployers/BundleLifecycleDeployer.java	2007-01-11 10:41:36 UTC (rev 59518)
+++ projects/osgi/trunk/deployment/src/main/org/jboss/osgi/deployers/BundleLifecycleDeployer.java	2007-01-11 11:01:39 UTC (rev 59519)
@@ -1,101 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2006, 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.deployers;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.jar.Attributes;
-import java.util.jar.Manifest;
-
-import org.jboss.deployers.plugins.deployers.helpers.AbstractParsingDeployer;
-import org.jboss.deployers.spi.DeploymentException;
-import org.jboss.deployers.spi.deployer.DeploymentUnit;
-import org.jboss.osgi.core.platform.spi.OSGiPlatform;
-import org.jboss.osgi.core.platform.spi.BundleAdapter;
-import org.jboss.osgi.metadata.spi.BundleMetaData;
-import org.jboss.osgi.metadata.plugins.AbstractBundleMetaData;
-import org.jboss.virtual.VirtualFile;
-
-/**
- * TODO - handle manifest, jar, BundleContext (ClassLoader), BundleActivatorMetaData, ...
- *
- * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
- */
-public class BundleLifecycleDeployer extends AbstractParsingDeployer<BundleMetaData>
-{
-   private OSGiPlatform platform;
-
-   public BundleLifecycleDeployer(OSGiPlatform platform)
-   {
-      super(BundleMetaData.class);
-      this.platform = platform;
-   }
-
-   public void deploy(DeploymentUnit unit) throws DeploymentException
-   {
-      createMetaData(unit, null, ".mf");
-   }
-
-   protected BundleMetaData parse(DeploymentUnit unit, VirtualFile file, BundleMetaData root) throws Exception
-   {
-      Manifest manifest = null;
-      // we can add this part of the code to VFS code - extracting the current one
-      InputStream stream = file.openStream();
-      try
-      {
-         manifest = new Manifest(stream);
-      }
-      finally
-      {
-         try
-         {
-            stream.close();
-         }
-         catch (IOException ignored)
-         {
-         }
-      }
-      // get activator from manifest
-      Attributes attributes = manifest.getMainAttributes();
-      String activatorClassName = attributes.getValue("Bundle-Activator");
-      // install bundle - TODO is this ok to deploy bundle?
-      BundleAdapter bundleAdapter = platform.installBundle(file.getParent().getPathName(), null);
-      return new AbstractBundleMetaData(bundleAdapter, activatorClassName);
-   }
-
-   public void undeploy(DeploymentUnit unit)
-   {
-      try
-      {
-         BundleMetaData bmd = unit.getTransientManagedObjects().getAttachment(BundleMetaData.class);
-         if (bmd != null)
-         {
-            platform.uninstallBundle(bmd.getBundleAdapter().getBundleId());
-         }
-      }
-      catch (Exception e)
-      {
-         log.error("Exception while uninstalling bundle:" + unit);
-      }
-   }
-
-}

Added: projects/osgi/trunk/deployment/src/main/org/jboss/osgi/deployers/BundleManifestDeployer.java
===================================================================
--- projects/osgi/trunk/deployment/src/main/org/jboss/osgi/deployers/BundleManifestDeployer.java	2007-01-11 10:41:36 UTC (rev 59518)
+++ projects/osgi/trunk/deployment/src/main/org/jboss/osgi/deployers/BundleManifestDeployer.java	2007-01-11 11:01:39 UTC (rev 59519)
@@ -0,0 +1,82 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, 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.deployers;
+
+import java.util.jar.Attributes;
+import java.util.jar.Manifest;
+
+import org.jboss.deployers.plugins.deployer.AbstractSimpleDeployer;
+import org.jboss.deployers.spi.DeploymentException;
+import org.jboss.deployers.spi.deployer.DeploymentUnit;
+import org.jboss.osgi.core.platform.spi.BundleAdapter;
+import org.jboss.osgi.metadata.plugins.AbstractBundleActivatorMetaData;
+import org.jboss.osgi.metadata.spi.BundleActivatorMetaData;
+import org.jboss.virtual.VirtualFile;
+
+/**
+ * Parses OSGi Bundle Manifest if BundleAdapter attachment exists.
+ * We are looking for manifest attributes (if they exist):
+ *  - Bundle-Activator
+ *
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class BundleManifestDeployer extends AbstractSimpleDeployer
+{
+   public BundleManifestDeployer()
+   {
+      setRelativeOrder(PARSER_DEPLOYER);
+   }
+
+   public void deploy(DeploymentUnit unit) throws DeploymentException
+   {
+      try
+      {
+         if (unit.getTransientManagedObjects().isAttachmentPresent(BundleAdapter.class))
+         {
+            VirtualFile manifestVF = unit.getMetaDataFile("MANIFEST.MF");
+            if (manifestVF != null)
+            {
+//               Manifest manifest = VFSUtils.readManifest(manifestVF);
+               Manifest manifest = null;
+               Attributes attributes = manifest.getMainAttributes();
+               String bundleActivator = attributes.getValue("Bundle-Activator");
+               if (bundleActivator != null)
+               {
+                  BundleActivatorMetaData bamd = new AbstractBundleActivatorMetaData(bundleActivator);
+                  unit.addAttachment(BundleActivatorMetaData.class.getName(), bamd);
+               }
+            }
+         }
+      }
+      catch (Exception e)
+      {
+         throw DeploymentException.rethrowAsDeploymentException("Exception while parsing manifest.", e);
+      }
+   }
+
+   public void undeploy(DeploymentUnit unit)
+   {
+      // try to remove, even if it doesn't exist
+      unit.removeAttachment(BundleActivatorMetaData.class.getName());
+   }
+
+}

Deleted: projects/osgi/trunk/deployment/src/main/org/jboss/osgi/deployers/BundleMetaDataDeployer.java
===================================================================
--- projects/osgi/trunk/deployment/src/main/org/jboss/osgi/deployers/BundleMetaDataDeployer.java	2007-01-11 10:41:36 UTC (rev 59518)
+++ projects/osgi/trunk/deployment/src/main/org/jboss/osgi/deployers/BundleMetaDataDeployer.java	2007-01-11 11:01:39 UTC (rev 59519)
@@ -1,81 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2006, 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.deployers;
-
-import org.jboss.deployers.plugins.deployers.helpers.AbstractRealDeployer;
-import org.jboss.deployers.plugins.deployers.helpers.SimpleDeploymentVisitor;
-import org.jboss.deployers.spi.DeploymentException;
-import org.jboss.deployers.spi.deployer.DeploymentUnit;
-import org.jboss.osgi.core.platform.spi.BundleAdapter;
-import org.jboss.osgi.metadata.spi.BundleActivatorMetaData;
-import org.jboss.osgi.metadata.spi.BundleMetaData;
-
-/**
- * TODO - javadoc
- *
- * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
- */
-public class BundleMetaDataDeployer extends AbstractRealDeployer<BundleMetaData>
-{
-   public BundleMetaDataDeployer()
-   {
-      setDeploymentVisitor(new BundleMetaDataVisitor());
-      setRelativeOrder(COMPONENT_DEPLOYER);
-   }
-
-   protected static void addBundleComponent(DeploymentUnit unit, Class clazz, Object value)
-   {
-      DeploymentUnit component = unit.addComponent(value.toString());
-      component.addAttachment(clazz.getName(), value);
-   }
-
-   protected static void removeBundleComponent(DeploymentUnit unit, Object value)
-   {
-      unit.removeComponent(value.toString());
-   }
-
-   /**
-    * KernelDeploymentVisitor.
-    */
-   public static class BundleMetaDataVisitor implements SimpleDeploymentVisitor<BundleMetaData>
-   {
-      public Class<BundleMetaData> getVisitorType()
-      {
-         return BundleMetaData.class;
-      }
-
-      public void deploy(DeploymentUnit unit, BundleMetaData bmd) throws DeploymentException
-      {
-         addBundleComponent(unit, BundleAdapter.class, bmd.getBundleAdapter());
-         if (bmd.getBundleActivator() != null)
-            addBundleComponent(unit, BundleActivatorMetaData.class, bmd.getBundleActivator());
-      }
-
-      public void undeploy(DeploymentUnit unit, BundleMetaData bmd)
-      {
-         removeBundleComponent(unit, bmd.getBundleAdapter());
-         if (bmd.getBundleActivator() != null)
-            removeBundleComponent(unit, bmd.getBundleActivator());
-      }
-   }
-
-}

Modified: projects/osgi/trunk/deployment/src/main/org/jboss/osgi/deployers/OSGiPluginDeployer.java
===================================================================
--- projects/osgi/trunk/deployment/src/main/org/jboss/osgi/deployers/OSGiPluginDeployer.java	2007-01-11 10:41:36 UTC (rev 59518)
+++ projects/osgi/trunk/deployment/src/main/org/jboss/osgi/deployers/OSGiPluginDeployer.java	2007-01-11 11:01:39 UTC (rev 59519)
@@ -67,7 +67,7 @@
 
    public void deploy(DeploymentUnit unit) throws DeploymentException
    {
-      BundleAdapter bundleAdapter = unit.getAttachment(BundleAdapter.class);
+      BundleAdapter bundleAdapter = unit.getTransientManagedObjects().getAttachment(BundleAdapter.class);
       if (bundleAdapter != null)
       {
          if (usedBundleAdapters.contains(bundleAdapter.getBundleId()) == false)

Modified: projects/osgi/trunk/deployment/src/main/org/jboss/osgi/metadata/plugins/AbstractBundleActivatorMetadata.java
===================================================================
--- projects/osgi/trunk/deployment/src/main/org/jboss/osgi/metadata/plugins/AbstractBundleActivatorMetadata.java	2007-01-11 10:41:36 UTC (rev 59518)
+++ projects/osgi/trunk/deployment/src/main/org/jboss/osgi/metadata/plugins/AbstractBundleActivatorMetadata.java	2007-01-11 11:01:39 UTC (rev 59519)
@@ -21,6 +21,8 @@
 */
 package org.jboss.osgi.metadata.plugins;
 
+import java.io.Serializable;
+
 import org.jboss.osgi.metadata.spi.BundleActivatorMetaData;
 
 /**
@@ -28,8 +30,10 @@
  * 
  * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
  */
-public class AbstractBundleActivatorMetaData implements BundleActivatorMetaData
+public class AbstractBundleActivatorMetaData implements BundleActivatorMetaData, Serializable
 {
+   private static final long serialVersionUID = 1l;
+
    private String className;
 
    public AbstractBundleActivatorMetaData(String activatorClassName)

Deleted: projects/osgi/trunk/deployment/src/main/org/jboss/osgi/metadata/plugins/AbstractBundleMetaData.java
===================================================================
--- projects/osgi/trunk/deployment/src/main/org/jboss/osgi/metadata/plugins/AbstractBundleMetaData.java	2007-01-11 10:41:36 UTC (rev 59518)
+++ projects/osgi/trunk/deployment/src/main/org/jboss/osgi/metadata/plugins/AbstractBundleMetaData.java	2007-01-11 11:01:39 UTC (rev 59519)
@@ -1,55 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2006, 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.metadata.plugins;
-
-import org.jboss.osgi.metadata.spi.BundleMetaData;
-import org.jboss.osgi.metadata.spi.BundleActivatorMetaData;
-import org.jboss.osgi.core.platform.spi.BundleAdapter;
-
-/**
- * TODO - comment, javadoc
- * 
- * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
- */
-public class AbstractBundleMetaData implements BundleMetaData
-{
-   private BundleAdapter bundleAdapter;
-
-   private BundleActivatorMetaData bundleActivator;
-
-   public AbstractBundleMetaData(BundleAdapter bundleAdapter, String bundleActivatorClass)
-   {
-      this.bundleAdapter = bundleAdapter;
-      this.bundleActivator = new AbstractBundleActivatorMetaData(bundleActivatorClass);
-   }
-
-   public BundleAdapter getBundleAdapter()
-   {
-      return bundleAdapter;
-   }
-
-   public BundleActivatorMetaData getBundleActivator()
-   {
-      return bundleActivator;
-   }
-
-}

Modified: projects/osgi/trunk/deployment/src/main/org/jboss/osgi/metadata/plugins/AbstractListenerMetaData.java
===================================================================
--- projects/osgi/trunk/deployment/src/main/org/jboss/osgi/metadata/plugins/AbstractListenerMetaData.java	2007-01-11 10:41:36 UTC (rev 59518)
+++ projects/osgi/trunk/deployment/src/main/org/jboss/osgi/metadata/plugins/AbstractListenerMetaData.java	2007-01-11 11:01:39 UTC (rev 59519)
@@ -21,6 +21,8 @@
 */
 package org.jboss.osgi.metadata.plugins;
 
+import java.io.Serializable;
+
 import org.jboss.osgi.metadata.spi.ListenerMetaData;
 
 /**
@@ -29,8 +31,9 @@
  *
  * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
  */
-public class AbstractListenerMetaData implements ListenerMetaData
+public class AbstractListenerMetaData implements ListenerMetaData, Serializable
 {
+   private static final long serialVersionUID = 1l;
 
    private String ref;
    private String bindMethod;

Modified: projects/osgi/trunk/deployment/src/main/org/jboss/osgi/metadata/plugins/AbstractOSGiMetaData.java
===================================================================
--- projects/osgi/trunk/deployment/src/main/org/jboss/osgi/metadata/plugins/AbstractOSGiMetaData.java	2007-01-11 10:41:36 UTC (rev 59518)
+++ projects/osgi/trunk/deployment/src/main/org/jboss/osgi/metadata/plugins/AbstractOSGiMetaData.java	2007-01-11 11:01:39 UTC (rev 59519)
@@ -22,6 +22,7 @@
 package org.jboss.osgi.metadata.plugins;
 
 import java.util.Set;
+import java.io.Serializable;
 
 import org.jboss.beans.metadata.plugins.AbstractFeatureMetaData;
 import org.jboss.beans.metadata.spi.ClassLoaderMetaData;
@@ -35,8 +36,10 @@
  * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
  */
 public abstract class AbstractOSGiMetaData extends AbstractFeatureMetaData
-      implements OSGiMetaData, BeanMetaDataFactory
+      implements OSGiMetaData, BeanMetaDataFactory, Serializable
 {
+   private static final long serialVersionUID = 1l;
+
    private String id;
    private String anInterface;
    private Set<DependencyMetaData> depends;

Modified: projects/osgi/trunk/deployment/src/main/org/jboss/osgi/metadata/plugins/AbstractReferenceMetaData.java
===================================================================
--- projects/osgi/trunk/deployment/src/main/org/jboss/osgi/metadata/plugins/AbstractReferenceMetaData.java	2007-01-11 10:41:36 UTC (rev 59518)
+++ projects/osgi/trunk/deployment/src/main/org/jboss/osgi/metadata/plugins/AbstractReferenceMetaData.java	2007-01-11 11:01:39 UTC (rev 59519)
@@ -23,6 +23,7 @@
 
 import java.util.List;
 import java.util.Set;
+import java.io.Serializable;
 
 import org.jboss.beans.metadata.spi.*;
 import org.jboss.osgi.metadata.spi.Cardinality;
@@ -37,8 +38,10 @@
  * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
  */
 public class AbstractReferenceMetaData extends AbstractOSGiMetaData
-      implements ReferenceMetaData
+      implements ReferenceMetaData, Serializable
 {
+   private static final long serialVersionUID = 1l;
+
    private String filter;
    private Cardinality cardinality = Cardinality.ONE_TO_ONE;
    private Integer timeout;

Modified: projects/osgi/trunk/deployment/src/main/org/jboss/osgi/metadata/plugins/AbstractServiceMetaData.java
===================================================================
--- projects/osgi/trunk/deployment/src/main/org/jboss/osgi/metadata/plugins/AbstractServiceMetaData.java	2007-01-11 10:41:36 UTC (rev 59518)
+++ projects/osgi/trunk/deployment/src/main/org/jboss/osgi/metadata/plugins/AbstractServiceMetaData.java	2007-01-11 11:01:39 UTC (rev 59519)
@@ -24,6 +24,7 @@
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
+import java.io.Serializable;
 
 import org.jboss.beans.metadata.spi.BeanMetaData;
 import org.jboss.beans.metadata.spi.MetaDataVisitor;
@@ -41,8 +42,10 @@
  * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
  */
 public class AbstractServiceMetaData extends AbstractOSGiMetaData
-      implements ServiceMetaData
+      implements ServiceMetaData, Serializable
 {
+   private static final long serialVersionUID = 1l;
+
    private Set<String> interfaces;
    private Map<String, String> serviceProperties;
    private String ref;

Deleted: projects/osgi/trunk/deployment/src/main/org/jboss/osgi/metadata/spi/BundleMetaData.java
===================================================================
--- projects/osgi/trunk/deployment/src/main/org/jboss/osgi/metadata/spi/BundleMetaData.java	2007-01-11 10:41:36 UTC (rev 59518)
+++ projects/osgi/trunk/deployment/src/main/org/jboss/osgi/metadata/spi/BundleMetaData.java	2007-01-11 11:01:39 UTC (rev 59519)
@@ -1,36 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2006, 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.metadata.spi;
-
-import org.jboss.osgi.core.platform.spi.BundleAdapter;
-
-/**
- * TODO - javadoc
- * 
- * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
- */
-public interface BundleMetaData
-{
-   BundleAdapter getBundleAdapter();
-
-   BundleActivatorMetaData getBundleActivator();
-}




More information about the jboss-cvs-commits mailing list