[jboss-osgi-commits] JBoss-OSGI SVN: r99783 - in projects: jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/classloading and 2 other directories.

jboss-osgi-commits at lists.jboss.org jboss-osgi-commits at lists.jboss.org
Thu Jan 21 16:52:56 EST 2010


Author: thomas.diesler at jboss.com
Date: 2010-01-21 16:52:56 -0500 (Thu, 21 Jan 2010)
New Revision: 99783

Added:
   projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/metadata/NativeLibrary.java
   projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/metadata/NativeLibraryMetaData.java
Removed:
   projects/jboss-cl/trunk/classloading/src/main/java/org/jboss/classloading/spi/metadata/NativeLibrary.java
   projects/jboss-cl/trunk/classloading/src/main/java/org/jboss/classloading/spi/metadata/NativeLibraryMetaData.java
Modified:
   projects/jboss-cl/trunk/classloading/src/main/java/org/jboss/classloading/spi/metadata/ClassLoadingMetaData.java
   projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/classloading/OSGiClassLoadingMetaData.java
   projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/deployers/OSGiNativeCodeMetaDataDeployer.java
   projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/deployers/OSGiNativeCodePolicyDeployer.java
Log:
[JBCL-136] Add a notion of native library mapping
Move NativeLibraryMetaData to the OSGi layer

Modified: projects/jboss-cl/trunk/classloading/src/main/java/org/jboss/classloading/spi/metadata/ClassLoadingMetaData.java
===================================================================
--- projects/jboss-cl/trunk/classloading/src/main/java/org/jboss/classloading/spi/metadata/ClassLoadingMetaData.java	2010-01-21 21:35:15 UTC (rev 99782)
+++ projects/jboss-cl/trunk/classloading/src/main/java/org/jboss/classloading/spi/metadata/ClassLoadingMetaData.java	2010-01-21 21:52:56 UTC (rev 99783)
@@ -47,7 +47,7 @@
 public class ClassLoadingMetaData extends NameAndVersionSupport
 {
    /** The serialVersionUID */
-   private static final long serialVersionUID = 8525659521747922713L;
+   private static final long serialVersionUID = 8574522599537469347L;
    
    /** The classloading domain */
    private String domain;
@@ -100,9 +100,6 @@
    /** The capabilities */
    private CapabilitiesMetaData capabilities = new CapabilitiesMetaData();
    
-   /** The native code libraries */
-   private NativeLibraryMetaData libraries = new NativeLibraryMetaData();
-   
    /**
     * Get the domain.
     * 
@@ -515,29 +512,6 @@
    }
 
    /**
-    * Get the native libraries.
-    * 
-    * @return the native libraries.
-    */
-   public NativeLibraryMetaData getNativeLibraries()
-   {
-      return libraries;
-   }
-
-   /**
-    * Set the native libraries.
-    * 
-    * @param nativeLibraries libraries the native libraries.
-    * @throws IllegalArgumentException for null native libraries
-    */
-   public void setNativeLibraries(NativeLibraryMetaData nativeLibraries)
-   {
-      if (nativeLibraries == null)
-         throw new IllegalArgumentException("Null libraries");
-      this.libraries = nativeLibraries;
-   }
-
-   /**
     * Set the requirements.
     * 
     * @param requirements the requirements.
@@ -595,9 +569,6 @@
       List<Requirement> requirements = getRequirements().getRequirements();
       if (requirements != null)
          builder.append(" requirements=").append(requirements);
-      List<NativeLibrary> libraries = getNativeLibraries().getNativeLibraries();
-      if (libraries != null)
-         builder.append(" libraries=").append(libraries);
    }
    
    @Override
@@ -630,8 +601,6 @@
          return false;
       if (equals(this.getRequirements().getRequirements(), other.getRequirements().getRequirements()) == false)
          return false;
-      if (equals(this.getNativeLibraries().getNativeLibraries(), other.getNativeLibraries().getNativeLibraries()) == false)
-         return false;
       return true;
    }
    
@@ -655,7 +624,6 @@
       ClassLoadingMetaData clone = (ClassLoadingMetaData) super.clone();
       requirements = clone.requirements.clone();
       capabilities = clone.capabilities.clone();
-      libraries = clone.libraries.clone();
       return clone;
    }
 }

Deleted: projects/jboss-cl/trunk/classloading/src/main/java/org/jboss/classloading/spi/metadata/NativeLibrary.java
===================================================================
--- projects/jboss-cl/trunk/classloading/src/main/java/org/jboss/classloading/spi/metadata/NativeLibrary.java	2010-01-21 21:35:15 UTC (rev 99782)
+++ projects/jboss-cl/trunk/classloading/src/main/java/org/jboss/classloading/spi/metadata/NativeLibrary.java	2010-01-21 21:52:56 UTC (rev 99783)
@@ -1,141 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2008, 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.classloading.spi.metadata;
-
-// $Id$
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import org.jboss.classloading.spi.version.VersionRange;
-
-/**
- * Meta data for native code libraries as defined by OSGi R4V42.  
- * 
- * 3.9 Loading Native Code Libraries
- * http://www.osgi.org/Download/File?url=/download/r4v42/r4.core.pdf
- * 
- * @author thomas.diesler at jboss.com
- * @version $Revision$
- * @since 21-Jan-2010
- */
-public class NativeLibrary implements Serializable
-{
-   /** The serialVersionUID */
-   private static final long serialVersionUID = 5059911178465658041L;
-
-   private List<String> osNames = new ArrayList<String>();
-   private String librarySource;
-   private String libraryPath;
-   private List<String> processors = new ArrayList<String>();
-   private List<VersionRange> osVersions = new ArrayList<VersionRange>();
-   private List<String> languages = new ArrayList<String>();
-   private String selectionFilter;
-   private boolean optional;
-
-   /**
-    * Create a NativeCode instance with mandatory properties.
-    * @param osNames The set of OS names 
-    * @param libraryPath The library path
-    * @param librarySource An interface from which to retrieve the actual library location
-    */
-   public NativeLibrary(List<String> osNames, String libraryPath, String librarySource)
-   {
-      if (libraryPath == null)
-         throw new IllegalArgumentException("Null library path: " + libraryPath);
-      if (osNames == null || osNames.isEmpty())
-         throw new IllegalArgumentException("Illegal OS names: " + osNames);
-      if (librarySource == null)
-         throw new IllegalArgumentException("Null file privider: " + librarySource);
-
-      this.osNames = osNames;
-      this.libraryPath = libraryPath;
-      this.librarySource = librarySource;
-   }
-
-   public String getLibrarySource()
-   {
-      return librarySource;
-   }
-
-   public String getLibraryPath()
-   {
-      return libraryPath;
-   }
-
-   public List<String> getOsNames()
-   {
-      return Collections.unmodifiableList(osNames);
-   }
-
-   public List<VersionRange> getOsVersions()
-   {
-      return Collections.unmodifiableList(osVersions);
-   }
-
-   public void setOsVersions(List<VersionRange> osVersions)
-   {
-      this.osVersions = osVersions;
-   }
-
-   public List<String> getProcessors()
-   {
-      return Collections.unmodifiableList(processors);
-   }
-
-   public void setProcessors(List<String> processors)
-   {
-      this.processors = processors;
-   }
-
-   public void setLanguages(List<String> languages)
-   {
-      this.languages = languages;
-   }
-   
-   public List<String> getLanguages()
-   {
-      return Collections.unmodifiableList(languages);
-   }
-
-   public String getSelectionFilter()
-   {
-      return selectionFilter;
-   }
-
-   public void setSelectionFilter(String selectionFilter)
-   {
-      this.selectionFilter = selectionFilter;
-   }
-
-   public boolean isOptional()
-   {
-      return optional;
-   }
-
-   public void setOptional(boolean optional)
-   {
-      this.optional = optional;
-   }
-}

Deleted: projects/jboss-cl/trunk/classloading/src/main/java/org/jboss/classloading/spi/metadata/NativeLibraryMetaData.java
===================================================================
--- projects/jboss-cl/trunk/classloading/src/main/java/org/jboss/classloading/spi/metadata/NativeLibraryMetaData.java	2010-01-21 21:35:15 UTC (rev 99782)
+++ projects/jboss-cl/trunk/classloading/src/main/java/org/jboss/classloading/spi/metadata/NativeLibraryMetaData.java	2010-01-21 21:52:56 UTC (rev 99783)
@@ -1,100 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2008, 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.classloading.spi.metadata;
-
-// $Id$
-
-import java.io.Serializable;
-import java.util.List;
-import java.util.concurrent.CopyOnWriteArrayList;
-
-
-/**
- * Meta data for native code libraries as defined by OSGi R4V42.  
- * 
- * 3.9 Loading Native Code Libraries
- * http://www.osgi.org/Download/File?url=/download/r4v42/r4.core.pdf
- * 
- * @author thomas.diesler at jboss.com
- * @version $Revision$
- * @since 21-Jan-2010
- */
-// [TODO] @XmlType(name="nativeLibraries", propOrder={"nativeLibraries"})
-public class NativeLibraryMetaData implements Serializable, Cloneable
-{
-   /** The serialVersionUID */
-   private static final long serialVersionUID = 8341019167903636599L;
-   
-   /** The nativeLibraries */
-   private List<NativeLibrary> nativeLibraries;
-
-   public List<NativeLibrary> getNativeLibraries()
-   {
-      return nativeLibraries;
-   }
-
-   public void setNativeLibraries(List<NativeLibrary> nativeLibraries)
-   {
-      this.nativeLibraries = nativeLibraries;
-   }
-
-   public void addNativeLibrary(NativeLibrary nativeLibrary)
-   {
-      if (nativeLibrary == null)
-         throw new IllegalArgumentException("Null library");
-      
-      if (nativeLibraries == null)
-         nativeLibraries = new CopyOnWriteArrayList<NativeLibrary>();
-      
-      nativeLibraries.add(nativeLibrary);
-   }
-
-   public void removeNativeLibrary(NativeLibrary nativeLibrary)
-   {
-      if (nativeLibrary == null)
-         throw new IllegalArgumentException("Null library");
-      
-      if (nativeLibraries == null)
-         return;
-      
-      nativeLibraries.remove(nativeLibrary);
-   }
-
-   @Override
-   public NativeLibraryMetaData clone()
-   {
-      try
-      {
-         NativeLibraryMetaData clone = (NativeLibraryMetaData) super.clone();
-         if (nativeLibraries != null)
-         {
-            List<NativeLibrary> clonedNativeCodes = new CopyOnWriteArrayList<NativeLibrary>(nativeLibraries);
-            clone.setNativeLibraries(clonedNativeCodes);
-         }
-         return clone;
-      }
-      catch (CloneNotSupportedException e)
-      {
-         throw new RuntimeException("Unexpected", e);
-      }
-   }
-}

Modified: projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/classloading/OSGiClassLoadingMetaData.java
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/classloading/OSGiClassLoadingMetaData.java	2010-01-21 21:35:15 UTC (rev 99782)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/classloading/OSGiClassLoadingMetaData.java	2010-01-21 21:52:56 UTC (rev 99783)
@@ -28,6 +28,7 @@
 import java.util.List;
 
 import org.jboss.classloading.spi.metadata.ClassLoadingMetaData;
+import org.jboss.osgi.framework.metadata.NativeLibraryMetaData;
 import org.osgi.framework.Version;
 
 /**
@@ -43,9 +44,13 @@
    
    // The optional fragment host
    private FragmentHostMetaData fragmentHost;
+   
    // The list of attached fragment classloading metadata
    private List<OSGiClassLoadingMetaData> attachedFragments = new ArrayList<OSGiClassLoadingMetaData>();
    
+   // The native code libraries 
+   private NativeLibraryMetaData libraries = new NativeLibraryMetaData();
+   
    public FragmentHostMetaData getFragmentHost()
    {
       return fragmentHost;
@@ -74,6 +79,29 @@
    }
 
    /**
+    * Get the native libraries.
+    * 
+    * @return the native libraries.
+    */
+   public NativeLibraryMetaData getNativeLibraries()
+   {
+      return libraries;
+   }
+
+   /**
+    * Set the native libraries.
+    * 
+    * @param nativeLibraries libraries the native libraries.
+    * @throws IllegalArgumentException for null native libraries
+    */
+   public void setNativeLibraries(NativeLibraryMetaData nativeLibraries)
+   {
+      if (nativeLibraries == null)
+         throw new IllegalArgumentException("Null libraries");
+      this.libraries = nativeLibraries;
+   }
+
+   /**
     *  Fragment-Host metadata.
     */
    public static class FragmentHostMetaData

Modified: projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/deployers/OSGiNativeCodeMetaDataDeployer.java
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/deployers/OSGiNativeCodeMetaDataDeployer.java	2010-01-21 21:35:15 UTC (rev 99782)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/deployers/OSGiNativeCodeMetaDataDeployer.java	2010-01-21 21:52:56 UTC (rev 99783)
@@ -30,8 +30,6 @@
 import java.util.Map;
 
 import org.jboss.classloading.spi.metadata.ClassLoadingMetaData;
-import org.jboss.classloading.spi.metadata.NativeLibrary;
-import org.jboss.classloading.spi.metadata.NativeLibraryMetaData;
 import org.jboss.deployers.spi.DeploymentException;
 import org.jboss.deployers.spi.deployer.DeploymentStages;
 import org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer;
@@ -39,6 +37,9 @@
 import org.jboss.osgi.framework.bundle.AbstractBundleState;
 import org.jboss.osgi.framework.bundle.OSGiBundleManager;
 import org.jboss.osgi.framework.bundle.OSGiBundleState;
+import org.jboss.osgi.framework.classloading.OSGiClassLoadingMetaData;
+import org.jboss.osgi.framework.metadata.NativeLibrary;
+import org.jboss.osgi.framework.metadata.NativeLibraryMetaData;
 import org.jboss.osgi.framework.metadata.OSGiMetaData;
 import org.jboss.osgi.framework.metadata.Parameter;
 import org.jboss.osgi.framework.metadata.ParameterizedAttribute;
@@ -113,7 +114,7 @@
    @Override
    protected void internalDeploy(DeploymentUnit unit) throws DeploymentException
    {
-      ClassLoadingMetaData classLoadingMetaData = unit.getAttachment(ClassLoadingMetaData.class);
+      OSGiClassLoadingMetaData classLoadingMetaData = (OSGiClassLoadingMetaData)unit.getAttachment(ClassLoadingMetaData.class);
       if (classLoadingMetaData == null)
          throw new IllegalStateException("No ClassLoadingMetaData");
 

Modified: projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/deployers/OSGiNativeCodePolicyDeployer.java
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/deployers/OSGiNativeCodePolicyDeployer.java	2010-01-21 21:35:15 UTC (rev 99782)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/deployers/OSGiNativeCodePolicyDeployer.java	2010-01-21 21:52:56 UTC (rev 99783)
@@ -33,8 +33,6 @@
 import org.jboss.classloader.spi.ClassLoaderPolicy;
 import org.jboss.classloader.spi.NativeLibraryProvider;
 import org.jboss.classloading.spi.metadata.ClassLoadingMetaData;
-import org.jboss.classloading.spi.metadata.NativeLibrary;
-import org.jboss.classloading.spi.metadata.NativeLibraryMetaData;
 import org.jboss.deployers.spi.DeploymentException;
 import org.jboss.deployers.spi.deployer.DeploymentStages;
 import org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer;
@@ -43,6 +41,9 @@
 import org.jboss.osgi.framework.bundle.AbstractBundleState;
 import org.jboss.osgi.framework.bundle.OSGiBundleManager;
 import org.jboss.osgi.framework.bundle.OSGiBundleState;
+import org.jboss.osgi.framework.classloading.OSGiClassLoadingMetaData;
+import org.jboss.osgi.framework.metadata.NativeLibrary;
+import org.jboss.osgi.framework.metadata.NativeLibraryMetaData;
 import org.jboss.osgi.framework.plugins.BundleStoragePlugin;
 import org.jboss.virtual.VFSUtils;
 import org.jboss.virtual.VirtualFile;
@@ -71,7 +72,7 @@
       if (absBundleState == null)
          throw new IllegalStateException("No bundle state");
 
-      ClassLoadingMetaData classLoadingMetaData = unit.getAttachment(ClassLoadingMetaData.class);
+      OSGiClassLoadingMetaData classLoadingMetaData = (OSGiClassLoadingMetaData)unit.getAttachment(ClassLoadingMetaData.class);
       NativeLibraryMetaData libMetaData = classLoadingMetaData.getNativeLibraries();
       if (libMetaData == null || libMetaData.getNativeLibraries() == null)
          return;

Copied: projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/metadata/NativeLibrary.java (from rev 99763, projects/jboss-cl/trunk/classloading/src/main/java/org/jboss/classloading/spi/metadata/NativeLibrary.java)
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/metadata/NativeLibrary.java	                        (rev 0)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/metadata/NativeLibrary.java	2010-01-21 21:52:56 UTC (rev 99783)
@@ -0,0 +1,141 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2008, 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.framework.metadata;
+
+// $Id$
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.jboss.classloading.spi.version.VersionRange;
+
+/**
+ * Meta data for native code libraries as defined by OSGi R4V42.  
+ * 
+ * 3.9 Loading Native Code Libraries
+ * http://www.osgi.org/Download/File?url=/download/r4v42/r4.core.pdf
+ * 
+ * @author thomas.diesler at jboss.com
+ * @version $Revision$
+ * @since 21-Jan-2010
+ */
+public class NativeLibrary implements Serializable
+{
+   /** The serialVersionUID */
+   private static final long serialVersionUID = -1637806718398794304L;
+
+   private List<String> osNames = new ArrayList<String>();
+   private String librarySource;
+   private String libraryPath;
+   private List<String> processors = new ArrayList<String>();
+   private List<VersionRange> osVersions = new ArrayList<VersionRange>();
+   private List<String> languages = new ArrayList<String>();
+   private String selectionFilter;
+   private boolean optional;
+
+   /**
+    * Create a NativeCode instance with mandatory properties.
+    * @param osNames The set of OS names 
+    * @param libraryPath The library path
+    * @param librarySource An interface from which to retrieve the actual library location
+    */
+   public NativeLibrary(List<String> osNames, String libraryPath, String librarySource)
+   {
+      if (libraryPath == null)
+         throw new IllegalArgumentException("Null library path: " + libraryPath);
+      if (osNames == null || osNames.isEmpty())
+         throw new IllegalArgumentException("Illegal OS names: " + osNames);
+      if (librarySource == null)
+         throw new IllegalArgumentException("Null file privider: " + librarySource);
+
+      this.osNames = osNames;
+      this.libraryPath = libraryPath;
+      this.librarySource = librarySource;
+   }
+
+   public String getLibrarySource()
+   {
+      return librarySource;
+   }
+
+   public String getLibraryPath()
+   {
+      return libraryPath;
+   }
+
+   public List<String> getOsNames()
+   {
+      return Collections.unmodifiableList(osNames);
+   }
+
+   public List<VersionRange> getOsVersions()
+   {
+      return Collections.unmodifiableList(osVersions);
+   }
+
+   public void setOsVersions(List<VersionRange> osVersions)
+   {
+      this.osVersions = osVersions;
+   }
+
+   public List<String> getProcessors()
+   {
+      return Collections.unmodifiableList(processors);
+   }
+
+   public void setProcessors(List<String> processors)
+   {
+      this.processors = processors;
+   }
+
+   public void setLanguages(List<String> languages)
+   {
+      this.languages = languages;
+   }
+   
+   public List<String> getLanguages()
+   {
+      return Collections.unmodifiableList(languages);
+   }
+
+   public String getSelectionFilter()
+   {
+      return selectionFilter;
+   }
+
+   public void setSelectionFilter(String selectionFilter)
+   {
+      this.selectionFilter = selectionFilter;
+   }
+
+   public boolean isOptional()
+   {
+      return optional;
+   }
+
+   public void setOptional(boolean optional)
+   {
+      this.optional = optional;
+   }
+}

Copied: projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/metadata/NativeLibraryMetaData.java (from rev 99763, projects/jboss-cl/trunk/classloading/src/main/java/org/jboss/classloading/spi/metadata/NativeLibraryMetaData.java)
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/metadata/NativeLibraryMetaData.java	                        (rev 0)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/metadata/NativeLibraryMetaData.java	2010-01-21 21:52:56 UTC (rev 99783)
@@ -0,0 +1,81 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2008, 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.framework.metadata;
+
+// $Id$
+
+import java.io.Serializable;
+import java.util.List;
+import java.util.concurrent.CopyOnWriteArrayList;
+
+
+
+/**
+ * Meta data for native code libraries as defined by OSGi R4V42.  
+ * 
+ * 3.9 Loading Native Code Libraries
+ * http://www.osgi.org/Download/File?url=/download/r4v42/r4.core.pdf
+ * 
+ * @author thomas.diesler at jboss.com
+ * @version $Revision$
+ * @since 21-Jan-2010
+ */
+public class NativeLibraryMetaData implements Serializable
+{
+   /** The serialVersionUID */
+   private static final long serialVersionUID = 7650641261993316609L;
+   
+   /** The nativeLibraries */
+   private List<NativeLibrary> nativeLibraries;
+
+   public List<NativeLibrary> getNativeLibraries()
+   {
+      return nativeLibraries;
+   }
+
+   public void setNativeLibraries(List<NativeLibrary> nativeLibraries)
+   {
+      this.nativeLibraries = nativeLibraries;
+   }
+
+   public void addNativeLibrary(NativeLibrary nativeLibrary)
+   {
+      if (nativeLibrary == null)
+         throw new IllegalArgumentException("Null library");
+      
+      if (nativeLibraries == null)
+         nativeLibraries = new CopyOnWriteArrayList<NativeLibrary>();
+      
+      nativeLibraries.add(nativeLibrary);
+   }
+
+   public void removeNativeLibrary(NativeLibrary nativeLibrary)
+   {
+      if (nativeLibrary == null)
+         throw new IllegalArgumentException("Null library");
+      
+      if (nativeLibraries == null)
+         return;
+      
+      nativeLibraries.remove(nativeLibrary);
+   }
+}



More information about the jboss-osgi-commits mailing list