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

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Mon May 5 01:17:03 EDT 2008


Author: alesj
Date: 2008-05-05 01:17:03 -0400 (Mon, 05 May 2008)
New Revision: 73051

Modified:
   projects/jboss-osgi/trunk/osgi-int/src/main/org/jboss/osgi/plugins/deployers/OSGiMetaData2ClassLoadingMetaDataDeployer.java
   projects/jboss-osgi/trunk/osgi-int/src/main/org/jboss/osgi/plugins/metadata/AbstractOSGiMetaData.java
   projects/jboss-osgi/trunk/osgi-int/src/main/org/jboss/osgi/spi/metadata/OSGiMetaData.java
Log:
Header value extension.

Modified: projects/jboss-osgi/trunk/osgi-int/src/main/org/jboss/osgi/plugins/deployers/OSGiMetaData2ClassLoadingMetaDataDeployer.java
===================================================================
--- projects/jboss-osgi/trunk/osgi-int/src/main/org/jboss/osgi/plugins/deployers/OSGiMetaData2ClassLoadingMetaDataDeployer.java	2008-05-05 05:06:56 UTC (rev 73050)
+++ projects/jboss-osgi/trunk/osgi-int/src/main/org/jboss/osgi/plugins/deployers/OSGiMetaData2ClassLoadingMetaDataDeployer.java	2008-05-05 05:17:03 UTC (rev 73051)
@@ -72,7 +72,7 @@
       Version bundleVersion = deployment.getBundleVersion();
       if (bundleVersion != null)
          clmd.setVersion(bundleVersion);
-      clmd.setDomain(deployment.getBundleName()); // todo
+      clmd.setDomain(deployment.getHeader("Domain-Name"));
       List<PackageAttribute> exports = deployment.getExportPackages();
       if (exports != null && exports.isEmpty() == false)
       {

Modified: projects/jboss-osgi/trunk/osgi-int/src/main/org/jboss/osgi/plugins/metadata/AbstractOSGiMetaData.java
===================================================================
--- projects/jboss-osgi/trunk/osgi-int/src/main/org/jboss/osgi/plugins/metadata/AbstractOSGiMetaData.java	2008-05-05 05:06:56 UTC (rev 73050)
+++ projects/jboss-osgi/trunk/osgi-int/src/main/org/jboss/osgi/plugins/metadata/AbstractOSGiMetaData.java	2008-05-05 05:17:03 UTC (rev 73051)
@@ -21,33 +21,6 @@
 */
 package org.jboss.osgi.plugins.metadata;
 
-import static org.jboss.osgi.plugins.metadata.ValueCreatorUtil.INTEGER_VC;
-import static org.jboss.osgi.plugins.metadata.ValueCreatorUtil.PACKAGE_LIST_VC;
-import static org.jboss.osgi.plugins.metadata.ValueCreatorUtil.PARAM_ATTRIB_VC;
-import static org.jboss.osgi.plugins.metadata.ValueCreatorUtil.PATH_ATTRIB_LIST_VC;
-import static org.jboss.osgi.plugins.metadata.ValueCreatorUtil.QNAME_ATTRIB_LIST_VC;
-import static org.jboss.osgi.plugins.metadata.ValueCreatorUtil.STRING_LIST_VC;
-import static org.jboss.osgi.plugins.metadata.ValueCreatorUtil.STRING_VC;
-import static org.jboss.osgi.plugins.metadata.ValueCreatorUtil.URL_VC;
-import static org.jboss.osgi.plugins.metadata.ValueCreatorUtil.VERSION_VC;
-import static org.osgi.framework.Constants.BUNDLE_ACTIVATOR;
-import static org.osgi.framework.Constants.BUNDLE_CLASSPATH;
-import static org.osgi.framework.Constants.BUNDLE_DESCRIPTION;
-import static org.osgi.framework.Constants.BUNDLE_LOCALIZATION;
-import static org.osgi.framework.Constants.BUNDLE_LOCALIZATION_DEFAULT_BASENAME;
-import static org.osgi.framework.Constants.BUNDLE_MANIFESTVERSION;
-import static org.osgi.framework.Constants.BUNDLE_NAME;
-import static org.osgi.framework.Constants.BUNDLE_NATIVECODE;
-import static org.osgi.framework.Constants.BUNDLE_REQUIREDEXECUTIONENVIRONMENT;
-import static org.osgi.framework.Constants.BUNDLE_SYMBOLICNAME;
-import static org.osgi.framework.Constants.BUNDLE_UPDATELOCATION;
-import static org.osgi.framework.Constants.BUNDLE_VERSION;
-import static org.osgi.framework.Constants.DYNAMICIMPORT_PACKAGE;
-import static org.osgi.framework.Constants.EXPORT_PACKAGE;
-import static org.osgi.framework.Constants.FRAGMENT_HOST;
-import static org.osgi.framework.Constants.IMPORT_PACKAGE;
-import static org.osgi.framework.Constants.REQUIRE_BUNDLE;
-
 import java.net.URL;
 import java.util.Arrays;
 import java.util.HashMap;
@@ -56,9 +29,11 @@
 import java.util.jar.Manifest;
 
 import org.jboss.deployers.vfs.spi.deployer.helpers.AbstractManifestMetaData;
+import static org.jboss.osgi.plugins.metadata.ValueCreatorUtil.*;
 import org.jboss.osgi.spi.metadata.OSGiMetaData;
 import org.jboss.osgi.spi.metadata.PackageAttribute;
 import org.jboss.osgi.spi.metadata.ParameterizedAttribute;
+import static org.osgi.framework.Constants.*;
 import org.osgi.framework.Version;
 
 /**
@@ -81,6 +56,11 @@
       super(manifest);
    }
 
+   public String getHeader(String key)
+   {
+      return get(key, STRING_VC);
+   }
+
    public String getBundleActivator()
    {
       return get(BUNDLE_ACTIVATOR, STRING_VC);

Modified: projects/jboss-osgi/trunk/osgi-int/src/main/org/jboss/osgi/spi/metadata/OSGiMetaData.java
===================================================================
--- projects/jboss-osgi/trunk/osgi-int/src/main/org/jboss/osgi/spi/metadata/OSGiMetaData.java	2008-05-05 05:06:56 UTC (rev 73050)
+++ projects/jboss-osgi/trunk/osgi-int/src/main/org/jboss/osgi/spi/metadata/OSGiMetaData.java	2008-05-05 05:17:03 UTC (rev 73051)
@@ -35,6 +35,14 @@
 public interface OSGiMetaData extends ManifestMetaData
 {
    /**
+    * Extension point to read custom manifest headers.
+    *
+    * @param key the header key
+    * @return value or null of no such header
+    */
+   String getHeader(String key);
+
+   /**
     * Get bundle activator class name.
     *
     * @return bundle activator classname or null if no such attribute




More information about the jboss-cvs-commits mailing list