[jboss-cvs] JBossAS SVN: r63730 - in trunk/system: src/main/org/jboss and 15 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Jun 28 13:24:29 EDT 2007


Author: adrian at jboss.org
Date: 2007-06-28 13:24:29 -0400 (Thu, 28 Jun 2007)
New Revision: 63730

Added:
   trunk/system/src/main/org/jboss/aop/
   trunk/system/src/main/org/jboss/aop/deployers/
   trunk/system/src/main/org/jboss/aop/deployers/temp/
   trunk/system/src/main/org/jboss/aop/deployers/temp/AspectDeployer.java
Modified:
   trunk/system/.classpath
   trunk/system/build.xml
   trunk/system/src/main/org/jboss/Main.java
   trunk/system/src/main/org/jboss/Version.java
   trunk/system/src/main/org/jboss/deployers/plugins/scanner/VFSDeploymentScannerImpl.java
   trunk/system/src/main/org/jboss/deployers/spi/management/ComponentTypeListener.java
   trunk/system/src/main/org/jboss/deployers/spi/management/ComponentTypeVisitor.java
   trunk/system/src/main/org/jboss/deployers/spi/management/DeploymentTemplate.java
   trunk/system/src/main/org/jboss/deployers/spi/management/ManagedDeployment.java
   trunk/system/src/main/org/jboss/deployers/spi/management/ManagementView.java
   trunk/system/src/main/org/jboss/profileservice/aop/DeployerAspects.java
   trunk/system/src/main/org/jboss/profileservice/spi/AttachmentsSerializer.java
   trunk/system/src/main/org/jboss/profileservice/spi/DeploymentRepository.java
   trunk/system/src/main/org/jboss/profileservice/spi/ModificationInfo.java
   trunk/system/src/main/org/jboss/profileservice/spi/Profile.java
   trunk/system/src/main/org/jboss/profileservice/spi/ProfileRepository.java
   trunk/system/src/main/org/jboss/system/JBossRMIClassLoader.java
   trunk/system/src/main/org/jboss/system/Registry.java
   trunk/system/src/main/org/jboss/system/Service.java
   trunk/system/src/main/org/jboss/system/server/BaseServerConfig.java
   trunk/system/src/main/org/jboss/system/server/NoAnnotationURLClassLoader.java
   trunk/system/src/main/org/jboss/system/server/Server.java
   trunk/system/src/main/org/jboss/system/server/ServerConfig.java
   trunk/system/src/main/org/jboss/system/server/ServerInfo.java
   trunk/system/src/main/org/jboss/system/server/ServerInfoMBean.java
   trunk/system/src/main/org/jboss/system/server/ServerLoader.java
   trunk/system/src/main/org/jboss/system/server/profile/basic/ProfileImpl.java
   trunk/system/src/main/org/jboss/system/server/profile/repository/ProfileImpl.java
   trunk/system/src/main/org/jboss/system/server/profileservice/ProfileServiceBootstrap.java
   trunk/system/src/main/org/jboss/system/server/profileservice/ServerImpl.java
   trunk/system/src/main/org/jboss/system/server/profileservice/VFSBootstrapScannerImpl.java
   trunk/system/src/main/org/jboss/system/server/profileservice/VFSDeployerScannerImpl.java
   trunk/system/src/main/org/jboss/system/server/profileservice/VFSDeploymentScannerImpl.java
   trunk/system/src/main/org/jboss/system/server/profileservice/VFSScanner.java
   trunk/system/src/main/org/jboss/system/server/profileservice/hotdeploy/HDScanner.java
   trunk/system/src/main/org/jboss/system/server/profileservice/repository/AbstractFileAttachmentsSerializer.java
   trunk/system/src/main/org/jboss/system/server/profileservice/repository/FileProfileRepository.java
   trunk/system/src/main/org/jboss/system/server/profileservice/repository/JavaSerializationAttachmentsSerializer.java
   trunk/system/src/main/org/jboss/system/server/profileservice/repository/SerializableDeploymentRepository.java
   trunk/system/src/tests/org/jboss/test/server/profileservice/MainTestCase.java
   trunk/system/src/tests/org/jboss/test/server/profileservice/MainWithSimpleHotDeployTestCase.java
Log:
Deployers reloaded

Modified: trunk/system/.classpath
===================================================================
--- trunk/system/.classpath	2007-06-28 17:24:15 UTC (rev 63729)
+++ trunk/system/.classpath	2007-06-28 17:24:29 UTC (rev 63730)
@@ -8,20 +8,27 @@
 	<classpathentry kind="lib" path="/thirdparty/apache-log4j/lib/log4j.jar"/>
 	<classpathentry kind="lib" path="/thirdparty/oswego-concurrent/lib/concurrent.jar"/>
 	<classpathentry kind="lib" path="/thirdparty/jboss/jbossxb/lib/jboss-xml-binding.jar" sourcepath="/thirdparty/jboss/jbossxb/lib/jboss-xml-binding-src.zip"/>
-	<classpathentry kind="lib" path="/thirdparty/jboss/microcontainer/lib/jboss-container.jar" sourcepath="/thirdparty/jboss/microcontainer/lib/jboss-container-src.zip"/>
-	<classpathentry kind="lib" path="/thirdparty/jboss/microcontainer/lib/jboss-dependency.jar" sourcepath="/thirdparty/jboss/microcontainer/lib/jboss-dependency-src.zip"/>
-	<classpathentry kind="lib" path="/thirdparty/jboss/microcontainer/lib/jboss-microcontainer.jar" sourcepath="/thirdparty/jboss/microcontainer/lib/jboss-microcontainer-src.zip"/>
+	<classpathentry kind="lib" path="/thirdparty/jboss/microcontainer/lib/jboss-container.jar" sourcepath="/thirdparty/jboss/microcontainer/lib/jboss-container-sources.jar"/>
+	<classpathentry kind="lib" path="/thirdparty/jboss/microcontainer/lib/jboss-dependency.jar" sourcepath="/thirdparty/jboss/microcontainer/lib/jboss-dependency-soruces.jar"/>
+	<classpathentry kind="lib" path="/thirdparty/jboss/microcontainer/lib/jboss-kernel.jar" sourcepath="/thirdparty/jboss/microcontainer/lib/jboss-kernel.sources.jar"/>
 	<classpathentry kind="lib" path="/thirdparty/junit/lib/junit.jar"/>
 	<classpathentry kind="lib" path="/thirdparty/jboss/test/lib/jboss-test.jar"/>
-	<classpathentry kind="lib" path="/thirdparty/jboss/microcontainer/lib/jboss-deployers.jar" sourcepath="/thirdparty/jboss/microcontainer/lib/jboss-deployers-src.zip"/>
 	<classpathentry kind="lib" path="/thirdparty/jboss/common-core/lib/jboss-common-core.jar"/>
 	<classpathentry kind="lib" path="/thirdparty/jboss/common-logging-jdk/lib/jboss-logging-jdk.jar"/>
 	<classpathentry kind="lib" path="/thirdparty/jboss/common-logging-log4j/lib/jboss-logging-log4j.jar"/>
 	<classpathentry kind="lib" path="/thirdparty/jboss/common-logging-spi/lib/jboss-logging-spi.jar"/>
 	<classpathentry kind="lib" path="/thirdparty/apache-xerces/lib/xercesImpl.jar"/>
 	<classpathentry kind="lib" path="/thirdparty/jboss/jboss-vfs/lib/jboss-vfs.jar" sourcepath="/thirdparty/jboss/jboss-vfs/lib/jboss-vfs-sources.jar"/>
-	<classpathentry kind="lib" path="/thirdparty/jboss/microcontainer/lib/jboss-managed.jar" sourcepath="/thirdparty/jboss/microcontainer/lib/jboss-managed-src.zip"/>
-	<classpathentry kind="lib" path="/thirdparty/jboss/microcontainer/lib/jboss-metatype.jar" sourcepath="/thirdparty/jboss/microcontainer/lib/jboss-metatype-src.zip"/>
+	<classpathentry kind="lib" path="/thirdparty/jboss/microcontainer/lib/jboss-managed.jar" sourcepath="/thirdparty/jboss/microcontainer/lib/jboss-managed-soruces.jar"/>
+	<classpathentry kind="lib" path="/thirdparty/jboss/microcontainer/lib/jboss-metatype.jar" sourcepath="/thirdparty/jboss/microcontainer/lib/jboss-metatype-sources.jar"/>
 	<classpathentry kind="lib" path="/thirdparty/jboss/aop/lib/jboss-aop-jdk50.jar" sourcepath="/thirdparty/jboss/aop/lib/jboss-aop-src.zip"/>
+	<classpathentry kind="lib" path="/thirdparty/jboss/microcontainer/lib/jboss-deployers-core-spi.jar" sourcepath="/thirdparty/jboss/microcontainer/lib/jboss-deployers-core-spi-sources.jar"/>
+	<classpathentry kind="lib" path="/thirdparty/jboss/microcontainer/lib/jboss-deployers-client-spi.jar" sourcepath="/thirdparty/jboss/microcontainer/lib/jboss-deployers-client-spi-sources.jar"/>
+	<classpathentry kind="lib" path="/thirdparty/jboss/microcontainer/lib/jboss-deployers-structure-spi.jar" sourcepath="/thirdparty/jboss/microcontainer/lib/jboss-deployers-structure-spi-sources.jar"/>
+	<classpathentry kind="lib" path="/thirdparty/jboss/microcontainer/lib/jboss-deployers-spi.jar" sourcepath="/thirdparty/jboss/microcontainer/lib/jboss-deployers-spi-sources.jar"/>
+	<classpathentry kind="lib" path="/thirdparty/jboss/microcontainer/lib/jboss-deployers-impl.jar" sourcepath="/thirdparty/jboss/microcontainer/lib/jboss-deployers-impl-sources.jar"/>
+	<classpathentry kind="lib" path="/thirdparty/jboss/microcontainer/lib/jboss-deployers-vfs-spi.jar" sourcepath="/thirdparty/jboss/microcontainer/lib/jboss-deployers-vfs-spi-sources.jar"/>
+	<classpathentry kind="lib" path="/thirdparty/javassist/lib/javassist.jar" sourcepath="/thirdparty/javassist/lib/javassist-src.jar"/>
+	<classpathentry kind="lib" path="/thirdparty/jboss/aop/lib/jboss-aop-deployer-jdk50.jar" sourcepath="/thirdparty/jboss/aop/lib/jboss-asintegration-src.zip"/>
 	<classpathentry kind="output" path="output/eclipse-classes"/>
 </classpath>

Modified: trunk/system/build.xml
===================================================================
--- trunk/system/build.xml	2007-06-28 17:24:15 UTC (rev 63729)
+++ trunk/system/build.xml	2007-06-28 17:24:29 UTC (rev 63730)
@@ -77,6 +77,8 @@
       <path refid="jboss.jboss.vfs.classpath"/>
       <path refid="jboss.common.core.classpath"/>
       <path refid="jboss.common.logging.spi.classpath"/>
+      <!-- TEMP for the temporary AOP Deployer -->
+      <path refid="javassist.javassist.classpath"/>
     </path>
 
     <!-- The combined dependant module classpath -->

Modified: trunk/system/src/main/org/jboss/Main.java
===================================================================
--- trunk/system/src/main/org/jboss/Main.java	2007-06-28 17:24:15 UTC (rev 63729)
+++ trunk/system/src/main/org/jboss/Main.java	2007-06-28 17:24:29 UTC (rev 63730)
@@ -69,13 +69,13 @@
    /** Extra jars from the /lib location that are added to the start of the boot
     classpath. This can be used to override jboss /lib boot classes.
     */
-   private List bootLibraries = new LinkedList();
+   private List<String> bootLibraries = new LinkedList<String>();
 
    /** Extra libraries to load the server with .*/
-   private List extraLibraries = new LinkedList();
+   private List<String> extraLibraries = new LinkedList<String>();
 
    /** Extra classpath URLS to load the server with .*/
-   private List extraClasspath = new LinkedList();
+   private List<URL> extraClasspath = new LinkedList<URL>();
 
    /**
     * Server properties.  This object holds all of the required
@@ -175,7 +175,7 @@
       // Add any extra libraries
       for (int i = 0; i < bootLibraries.size(); i++)
       {
-         loader.addLibrary((String)bootLibraries.get(i));
+         loader.addLibrary(bootLibraries.get(i));
       }
 
       // Add the jars from the endorsed dir
@@ -190,13 +190,13 @@
       // Add any extra libraries after the boot libs
       for (int i = 0; i < extraLibraries.size(); i++)
       {
-         loader.addLibrary((String)extraLibraries.get(i));
+         loader.addLibrary(extraLibraries.get(i));
       }
 
       // Add any extra classapth URLs
       for (int i = 0; i < extraClasspath.size(); i++)
       {
-         loader.addURL((URL)extraClasspath.get(i));
+         loader.addURL(extraClasspath.get(i));
       }
 
       // Load the server
@@ -510,6 +510,7 @@
     *    identification of JBoss threads.
     *
     * @param args    The command line arguments.
+    * @throws Exception for any error
     */
    public static void main(final String[] args) throws Exception
    {
@@ -538,6 +539,8 @@
     * This method is here so that if JBoss is running under
     * Alexandria (An NT Service Installer), Alexandria can shutdown
     * the system down correctly.
+    * 
+    * @param argv the arguments
     */
    public static void systemExit(String argv[])
    {

Modified: trunk/system/src/main/org/jboss/Version.java
===================================================================
--- trunk/system/src/main/org/jboss/Version.java	2007-06-28 17:24:15 UTC (rev 63729)
+++ trunk/system/src/main/org/jboss/Version.java	2007-06-28 17:24:29 UTC (rev 63730)
@@ -198,7 +198,7 @@
 
    /** Returns the BUILD_JVM_VERSION (BUILD_JVM_VENDOR) which should look like:
     * 1.4.2_05-b04 (Sun Microsystems Inc.)
-    * @return
+    * @return the jvm
     */ 
    public String getBuildJVM()
    {
@@ -211,7 +211,7 @@
     * like:
     * Windows XP (x86,5.1)
     * Linux (i386,2.4.21-4.ELsmp)
-    * @return
+    * @return the OS
     */ 
    public String getBuildOS()
    {

Added: trunk/system/src/main/org/jboss/aop/deployers/temp/AspectDeployer.java
===================================================================
--- trunk/system/src/main/org/jboss/aop/deployers/temp/AspectDeployer.java	                        (rev 0)
+++ trunk/system/src/main/org/jboss/aop/deployers/temp/AspectDeployer.java	2007-06-28 17:24:29 UTC (rev 63730)
@@ -0,0 +1,362 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, Red Hat Middleware LLC., 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.aop.deployers.temp;
+
+import java.io.BufferedInputStream;
+import java.io.DataInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.List;
+
+import javassist.bytecode.ClassFile;
+
+import org.jboss.aop.AspectAnnotationLoader;
+import org.jboss.aop.AspectManager;
+import org.jboss.aop.AspectXmlLoader;
+import org.jboss.aop.deployment.JBossScopedClassLoaderHelper;
+import org.jboss.deployers.spi.DeploymentException;
+import org.jboss.deployers.spi.deployer.DeploymentStages;
+import org.jboss.deployers.vfs.spi.deployer.AbstractVFSRealDeployer;
+import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
+import org.jboss.virtual.VirtualFile;
+import org.jboss.virtual.VirtualFileFilter;
+import org.jboss.virtual.VisitorAttributes;
+import org.jboss.virtual.plugins.context.jar.JarUtils;
+import org.jboss.virtual.plugins.vfs.helpers.FilterVirtualFileVisitor;
+import org.jboss.virtual.plugins.vfs.helpers.SuffixesExcludeFilter;
+import org.w3c.dom.Document;
+
+/**
+ * Deployer for Aspects
+ *
+ * @author <a href="mailto:bill at jboss.org">Bill Burke</a>
+ * @author <a href="mailto:kabir.khan at jboss.org">Kabir Khan</a>
+ * @author adrian at jboss.org
+ */
+public class AspectDeployer extends AbstractVFSRealDeployer
+{
+   private static final String AOP_JAR_SUFFIX = ".aop";
+   private static final String AOP_DD_SUFFIX = "-aop.xml";
+
+   /** The aspect manager */
+   private AspectManager aspectManager;
+   
+   /**
+    * Create a new AspectDeployer.
+    */
+   public AspectDeployer()
+   {
+      setStage(DeploymentStages.POST_CLASSLOADER);
+   }
+
+   /**
+    * Get the aspectManager.
+    * 
+    * @return the aspectManager.
+    */
+   public AspectManager getAspectManager()
+   {
+      return aspectManager;
+   }
+
+   /**
+    * Set the aspectManager.
+    * 
+    * @param aspectManager the aspectManager.
+    */
+   public void setAspectManager(AspectManager aspectManager)
+   {
+      this.aspectManager = aspectManager;
+   }
+
+   /**
+    * Validate the configuration
+    */
+   public void create()
+   {
+      if (aspectManager == null)
+         throw new IllegalStateException("No aspect manager configured");
+   }
+   
+   public void deploy(VFSDeploymentUnit unit) throws DeploymentException
+   {
+      List<VirtualFile> files = unit.getMetaDataFiles(null, AOP_DD_SUFFIX);
+
+      if (isAopArchiveOrFolder(unit))
+      {
+         deployAnnotations(unit);
+      }
+      
+      if (files.size() > 0)
+      {
+         deployXml(unit, files);
+      }
+   }
+   
+   public void undeploy(VFSDeploymentUnit unit)
+   {
+      List<VirtualFile> files = unit.getMetaDataFiles(null, AOP_DD_SUFFIX);
+
+      if (isAopArchiveOrFolder(unit))
+      {
+         undeployAnnotations(unit);
+      }
+      
+      if (files.size() > 0)
+      {
+         undeployXml(unit, files);
+      }
+   }
+
+   private void deployXml(VFSDeploymentUnit unit, List<VirtualFile> files) throws DeploymentException
+   {
+      ClassLoader scl = getScopedClassLoader(unit);
+
+      if (scl != null)
+      {
+         log.info("AOP deployment is scoped using classloader " + scl);   
+      }
+      
+      for (VirtualFile vf : files)
+      {
+         try
+         {
+            log.debug("deploying: " + vf.toURL());
+            InputStream is = vf.openStream();
+            try
+            {
+               Document doc = AspectXmlLoader.loadDocument(is);
+               AspectXmlLoader loader = new AspectXmlLoader();
+      
+               if (scl != null)
+               {
+                  loader.setManager(AspectManager.instance(scl));
+                  loader.setClassLoader(scl);
+               }
+               else
+               {
+                  loader.setManager(AspectManager.instance());
+               }
+               loader.deployXML(doc, vf.toURL(), scl);
+            }
+            finally
+            {
+               is.close();
+            }
+         }
+         catch (Exception e)
+         {
+            throw DeploymentException.rethrowAsDeploymentException("Error deploying xml " + vf.getName(), e);
+         }
+      }
+   }
+
+   private void undeployXml(VFSDeploymentUnit unit, List<VirtualFile> files)
+   {
+      ClassLoader scl = getScopedClassLoader(unit);
+
+      for (VirtualFile vf : files)
+      {
+         try
+         {
+            log.debug("undeploying: " + vf.toURL());
+            InputStream is = vf.openStream();
+            try
+            {
+               Document doc = AspectXmlLoader.loadDocument(is);
+               AspectXmlLoader loader = new AspectXmlLoader();
+               
+               AspectManager manager = (scl != null) ? AspectManager.instance(scl) : aspectManager;
+               
+               loader.setManager(manager);
+               loader.undeployXML(doc, vf.toURL());
+            }
+            finally
+            {
+               is.close();
+            }
+         }
+         catch (Exception e)
+         {
+            log.warn("Error undeploying xml " + vf.getName(), e);
+         }
+      }
+      
+      aspectManager.unregisterClassLoader(unit.getClassLoader());
+   }
+
+   private void deployAnnotations(VFSDeploymentUnit unit) throws DeploymentException
+   {
+      ClassLoader scl = getScopedClassLoader(unit);
+
+      if (scl != null)
+      {
+         log.info("AOP deployment is scoped using classloader " + scl);   
+      }
+
+      AspectAnnotationLoader loader = getAnnotationLoader(scl); 
+      List<VirtualFile> files = getClasses(unit);
+      for(VirtualFile file : files)
+      {
+         ClassFile cf = loadClassFile(file);
+         
+         try
+         {
+            log.debug("Deploying possibly annotated class " + cf.getName());
+            loader.deployClassFile(cf);
+         }
+         catch (Exception e)
+         {
+            throw new DeploymentException("Error reading annotations for " + file, e);
+         }
+      }
+   }
+   
+   private void undeployAnnotations(VFSDeploymentUnit unit)
+   {
+      ClassLoader scl = getScopedClassLoader(unit);
+      AspectAnnotationLoader loader = getAnnotationLoader(scl); 
+      List<VirtualFile> files = getClasses(unit);
+      for(VirtualFile file : files)
+      {
+         ClassFile cf = loadClassFile(file);
+         
+         try
+         {
+            log.debug("Undeploying possibly annotated class " + cf.getName());
+            loader.undeployClassFile(cf);
+         }
+         catch (Exception e)
+         {
+            log.warn("Error reading annotations for " + file, e);
+         }
+      }
+   }
+
+   private AspectAnnotationLoader getAnnotationLoader(ClassLoader scl)
+   {
+      AspectManager manager = (scl != null) ? AspectManager.instance(scl) : AspectManager.instance();
+      AspectAnnotationLoader loader = new AspectAnnotationLoader(manager);
+      loader.setClassLoader(scl);
+      return loader;
+   }
+   
+   private ClassFile loadClassFile(VirtualFile file)
+   {
+      DataInputStream din = null;
+      ClassFile cf = null;
+      try
+      {
+         InputStream in = file.openStream();
+         din = new DataInputStream(new BufferedInputStream(in));
+         cf = new ClassFile(din);
+      }
+      catch (IOException e)
+      {
+         throw new RuntimeException("Error reading " + file, e);
+      }
+      finally
+      {
+         try
+         {
+            din.close();
+         }
+         catch (IOException ignored)
+         {
+         }
+      }
+      
+      return cf;
+   }
+   
+   private List<VirtualFile> getClasses(VFSDeploymentUnit unit)
+   {
+      VisitorAttributes va = new VisitorAttributes();
+      va.setLeavesOnly(true);
+      ClassFileFilter filter = new ClassFileFilter();
+      SuffixesExcludeFilter noJars = new SuffixesExcludeFilter(JarUtils.getSuffixes());
+      va.setRecurseFilter(noJars);
+      FilterVirtualFileVisitor visitor = new FilterVirtualFileVisitor(filter, va);
+
+      for (VirtualFile vf : unit.getClassPath())
+      {
+         try
+         {
+            vf.visit(visitor);
+         }
+         catch (IOException e)
+         {
+            throw new RuntimeException(e);
+         }
+      }
+      return visitor.getMatched();
+
+   }
+   
+   private boolean isAopArchiveOrFolder(VFSDeploymentUnit unit)
+   {
+      String name = unit.getName();
+      
+      //If name is of format 'blah-blah.aop!/' get rid of the trailing '!' and '/', and see if it ends with .aop
+      int index = name.length();
+      if (name.charAt(name.length() - 1) == '/') 
+      {
+         index--;
+      }
+      if (name.charAt(name.length() - 2) == '!')
+      {
+         index--;
+      }
+      String realName = (index == name.length()) ? name : name.substring(0, index);
+      
+      return (realName.endsWith(AOP_JAR_SUFFIX));
+   }
+   
+   private ClassLoader getScopedClassLoader(VFSDeploymentUnit unit)
+   {
+      //Scoped AOP deployments are only available when deployed as part of a scoped sar, ear etc.
+      //It can contain an aop.xml file, or it can be part of a .aop file
+      //Linking a standalone -aop.xml file onto a scoped deployment is not possible at the moment
+      if (JBossScopedClassLoaderHelper.isScopedClassLoader(unit.getClassLoader()))
+      {
+         return unit.getClassLoader();
+      }
+      
+      return null;
+   }
+
+   private static class ClassFileFilter implements VirtualFileFilter
+   {
+      public boolean accepts(VirtualFile file)
+      {
+         try
+         {
+            return file.isLeaf() && file.getName().endsWith(".class");
+         }
+         catch (IOException e)
+         {
+            throw new RuntimeException("Error visiting file: " + file.getName(), e);
+         }
+      }
+   }
+
+}

Modified: trunk/system/src/main/org/jboss/deployers/plugins/scanner/VFSDeploymentScannerImpl.java
===================================================================
--- trunk/system/src/main/org/jboss/deployers/plugins/scanner/VFSDeploymentScannerImpl.java	2007-06-28 17:24:15 UTC (rev 63729)
+++ trunk/system/src/main/org/jboss/deployers/plugins/scanner/VFSDeploymentScannerImpl.java	2007-06-28 17:24:29 UTC (rev 63730)
@@ -21,22 +21,15 @@
  */
 package org.jboss.deployers.plugins.scanner;
 
-import static org.jboss.deployers.spi.structure.StructureDetermined.PREDETERMINED;
-
 import java.io.IOException;
-import java.net.MalformedURLException;
 import java.net.URI;
 import java.net.URISyntaxException;
-import java.net.URL;
 import java.util.ArrayList;
 import java.util.Collections;
-import java.util.HashMap;
 import java.util.Iterator;
 import java.util.LinkedList;
 import java.util.List;
 import java.util.Map;
-import java.util.Set;
-import java.util.SortedSet;
 import java.util.StringTokenizer;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.Executors;
@@ -45,16 +38,9 @@
 import java.util.concurrent.ThreadFactory;
 import java.util.concurrent.TimeUnit;
 
-import org.jboss.deployers.plugins.structure.AbstractDeploymentContext;
-import org.jboss.deployers.plugins.structure.BasicStructuredDeployers;
-import org.jboss.deployers.plugins.structure.StructureMetaDataImpl;
-import org.jboss.deployers.spi.DeploymentException;
-import org.jboss.deployers.spi.deployment.MainDeployer;
-import org.jboss.deployers.spi.structure.DeploymentContext;
-import org.jboss.deployers.spi.structure.vfs.StructureBuilder;
-import org.jboss.deployers.spi.structure.vfs.StructureDeployer;
-import org.jboss.deployers.spi.structure.vfs.StructureMetaData;
-import org.jboss.deployers.spi.structure.vfs.StructuredDeployers;
+import org.jboss.deployers.client.spi.Deployment;
+import org.jboss.deployers.client.spi.main.MainDeployer;
+import org.jboss.deployers.vfs.spi.client.VFSDeploymentFactory;
 import org.jboss.logging.Logger;
 import org.jboss.util.StringPropertyReplacer;
 import org.jboss.virtual.VFS;
@@ -76,6 +62,9 @@
    // Private Data --------------------------------------------------
    private MainDeployer mainDeployer;
 
+   /** The deployment factory */
+   private VFSDeploymentFactory deploymentFactory = VFSDeploymentFactory.getInstance();
+   
    /** */
    private VirtualFileFilter filter;
    /** The ExecutorService/ThreadPool for performing scans */
@@ -98,7 +87,7 @@
    private int scanCount;
 
    /** A set of scanned VirtualFiles which have been deployed */
-   private Map<VirtualFile, DeploymentContext> deployedMap = new ConcurrentHashMap<VirtualFile, DeploymentContext>();
+   private Map<VirtualFile, DeploymentInfo> deployedMap = new ConcurrentHashMap<VirtualFile, DeploymentInfo>();
 
    // Constructor ---------------------------------------------------
    
@@ -154,7 +143,10 @@
       this.scanPeriod = period;
    }
 
-   /** Are deployment scans enabled.
+   /** 
+    * Are deployment scans enabled.
+    * 
+    * @return whether scan is enabled
     */
    public boolean isScanEnabled()
    {
@@ -188,7 +180,10 @@
       }
    }
 
-    /**
+   /**
+    * Set the urls to scan 
+    * 
+    * @param listspec the urls
     * @throws URISyntaxException
     * @throws IOException
     */
@@ -218,7 +213,9 @@
    }
 
    /**
+    * Set uris to scan
     * 
+    * @param list the urls to scan
     * @throws IOException
     */
    public void setURIList(final List<URI> list) throws IOException
@@ -431,11 +428,12 @@
       ArrayList<VirtualFile> toUpdateList = new ArrayList<VirtualFile>(toCheckForUpdateList.size());
       for (VirtualFile vf : toUpdateList)
       {
-         DeploymentContext context = deployedMap.get(vf);
+         DeploymentInfo info = deployedMap.get(vf);
          long modified = vf.getLastModified();
-         Long prevLastDeployed = context.getTransientAttachments().getAttachment("deployedLastModified", Long.class);
-         if (prevLastDeployed != null && prevLastDeployed.compareTo(modified) < 0)
+         Long prevLastDeployed = info.lastModified;;
+         if (prevLastDeployed.compareTo(modified) < 0)
          {
+            info.lastModified = modified;
             if (trace)
             {
                log.trace("Re-deploying " + vf);
@@ -548,10 +546,10 @@
    {
       // If the deployer is null simply ignore the request
       log.debug("Deploying: " + vf);
-      DeploymentContext context = new AbstractDeploymentContext(vf);
+      Deployment deployment = deploymentFactory.createVFSDeployment(vf);
       try
       {
-         mainDeployer.addDeploymentContext(context);
+         mainDeployer.addDeployment(deployment);
          mainDeployer.process();
       }
       catch (Exception e)
@@ -567,11 +565,10 @@
       */
       try
       {
-         long deployedLastModified = vf.getLastModified();
-         context.getTransientAttachments().addAttachment("deployedLastModified", deployedLastModified);
+         DeploymentInfo info = new DeploymentInfo(deployment, vf.getLastModified());
          if (!deployedMap.containsKey(vf))
          {
-            deployedMap.put(vf, context);
+            deployedMap.put(vf, info);
          }
       }
       catch(IOException e)
@@ -588,8 +585,8 @@
       try
       {
          log.debug("Undeploying: " + vf);
-         DeploymentContext deployment = deployedMap.remove(vf);
-         mainDeployer.removeDeploymentContext(deployment.getName());
+         DeploymentInfo info = deployedMap.remove(vf);
+         mainDeployer.removeDeployment(info.deployment);
       }
       catch (Exception e)
       {
@@ -597,4 +594,29 @@
       }
    }
 
+   /**
+    * DeploymentInfo.
+    */
+   private class DeploymentInfo
+   {
+      /** The deployment */
+      Deployment deployment;
+      
+      /** The last modified time */
+      long lastModified;
+      
+      /**
+       * Create a new DeploymentInfo.
+       * 
+       * @param deployment the deployment
+       * @param lastModified the last modified
+       */
+      public DeploymentInfo(Deployment deployment, long lastModified)
+      {
+         if (deployment == null)
+            throw new IllegalArgumentException("Null deployment");
+         this.deployment = deployment;
+         this.lastModified = lastModified;
+      }
+   }
 }

Modified: trunk/system/src/main/org/jboss/deployers/spi/management/ComponentTypeListener.java
===================================================================
--- trunk/system/src/main/org/jboss/deployers/spi/management/ComponentTypeListener.java	2007-06-28 17:24:15 UTC (rev 63729)
+++ trunk/system/src/main/org/jboss/deployers/spi/management/ComponentTypeListener.java	2007-06-28 17:24:29 UTC (rev 63730)
@@ -21,7 +21,7 @@
  */
 package org.jboss.deployers.spi.management;
 
-import org.jboss.deployers.spi.deployer.DeploymentUnit;
+import org.jboss.deployers.structure.spi.DeploymentUnit;
 
 /**
  * Callback interface for deployment ComponentType identification.

Modified: trunk/system/src/main/org/jboss/deployers/spi/management/ComponentTypeVisitor.java
===================================================================
--- trunk/system/src/main/org/jboss/deployers/spi/management/ComponentTypeVisitor.java	2007-06-28 17:24:15 UTC (rev 63729)
+++ trunk/system/src/main/org/jboss/deployers/spi/management/ComponentTypeVisitor.java	2007-06-28 17:24:29 UTC (rev 63730)
@@ -21,7 +21,7 @@
  */
 package org.jboss.deployers.spi.management;
 
-import org.jboss.deployers.spi.deployer.DeploymentUnit;
+import org.jboss.deployers.structure.spi.DeploymentUnit;
 
 /**
  * Visitor api for determining the ComponentType of a deployment.

Modified: trunk/system/src/main/org/jboss/deployers/spi/management/DeploymentTemplate.java
===================================================================
--- trunk/system/src/main/org/jboss/deployers/spi/management/DeploymentTemplate.java	2007-06-28 17:24:15 UTC (rev 63729)
+++ trunk/system/src/main/org/jboss/deployers/spi/management/DeploymentTemplate.java	2007-06-28 17:24:29 UTC (rev 63730)
@@ -22,7 +22,7 @@
 
 package org.jboss.deployers.spi.management;
 
-import org.jboss.deployers.spi.structure.DeploymentContext;
+import org.jboss.deployers.vfs.spi.client.VFSDeployment;
 import org.jboss.virtual.VirtualFile;
 
 /**
@@ -65,7 +65,7 @@
     * @param values - the template ManagedProperty values.
     * @throws Exception
     */
-   public void updateTemplateDeployment(DeploymentContext ctx,
+   public void updateTemplateDeployment(VFSDeployment ctx,
          DeploymentTemplateInfo values)
       throws Exception;
 }

Modified: trunk/system/src/main/org/jboss/deployers/spi/management/ManagedDeployment.java
===================================================================
--- trunk/system/src/main/org/jboss/deployers/spi/management/ManagedDeployment.java	2007-06-28 17:24:15 UTC (rev 63729)
+++ trunk/system/src/main/org/jboss/deployers/spi/management/ManagedDeployment.java	2007-06-28 17:24:29 UTC (rev 63730)
@@ -49,7 +49,7 @@
    public String getSimpleName();
    /**
     * Get the phase this deployment is associated with
-    * @return
+    * @return the phase
     */
    public DeploymentPhase getDeploymentPhase();
    /**
@@ -80,7 +80,7 @@
 
    /**
     * 
-    * @return
+    * @return the parent
     */
    public ManagedDeployment getParent();
 
@@ -98,14 +98,14 @@
    /**
     * Get the DeploymentTemplate names for components
     * that can be added to this deployment.
-    * @return 
+    * @return  the template names
     */
    public Set<String> getComponentTemplateNames();
    public DeploymentTemplateInfo getTemplate(String name);
    /**
     * Add a component to this deployment
     * @param info
-    * @return
+    * @return the component
     */
    public ManagedComponent addComponent(DeploymentTemplateInfo info);
    public void removeComponent(ManagedComponent mc);
@@ -113,14 +113,14 @@
    /**
     * Get the DeploymentTemplate names for deployments
     * that can be added to this deployment.
-    * @return 
+    * @return the template names
     */
    public Set<String> getDeploymentTemplateNames();
    /**
     * Add a deployment
     * @param deplymentBaseName
     * @param info
-    * @return
+    * @return the deployment
     */
    public ManagedDeployment addModule(String deplymentBaseName, DeploymentTemplateInfo info);
 }

Modified: trunk/system/src/main/org/jboss/deployers/spi/management/ManagementView.java
===================================================================
--- trunk/system/src/main/org/jboss/deployers/spi/management/ManagementView.java	2007-06-28 17:24:15 UTC (rev 63729)
+++ trunk/system/src/main/org/jboss/deployers/spi/management/ManagementView.java	2007-06-28 17:24:29 UTC (rev 63730)
@@ -24,13 +24,10 @@
 
 import java.util.Set;
 
-import org.jboss.managed.api.ManagedObject;
-import org.jboss.managed.api.ManagedProperty;
 import org.jboss.profileservice.spi.NoSuchDeploymentException;
+import org.jboss.profileservice.spi.NoSuchProfileException;
 import org.jboss.profileservice.spi.ProfileKey;
-import org.jboss.profileservice.spi.NoSuchProfileException;
 import org.jboss.profileservice.spi.Profile.DeploymentPhase;
-import org.jboss.util.graph.Graph;
 
 /**
  * The management view plugin spi for querying profiles for the
@@ -53,15 +50,16 @@
 
    /**
     * Get the names of the deployment in the profile.
-    * @param key - the profile containing the deployment
+    * 
+    * @return the names
     */
    public Set<String> getDeploymentNames();
 
    /**
     * Get the names of the deployment in the profile that have the
     * given deployment type.
-    * @param key - the profile containing the deployment
     * @param type - the deployment type
+    * @return the names
     */
    public Set<String> getDeploymentNamesForType(String type);
 
@@ -69,17 +67,19 @@
     * Search for a deployment matching the regex expression.
     * @param regex - the regex to query deployment name 
     * @return the deployment name.
-    * @throws NoSuchProfileException if key is not valie
     * @throws NoSuchDeploymentException if no matches are found 
     */
    public Set<String> getMatchingDeploymentName(String regex)
       throws NoSuchDeploymentException;
 
    /**
+    * Get a deployment
     * 
-    * @param key
-    * @param name
-    * @return
+    * @param name the name
+    * @param phase the phase
+    * @return the deployment
+    * @throws NoSuchDeploymentException if no matches are found 
+    * @throws Exception for any error
     */
    public ManagedDeployment getDeployment(String name, DeploymentPhase phase)
       throws NoSuchDeploymentException, Exception;
@@ -118,7 +118,7 @@
     * Get the registered DeploymentTemplate names.
     * 
     * TODO: probably needs a Map<String, DeploymentType> notion
-    * @return
+    * @return the template names
     */
    public Set<String> getTemplateNames();
 
@@ -134,7 +134,6 @@
 
    /**
     * 
-    * @param key
     * @param phase
     * @param deploymentBaseName
     * @param info
@@ -147,9 +146,11 @@
    /**
     * Remove a deployment
     * 
-    * @param name
+    * @param deploymentName the deployment name
+    * @param phase the phase
     * @throws NoSuchProfileException
     * @throws NoSuchDeploymentException
+    * @throws Exception for any error
     */
    public void removeDeployment(String deploymentName, DeploymentPhase phase)
       throws NoSuchDeploymentException, Exception;

Modified: trunk/system/src/main/org/jboss/profileservice/aop/DeployerAspects.java
===================================================================
--- trunk/system/src/main/org/jboss/profileservice/aop/DeployerAspects.java	2007-06-28 17:24:15 UTC (rev 63729)
+++ trunk/system/src/main/org/jboss/profileservice/aop/DeployerAspects.java	2007-06-28 17:24:29 UTC (rev 63730)
@@ -26,11 +26,10 @@
 import org.jboss.aop.joinpoint.Invocation;
 import org.jboss.aop.joinpoint.MethodInvocation;
 import org.jboss.deployers.spi.deployer.Deployer;
-import org.jboss.deployers.spi.deployer.DeploymentUnit;
 import org.jboss.deployers.spi.management.ComponentType;
 import org.jboss.deployers.spi.management.ComponentTypeListener;
 import org.jboss.deployers.spi.management.ComponentTypeVisitor;
-import org.jboss.deployers.spi.structure.DeploymentContext;
+import org.jboss.deployers.structure.spi.DeploymentUnit;
 import org.jboss.logging.Logger;
 import org.jboss.profileservice.spi.AttachmentsSerializer;
 
@@ -55,9 +54,11 @@
    {
       return compVisitor;
    }
+
    /**
-    * Set the ComponentTypeVisitor 
-    * @return
+    * Set the ComponentTypeVisitor
+    * 
+    * @param compVisitor the visitor
     */
    public static void setCompVisitor(ComponentTypeVisitor compVisitor)
    {
@@ -110,7 +111,7 @@
    /**
     * 
     * @param invocation
-    * @return
+    * @return the result
     * @throws Throwable
     */
    public Object prepareDeploy(MethodInvocation invocation)
@@ -143,12 +144,14 @@
             {
                if( unit.getSimpleName().equals("hsqldb-ds.xml") )
                   log.info("Loading hsqldb-ds.xml attachments, "+deployerID);
+               /** TODO what is this doing?
                for(String key : map.keySet())
                {
                   Object value = map.get(key);
                   DeploymentContext ctx = unit.getDeploymentContext();
                   ctx.getPredeterminedManagedObjects().addAttachment(key, value);
                }
+                  */
             }
          }
          finally

Modified: trunk/system/src/main/org/jboss/profileservice/spi/AttachmentsSerializer.java
===================================================================
--- trunk/system/src/main/org/jboss/profileservice/spi/AttachmentsSerializer.java	2007-06-28 17:24:15 UTC (rev 63729)
+++ trunk/system/src/main/org/jboss/profileservice/spi/AttachmentsSerializer.java	2007-06-28 17:24:29 UTC (rev 63730)
@@ -23,8 +23,7 @@
 
 import java.util.Map;
 
-import org.jboss.deployers.spi.deployer.DeploymentUnit;
-import org.jboss.deployers.spi.structure.DeploymentContext;
+import org.jboss.deployers.structure.spi.DeploymentUnit;
 
 /**
  * An interface that allows externalization of the attachment

Modified: trunk/system/src/main/org/jboss/profileservice/spi/DeploymentRepository.java
===================================================================
--- trunk/system/src/main/org/jboss/profileservice/spi/DeploymentRepository.java	2007-06-28 17:24:15 UTC (rev 63729)
+++ trunk/system/src/main/org/jboss/profileservice/spi/DeploymentRepository.java	2007-06-28 17:24:29 UTC (rev 63730)
@@ -28,14 +28,14 @@
 import java.util.zip.ZipInputStream;
 
 import org.jboss.deployers.spi.attachments.Attachments;
-import org.jboss.deployers.spi.management.ComponentType;
-import org.jboss.deployers.spi.structure.DeploymentContext;
+import org.jboss.deployers.vfs.spi.client.VFSDeployment;
 import org.jboss.profileservice.spi.Profile.DeploymentPhase;
 
 /**
  * An interface for managing the contents of a Profile.
  * 
  * @author Scott.Stark at jboss.org
+ * @author adrian at jboss.org
  * @version $Revision:$
  */
 public interface DeploymentRepository
@@ -58,13 +58,15 @@
    /**
     * Add a deployment
     * 
+    * @param vfsPath the path
     * @param d the deployment
     * @param phase - the phase of the deployment as it relates to when the
     * deployment is loaded
+    * @throws Exception for any error
     */
-   public void addDeployment(String vfsPath, DeploymentContext d, DeploymentPhase phase)
+   public void addDeployment(String vfsPath, VFSDeployment d, DeploymentPhase phase)
       throws Exception;
-   public void updateDeployment(String vfsPath, DeploymentContext d, DeploymentPhase phase)
+   public void updateDeployment(String vfsPath, VFSDeployment d, DeploymentPhase phase)
       throws Exception;
    /**
     * Get a named deployment.
@@ -75,18 +77,21 @@
     * @return the named bootstrap
     * @throws NoSuchDeploymentException - if there is no such bootstrap
     * @throws IOException 
+    * @throws Exception for any error
     */
-   public DeploymentContext getDeployment(String name, DeploymentPhase phase)
+   public VFSDeployment getDeployment(String name, DeploymentPhase phase)
       throws NoSuchDeploymentException, Exception;
 
    /**
     * Remove a deployment
     * 
-    * @param name - the deployment name
+    * @param vfsPath - the vfs path
     * @param phase - the phase of the deployment as it relates to when the
     * deployment is loaded
+    * @return the removed deployment
+    * @throws Exception for any error
     */
-   public DeploymentContext removeDeployment(String vfsPath, DeploymentPhase phase)
+   public VFSDeployment removeDeployment(String vfsPath, DeploymentPhase phase)
       throws Exception;
 
    /**
@@ -95,15 +100,17 @@
     * @param phase - the phase of the deployment as it relates to when the
     * deployment is loaded
     * @return the bootstrap instances in this profile.
+    * @throws Exception for any error
     */
-   public Collection<DeploymentContext> getDeployments(DeploymentPhase phase)
+   public Collection<VFSDeployment> getDeployments(DeploymentPhase phase)
       throws Exception;
    /**
     * Get all deployments defined in this profile
     * 
     * @return the deployment instances in this profile.
+    * @throws Exception for any error
     */
-   public Collection<DeploymentContext> getDeployments()
+   public Collection<VFSDeployment> getDeployments()
       throws Exception;
 
    public Collection<ModificationInfo> getModifiedDeployments()

Modified: trunk/system/src/main/org/jboss/profileservice/spi/ModificationInfo.java
===================================================================
--- trunk/system/src/main/org/jboss/profileservice/spi/ModificationInfo.java	2007-06-28 17:24:15 UTC (rev 63729)
+++ trunk/system/src/main/org/jboss/profileservice/spi/ModificationInfo.java	2007-06-28 17:24:29 UTC (rev 63730)
@@ -23,7 +23,7 @@
 
 import java.io.Serializable;
 
-import org.jboss.deployers.spi.structure.DeploymentContext;
+import org.jboss.deployers.vfs.spi.client.VFSDeployment;
 
 /**
  * Represents a modified deployment returned from the modified deployments scan.
@@ -31,6 +31,7 @@
  * @see Profile#getModifiedDeployments()
  * 
  * @author Scott.Stark at jboss.org
+ * @author adrian at jboss.org
  * @version $Revision$
  */
 public class ModificationInfo implements Serializable
@@ -38,21 +39,20 @@
    private final static long serialVersionUID = 1;
 
    public enum ModifyStatus {ADDED, MODIFIED, REMOVED};
-   private DeploymentContext ctx;
+   private VFSDeployment deployment;
    private long lastModified;
    private ModifyStatus status;
 
-   public ModificationInfo(DeploymentContext ctx, long lastModified, ModifyStatus status)
+   public ModificationInfo(VFSDeployment deployment, long lastModified, ModifyStatus status)
    {
-      super();
-      this.ctx = ctx;
+      this.deployment = deployment;
       this.lastModified = lastModified;
       this.status = status;
    }
 
-   public DeploymentContext getCtx()
+   public VFSDeployment getDeployment()
    {
-      return ctx;
+      return deployment;
    }
 
    public long getLastModified()

Modified: trunk/system/src/main/org/jboss/profileservice/spi/Profile.java
===================================================================
--- trunk/system/src/main/org/jboss/profileservice/spi/Profile.java	2007-06-28 17:24:15 UTC (rev 63729)
+++ trunk/system/src/main/org/jboss/profileservice/spi/Profile.java	2007-06-28 17:24:29 UTC (rev 63730)
@@ -25,13 +25,14 @@
 import java.util.Map;
 import java.util.Set;
 
-import org.jboss.deployers.spi.structure.DeploymentContext;
+import org.jboss.deployers.vfs.spi.client.VFSDeployment;
 import org.jboss.virtual.VirtualFile;
 
 /**
  * A profile represents a named collection of deployments on a server
  * 
  * @author Scott.Stark at jboss.org
+ * @author adrian at jboss.org
  * @version $Revision$
  */
 public interface Profile
@@ -50,7 +51,7 @@
     * Get the key used to create the Profile
     * @return the key used to create the Profile
     */
-   public ProfileKey getKey();
+   ProfileKey getKey();
 
    /**
     * The x.y.z version of the profile
@@ -62,35 +63,37 @@
    /**
     * Get the names of the deployments in the profile
     * @return names of deployments
-        */
-   public Set<String> getDeploymentNames();
+    */
+   Set<String> getDeploymentNames();
 
    /**
     * Get the names of the deployments for the given phase defined in this profile
     * @param phase - the phase of the deployment as it relates to when the
     * deployment is loaded
     * @return names of deployments
-        */
-   public Set<String> getDeploymentNames(DeploymentPhase phase);
+    */
+   Set<String> getDeploymentNames(DeploymentPhase phase);
 
    //public DeploymentInfo getDeploymentInfo(String name);
 
    /**
     * Get the names of the deployment in the profile that have the
     * given deployment type.
+    * 
     * @param type - the deployment type
+    * @return the deployments names by type
     */
-   public Set<String> getDeploymentNamesForType(String type);
+   Set<String> getDeploymentNamesForType(String type);
 
    /**
     * Get the root for deployments of the given phase.
     * 
-    * @param phase
+    * @param phase the deployment phase
     * @return the VirtualFile directory that contains deployments of the
     * given phase.
+    * @throws Exception for any error
     */
-   public VirtualFile getRootFile(DeploymentPhase phase)
-      throws Exception;
+   VirtualFile getRootFile(DeploymentPhase phase) throws Exception;
 
    /**
     * Add a deployment
@@ -98,9 +101,10 @@
     * @param d the deployment
     * @param phase - the phase of the deployment as it relates to when the
     * deployment is loaded
+    * @throws Exception for any error
     */
-   public void addDeployment(DeploymentContext d, DeploymentPhase phase)
-      throws Exception;
+   void addDeployment(VFSDeployment d, DeploymentPhase phase) throws Exception;
+   
    /**
     * Update a deployment. This can be used to save attachments, other
     * metadata of the deployment.
@@ -108,10 +112,9 @@
     * @param d the deployment
     * @param phase - the phase of the deployment as it relates to when the
     * deployment is loaded
-    * @throws Exception
+    * @throws Exception for any error
     */
-   public void updateDeployment(DeploymentContext d, DeploymentPhase phase)
-      throws Exception;
+   void updateDeployment(VFSDeployment d, DeploymentPhase phase) throws Exception;
 
    /**
     * Remove a deployment
@@ -120,9 +123,9 @@
     * @param phase - the phase of the deployment as it relates to when the
     * deployment is loaded
     * @return the DeploymentContext for the name if found
+    * @throws Exception for any error
     */
-   public DeploymentContext removeDeployment(String name, DeploymentPhase phase)
-      throws Exception;
+   VFSDeployment removeDeployment(String name, DeploymentPhase phase) throws Exception;
 
    /**
     * Get a named deployment.
@@ -131,26 +134,26 @@
     * @param phase - the phase of the deployment as it relates to when the
     * deployment is loaded. If null, then all phases are queried.
     * @return the named bootstrap
+    * @throws Exception for any error
     * @throws NoSuchDeploymentException - if there is no such bootstrap
     */
-   public DeploymentContext getDeployment(String name, DeploymentPhase phase)
-      throws Exception, NoSuchDeploymentException;
+   VFSDeployment getDeployment(String name, DeploymentPhase phase) throws Exception, NoSuchDeploymentException;
 
    /**
     * @param phase - the phase of the deployment as it relates to when the
     * deployment is loaded
     * @return the bootstrap instances in this profile.
-        */
-   public Collection<DeploymentContext> getDeployments(DeploymentPhase phase)
-      throws Exception;
+    * @throws Exception for any error
+    */
+   Collection<VFSDeployment> getDeployments(DeploymentPhase phase) throws Exception;
 
    /**
     * Get all deployments defined in this profile
     * 
     * @return the deployment instances in this profile.
+    * @throws Exception for any error
     */
-   public Collection<DeploymentContext> getDeployments()
-      throws Exception;
+   Collection<VFSDeployment> getDeployments() throws Exception;
 
    /**
     * Get the deployments that have been modified since the last
@@ -161,8 +164,7 @@
     * 
     * @throws Exception - thrown on error scanning for deployments
     */
-   public Collection<ModificationInfo> getModifiedDeployments()
-      throws Exception;
+   Collection<ModificationInfo> getModifiedDeployments() throws Exception;
 
    /**
     * Enable/disable the getModifiedDeployments results. This can be
@@ -171,14 +173,14 @@
     * @see #getModifiedDeployments
     * @param flag - the enable/disable flag
     */
-   public void enableModifiedDeploymentChecks(boolean flag);
+   void enableModifiedDeploymentChecks(boolean flag);
 
    /**
     * Get the config
     * 
     * @return the config
     */
-   public Map<String, Object> getConfig();
+   Map<String, Object> getConfig();
 
    /**
     * Checks whether a deployment context is available in the basic profile service.
@@ -187,6 +189,5 @@
     * @param    phase   optionally a deployment phase, if null search all
     * @return   true if the deployment is found or false otherwise
     */
-   public boolean hasDeployment(String name, DeploymentPhase phase);
-
+   boolean hasDeployment(String name, DeploymentPhase phase);
 }

Modified: trunk/system/src/main/org/jboss/profileservice/spi/ProfileRepository.java
===================================================================
--- trunk/system/src/main/org/jboss/profileservice/spi/ProfileRepository.java	2007-06-28 17:24:15 UTC (rev 63729)
+++ trunk/system/src/main/org/jboss/profileservice/spi/ProfileRepository.java	2007-06-28 17:24:29 UTC (rev 63730)
@@ -45,6 +45,7 @@
     * @return the profile DeploymentRepository
     * @throws IOException thrown if the repository cannot be created or
     *    already exists
+    * @throws Exception for any error
     */
    public DeploymentRepository createProfileDeploymentRepository(ProfileKey key)
       throws Exception;
@@ -55,6 +56,7 @@
     * @param key - the key for the Profile to obtain the DeploymentRepository for.
     * @return the profile DeploymentRepository
     * @throws NoSuchProfileException thrown if there is no such profile.
+    * @throws Exception for any error
     */
    public DeploymentRepository getProfileDeploymentRepository(ProfileKey key)
       throws Exception, NoSuchProfileException;
@@ -64,6 +66,7 @@
     * @param key - the key for the Profile to obtain the DeploymentRepository for.
     * @throws IOException thrown on error removing the repository
     * @throws NoSuchProfileException thrown if there is no such profile.
+    * @throws Exception for any error
     */
    public void removeProfileDeploymentRepository(ProfileKey key)
       throws Exception, NoSuchProfileException;

Modified: trunk/system/src/main/org/jboss/system/JBossRMIClassLoader.java
===================================================================
--- trunk/system/src/main/org/jboss/system/JBossRMIClassLoader.java	2007-06-28 17:24:15 UTC (rev 63729)
+++ trunk/system/src/main/org/jboss/system/JBossRMIClassLoader.java	2007-06-28 17:24:29 UTC (rev 63730)
@@ -76,7 +76,7 @@
    /**
     * Ignore the JVM, use the thread context classloader for proxy caching
     */
-   public Class loadProxyClass(String codebase, String[] interfaces, ClassLoader ignored)
+   public Class<?> loadProxyClass(String codebase, String[] interfaces, ClassLoader ignored)
       throws MalformedURLException, ClassNotFoundException
    {
       return delegate.loadProxyClass(codebase, interfaces, Thread.currentThread().getContextClassLoader());
@@ -85,7 +85,7 @@
    /**
     * Just delegate
     */
-   public Class loadClass(String codebase, String name, ClassLoader ignored)
+   public Class<?> loadClass(String codebase, String name, ClassLoader ignored)
       throws MalformedURLException, ClassNotFoundException
    {
       return delegate.loadClass(codebase, name, Thread.currentThread().getContextClassLoader());

Modified: trunk/system/src/main/org/jboss/system/Registry.java
===================================================================
--- trunk/system/src/main/org/jboss/system/Registry.java	2007-06-28 17:24:15 UTC (rev 63729)
+++ trunk/system/src/main/org/jboss/system/Registry.java	2007-06-28 17:24:29 UTC (rev 63730)
@@ -22,11 +22,10 @@
 package org.jboss.system;
 
 import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
 
 import org.jboss.logging.Logger;
 
-import EDU.oswego.cs.dl.util.concurrent.ConcurrentReaderHashMap;
-
 /**
  * A registry, really, a registry.
  *
@@ -41,7 +40,7 @@
 {
    private static final Logger log = Logger.getLogger(Registry.class);
    
-   public static Map entries = new ConcurrentReaderHashMap();
+   public static Map<Object, Object> entries = new ConcurrentHashMap<Object, Object>();
    
    public static void bind(final Object key, final Object value)
    {

Modified: trunk/system/src/main/org/jboss/system/Service.java
===================================================================
--- trunk/system/src/main/org/jboss/system/Service.java	2007-06-28 17:24:15 UTC (rev 63729)
+++ trunk/system/src/main/org/jboss/system/Service.java	2007-06-28 17:24:29 UTC (rev 63730)
@@ -30,12 +30,16 @@
 public interface Service
 {
    /**
-    * create the service, do expensive operations etc 
+    * create the service, do expensive operations etc
+    * 
+    * @throws Exception for any error
     */
    void create() throws Exception;
    
    /**
     * start the service, create is already called
+    * 
+    * @throws Exception for any error
     */
    void start() throws Exception;
    

Modified: trunk/system/src/main/org/jboss/system/server/BaseServerConfig.java
===================================================================
--- trunk/system/src/main/org/jboss/system/server/BaseServerConfig.java	2007-06-28 17:24:15 UTC (rev 63729)
+++ trunk/system/src/main/org/jboss/system/server/BaseServerConfig.java	2007-06-28 17:24:29 UTC (rev 63730)
@@ -42,12 +42,6 @@
  * <p>Most values are determined durring first call to getter.  All values
  *    when determined will have equivilent system properties set.
  *
- * <p>Clients are not meant to use this class directly.  Instead use
- *    {@link ServerConfigLocator} to get an instance of {@link ServerConfig}
- *    and then use it to get the server's configuration bits.
- *
- * @jmx:mbean name="jboss.system:type=ServerConfig"
- *
  * @author <a href="mailto:jason at planet57.com">Jason Dillon</a>
  * @author <a href="mailto:dimitris at jboss.org">Dimitris Andreadis</a>
  * @author Scott.Stark at jboss.org
@@ -121,6 +115,8 @@
    /** Breakout the initialization of URLs from the constructor as we need
     * the ServerConfig.HOME_DIR set for log setup, but we cannot create any
     * file URLs prior to the
+    * 
+    * @throws MalformedURLException for a bad home url
     */
    public void initURLs()
       throws MalformedURLException
@@ -138,8 +134,6 @@
 
    /**
     * Get the local home directory which the server is running from.
-    *
-    * @jmx:managed-attribute
     */
    public File getHomeDir()
    {
@@ -148,8 +142,6 @@
 
    /**
     * Get the home URL which the server is running from.
-    *
-    * @jmx:managed-attribute
     */
    public URL getHomeURL()
    {
@@ -158,8 +150,6 @@
 
    /**
     * Get the home URL which the server is running from.
-    *
-    * @jmx:managed-attribute
     */
    public URL getLibraryURL()
    {
@@ -184,8 +174,6 @@
 
    /**
     * Get the patch URL for the server.
-    *
-    * @jmx:managed-attribute
     */
    public URL getPatchURL()
    {
@@ -217,8 +205,6 @@
 
    /**
     * Get the name of the server.
-    *
-    * @jmx:managed-attribute
     */
    public String getServerName()
    {
@@ -232,8 +218,6 @@
 
    /**
     * Get the base directory for calculating server home directories.
-    *
-    * @jmx:managed-attribute
     */
    public File getServerBaseDir()
    {
@@ -251,8 +235,6 @@
 
    /**
     * Get the server home directory.
-    *
-    * @jmx:managed-attribute
     */
    public File getServerHomeDir()
    {
@@ -273,7 +255,7 @@
     * ServerConfig.SERVER_LOG_DIR system property needs to be set before
     * the logging framework is used.
     *
-    * @see ServerConfig.SERVER_LOG_DIR
+    * @see ServerConfig#SERVER_LOG_DIR
     * @return the writable temp directory
     */
    public File getServerLogDir()
@@ -293,7 +275,6 @@
    /**
     * Get the directory where temporary files will be stored.
     *
-    * @jmx:managed-attribute
     * @return the writable temp directory
     */
    public File getServerTempDir()
@@ -313,7 +294,6 @@
    /**
     * Get the directory where local data will be stored.
     *
-    * @jmx:managed-attribute
     * @return the data directory
     */
    public File getServerDataDir()
@@ -333,7 +313,6 @@
    /**
     * Get the native dir for unpacking
     * 
-    * @jmx:managed-attribute
     * @return the directory
     */
    public File getServerNativeDir()
@@ -347,7 +326,6 @@
    /**
     * Get the temporary deployment dir for unpacking
     * 
-    * @jmx:managed-attribute
     * @return the directory
     */
    public File getServerTempDeployDir()
@@ -357,8 +335,6 @@
 
    /**
     * Get the base directory for calculating server home URLs.
-    *
-    * @jmx:managed-attribute
     */
    public URL getServerBaseURL()
    {
@@ -383,8 +359,6 @@
 
    /**
     * Get the server home URL.
-    *
-    * @jmx:managed-attribute
     */
    public URL getServerHomeURL()
    {
@@ -409,8 +383,6 @@
 
    /**
     * Get the server library URL.
-    *
-    * @jmx:managed-attribute
     */
    public URL getServerLibraryURL()
    {
@@ -435,8 +407,6 @@
 
    /**
     * Get the server configuration URL.
-    *
-    * @jmx:managed-attribute
     */
    public URL getServerConfigURL()
    {
@@ -462,12 +432,10 @@
    /**
     * Get the current value of the flag that indicates if we are
     * using the platform MBeanServer as the main jboss server.
-    * Both the {@link ServerConfig.PLATFORM_MBEANSERVER}
+    * Both the {@link ServerConfig#PLATFORM_MBEANSERVER}
     * property must be set, and the jvm must be jdk1.5+
     * 
     * @return true if jboss runs on the jvm platfrom MBeanServer
-    * 
-    * @jmx:managed-attribute
     */
    public boolean getPlatformMBeanServer()
    {
@@ -495,13 +463,11 @@
    }
    
    /**
-    * Enable or disable exiting the JVM when {@link Server#shutdown} is called.
-    * If enabled, then shutdown calls {@link Server#exit}.  If disabled, then
+    * Enable or disable exiting the JVM when {@link Server#shutdown()} is called.
+    * If enabled, then shutdown calls {@link Server#exit()}.  If disabled, then
     * only the shutdown hook will be run.
     *
     * @param flag    True to enable calling exit on shutdown.
-    *
-    * @jmx:managed-attribute
     */
    public void setExitOnShutdown(final boolean flag)
    {
@@ -512,8 +478,6 @@
     * Get the current value of the exit on shutdown flag.
     *
     * @return    The current value of the exit on shutdown flag.
-    *
-    * @jmx:managed-attribute
     */
    public boolean getExitOnShutdown()
    {
@@ -539,8 +503,6 @@
     * ansynchronously in a separate thread.
     *
     * @param flag    True to enable blocking shutdown.
-    *
-    * @jmx:managed-attribute
     */
    public void setBlockingShutdown(final boolean flag)
    {
@@ -551,8 +513,6 @@
     * Get the current value of the blocking shutdown flag.
     *
     * @return    The current value of the blocking shutdown flag.
-    *
-    * @jmx:managed-attribute
     */
    public boolean getBlockingShutdown()
    {
@@ -578,8 +538,6 @@
     * logged and ignored.
     *
     * @param flag    True to enable blocking shutdown.
-    *
-    * @jmx:managed-attribute
     */
    public void setRequireJBossURLStreamHandlerFactory(final boolean flag)
    {
@@ -590,8 +548,6 @@
     * Get the current value of the requireJBossURLStreamHandlerFactory flag.
     *
     * @return    The current value of the requireJBossURLStreamHandlerFactory flag.
-    *
-    * @jmx:managed-attribute
     */
    public boolean getRequireJBossURLStreamHandlerFactory()
    {
@@ -615,8 +571,6 @@
     * the bootstrap process.
     *
     * @param filename    The filename of the root deployable.
-    *
-    * @jmx:managed-attribute
     */
    public void setRootDeploymentFilename(final String filename)
    {
@@ -628,8 +582,6 @@
     * the bootstrap process.
     *
     * @return    The filename of the root deployable.
-    *
-    * @jmx:managed-attribute
     */
    public String getRootDeploymentFilename()
    {

Modified: trunk/system/src/main/org/jboss/system/server/NoAnnotationURLClassLoader.java
===================================================================
--- trunk/system/src/main/org/jboss/system/server/NoAnnotationURLClassLoader.java	2007-06-28 17:24:15 UTC (rev 63729)
+++ trunk/system/src/main/org/jboss/system/server/NoAnnotationURLClassLoader.java	2007-06-28 17:24:29 UTC (rev 63730)
@@ -75,6 +75,7 @@
    * Return all library URLs
    *
    * <p>Do not remove this method without running the WebIntegrationTestSuite
+   * @return the urls
    */
    public URL[] getAllURLs()
    {

Modified: trunk/system/src/main/org/jboss/system/server/Server.java
===================================================================
--- trunk/system/src/main/org/jboss/system/server/Server.java	2007-06-28 17:24:15 UTC (rev 63729)
+++ trunk/system/src/main/org/jboss/system/server/Server.java	2007-06-28 17:24:29 UTC (rev 63730)
@@ -39,34 +39,34 @@
    /** The JMX notification event type sent on begin of the server shutdown */
    public final String STOP_NOTIFICATION_TYPE = "org.jboss.system.server.stopped";
 
-   /** The server start date */
+   /** @return The server start date */
    Date getStartDate();
    
-   /** The server version */
+   /** @return The server version */
    String getVersion();
 
-   /** The server version code name */
+   /** @return The server version code name */
    String getVersionName();
 
-   /** The full server version number */
+   /** @return The full server version number */
    String getVersionNumber();
 
-   /** The date the server was build (compiled) */
+   /** @return The date the server was build (compiled) */
    String getBuildNumber();
 
-   /** The JVM used to build the server */
+   /** @return The JVM used to build the server */
    String getBuildJVM();
 
-   /** The Operating System used to build the server */
+   /** @return The Operating System used to build the server */
    String getBuildOS();
 
-   /** The build id */
+   /** @return The build id */
    String getBuildID();
 
-   /** The date the server was build */
+   /** @return The date the server was build */
    String getBuildDate();
    
-   /** A flag indicating if shutdown has been called */
+   /** @return A flag indicating if shutdown has been called */
    boolean isInShutdown();
 
    // Operations ----------------------------------------------------
@@ -76,7 +76,6 @@
     * Initialize the Server instance.
     *
     * @param props     The configuration properties for the server.
-    * @return          Typed server configuration object.
     *
     * @throws IllegalStateException    Already initialized.
     * @throws Exception                Failed to initialize.
@@ -111,7 +110,7 @@
    /**
     * Shutdown the Server instance and run shutdown hooks.  
     *
-    * <p>If the exit on shutdown flag is true, then {@link #exit} 
+    * <p>If the exit on shutdown flag is true, then {@link #exit()} 
     *    is called, else only the shutdown hook is run.
     *
     * @throws IllegalStateException    No started.

Modified: trunk/system/src/main/org/jboss/system/server/ServerConfig.java
===================================================================
--- trunk/system/src/main/org/jboss/system/server/ServerConfig.java	2007-06-28 17:24:15 UTC (rev 63729)
+++ trunk/system/src/main/org/jboss/system/server/ServerConfig.java	2007-06-28 17:24:29 UTC (rev 63730)
@@ -27,9 +27,6 @@
 /**
  * The interface of the basic <em>typed</em> JBoss server configuration.
  *
- * <p>Clients should use {@link ServerConfigLocator} to get an instance of
- *    {@link ServerConfig} and then use it to get the server's configuration bits.
- *
  * @author  <a href="mailto:jason at planet57.com">Jason Dillon</a>
  * @author Scott.Stark at jboss.org 
  * @version $Revision$
@@ -312,7 +309,7 @@
    /** The default value for {@link #PLATFORM_MBEANSERVER}. */
    boolean DEFAULT_PLATFORM_MBEANSERVER = false;
 
-   /** The default value for {@link ROOT_DEPLOYMENT_FILENAME}. */
+   /** The default value for {@link #ROOT_DEPLOYMENT_FILENAME}. */
    String DEFAULT_ROOT_DEPLOYMENT_FILENAME = "jboss-service.xml";
 
 
@@ -421,7 +418,7 @@
    /**
     * Get the current value of the flag that indicates if we are
     * using the platform MBeanServer as the main jboss server.
-    * Both the {@link ServerConfig.PLATFORM_MBEANSERVER}
+    * Both the {@link ServerConfig#PLATFORM_MBEANSERVER}
     * property must be set, and the jvm must be jdk1.5+
     * 
     * @return true if jboss runs on the jvm platfrom MBeanServer
@@ -429,8 +426,8 @@
    boolean getPlatformMBeanServer();
     
    /**
-    * Enable or disable exiting the JVM when {@link Server#shutdown} is called.
-    * If enabled, then shutdown calls {@link Server#exit}.  If disabled, then
+    * Enable or disable exiting the JVM when {@link Server#shutdown()} is called.
+    * If enabled, then shutdown calls {@link Server#exit()}.  If disabled, then
     * only the shutdown hook will be run.
     *
     * @param flag    True to enable calling exit on shutdown.
@@ -501,6 +498,8 @@
 
    /**
     * Get the server Specification-Version
+    * 
+    * @return the spec version
     */
    String getSpecificationVersion();
 }

Modified: trunk/system/src/main/org/jboss/system/server/ServerInfo.java
===================================================================
--- trunk/system/src/main/org/jboss/system/server/ServerInfo.java	2007-06-28 17:24:15 UTC (rev 63729)
+++ trunk/system/src/main/org/jboss/system/server/ServerInfo.java	2007-06-28 17:24:29 UTC (rev 63730)
@@ -212,81 +212,51 @@
    //                            Server Information                         //
    ///////////////////////////////////////////////////////////////////////////
 
-   /**
-    * @jmx:managed-attribute
-    */
    public String getJavaVersion()
    {
       return System.getProperty("java.version");
    }
 
-   /**
-    * @jmx:managed-attribute
-    */
    public String getJavaVendor()
    {
       return System.getProperty("java.vendor");
    }
 
-   /**
-    * @jmx:managed-attribute
-    */
    public String getJavaVMName()
    {
       return System.getProperty("java.vm.name");
    }
 
-   /**
-    * @jmx:managed-attribute
-    */
    public String getJavaVMVersion()
    {
       return System.getProperty("java.vm.version");
    }
 
-   /**
-    * @jmx:managed-attribute
-    */
    public String getJavaVMVendor()
    {
       return System.getProperty("java.vm.vendor");
    }
 
-   /**
-    * @jmx:managed-attribute
-    */
    public String getOSName()
    {
       return System.getProperty("os.name");
    }
 
-   /**
-    * @jmx:managed-attribute
-    */
    public String getOSVersion()
    {
       return System.getProperty("os.version");
    }
 
-   /**
-    * @jmx:managed-attribute
-    */
    public String getOSArch()
    {
       return System.getProperty("os.arch");
    }
    
-   /**
-    * @jmx:managed-attribute
-    */
    public Long getTotalMemory()
    {
       return new Long(Runtime.getRuntime().totalMemory());
    }
    
-   /**
-    * @jmx:managed-attribute
-    */
    public Long getFreeMemory()
    {
       return new Long(Runtime.getRuntime().freeMemory());
@@ -295,8 +265,6 @@
    /**
     * Returns <tt>Runtime.getRuntime().maxMemory()<tt> on 
     * JDK 1.4 vms or -1 on previous versions.
-    * 
-    * @jmx:managed-attribute
     */
    public Long getMaxMemory()
    {
@@ -321,8 +289,6 @@
    /**
     * Returns <tt>Runtime.getRuntime().availableProcessors()</tt> on 
     * JDK 1.4 vms or -1 on previous versions.
-    * 
-    * @jmx:managed-attribute
     */
    public Integer getAvailableProcessors()
    {
@@ -346,8 +312,6 @@
 
    /**
     * Returns InetAddress.getLocalHost().getHostName();
-    *
-    * @jmx:managed-attribute
     */
    public String getHostName()
    {
@@ -369,8 +333,6 @@
    
    /**
     * Returns InetAddress.getLocalHost().getHostAddress();
-    *
-    * @jmx:managed-attribute
     */
    public String getHostAddress()
    {
@@ -393,8 +355,6 @@
    /**
     * Return a listing of the thread pools on jdk5+.
     * 
-    * @jmx:managed-operation
-    * 
     * @param fancy produce a text-based graph when true
     */
    public String listMemoryPools(boolean fancy)
@@ -474,17 +434,11 @@
       }
    }
    
-   /**
-    * @jmx:managed-operation
-    */
    public Integer getActiveThreadCount()
    {
       return new Integer(getRootThreadGroup().activeCount());
    }
 
-   /**
-    * @jmx:managed-operation
-    */
    public Integer getActiveThreadGroupCount()
    {
       return new Integer(getRootThreadGroup().activeGroupCount());
@@ -492,8 +446,6 @@
    
    /**
     * Return a listing of the active threads and thread groups.
-    *
-    * @jmx:managed-operation
     */
    public String listThreadDump()
    {
@@ -517,8 +469,6 @@
    
    /**
     * Return a listing of the active threads and thread groups.
-    *
-    * @jmx:managed-operation
     */
    public String listThreadCpuUtilization()
    {
@@ -555,14 +505,14 @@
     * 
     * @return an ordered 
     */
-   private Set getThreadCpuUtilization()
+   private Set<ThreadCPU> getThreadCpuUtilization()
    {
       if (threadMXBean == null)
          return null;
       
       try
       {
-         TreeSet result = new TreeSet();
+         TreeSet<ThreadCPU> result = new TreeSet<ThreadCPU>();
          long[] threads = (long[]) getAllThreadIds.invoke(threadMXBean, NO_PARAMS);
          for (int i = 0; i < threads.length; ++i)
          {
@@ -705,8 +655,6 @@
    
    /**
     * Display the java.lang.Package info for the pkgName
-    *
-    * @jmx:managed-operation
     */
    public String displayPackageInfo(String pkgName)
    {

Modified: trunk/system/src/main/org/jboss/system/server/ServerInfoMBean.java
===================================================================
--- trunk/system/src/main/org/jboss/system/server/ServerInfoMBean.java	2007-06-28 17:24:15 UTC (rev 63729)
+++ trunk/system/src/main/org/jboss/system/server/ServerInfoMBean.java	2007-06-28 17:24:29 UTC (rev 63730)
@@ -21,8 +21,6 @@
  */
 package org.jboss.system.server;
 
-import javax.management.ObjectName;
-
 /**
  * ServerInfo MBean interface.
  * 
@@ -49,18 +47,18 @@
    Integer getActiveThreadCount();
    Integer getActiveThreadGroupCount();
    
-   /** Returns <tt>Runtime.getRuntime().maxMemory()<tt> on JDK 1.4 vms or -1 on previous versions. */
+   /** @return <tt>Runtime.getRuntime().maxMemory()<tt> on JDK 1.4 vms or -1 on previous versions. */
    Long getMaxMemory();   
    Long getTotalMemory();
    Long getFreeMemory();
 
-   /** Returns <tt>Runtime.getRuntime().availableProcessors()</tt> on JDK 1.4 vms or -1 on previous versions. */
+   /** @return <tt>Runtime.getRuntime().availableProcessors()</tt> on JDK 1.4 vms or -1 on previous versions. */
    Integer getAvailableProcessors();
 
-   /** Returns InetAddress.getLocalHost().getHostName(); */
+   /** @return InetAddress.getLocalHost().getHostName(); */
    String getHostName();
 
-   /** Returns InetAddress.getLocalHost().getHostAddress(); */
+   /** @return InetAddress.getLocalHost().getHostAddress(); */
    String getHostAddress();
 
    // Operations ----------------------------------------------------
@@ -68,22 +66,27 @@
    /**
     * Return a listing of the thread pools on jdk5+.
     * @param fancy produce a text-based graph when true
+    * @return the memory pools
     */
    String listMemoryPools(boolean fancy);
 
    /**
     * Return a listing of the active threads and thread groups,
     * and a full stack trace for every thread, on jdk5+.
+    * @return the thread dump
     */
    String listThreadDump();
 
    /**
     * Return a sort list of thread cpu utilization.
+    * @return the cpu utilization
     */
    String listThreadCpuUtilization();
 
    /**
     * Display the java.lang.Package info for the pkgName
+    * @param pkgName the package name
+    * @return the package info
     */
    String displayPackageInfo(String pkgName);
 

Modified: trunk/system/src/main/org/jboss/system/server/ServerLoader.java
===================================================================
--- trunk/system/src/main/org/jboss/system/server/ServerLoader.java	2007-06-28 17:24:15 UTC (rev 63729)
+++ trunk/system/src/main/org/jboss/system/server/ServerLoader.java	2007-06-28 17:24:29 UTC (rev 63730)
@@ -94,10 +94,18 @@
       "jboss-vfs.jar",
       "jboss-container.jar",
       "jboss-dependency.jar",
-      "jboss-microcontainer.jar",
+      "jboss-kernel.jar",
       "jboss-managed.jar",
       "jboss-metatype.jar",
-      "jboss-deployers.jar",
+      "jboss-deployers-client.jar",
+      "jboss-deployers-client-spi.jar",
+      "jboss-deployers-core.jar",
+      "jboss-deployers-core-spi.jar",
+      "jboss-deployers-impl.jar",
+      "jboss-deployers-spi.jar",
+      "jboss-deployers-structure-spi.jar",
+      "jboss-deployers-vfs.jar",
+      "jboss-deployers-vfs-spi.jar",
       // Core server bootstrap
       "jboss-system.jar",
       // JMX related dependencies
@@ -241,6 +249,10 @@
 
    /**
     * Get a URL from configuration or system properties.
+    * 
+    * @param name the system property
+    * @return the url
+    * @throws MalformedURLException for a bad url
     */
    protected URL getURL(final String name) throws MalformedURLException
    {
@@ -256,6 +268,8 @@
    /**
     * Returns an array of URLs which will be used to load the
     * core system and construct a new Server object instance.
+    * @return the urls
+    * @throws MalformedURLException for a bad url
     */
    protected URL[] getBootClasspath() throws MalformedURLException
    {
@@ -292,6 +306,7 @@
     * @parent    The parent of any class loader created during boot.
     * @return    An uninitialized (and unstarted) Server instance.
     *
+    * @param parent the parent classloader
     * @throws Exception   Failed to load or create Server instance.
     */
    public Server load(final ClassLoader parent) throws Exception
@@ -323,7 +338,9 @@
     * Construct a new instance of Server, loading all required classes from
     * the given ClassLoader.
     * @param typename - the fqcn of the Server implementation
-    * @param loader - the ClassLoader to load typename with 
+    * @param loader - the ClassLoader to load typename with
+    * @return the server
+    * @throws Exception for any error 
     */
    protected Server createServer(final String typename, final ClassLoader loader)
       throws Exception

Modified: trunk/system/src/main/org/jboss/system/server/profile/basic/ProfileImpl.java
===================================================================
--- trunk/system/src/main/org/jboss/system/server/profile/basic/ProfileImpl.java	2007-06-28 17:24:15 UTC (rev 63729)
+++ trunk/system/src/main/org/jboss/system/server/profile/basic/ProfileImpl.java	2007-06-28 17:24:29 UTC (rev 63730)
@@ -32,13 +32,14 @@
 import java.util.Map;
 import java.util.Set;
 
-import org.jboss.deployers.plugins.structure.AbstractDeploymentContext;
-import org.jboss.deployers.spi.structure.DeploymentContext;
+import org.jboss.deployers.vfs.spi.client.VFSDeployment;
+import org.jboss.deployers.vfs.spi.client.VFSDeploymentFactory;
 import org.jboss.profileservice.spi.ModificationInfo;
 import org.jboss.profileservice.spi.NoSuchDeploymentException;
 import org.jboss.profileservice.spi.Profile;
 import org.jboss.profileservice.spi.ProfileKey;
 import org.jboss.profileservice.spi.ModificationInfo.ModifyStatus;
+import org.jboss.system.server.profileservice.VFSScanner;
 import org.jboss.util.JBossObject;
 import org.jboss.virtual.VFS;
 import org.jboss.virtual.VirtualFile;
@@ -53,15 +54,17 @@
  * @author adrian at jboss.org
  * @version $Revision$
  */
-public class ProfileImpl extends JBossObject
-   implements Profile
+public class ProfileImpl extends JBossObject implements Profile
 {
+   /** The deployment factory */
+   private VFSDeploymentFactory deploymentFactory = VFSDeploymentFactory.getInstance();
+   
    private ProfileKey key;
    /** The directory containing the profiles */
    private File profileRoot;
-   private LinkedHashMap<String,DeploymentContext> bootstraps = new LinkedHashMap<String,DeploymentContext>();
-   private LinkedHashMap<String,DeploymentContext> applications = new LinkedHashMap<String,DeploymentContext>();
-   private LinkedHashMap<String,DeploymentContext> deployers = new LinkedHashMap<String,DeploymentContext>();
+   private LinkedHashMap<String, VFSDeployment> bootstraps = new LinkedHashMap<String, VFSDeployment>();
+   private LinkedHashMap<String, VFSDeployment> applications = new LinkedHashMap<String, VFSDeployment>();
+   private LinkedHashMap<String, VFSDeployment> deployers = new LinkedHashMap<String, VFSDeployment>();
    /** Is hot deployment checking enabled */
    private volatile boolean hotdeployEnabled;
 
@@ -119,7 +122,7 @@
       return root;
    }
 
-   public void addDeployment(DeploymentContext d, DeploymentPhase phase)
+   public void addDeployment(VFSDeployment d, DeploymentPhase phase)
       throws Exception
    {
       switch( phase )
@@ -135,7 +138,7 @@
             break;
       }      
    }
-   public void updateDeployment(DeploymentContext d, DeploymentPhase phase)
+   public void updateDeployment(VFSDeployment d, DeploymentPhase phase)
       throws Exception
    {
    
@@ -148,34 +151,34 @@
     * @param    phase   optionally a deployment phase, if null search all
     * @return   the deployment or null if not found
     */
-   private DeploymentContext findDeployment(String name, DeploymentPhase phase)
+   private VFSDeployment findDeployment(String name, DeploymentPhase phase)
    {
-      DeploymentContext ctx = null;
+      VFSDeployment d = null;
       if( phase == null )
       {
          // Try all phases
-         ctx = this.getBootstrap(name);
-         if( ctx == null )
-            ctx = this.getDeployer(name);
-         if( ctx == null )
-            ctx = this.getApplication(name);
+         d = this.getBootstrap(name);
+         if( d == null )
+            d = this.getDeployer(name);
+         if( d == null )
+            d = this.getApplication(name);
       }
       else
       {
          switch( phase )
          {
             case BOOTSTRAP:
-               ctx = this.getBootstrap(name);
+               d = this.getBootstrap(name);
                break;
             case DEPLOYER:
-               ctx = this.getDeployer(name);
+               d = this.getDeployer(name);
                break;
             case APPLICATION:
-               ctx = this.getApplication(name);
+               d = this.getApplication(name);
                break;
          }
       }
-      return ctx;
+      return d;
    }
    
    /**
@@ -186,14 +189,14 @@
     * @return   the deployment or NoSuchDeploymentException
     * @throws   NoSuchDeploymentException   if the deployment can't be found
     */
-   public DeploymentContext getDeployment(String name, DeploymentPhase phase)
+   public VFSDeployment getDeployment(String name, DeploymentPhase phase)
       throws NoSuchDeploymentException
    {
-      DeploymentContext ctx = findDeployment(name, phase);
+      VFSDeployment d = findDeployment(name, phase);
       // Make sure we don't return null
-      if( ctx == null )
+      if( d == null )
          throw new NoSuchDeploymentException("name="+name+", phase="+phase);
-      return ctx;
+      return d;
    }
 
    /**
@@ -228,28 +231,31 @@
 
    public Set<String> getDeploymentNamesForType(String type)
    {
+      throw new UnsupportedOperationException("getDeploymentNamesForType");
+      /** TODO Deployment.getTypes()
       HashSet<String> names = new HashSet<String>();
-      for(DeploymentContext ctx : bootstraps.values())
+      for(VFSDeployment d : bootstraps.values())
       {
-         if( ctx.getTypes().contains(type) )
-            names.add(ctx.getName());
+         if( d.getTypes().contains(type) )
+            names.add(d.getName());
       }
-      for(DeploymentContext ctx : deployers.values())
+      for(VFSDeployment d : deployers.values())
       {
-         if( ctx.getTypes().contains(type) )
-            names.add(ctx.getName());
+         if( d.getTypes().contains(type) )
+            names.add(d.getName());
       }
-      for(DeploymentContext ctx : applications.values())
+      for(VFSDeployment d : applications.values())
       {
-         if( ctx.getTypes().contains(type) )
-            names.add(ctx.getName());
+         if( d.getTypes().contains(type) )
+            names.add(d.getName());
       }
       return names;
+      */
    }
 
-   public Collection<DeploymentContext> getDeployments()
+   public Collection<VFSDeployment> getDeployments()
    {
-      HashSet<DeploymentContext> deployments = new HashSet<DeploymentContext>();
+      HashSet<VFSDeployment> deployments = new HashSet<VFSDeployment>();
       deployments.addAll(this.bootstraps.values());
       deployments.addAll(this.deployers.values());
       deployments.addAll(this.applications.values());
@@ -270,18 +276,18 @@
          return Collections.emptyList();
 
       ArrayList<ModificationInfo> modified = new ArrayList<ModificationInfo>();
-      Collection<DeploymentContext> apps = applications.values();
+      Collection<VFSDeployment> apps = applications.values();
       boolean trace = log.isTraceEnabled();
       if( trace )
          log.trace("Checking applications for modifications");
       VirtualFile applicationDir = null;
       if( apps != null )
       {
-         Iterator<DeploymentContext> iter = apps.iterator();
+         Iterator<VFSDeployment> iter = apps.iterator();
          while( iter.hasNext() )
          {
-            DeploymentContext ctx = iter.next();
-            VirtualFile root = ctx.getRoot();
+            VFSDeployment d = iter.next();
+            VirtualFile root = d.getRoot();
             // Save the containing parent dir to scan for new deployments
             VirtualFile parent = root.getParent();
             if( applicationDir == null || parent.getPathName().compareTo(applicationDir.getPathName()) < 0 )
@@ -291,7 +297,7 @@
             // Check for removal
             if( root.exists() == false )
             {
-               ModificationInfo info = new ModificationInfo(ctx, rootLastModified, ModifyStatus.REMOVED);
+               ModificationInfo info = new ModificationInfo(d, rootLastModified, ModifyStatus.REMOVED);
                modified.add(info);
                iter.remove();
                if( trace )
@@ -303,8 +309,8 @@
                if( trace )
                   log.trace(name+" was modified: "+rootLastModified);
                // Need to create a duplicate ctx
-               DeploymentContext ctx2 = new AbstractDeploymentContext(root);               
-               ModificationInfo info = new ModificationInfo(ctx2, rootLastModified, ModifyStatus.MODIFIED);
+               VFSDeployment deployment2 = deploymentFactory.createVFSDeployment(root);
+               ModificationInfo info = new ModificationInfo(deployment2, rootLastModified, ModifyStatus.MODIFIED);
                modified.add(info);
             }
             // TODO: this could check metadata files modifications as well
@@ -318,10 +324,10 @@
          addDeployments(added, applicationDir);
          for(VirtualFile vf : added)
          {
-            DeploymentContext ctx = new AbstractDeploymentContext(vf);
-            ModificationInfo info = new ModificationInfo(ctx, vf.getLastModified(), ModifyStatus.ADDED);
+            VFSDeployment d = deploymentFactory.createVFSDeployment(vf);
+            ModificationInfo info = new ModificationInfo(d, vf.getLastModified(), ModifyStatus.ADDED);
             modified.add(info);
-            applications.put(ctx.getName(), ctx);
+            applications.put(d.getName(), d);
          }
       }
       return modified;
@@ -335,41 +341,41 @@
       this.hotdeployEnabled = flag;
    }
 
-   public Collection<DeploymentContext> getDeployments(DeploymentPhase phase)
+   public Collection<VFSDeployment> getDeployments(DeploymentPhase phase)
    {
-      Collection<DeploymentContext> ctxs = null;
+      Collection<VFSDeployment> deployments = null;
       switch( phase )
       {
          case BOOTSTRAP:
-            ctxs = this.getBootstraps();
+            deployments = this.getBootstraps();
             break;
          case DEPLOYER:
-            ctxs = this.getDeployers();
+            deployments = this.getDeployers();
             break;
          case APPLICATION:
-            ctxs = this.getApplications();
+            deployments = this.getApplications();
             break;
       }
-      return ctxs;
+      return deployments;
    }
 
-   public DeploymentContext removeDeployment(String name, DeploymentPhase phase)
+   public VFSDeployment removeDeployment(String name, DeploymentPhase phase)
       throws Exception
    {
-      DeploymentContext ctx = null;
+      VFSDeployment d = null;
       switch( phase )
       {
          case BOOTSTRAP:
-            ctx = this.removeBootstrap(name);
+            d = this.removeBootstrap(name);
             break;
          case DEPLOYER:
-            ctx = this.removeDeployer(name);
+            d = this.removeDeployer(name);
             break;
          case APPLICATION:
-            ctx = this.removeApplication(name);
+            d = this.removeApplication(name);
             break;
       }
-      return ctx;
+      return d;
    }
 
    public Map<String, Object> getConfig()
@@ -378,65 +384,65 @@
       return null;
    }
 
-   protected void addBootstrap(DeploymentContext d)
+   protected void addBootstrap(VFSDeployment d)
    {
       bootstraps.put(d.getName(), d);
    }
 
-   protected DeploymentContext removeBootstrap(String name)
+   protected VFSDeployment removeBootstrap(String name)
    {
       return bootstraps.remove(name);
    }
 
-   protected DeploymentContext getBootstrap(String name)
+   protected VFSDeployment getBootstrap(String name)
    {
-      DeploymentContext deployment = bootstraps.get(name);
+      VFSDeployment deployment = bootstraps.get(name);
       return deployment;
    }
 
-   protected Collection<DeploymentContext> getBootstraps()
+   protected Collection<VFSDeployment> getBootstraps()
    {
       return Collections.unmodifiableCollection(bootstraps.values());
    }
 
-   protected void addDeployer(DeploymentContext d)
+   protected void addDeployer(VFSDeployment d)
    {
       deployers.put(d.getName(), d);
    }
 
-   protected DeploymentContext removeDeployer(String name)
+   protected VFSDeployment removeDeployer(String name)
    {
       return deployers.remove(name);
    }
 
-   protected DeploymentContext getDeployer(String name)
+   protected VFSDeployment getDeployer(String name)
    {
-      DeploymentContext deployment = deployers.get(name);
+      VFSDeployment deployment = deployers.get(name);
       return deployment;
    }
 
-   protected Collection<DeploymentContext> getDeployers()
+   protected Collection<VFSDeployment> getDeployers()
    {
       return Collections.unmodifiableCollection(deployers.values());
    }
 
-   protected void addApplication(DeploymentContext d)
+   protected void addApplication(VFSDeployment d)
    {
       applications.put(d.getName(), d);
    }
 
-   protected DeploymentContext removeApplication(String name)
+   protected VFSDeployment removeApplication(String name)
    {
       return applications.remove(name);
    }
 
-   protected DeploymentContext getApplication(String name)
+   protected VFSDeployment getApplication(String name)
    {
-      DeploymentContext deployment = applications.get(name);
+      VFSDeployment deployment = applications.get(name);
       return deployment;
    }
 
-   protected Collection<DeploymentContext> getApplications()
+   protected Collection<VFSDeployment> getApplications()
    {
       return Collections.unmodifiableCollection(applications.values());
    }

Modified: trunk/system/src/main/org/jboss/system/server/profile/repository/ProfileImpl.java
===================================================================
--- trunk/system/src/main/org/jboss/system/server/profile/repository/ProfileImpl.java	2007-06-28 17:24:15 UTC (rev 63729)
+++ trunk/system/src/main/org/jboss/system/server/profile/repository/ProfileImpl.java	2007-06-28 17:24:29 UTC (rev 63730)
@@ -27,13 +27,12 @@
 import java.util.Map;
 import java.util.Set;
 
-import org.jboss.deployers.spi.structure.DeploymentContext;
+import org.jboss.deployers.vfs.spi.client.VFSDeployment;
 import org.jboss.profileservice.spi.DeploymentRepository;
 import org.jboss.profileservice.spi.ModificationInfo;
 import org.jboss.profileservice.spi.NoSuchDeploymentException;
 import org.jboss.profileservice.spi.Profile;
 import org.jboss.profileservice.spi.ProfileKey;
-import org.jboss.profileservice.spi.Profile.DeploymentPhase;
 import org.jboss.util.JBossObject;
 import org.jboss.virtual.VFS;
 import org.jboss.virtual.VirtualFile;
@@ -57,8 +56,8 @@
 
    /**
     * 
-    * @param repository
-    * @param name
+    * @param repository the repository
+    * @param key the key
     */
    public ProfileImpl(DeploymentRepository repository, ProfileKey key)
    {
@@ -107,12 +106,12 @@
       return root;
    }
 
-   public Collection<DeploymentContext> getDeployments(DeploymentPhase phase)
+   public Collection<VFSDeployment> getDeployments(DeploymentPhase phase)
       throws Exception
    {
       return repository.getDeployments(phase);
    }
-   public Collection<DeploymentContext> getDeployments()
+   public Collection<VFSDeployment> getDeployments()
       throws Exception
    {
       return repository.getDeployments();
@@ -137,25 +136,23 @@
       this.hotdeployEnabled = flag;
    }
 
-   public void addDeployment(DeploymentContext d, DeploymentPhase phase)
+   public void addDeployment(VFSDeployment d, DeploymentPhase phase)
        throws Exception
    {
-      String name = d.getRelativePath();
-      if( name.length() == 0 )
-         name = d.getSimpleName();
+      String name = d.getSimpleName();
       repository.addDeployment(name, d, phase);
    }
-   public void updateDeployment(DeploymentContext d, DeploymentPhase phase)
+   public void updateDeployment(VFSDeployment d, DeploymentPhase phase)
        throws Exception
    {
-      repository.updateDeployment(d.getRelativePath(), d, phase);
+      repository.updateDeployment(d.getSimpleName(), d, phase);
    }
-   public DeploymentContext getDeployment(String name, DeploymentPhase phase)
+   public VFSDeployment getDeployment(String name, DeploymentPhase phase)
        throws Exception, NoSuchDeploymentException
    {
       return repository.getDeployment(name, phase);
    }
-   public DeploymentContext removeDeployment(String name, DeploymentPhase phase)
+   public VFSDeployment removeDeployment(String name, DeploymentPhase phase)
       throws Exception
    {
       return repository.removeDeployment(name, phase);

Modified: trunk/system/src/main/org/jboss/system/server/profileservice/ProfileServiceBootstrap.java
===================================================================
--- trunk/system/src/main/org/jboss/system/server/profileservice/ProfileServiceBootstrap.java	2007-06-28 17:24:15 UTC (rev 63729)
+++ trunk/system/src/main/org/jboss/system/server/profileservice/ProfileServiceBootstrap.java	2007-06-28 17:24:29 UTC (rev 63730)
@@ -27,12 +27,11 @@
 
 import org.jboss.beans.metadata.plugins.AbstractBeanMetaData;
 import org.jboss.dependency.spi.ControllerContext;
-import org.jboss.deployers.spi.DeploymentException;
-import org.jboss.deployers.spi.IncompleteDeploymentException;
-import org.jboss.deployers.spi.IncompleteDeployments;
-import org.jboss.deployers.spi.IncompleteDeploymentsBuilder;
-import org.jboss.deployers.spi.deployment.MainDeployer;
-import org.jboss.deployers.spi.structure.DeploymentContext;
+import org.jboss.deployers.client.spi.IncompleteDeploymentException;
+import org.jboss.deployers.client.spi.main.MainDeployer;
+import org.jboss.deployers.plugins.main.MainDeployerImpl;
+import org.jboss.deployers.structure.spi.DeploymentContext;
+import org.jboss.deployers.vfs.spi.client.VFSDeployment;
 import org.jboss.kernel.Kernel;
 import org.jboss.kernel.plugins.bootstrap.basic.BasicBootstrap;
 import org.jboss.kernel.plugins.deployment.xml.BasicXMLDeployer;
@@ -49,6 +48,7 @@
  * loads additional deployments using the ProfileService.
  * 
  * @author Scott.Stark at jboss.org
+ * @author adrian at jboss.org
  * @version $Revision$
  */
 public class ProfileServiceBootstrap extends BasicBootstrap
@@ -232,15 +232,15 @@
          controller.install(metaData, server);
       }
 
-      // Validate that everything is ok
-      checkIncomplete();
-
       // Get the beans TODO injection!
       profileService = getBean(controller, "ProfileService", ProfileService.class);
       log.debug("Using ProfileService: " + profileService);
       mainDeployer = getBean(controller, "MainDeployer", MainDeployer.class);
       log.debug("Using MainDeployer: " + mainDeployer);
 
+      // Validate that everything is ok
+      mainDeployer.checkComplete();
+
       // Load the profile beans
       try
       {
@@ -336,56 +336,52 @@
       Profile profile = ps.getProfile(key);
 
       // HACK
-      DeploymentContext first = null;
+      VFSDeployment first = null;
       
       // Deploy the bootstrap
-      Collection<DeploymentContext> boostraps = profile.getDeployments(DeploymentPhase.BOOTSTRAP);
-      for (DeploymentContext d : boostraps)
+      Collection<VFSDeployment> boostraps = profile.getDeployments(DeploymentPhase.BOOTSTRAP);
+      for (VFSDeployment d : boostraps)
       {
-         deployer.addDeploymentContext(d);
+         deployer.addDeployment(d);
          if (first == null)
             first = d;
       }
       deployer.process();
-      checkIncomplete();
+      deployer.checkComplete();
 
       Thread thread = Thread.currentThread();
       ClassLoader old = thread.getContextClassLoader();
-      ClassLoader cl = first != null ? first.getClassLoader() : null;
+      // FIXME remove this hack
+      MainDeployerImpl hack = (MainDeployerImpl) deployer;
+      ClassLoader cl = null;
+      if (first != null)
+      {
+         DeploymentContext ctx = hack.getDeploymentContext(first.getName());
+         if (ctx != null)
+            cl = ctx.getClassLoader();
+      }
       if (cl != null)
          thread.setContextClassLoader(cl);
       try
       {
          
          // Deploy the profile deployers
-         Collection<DeploymentContext> profileDeployers = profile.getDeployments(DeploymentPhase.DEPLOYER);
-         for (DeploymentContext d : profileDeployers)
-            deployer.addDeploymentContext(d);
+         Collection<VFSDeployment> profileDeployers = profile.getDeployments(DeploymentPhase.DEPLOYER);
+         for (VFSDeployment d : profileDeployers)
+            deployer.addDeployment(d);
          deployer.process();
-         checkIncomplete();
+         deployer.checkComplete();
 
          // Deploy the profile applications
-         Collection<DeploymentContext> profileDeployments = profile.getDeployments(DeploymentPhase.APPLICATION);
-         for (DeploymentContext d : profileDeployments)
-            deployer.addDeploymentContext(d);
+         Collection<VFSDeployment> profileDeployments = profile.getDeployments(DeploymentPhase.APPLICATION);
+         for (VFSDeployment d : profileDeployments)
+            deployer.addDeployment(d);
          deployer.process();
-         checkIncomplete();
+         deployer.checkComplete();
       }
       finally
       {
          thread.setContextClassLoader(old);
       }
    }
-   
-   /**
-    * Check whether we are incomplete
-    * 
-    * @throws DeploymentException the deployment exception
-    */
-   protected void checkIncomplete() throws DeploymentException
-   {
-      IncompleteDeployments incomplete = IncompleteDeploymentsBuilder.build(mainDeployer, controller);
-      if (incomplete.isIncomplete())
-         throw new IncompleteDeploymentException(incomplete);
-   }
 }

Modified: trunk/system/src/main/org/jboss/system/server/profileservice/ServerImpl.java
===================================================================
--- trunk/system/src/main/org/jboss/system/server/profileservice/ServerImpl.java	2007-06-28 17:24:15 UTC (rev 63729)
+++ trunk/system/src/main/org/jboss/system/server/profileservice/ServerImpl.java	2007-06-28 17:24:29 UTC (rev 63730)
@@ -34,15 +34,15 @@
 import javax.management.NotificationEmitter;
 
 import org.jboss.Version;
-import org.jboss.deployers.spi.deployment.MainDeployer;
+import org.jboss.deployers.client.spi.main.MainDeployer;
 import org.jboss.kernel.Kernel;
 import org.jboss.kernel.plugins.deployment.BasicKernelDeployer;
 import org.jboss.kernel.spi.event.KernelEvent;
 import org.jboss.logging.Logger;
 import org.jboss.net.protocol.URLStreamHandlerFactory;
+import org.jboss.system.server.BaseServerConfig;
 import org.jboss.system.server.Server;
 import org.jboss.system.server.ServerConfig;
-import org.jboss.system.server.BaseServerConfig;
 import org.jboss.util.StopWatch;
 
 

Modified: trunk/system/src/main/org/jboss/system/server/profileservice/VFSBootstrapScannerImpl.java
===================================================================
--- trunk/system/src/main/org/jboss/system/server/profileservice/VFSBootstrapScannerImpl.java	2007-06-28 17:24:15 UTC (rev 63729)
+++ trunk/system/src/main/org/jboss/system/server/profileservice/VFSBootstrapScannerImpl.java	2007-06-28 17:24:29 UTC (rev 63730)
@@ -21,8 +21,7 @@
  */
 package org.jboss.system.server.profileservice;
 
-import org.jboss.deployers.plugins.structure.AbstractDeploymentContext;
-import org.jboss.deployers.spi.structure.DeploymentContext;
+import org.jboss.deployers.vfs.spi.client.VFSDeployment;
 import org.jboss.profileservice.spi.Profile;
 import org.jboss.profileservice.spi.Profile.DeploymentPhase;
 import org.jboss.virtual.VirtualFile;
@@ -35,9 +34,9 @@
  */
 public class VFSBootstrapScannerImpl extends VFSScanner
 {
-   protected DeploymentContext add(Profile profile, VirtualFile file) throws Exception
+   protected VFSDeployment add(Profile profile, VirtualFile file) throws Exception
    {
-      DeploymentContext deployment = new AbstractDeploymentContext(file);
+      VFSDeployment deployment = createDeployment(file);;
       if( !profile.hasDeployment(deployment.getName(), DeploymentPhase.BOOTSTRAP) )
             profile.addDeployment(deployment, DeploymentPhase.BOOTSTRAP);
       return deployment;

Modified: trunk/system/src/main/org/jboss/system/server/profileservice/VFSDeployerScannerImpl.java
===================================================================
--- trunk/system/src/main/org/jboss/system/server/profileservice/VFSDeployerScannerImpl.java	2007-06-28 17:24:15 UTC (rev 63729)
+++ trunk/system/src/main/org/jboss/system/server/profileservice/VFSDeployerScannerImpl.java	2007-06-28 17:24:29 UTC (rev 63730)
@@ -21,8 +21,7 @@
  */
 package org.jboss.system.server.profileservice;
 
-import org.jboss.deployers.plugins.structure.AbstractDeploymentContext;
-import org.jboss.deployers.spi.structure.DeploymentContext;
+import org.jboss.deployers.vfs.spi.client.VFSDeployment;
 import org.jboss.profileservice.spi.Profile;
 import org.jboss.profileservice.spi.Profile.DeploymentPhase;
 import org.jboss.virtual.VirtualFile;
@@ -35,9 +34,9 @@
  */
 public class VFSDeployerScannerImpl extends VFSScanner
 {
-   protected DeploymentContext add(Profile profile, VirtualFile file) throws Exception
+   protected VFSDeployment add(Profile profile, VirtualFile file) throws Exception
    {
-      DeploymentContext deployment = new AbstractDeploymentContext(file);
+      VFSDeployment deployment = createDeployment(file);;
       if( !profile.hasDeployment(deployment.getName(), DeploymentPhase.DEPLOYER) )
          profile.addDeployment(deployment, DeploymentPhase.DEPLOYER);
       return deployment;

Modified: trunk/system/src/main/org/jboss/system/server/profileservice/VFSDeploymentScannerImpl.java
===================================================================
--- trunk/system/src/main/org/jboss/system/server/profileservice/VFSDeploymentScannerImpl.java	2007-06-28 17:24:15 UTC (rev 63729)
+++ trunk/system/src/main/org/jboss/system/server/profileservice/VFSDeploymentScannerImpl.java	2007-06-28 17:24:29 UTC (rev 63730)
@@ -21,8 +21,7 @@
  */
 package org.jboss.system.server.profileservice;
 
-import org.jboss.deployers.plugins.structure.AbstractDeploymentContext;
-import org.jboss.deployers.spi.structure.DeploymentContext;
+import org.jboss.deployers.vfs.spi.client.VFSDeployment;
 import org.jboss.profileservice.spi.Profile;
 import org.jboss.profileservice.spi.Profile.DeploymentPhase;
 import org.jboss.virtual.VirtualFile;
@@ -35,9 +34,9 @@
  */
 public class VFSDeploymentScannerImpl extends VFSScanner
 {
-   protected DeploymentContext add(Profile profile, VirtualFile file) throws Exception
+   protected VFSDeployment add(Profile profile, VirtualFile file) throws Exception
    {
-      DeploymentContext deployment = new AbstractDeploymentContext(file);
+      VFSDeployment deployment = createDeployment(file);
       if( !profile.hasDeployment(deployment.getName(), DeploymentPhase.APPLICATION) )
          profile.addDeployment(deployment, DeploymentPhase.APPLICATION);
       return deployment;

Modified: trunk/system/src/main/org/jboss/system/server/profileservice/VFSScanner.java
===================================================================
--- trunk/system/src/main/org/jboss/system/server/profileservice/VFSScanner.java	2007-06-28 17:24:15 UTC (rev 63729)
+++ trunk/system/src/main/org/jboss/system/server/profileservice/VFSScanner.java	2007-06-28 17:24:29 UTC (rev 63730)
@@ -33,7 +33,8 @@
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.CopyOnWriteArrayList;
 
-import org.jboss.deployers.spi.structure.DeploymentContext;
+import org.jboss.deployers.vfs.spi.client.VFSDeployment;
+import org.jboss.deployers.vfs.spi.client.VFSDeploymentFactory;
 import org.jboss.profileservice.spi.Profile;
 import org.jboss.profileservice.spi.ProfileKey;
 import org.jboss.profileservice.spi.ProfileService;
@@ -78,6 +79,9 @@
    /** A map of deployed virtual files to their names */
    private Map<VirtualFile, String> deployedSet = new ConcurrentHashMap<VirtualFile, String>();
 
+   /** The deployment factory */
+   private VFSDeploymentFactory deploymentFactory = VFSDeploymentFactory.getInstance();
+   
     /**
     * Get the profileKey.
     * 
@@ -215,6 +219,7 @@
     * @throws IllegalAccessException when the class's default constructor is not public
     * @throws InstantiationException when there is an error constructing the class
     */
+   @SuppressWarnings("unchecked")
    public void setFilter(String classname)
       throws ClassNotFoundException, IllegalAccessException, InstantiationException
    {
@@ -499,7 +504,7 @@
          log.trace("Deploying: " + component);
       }
 
-      DeploymentContext deployment = null;
+      VFSDeployment deployment = null;
       try
       {
          Profile profile = profileService.getProfile(profileKey);
@@ -547,16 +552,30 @@
     * @return the deployment context or null if not added, e.g. it already exists
     * @throws Exception for any error
     */
-   protected abstract DeploymentContext add(Profile profile, VirtualFile file) throws Exception;
+   protected abstract VFSDeployment add(Profile profile, VirtualFile file) throws Exception;
    
    /**
     * Remove the component
     * 
     * @param profile the profile
     * @param name the name
+    * @throws Exception for any error
     */
    protected abstract void remove(Profile profile, String name) throws Exception;
    
+   /**
+    * Create a deployment
+    * 
+    * @param file the root file
+    * @return the deployment
+    */
+   protected VFSDeployment createDeployment(VirtualFile file)
+   {
+      if (file == null)
+         throw new IllegalArgumentException("Null file");
+      return deploymentFactory.createVFSDeployment(file);
+   }
+   
    private VirtualFile getVFforURI(URI uri)
       throws IOException
    {

Modified: trunk/system/src/main/org/jboss/system/server/profileservice/hotdeploy/HDScanner.java
===================================================================
--- trunk/system/src/main/org/jboss/system/server/profileservice/hotdeploy/HDScanner.java	2007-06-28 17:24:15 UTC (rev 63729)
+++ trunk/system/src/main/org/jboss/system/server/profileservice/hotdeploy/HDScanner.java	2007-06-28 17:24:29 UTC (rev 63730)
@@ -22,26 +22,20 @@
 package org.jboss.system.server.profileservice.hotdeploy;
 
 import java.util.Collection;
-import java.util.Iterator;
 import java.util.concurrent.Executors;
 import java.util.concurrent.ScheduledExecutorService;
 import java.util.concurrent.ScheduledFuture;
 import java.util.concurrent.ThreadFactory;
 import java.util.concurrent.TimeUnit;
 
-import org.jboss.deployers.spi.DeploymentException;
-import org.jboss.deployers.spi.IncompleteDeploymentException;
-import org.jboss.deployers.spi.IncompleteDeployments;
-import org.jboss.deployers.spi.IncompleteDeploymentsBuilder;
-import org.jboss.deployers.spi.deployment.MainDeployer;
-import org.jboss.deployers.spi.structure.DeploymentContext;
+import org.jboss.deployers.client.spi.main.MainDeployer;
+import org.jboss.deployers.vfs.spi.client.VFSDeployment;
 import org.jboss.kernel.Kernel;
 import org.jboss.kernel.spi.dependency.KernelController;
 import org.jboss.logging.Logger;
 import org.jboss.profileservice.spi.ModificationInfo;
 import org.jboss.profileservice.spi.Profile;
 import org.jboss.profileservice.spi.ProfileService;
-import org.jboss.profileservice.spi.Profile.DeploymentPhase;
 
 
 /**
@@ -55,6 +49,7 @@
  * 
  * @author <a href="mailto:dimitris at jboss.org">Dimitris Andreadis</a>
  * @author Scott.Stark at jboss.org
+ * @author adrian at jboss.org
  * @version $Revision$
  */
 public class HDScanner
@@ -167,7 +162,10 @@
       this.scanPeriod = period;
    }
 
-   /** Are deployment scans enabled.
+   /** 
+    * Are deployment scans enabled.
+    * 
+    * @return whether scan is enabled
     */
    public boolean isScanEnabled()
    {
@@ -273,17 +271,17 @@
       Collection<ModificationInfo> modified = activeProfile.getModifiedDeployments();
       for(ModificationInfo info : modified)
       {
-         DeploymentContext ctx = info.getCtx();
+         VFSDeployment ctx = info.getDeployment();
          switch( info.getStatus() )
          {
             case ADDED:
-               mainDeployer.addDeploymentContext(ctx);
+               mainDeployer.addDeployment(ctx);
                break;
             case MODIFIED:
-               mainDeployer.addDeploymentContext(ctx);
+               mainDeployer.addDeployment(ctx);
                break;
             case REMOVED:
-               mainDeployer.removeDeploymentContext(ctx.getName());
+               mainDeployer.removeDeployment(ctx.getName());
                break;
          }
       }
@@ -300,7 +298,7 @@
             {
                Thread.currentThread().setContextClassLoader(tcl);
                mainDeployer.process();
-               checkIncomplete();
+               mainDeployer.checkComplete();
             }
             finally
             {
@@ -330,22 +328,7 @@
    }
 
    // Private -------------------------------------------------------
-   /**
-    * Check whether we are incomplete
-    * TODO: this should be elsewhere 
-    * 
-    * @throws DeploymentException the deployment exception
-    */
-   protected void checkIncomplete() throws DeploymentException
-   {
-      if( controller == null )
-         return;
 
-      IncompleteDeployments incomplete = IncompleteDeploymentsBuilder.build(mainDeployer, controller);
-      if (incomplete.isIncomplete())
-         throw new IncompleteDeploymentException(incomplete);
-   }
-
    /**
     * Current workaround for JBAS-4206
     */
@@ -353,6 +336,7 @@
       throws Exception
    {
       ClassLoader tcl = null;
+      /** TODO What is this doing?
       Collection<DeploymentContext> ctxs = activeProfile.getDeployments(DeploymentPhase.BOOTSTRAP);
       Iterator<DeploymentContext> iter = ctxs.iterator();
       while( iter.hasNext() )
@@ -362,6 +346,7 @@
          if( tcl != null )
             break;
       }
+      */
       return tcl;
    }
 }

Modified: trunk/system/src/main/org/jboss/system/server/profileservice/repository/AbstractFileAttachmentsSerializer.java
===================================================================
--- trunk/system/src/main/org/jboss/system/server/profileservice/repository/AbstractFileAttachmentsSerializer.java	2007-06-28 17:24:15 UTC (rev 63729)
+++ trunk/system/src/main/org/jboss/system/server/profileservice/repository/AbstractFileAttachmentsSerializer.java	2007-06-28 17:24:29 UTC (rev 63730)
@@ -27,8 +27,7 @@
 import java.util.Map;
 import java.util.Map.Entry;
 
-import org.jboss.deployers.spi.deployer.DeploymentUnit;
-import org.jboss.deployers.spi.structure.DeploymentContext;
+import org.jboss.deployers.structure.spi.DeploymentUnit;
 import org.jboss.logging.Logger;
 import org.jboss.profileservice.aop.TrackingAdvice;
 import org.jboss.profileservice.spi.AttachmentsSerializer;
@@ -61,9 +60,7 @@
       if( attachmentsStoreDir == null )
          throw new IllegalStateException("attachmentsStoreDir has not been set");
 
-      String vfsPath = ctx.getRelativePath();
-      if( vfsPath.length() == 0 )
-         vfsPath = ctx.getSimpleName();
+      String vfsPath = ctx.getSimpleName();
       vfsPath += ".attachments";
       File deployerDir = new File(attachmentsStoreDir, deployerID);
       File attachmentsStore = new File(deployerDir, vfsPath);
@@ -81,7 +78,7 @@
       if( attachmentsStoreDir == null )
          throw new IllegalStateException("attachmentsStoreDir has not been set");
 
-      String vfsPath = ctx.getRelativePath();
+      String vfsPath = ctx.getSimpleName();
       if( vfsPath.length() == 0 )
          vfsPath = ctx.getSimpleName();
       vfsPath += ".attachments";

Modified: trunk/system/src/main/org/jboss/system/server/profileservice/repository/FileProfileRepository.java
===================================================================
--- trunk/system/src/main/org/jboss/system/server/profileservice/repository/FileProfileRepository.java	2007-06-28 17:24:15 UTC (rev 63729)
+++ trunk/system/src/main/org/jboss/system/server/profileservice/repository/FileProfileRepository.java	2007-06-28 17:24:29 UTC (rev 63730)
@@ -25,7 +25,7 @@
 import java.util.Collection;
 import java.util.HashSet;
 
-import org.jboss.deployers.spi.deployment.MainDeployer;
+import org.jboss.deployers.client.spi.main.MainDeployer;
 import org.jboss.profileservice.spi.DeploymentRepository;
 import org.jboss.profileservice.spi.DeploymentRepositoryFactory;
 import org.jboss.profileservice.spi.NoSuchProfileException;

Modified: trunk/system/src/main/org/jboss/system/server/profileservice/repository/JavaSerializationAttachmentsSerializer.java
===================================================================
--- trunk/system/src/main/org/jboss/system/server/profileservice/repository/JavaSerializationAttachmentsSerializer.java	2007-06-28 17:24:15 UTC (rev 63729)
+++ trunk/system/src/main/org/jboss/system/server/profileservice/repository/JavaSerializationAttachmentsSerializer.java	2007-06-28 17:24:29 UTC (rev 63730)
@@ -24,7 +24,6 @@
 import java.io.File;
 import java.io.FileInputStream;
 import java.io.FileOutputStream;
-import java.io.NotSerializableException;
 import java.io.ObjectInputStream;
 import java.io.ObjectOutputStream;
 import java.lang.reflect.Method;
@@ -45,6 +44,7 @@
 {
    private static final Logger log = Logger.getLogger(JavaSerializationAttachmentsSerializer.class);
 
+   @SuppressWarnings("unchecked")
    protected Map<String, Object> loadAttachments(File attachmentsStore, ClassLoader loader)
       throws Exception
    {
@@ -124,6 +124,7 @@
    that non-URLClassLoader class loaders, or class loaders that override
    getURLs to return null or empty, can provide the true classpath info.
    */
+   @SuppressWarnings("unchecked")
   private static URL[] getClassLoaderURLs(ClassLoader cl)
   {
      URL[] urls = {};

Modified: trunk/system/src/main/org/jboss/system/server/profileservice/repository/SerializableDeploymentRepository.java
===================================================================
--- trunk/system/src/main/org/jboss/system/server/profileservice/repository/SerializableDeploymentRepository.java	2007-06-28 17:24:15 UTC (rev 63729)
+++ trunk/system/src/main/org/jboss/system/server/profileservice/repository/SerializableDeploymentRepository.java	2007-06-28 17:24:29 UTC (rev 63730)
@@ -38,9 +38,9 @@
 import java.util.Set;
 import java.util.zip.ZipInputStream;
 
-import org.jboss.deployers.plugins.structure.AbstractDeploymentContext;
 import org.jboss.deployers.spi.attachments.Attachments;
-import org.jboss.deployers.spi.structure.DeploymentContext;
+import org.jboss.deployers.vfs.spi.client.VFSDeployment;
+import org.jboss.deployers.vfs.spi.client.VFSDeploymentFactory;
 import org.jboss.logging.Logger;
 import org.jboss.profileservice.spi.AttachmentsSerializer;
 import org.jboss.profileservice.spi.DeploymentRepository;
@@ -86,13 +86,13 @@
    private File adminEditsRoot;
    /** The profile key this repository is associated with */
    private ProfileKey key;
-   /** The bootstrap DeploymentContexts */
-   private LinkedHashMap<String,DeploymentContext> bootstrapCtxs = new LinkedHashMap<String,DeploymentContext>();
-   /** The deployer DeploymentContexts */
-   private LinkedHashMap<String,DeploymentContext> deployerCtxs = new LinkedHashMap<String,DeploymentContext>();
-   /** The application DeploymentContexts */
-   private LinkedHashMap<String,DeploymentContext> applicationCtxs = new LinkedHashMap<String,DeploymentContext>();
-   /** The {@link DeploymentContext#getTransientManagedObjects()} serializer */
+   /** The bootstrap VFSDeployments */
+   private LinkedHashMap<String,VFSDeployment> bootstrapCtxs = new LinkedHashMap<String,VFSDeployment>();
+   /** The deployer VFSDeployments */
+   private LinkedHashMap<String,VFSDeployment> deployerCtxs = new LinkedHashMap<String,VFSDeployment>();
+   /** The application VFSDeployments */
+   private LinkedHashMap<String,VFSDeployment> applicationCtxs = new LinkedHashMap<String,VFSDeployment>();
+   /** The {@link VFSDeployment#getTransientManagedObjects()} serializer */
    private AttachmentsSerializer serializer;
 
    public SerializableDeploymentRepository(File root, ProfileKey key)
@@ -176,30 +176,34 @@
 
    public Set<String> getDeploymentNamesForType(String type)
    {
+      throw new UnsupportedOperationException("getTypes");
+      
+      /** TODO getTypes()
       HashSet<String> names = new HashSet<String>();
-      for(DeploymentContext ctx : bootstrapCtxs.values())
+      for(VFSDeployment ctx : bootstrapCtxs.values())
       {
          if( ctx.getTypes().contains(type) )
             names.add(ctx.getName());
       }
-      for(DeploymentContext ctx : deployerCtxs.values())
+      for(VFSDeployment ctx : deployerCtxs.values())
       {
          if( ctx.getTypes().contains(type) )
             names.add(ctx.getName());
       }
-      for(DeploymentContext ctx : applicationCtxs.values())
+      for(VFSDeployment ctx : applicationCtxs.values())
       {
          if( ctx.getTypes().contains(type) )
             names.add(ctx.getName());
       }
       return names;
+      */
    }
 
    public void addDeploymentContent(String name, ZipInputStream contentIS, DeploymentPhase phase)
       throws IOException
    {
    }
-   public void addDeployment(String vfsPath, DeploymentContext d, DeploymentPhase phase)
+   public void addDeployment(String vfsPath, VFSDeployment d, DeploymentPhase phase)
       throws Exception
    {
       switch( phase )
@@ -216,14 +220,14 @@
       }
    }
 
-   public void updateDeployment(String vfsPath, DeploymentContext d, DeploymentPhase phase)
+   public void updateDeployment(String vfsPath, VFSDeployment d, DeploymentPhase phase)
       throws Exception
    {
    }
-   public DeploymentContext getDeployment(String name, DeploymentPhase phase)
+   public VFSDeployment getDeployment(String name, DeploymentPhase phase)
       throws Exception, NoSuchDeploymentException
    {
-      DeploymentContext ctx = null;
+      VFSDeployment ctx = null;
       if( phase == null )
       {
          // Try all phases
@@ -272,9 +276,9 @@
       return ctx;
    }
 
-   public Collection<DeploymentContext> getDeployments()
+   public Collection<VFSDeployment> getDeployments()
    {
-      HashSet<DeploymentContext> deployments = new HashSet<DeploymentContext>();
+      HashSet<VFSDeployment> deployments = new HashSet<VFSDeployment>();
       deployments.addAll(this.bootstrapCtxs.values());
       deployments.addAll(this.deployerCtxs.values());
       deployments.addAll(this.applicationCtxs.values());
@@ -288,16 +292,16 @@
       throws Exception
    {
       ArrayList<ModificationInfo> modified = new ArrayList<ModificationInfo>();
-      Collection<DeploymentContext> apps = getApplications();
+      Collection<VFSDeployment> apps = getApplications();
       boolean trace = log.isTraceEnabled();
       if( trace )
          log.trace("Checking applications for modifications");
       if( apps != null )
       {
-         Iterator<DeploymentContext> iter = apps.iterator();
+         Iterator<VFSDeployment> iter = apps.iterator();
          while( iter.hasNext() )
          {
-            DeploymentContext ctx = iter.next();
+            VFSDeployment ctx = iter.next();
             VirtualFile root = ctx.getRoot();
             Long rootLastModified = root.getLastModified();
             String name = root.getPathName();
@@ -316,7 +320,7 @@
                if( trace )
                   log.trace(name+" was modified: "+rootLastModified);
                // Need to create a duplicate ctx
-               DeploymentContext ctx2 = loadDeploymentData(root);               
+               VFSDeployment ctx2 = loadDeploymentData(root);               
                ModificationInfo info = new ModificationInfo(ctx2, rootLastModified, ModifyStatus.MODIFIED);
                modified.add(info);
             }
@@ -330,7 +334,7 @@
          {
             if( applicationCtxs.containsKey(vf.getPathName()) == false )
             {
-               DeploymentContext ctx = loadDeploymentData(vf);
+               VFSDeployment ctx = loadDeploymentData(vf);
                ModificationInfo info = new ModificationInfo(ctx, vf.getLastModified(), ModifyStatus.ADDED);
                modified.add(info);
                applicationCtxs.put(vf.getPathName(), ctx);
@@ -340,10 +344,10 @@
       return modified;
    }
 
-   public Collection<DeploymentContext> getDeployments(DeploymentPhase phase)
+   public Collection<VFSDeployment> getDeployments(DeploymentPhase phase)
       throws Exception
    {
-      Collection<DeploymentContext> ctxs = null;
+      Collection<VFSDeployment> ctxs = null;
       switch( phase )
       {
          case BOOTSTRAP:
@@ -359,10 +363,10 @@
       return ctxs;
    }
 
-   public DeploymentContext removeDeployment(String name, DeploymentPhase phase)
+   public VFSDeployment removeDeployment(String name, DeploymentPhase phase)
       throws Exception
    {
-      DeploymentContext ctx = null;
+      VFSDeployment ctx = null;
       switch( phase )
       {
          case BOOTSTRAP:
@@ -486,7 +490,7 @@
       Files.delete(profileRoot);
    }
 
-   protected void addBootstrap(String vfsPath, DeploymentContext ctx)
+   protected void addBootstrap(String vfsPath, VFSDeployment ctx)
       throws Exception
    {
       this.bootstrapCtxs.put(vfsPath, ctx);
@@ -505,31 +509,31 @@
       fos.close();
    }
 
-   protected void addDeployer(String vfsPath, DeploymentContext ctx)
+   protected void addDeployer(String vfsPath, VFSDeployment ctx)
       throws Exception
    {
       this.deployerCtxs.put(vfsPath, ctx);
    }
 
-   protected void addApplication(String vfsPath, DeploymentContext ctx)
+   protected void addApplication(String vfsPath, VFSDeployment ctx)
       throws Exception
    {
       this.applicationCtxs.put(vfsPath, ctx);
    }
 
-   protected DeploymentContext getBootstrap(String vfsPath)
+   protected VFSDeployment getBootstrap(String vfsPath)
       throws Exception
    {
-      DeploymentContext ctx = bootstrapCtxs.get(vfsPath);
+      VFSDeployment ctx = bootstrapCtxs.get(vfsPath);
       if( ctx == null )
          throw new NoSuchDeploymentException(vfsPath);
       return ctx;
    }
 
-   protected Collection<DeploymentContext> getBootstraps()
+   protected Collection<VFSDeployment> getBootstraps()
       throws Exception
    {
-      Collection<DeploymentContext> ctxs = bootstrapCtxs.values();
+      Collection<VFSDeployment> ctxs = bootstrapCtxs.values();
       return ctxs;
    }
 
@@ -546,53 +550,53 @@
       return applicationDir.toURI();
    }
 
-   protected DeploymentContext getDeployer(String vfsPath)
+   protected VFSDeployment getDeployer(String vfsPath)
       throws Exception
    {
-      DeploymentContext ctx = deployerCtxs.get(vfsPath);
+      VFSDeployment ctx = deployerCtxs.get(vfsPath);
       if( ctx == null )
          throw new NoSuchDeploymentException(vfsPath);
       return ctx;
    }
 
-   protected Collection<DeploymentContext> getDeployers()
+   protected Collection<VFSDeployment> getDeployers()
       throws Exception
    {
-      Collection<DeploymentContext> ctxs = deployerCtxs.values();
+      Collection<VFSDeployment> ctxs = deployerCtxs.values();
       return ctxs;
    }
 
-   protected DeploymentContext getApplication(String vfsPath)
+   protected VFSDeployment getApplication(String vfsPath)
       throws Exception
    {
-      DeploymentContext ctx = applicationCtxs.get(vfsPath);
+      VFSDeployment ctx = applicationCtxs.get(vfsPath);
       if( ctx == null )
          throw new NoSuchDeploymentException(vfsPath);
       return ctx;
    }
 
-   protected Collection<DeploymentContext> getApplications()
+   protected Collection<VFSDeployment> getApplications()
       throws Exception
    {
-      Collection<DeploymentContext> ctxs = applicationCtxs.values();
+      Collection<VFSDeployment> ctxs = applicationCtxs.values();
       return ctxs;
    }
 
-   protected DeploymentContext removeBootstrap(String vfsPath) throws IOException
+   protected VFSDeployment removeBootstrap(String vfsPath) throws IOException
    {
       File bootstrapFile = new File(bootstrapDir, vfsPath);
       if( bootstrapFile.delete() == false )
          throw new IOException("Failed to delete: "+bootstrapFile);
       return bootstrapCtxs.remove(vfsPath);
    }
-   protected DeploymentContext removeDeployer(String vfsPath) throws IOException
+   protected VFSDeployment removeDeployer(String vfsPath) throws IOException
    {
       File deployerFile = new File(deployersDir, vfsPath);
       if( Files.delete(deployerFile) == false )
          throw new IOException("Failed to delete: "+deployerFile);
       return this.removeDeployer(vfsPath);
    }
-   protected DeploymentContext removeApplication(String vfsPath) throws IOException
+   protected VFSDeployment removeApplication(String vfsPath) throws IOException
    {
       File deploymentFile = new File(applicationDir, vfsPath);
       if( Files.delete(deploymentFile) == false )
@@ -626,7 +630,7 @@
          List<VirtualFile> children = bootstrapDir.getChildren();
          for(VirtualFile vf : children)
          {
-            DeploymentContext vfCtx = loadDeploymentData(vf);
+            VFSDeployment vfCtx = loadDeploymentData(vf);
             bootstrapCtxs.put(vf.getPathName(), vfCtx);       
          }
       }
@@ -637,7 +641,7 @@
          File confDir = new File(profileRoot, "conf");
          VirtualFile confVF = VFS.getRoot(confDir.toURI());
          VirtualFile jbossServiceVF = confVF.findChild("jboss-service.xml");
-         DeploymentContext vfCtx = loadDeploymentData(jbossServiceVF);
+         VFSDeployment vfCtx = loadDeploymentData(jbossServiceVF);
          bootstrapCtxs.put(jbossServiceVF.getPathName(), vfCtx);                
       }
    }
@@ -654,7 +658,7 @@
       List<VirtualFile> children = deployersDir.getChildren();
       for(VirtualFile vf : children)
       {
-         DeploymentContext vfCtx = loadDeploymentData(vf);
+         VFSDeployment vfCtx = loadDeploymentData(vf);
          deployerCtxs.put(vf.getPathName(), vfCtx);       
       }
    }
@@ -671,7 +675,7 @@
       List<VirtualFile> children = applicationDir.getChildren();
       for(VirtualFile vf : children)
       {
-         DeploymentContext vfCtx = loadDeploymentData(vf);
+         VFSDeployment vfCtx = loadDeploymentData(vf);
          applicationCtxs.put(vf.getPathName(), vfCtx);         
       }
    }
@@ -679,14 +683,14 @@
    /**
     * TODO: this could be dropped since the serialize aspect loads the data
     * @param file
-    * @return
+    * @return the deployment
     */
-   private DeploymentContext loadDeploymentData(VirtualFile file)
+   private VFSDeployment loadDeploymentData(VirtualFile file)
    {
       // Check for a persisted context
       // Load the base deployment
-      DeploymentContext deployment = new AbstractDeploymentContext(file);
-      log.debug("Created deployment: "+deployment+", tmo="+deployment.getTransientManagedObjects());
+      VFSDeployment deployment = VFSDeploymentFactory.getInstance().createVFSDeployment(file);
+      log.debug("Created deployment: "+deployment);
       return deployment;
    }
 

Modified: trunk/system/src/tests/org/jboss/test/server/profileservice/MainTestCase.java
===================================================================
--- trunk/system/src/tests/org/jboss/test/server/profileservice/MainTestCase.java	2007-06-28 17:24:15 UTC (rev 63729)
+++ trunk/system/src/tests/org/jboss/test/server/profileservice/MainTestCase.java	2007-06-28 17:24:29 UTC (rev 63730)
@@ -25,9 +25,10 @@
 import java.net.URL;
 import java.util.ArrayList;
 
-import org.jboss.deployers.plugins.structure.AbstractDeploymentContext;
-import org.jboss.deployers.spi.deployment.MainDeployer;
-import org.jboss.deployers.spi.structure.DeploymentContext;
+import org.jboss.Main;
+import org.jboss.deployers.client.spi.main.MainDeployer;
+import org.jboss.deployers.vfs.spi.client.VFSDeployment;
+import org.jboss.deployers.vfs.spi.client.VFSDeploymentFactory;
 import org.jboss.profileservice.spi.Profile;
 import org.jboss.profileservice.spi.ProfileKey;
 import org.jboss.profileservice.spi.ProfileService;
@@ -36,7 +37,6 @@
 import org.jboss.test.BaseTestCase;
 import org.jboss.virtual.VFS;
 import org.jboss.virtual.VirtualFile;
-import org.jboss.Main;
 
 /**
  * Test of the jboss main loading a configuration via the ProfileService.
@@ -53,10 +53,6 @@
 
    // Public --------------------------------------------------------
 
-   /**
-    * Test creation of a default profile
-    * @throws Exception
-    */
    public void testCreateDefaultProfile() throws Throwable
    {
       // Set the jboss.server.home.url property to the system/src/resources dir
@@ -73,7 +69,7 @@
       ProfileService ps = psb.getProfileService();
       ProfileKey defaultKey = new ProfileKey("default");
       Profile profile = ps.getProfile(defaultKey);
-      DeploymentContext testBeans = profile.getDeployment("test-beans.xml", DeploymentPhase.APPLICATION);
+      VFSDeployment testBeans = profile.getDeployment("test-beans.xml", DeploymentPhase.APPLICATION);
       if( testBeans == null )
       {
          if( profile == null )
@@ -81,8 +77,8 @@
          MainDeployer deployer = psb.getMainDeployer();
          VFS vfs = VFS.getVFS(resourcesDir);
          VirtualFile file = vfs.findChildFromRoot("deploy/beans/test-beans.xml");
-         testBeans = new AbstractDeploymentContext(file);
-         deployer.addDeploymentContext(testBeans);
+         testBeans = createDeployment(file);
+         deployer.addDeployment(testBeans);
          profile.addDeployment(testBeans, DeploymentPhase.APPLICATION);
       }
       // Validate the deployment
@@ -117,4 +113,8 @@
       main.boot(args.toArray(tmp));
    }
 
+   protected VFSDeployment createDeployment(VirtualFile file)
+   {
+      return VFSDeploymentFactory.getInstance().createVFSDeployment(file);
+   }
 }

Modified: trunk/system/src/tests/org/jboss/test/server/profileservice/MainWithSimpleHotDeployTestCase.java
===================================================================
--- trunk/system/src/tests/org/jboss/test/server/profileservice/MainWithSimpleHotDeployTestCase.java	2007-06-28 17:24:15 UTC (rev 63729)
+++ trunk/system/src/tests/org/jboss/test/server/profileservice/MainWithSimpleHotDeployTestCase.java	2007-06-28 17:24:29 UTC (rev 63730)
@@ -37,8 +37,6 @@
  * Test of the jboss main loading a bootstrap configuration via the ProfileService
  * and additional service via a simple hot deployment service.
  * 
- * @see 
- * 
  * @author Scott.Stark at jboss.org
  * @version $Revision: 56797 $
  */




More information about the jboss-cvs-commits mailing list