[Jboss-cvs] JBossAS SVN: r55515 - branches/MC_VDF_WORK/system/src/main/org/jboss/deployers/plugins

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Fri Aug 11 02:38:38 EDT 2006


Author: scott.stark at jboss.org
Date: 2006-08-11 02:38:35 -0400 (Fri, 11 Aug 2006)
New Revision: 55515

Modified:
   branches/MC_VDF_WORK/system/src/main/org/jboss/deployers/plugins/DeploymentImpl.java
   branches/MC_VDF_WORK/system/src/main/org/jboss/deployers/plugins/MainDeployerImpl.java
Log:
Propagate the vfs to the DeploymentImpl and DeploymentContexts

Modified: branches/MC_VDF_WORK/system/src/main/org/jboss/deployers/plugins/DeploymentImpl.java
===================================================================
--- branches/MC_VDF_WORK/system/src/main/org/jboss/deployers/plugins/DeploymentImpl.java	2006-08-11 03:36:13 UTC (rev 55514)
+++ branches/MC_VDF_WORK/system/src/main/org/jboss/deployers/plugins/DeploymentImpl.java	2006-08-11 06:38:35 UTC (rev 55515)
@@ -22,35 +22,52 @@
 package org.jboss.deployers.plugins;
 
 import java.io.Serializable;
+import java.net.MalformedURLException;
 import java.net.URL;
 import java.util.Set;
 
 import org.jboss.deployers.spi.Deployment;
 import org.jboss.deployers.spi.DeploymentContext;
 import org.jboss.deployers.spi.management.ManagedObject;
+import org.jboss.util.JBossObject;
+import org.jboss.vfs.spi.ReadOnlyVFS;
+import org.jboss.vfs.spi.VirtualFile;
 
 /**
  * A root deployment container
  * 
  * @author Scott.Stark at jboss.org
- * @version $Revision$
+ * @version $Revision:$
  */
-public class DeploymentImpl implements Deployment, Serializable
+public class DeploymentImpl extends JBossObject
+   implements Deployment, Serializable
 {
    private static final long serialVersionUID = 1;
-   private String name;
+   private ReadOnlyVFS vfs;
+   private VirtualFile rootFile;
    private DeploymentContext rootContext;
 
-   public DeploymentImpl(String name)
+   public DeploymentImpl(ReadOnlyVFS vfs, VirtualFile rootFile)
    {
-      this.name = name;
+      this.rootFile = rootFile;
+      this.vfs = vfs;
    }
 
    public String getName()
    {
-      return name;
+      return rootFile.getName();
    }
 
+   public ReadOnlyVFS getVFS()
+   {
+      return vfs;
+   }
+
+   public VirtualFile getRootFile()
+   {
+      return rootFile;
+   }
+
    public String getType()
    {
       return getRootContext().getDeploymentTypes().iterator().next();
@@ -64,8 +81,16 @@
 
    public URL getRootURL()
    {
-      // TODO Auto-generated method stub
-      return null;
+      URL rootURL = null;
+      try
+      {
+         rootURL = rootFile.toURL();
+      }
+      catch(MalformedURLException e)
+      {
+         throw new IllegalStateException(e);
+      }
+      return rootURL;
    }
 
    public String[] getFiles()

Modified: branches/MC_VDF_WORK/system/src/main/org/jboss/deployers/plugins/MainDeployerImpl.java
===================================================================
--- branches/MC_VDF_WORK/system/src/main/org/jboss/deployers/plugins/MainDeployerImpl.java	2006-08-11 03:36:13 UTC (rev 55514)
+++ branches/MC_VDF_WORK/system/src/main/org/jboss/deployers/plugins/MainDeployerImpl.java	2006-08-11 06:38:35 UTC (rev 55515)
@@ -283,7 +283,7 @@
          throw new DeploymentException("Failed to resolve root file", e);         
       }
 
-      DeploymentImpl rootDeployment = new DeploymentImpl(root.getName());
+      DeploymentImpl rootDeployment = new DeploymentImpl(vfs, root);
       try
       {
          if( parse(root, rootDeployment, null) == false )
@@ -418,7 +418,8 @@
       DeploymentContext parent)
       throws DeploymentException, IOException
    {
-      DeploymentContext ctx = new DeploymentContext(file, parent);
+      ReadOnlyVFS vfs = rootDeployment.getVFS();
+      DeploymentContext ctx = new DeploymentContext(vfs, file, parent);
       Iterator<AspectDeployer> iter = deployers.listIterator();
       boolean accepted = false;
       while( iter.hasNext() )




More information about the jboss-cvs-commits mailing list