]> git.argeo.org Git - gpl/argeo-slc.git/blobdiff - runtime/org.argeo.slc.support.osgi/src/main/java/org/argeo/slc/osgi/OsgiBundle.java
Introduce module meta data
[gpl/argeo-slc.git] / runtime / org.argeo.slc.support.osgi / src / main / java / org / argeo / slc / osgi / OsgiBundle.java
index 0be7d02e9e19e7e2f23913327962f39265c4ebb5..420c7ad3d83cd071cc740c9e09cbd0be008498b9 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2010 Mathieu Baudier <mbaudier@argeo.org>
+ * Copyright (C) 2007-2012 Mathieu Baudier
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -13,7 +13,6 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
 package org.argeo.slc.osgi;
 
 import org.argeo.slc.BasicNameVersion;
@@ -22,6 +21,7 @@ import org.argeo.slc.build.Distribution;
 import org.argeo.slc.core.build.ResourceDistribution;
 import org.argeo.slc.deploy.DeploymentData;
 import org.argeo.slc.deploy.Module;
+import org.argeo.slc.deploy.ModuleDescriptor;
 import org.argeo.slc.deploy.TargetData;
 import org.argeo.slc.process.RealizedFlow;
 import org.osgi.framework.Bundle;
@@ -30,13 +30,13 @@ import org.springframework.core.io.Resource;
 
 /** A deployed OSGi bundle. */
 public class OsgiBundle extends BasicNameVersion implements Module {
-       private static final long serialVersionUID = -1970854723780452072L;
+       private static final long serialVersionUID = 35073826504550477L;
 
        private ResourceDistribution distribution;
 
        private Long internalBundleId;
 
-       private String label;
+       private String title;
        private String description;
 
        public OsgiBundle() {
@@ -126,12 +126,12 @@ public class OsgiBundle extends BasicNameVersion implements Module {
        }
 
        /** Value of the <code>Bundle-Name</code> directive. */
-       public String getLabel() {
-               return label;
+       public String getTitle() {
+               return title;
        }
 
-       public void setLabel(String label) {
-               this.label = label;
+       public void setTitle(String label) {
+               this.title = label;
        }
 
        /** Value of the <code>Bundle-Description</code> directive. */
@@ -143,4 +143,12 @@ public class OsgiBundle extends BasicNameVersion implements Module {
                this.description = description;
        }
 
+       public ModuleDescriptor getModuleDescriptor() {
+               ModuleDescriptor moduleDescriptor = new ModuleDescriptor();
+               moduleDescriptor.setName(getName());
+               moduleDescriptor.setVersion(getVersion());
+               moduleDescriptor.setDescription(description);
+               moduleDescriptor.setTitle(title);
+               return moduleDescriptor;
+       }
 }