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

jboss-osgi-commits at lists.jboss.org jboss-osgi-commits at lists.jboss.org
Mon Nov 30 11:06:48 EST 2009


Author: thomas.diesler at jboss.com
Date: 2009-11-30 11:06:48 -0500 (Mon, 30 Nov 2009)
New Revision: 97173

Modified:
   projects/jboss-osgi/projects/runtime/deployers/trunk/pom.xml
   projects/jboss-osgi/projects/runtime/deployers/trunk/src/main/java/org/jboss/osgi/deployer/BundleMetaDataDeployer.java
   projects/jboss-osgi/projects/runtime/deployers/trunk/src/main/java/org/jboss/osgi/deployer/BundleStartLevelDeployer.java
   projects/jboss-osgi/projects/runtime/deployers/trunk/src/main/java/org/jboss/osgi/deployer/BundleStartStopDeployer.java
Log:
Use Deployment.class instead of individual property attachments

Modified: projects/jboss-osgi/projects/runtime/deployers/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/projects/runtime/deployers/trunk/pom.xml	2009-11-30 16:06:26 UTC (rev 97172)
+++ projects/jboss-osgi/projects/runtime/deployers/trunk/pom.xml	2009-11-30 16:06:48 UTC (rev 97173)
@@ -20,7 +20,7 @@
   <artifactId>jboss-osgi-deployers</artifactId>
   <packaging>jar</packaging>
 
-  <version>1.0.4-SNAPSHOT</version>
+  <version>1.0.3-SNAPSHOT</version>
 
   <!-- Parent -->
   <parent>
@@ -30,8 +30,9 @@
   </parent>
 
   <properties>
-    <version.jboss.deployers>2.0.8.GA</version.jboss.deployers>
-    <version.jboss.osgi.spi>1.0.3</version.jboss.osgi.spi>
+    <version.jboss.deployers>2.0.9.GA</version.jboss.deployers>
+    <version.jboss.osgi.deployment>1.0.0</version.jboss.osgi.deployment>
+    <version.jboss.osgi.spi>1.0.3-SNAPSHOT</version.jboss.osgi.spi>
     <version.osgi>4.2.0</version.osgi>
   </properties>
 
@@ -43,6 +44,11 @@
       <version>${version.jboss.osgi.spi}</version>
     </dependency>
     <dependency>
+      <groupId>org.jboss.osgi.runtime</groupId>
+      <artifactId>jboss-osgi-deployment</artifactId>
+      <version>${version.jboss.osgi.deployment}</version>
+    </dependency>
+    <dependency>
       <groupId>org.jboss.deployers</groupId>
       <artifactId>jboss-deployers-vfs</artifactId>
       <version>${version.jboss.deployers}</version>

Modified: projects/jboss-osgi/projects/runtime/deployers/trunk/src/main/java/org/jboss/osgi/deployer/BundleMetaDataDeployer.java
===================================================================
--- projects/jboss-osgi/projects/runtime/deployers/trunk/src/main/java/org/jboss/osgi/deployer/BundleMetaDataDeployer.java	2009-11-30 16:06:26 UTC (rev 97172)
+++ projects/jboss-osgi/projects/runtime/deployers/trunk/src/main/java/org/jboss/osgi/deployer/BundleMetaDataDeployer.java	2009-11-30 16:06:48 UTC (rev 97173)
@@ -28,6 +28,7 @@
 
 import org.jboss.deployers.vfs.spi.deployer.ManifestDeployer;
 import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
+import org.jboss.osgi.deployment.deployer.Deployment;
 import org.jboss.osgi.spi.OSGiConstants;
 import org.jboss.virtual.VirtualFile;
 import org.osgi.framework.Constants;
@@ -45,6 +46,7 @@
    public BundleMetaDataDeployer()
    {
       super(BundleMetaData.class);
+      addInput(Deployment.class);
    }
 
    @Override
@@ -56,7 +58,8 @@
          String symbolicName = metaData.getSymbolicName();
          log.debug("Bundle-SymbolicName: " + symbolicName + " in " + file);
 
-         metaData.setBundleLocation(unit.getRoot().toURL());
+         Deployment dep = unit.getAttachment(Deployment.class);
+         metaData.setBundleLocation(dep.getLocation());
 
          // Add a marker that this is an OSGi deployment
          unit.addAttachment(OSGiConstants.KEY_BUNDLE_SYMBOLIC_NAME, symbolicName);

Modified: projects/jboss-osgi/projects/runtime/deployers/trunk/src/main/java/org/jboss/osgi/deployer/BundleStartLevelDeployer.java
===================================================================
--- projects/jboss-osgi/projects/runtime/deployers/trunk/src/main/java/org/jboss/osgi/deployer/BundleStartLevelDeployer.java	2009-11-30 16:06:26 UTC (rev 97172)
+++ projects/jboss-osgi/projects/runtime/deployers/trunk/src/main/java/org/jboss/osgi/deployer/BundleStartLevelDeployer.java	2009-11-30 16:06:48 UTC (rev 97173)
@@ -26,7 +26,7 @@
 import org.jboss.deployers.spi.DeploymentException;
 import org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer;
 import org.jboss.deployers.structure.spi.DeploymentUnit;
-import org.jboss.osgi.spi.OSGiConstants;
+import org.jboss.osgi.deployment.deployer.Deployment;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.BundleContext;
 import org.osgi.service.startlevel.StartLevel;
@@ -50,7 +50,7 @@
    public BundleStartLevelDeployer()
    {
       super(Bundle.class);
-      addOutput(OSGiConstants.PROPERTY_START_LEVEL);
+      addInput(Deployment.class);
    }
 
    public void setSystemContext(BundleContext systemContext)
@@ -60,7 +60,9 @@
 
    public void deploy(DeploymentUnit unit, Bundle bundle) throws DeploymentException
    {
-      Integer propStart = unit.getAttachment(OSGiConstants.PROPERTY_START_LEVEL, Integer.class);
+      Deployment dep = unit.getAttachment(Deployment.class);
+      Integer propStart = dep.getStartLevel();
+      
       StartLevel startLevel = getStartLevel();
       if (propStart != null && startLevel != null)
       {

Modified: projects/jboss-osgi/projects/runtime/deployers/trunk/src/main/java/org/jboss/osgi/deployer/BundleStartStopDeployer.java
===================================================================
--- projects/jboss-osgi/projects/runtime/deployers/trunk/src/main/java/org/jboss/osgi/deployer/BundleStartStopDeployer.java	2009-11-30 16:06:26 UTC (rev 97172)
+++ projects/jboss-osgi/projects/runtime/deployers/trunk/src/main/java/org/jboss/osgi/deployer/BundleStartStopDeployer.java	2009-11-30 16:06:48 UTC (rev 97173)
@@ -30,6 +30,7 @@
 import org.jboss.deployers.spi.DeploymentException;
 import org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer;
 import org.jboss.deployers.structure.spi.DeploymentUnit;
+import org.jboss.osgi.deployment.deployer.Deployment;
 import org.jboss.osgi.spi.OSGiConstants;
 import org.jboss.osgi.spi.util.ExportedPackageHelper;
 import org.osgi.framework.Bundle;
@@ -56,7 +57,7 @@
    public BundleStartStopDeployer()
    {
       super(Bundle.class);
-      addInput(OSGiConstants.PROPERTY_START_LEVEL);
+      addInput(Deployment.class);
    }
 
    public void setSystemContext(BundleContext systemContext)
@@ -66,9 +67,8 @@
 
    public void deploy(DeploymentUnit unit, Bundle bundle) throws DeploymentException
    {
-      Boolean autoStart = unit.getAttachment(OSGiConstants.PROPERTY_AUTO_START, Boolean.class);
-      if (autoStart == null)
-         autoStart = Boolean.TRUE;
+      Deployment dep = unit.getAttachment(Deployment.class);
+      boolean autoStart = dep.isAutoStart();
       
       if (autoStart == true)
       {



More information about the jboss-osgi-commits mailing list