[Jboss-cvs] JBossAS SVN: r56797 - in branches/MC_VDF_WORK: build server/src/etc/conf/default system/src/main/org/jboss system/src/main/org/jboss/deployers/spi system/src/main/org/jboss/profileservice/spi system/src/main/org/jboss/system/server system/src/main/org/jboss/system/server/profile/basic system/src/main/org/jboss/system/server/profileservice system/src/tests/org/jboss/test/profileservice/simple1 system/src/tests/org/jboss/test/profileservice/support system/src/tests/org/jboss/test/server/profileservice system-jmx/src/main/org/jboss/system/server/jmx

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed Sep 13 10:31:51 EDT 2006


Author: adrian at jboss.org
Date: 2006-09-13 10:31:25 -0400 (Wed, 13 Sep 2006)
New Revision: 56797

Removed:
   branches/MC_VDF_WORK/system/src/main/org/jboss/deployers/spi/Deployment.java
   branches/MC_VDF_WORK/system/src/main/org/jboss/deployers/spi/DeploymentContext.java
   branches/MC_VDF_WORK/system/src/main/org/jboss/deployers/spi/DeploymentState.java
   branches/MC_VDF_WORK/system/src/main/org/jboss/deployers/spi/MainDeployer.java
   branches/MC_VDF_WORK/system/src/main/org/jboss/deployment/
Modified:
   branches/MC_VDF_WORK/build/build-distr.xml
   branches/MC_VDF_WORK/build/build.xml
   branches/MC_VDF_WORK/server/src/etc/conf/default/deployer-beans.xml
   branches/MC_VDF_WORK/server/src/etc/conf/default/jboss-minimal.xml
   branches/MC_VDF_WORK/system-jmx/src/main/org/jboss/system/server/jmx/JMXKernel.java
   branches/MC_VDF_WORK/system/src/main/org/jboss/profileservice/spi/DeploymentTemplate.java
   branches/MC_VDF_WORK/system/src/main/org/jboss/profileservice/spi/Profile.java
   branches/MC_VDF_WORK/system/src/main/org/jboss/system/server/ServerLoader.java
   branches/MC_VDF_WORK/system/src/main/org/jboss/system/server/profile/basic/ProfileImpl.java
   branches/MC_VDF_WORK/system/src/main/org/jboss/system/server/profileservice/ManagementViewImpl.java
   branches/MC_VDF_WORK/system/src/main/org/jboss/system/server/profileservice/ProfileServiceBootstrap.java
   branches/MC_VDF_WORK/system/src/main/org/jboss/system/server/profileservice/ServerImpl.java
   branches/MC_VDF_WORK/system/src/main/org/jboss/system/server/profileservice/VFSDeploymentScannerImpl.java
   branches/MC_VDF_WORK/system/src/tests/org/jboss/test/profileservice/simple1/DeploymentImpl.java
   branches/MC_VDF_WORK/system/src/tests/org/jboss/test/profileservice/simple1/ManagementViewImpl.java
   branches/MC_VDF_WORK/system/src/tests/org/jboss/test/profileservice/simple1/ProfileImpl.java
   branches/MC_VDF_WORK/system/src/tests/org/jboss/test/profileservice/simple1/ProfileImpl2.java
   branches/MC_VDF_WORK/system/src/tests/org/jboss/test/profileservice/support/Simple1PSBootstrap.java
   branches/MC_VDF_WORK/system/src/tests/org/jboss/test/server/profileservice/MainTestCase.java
   branches/MC_VDF_WORK/system/src/tests/org/jboss/test/server/profileservice/MainWithSimpleHotDeployTestCase.java
Log:
[JBMICROCONT-5] - Full integration of jboss-deployers.
* Broken the profile api/tests for now
* ClassLoaders still need doing

Modified: branches/MC_VDF_WORK/build/build-distr.xml
===================================================================
--- branches/MC_VDF_WORK/build/build-distr.xml	2006-09-13 14:01:27 UTC (rev 56796)
+++ branches/MC_VDF_WORK/build/build-distr.xml	2006-09-13 14:31:25 UTC (rev 56797)
@@ -1830,6 +1830,7 @@
         <include name="jboss-container.jar"/>
         <include name="jboss-dependency.jar"/>
         <include name="jboss-microcontainer.jar"/>
+        <include name="jboss-deployers.jar"/>
       </fileset>
     </copy>
 

Modified: branches/MC_VDF_WORK/build/build.xml
===================================================================
--- branches/MC_VDF_WORK/build/build.xml	2006-09-13 14:01:27 UTC (rev 56796)
+++ branches/MC_VDF_WORK/build/build.xml	2006-09-13 14:31:25 UTC (rev 56797)
@@ -797,6 +797,7 @@
       <fileset dir="${install.default.conf}">
         <include name="jndi.properties" />
         <include name="log4j.xml" />
+        <include name="deployer-beans.xml" />
       </fileset>
     </copy>
     <copy file="${install.default.conf}/jboss-minimal.xml"

Modified: branches/MC_VDF_WORK/server/src/etc/conf/default/deployer-beans.xml
===================================================================
--- branches/MC_VDF_WORK/server/src/etc/conf/default/deployer-beans.xml	2006-09-13 14:01:27 UTC (rev 56796)
+++ branches/MC_VDF_WORK/server/src/etc/conf/default/deployer-beans.xml	2006-09-13 14:31:25 UTC (rev 56797)
@@ -1,96 +1,64 @@
 <?xml version="1.0" encoding="UTF-8"?>
 
-<!-- A ProfileServiceBootstrap bootstrap descriptor that uses the simple
-   VFSDeploymentScanner that goes directly to the MainDeployer rather than the
-   ProfileService.
-   $Id:$
+<!--
+   The bootstrap of the server
 -->
-<deployment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-   xsi:schemaLocation="urn:jboss:bean-deployer:2.0 bean-deployer_2_0.xsd"
-   xmlns="urn:jboss:bean-deployer:2.0">
-   <!-- -->
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+   <!-- The profile service -->
    <bean name="ProfileService" class="org.jboss.system.server.profileservice.ProfileServiceImpl">
       <constructor>
          <parameter>${jboss.server.name}</parameter>
       </constructor>
       <property name="profileRoot">${jboss.server.home.url}/profile</property>
    </bean>
+
+   <!-- The legacy JMX kernel -->
+   <bean name="JMXKernel" class="org.jboss.system.server.jmx.JMXKernel">
+      <property name="kernel"><inject bean="jboss.kernel:service=Kernel"/></property>
+      <property name="serverImpl"><inject bean="JBossServer"/></property>
+   </bean>
    
    <!-- The MainDeployer -->
-   <bean name="MainDeployer" class="org.jboss.deployers.plugins.MainDeployerImpl">
-      <property name="VFSFactory"><inject bean="VFSFactory"/></property>
+   <bean name="MainDeployer" class="org.jboss.deployers.plugins.deployment.MainDeployerImpl">
+      <property name="structureDeployers">
+         <list>
+            <!-- JAR Structure -->
+            <bean name="JARStructure" class="org.jboss.deployers.plugins.structure.vfs.jar.JARStructure"/>
+            <!-- File Structure -->
+            <bean name="FileStructure" class="org.jboss.deployers.plugins.structure.vfs.file.FileStructure"/>
+         </list>
+      </property>
       <property name="deployers">
-         <array class="[Lorg.jboss.deployers.spi.AspectDeployer;" elementClass="org.jboss.deployers.spi.AspectDeployer">
-            <inject bean="ClassLoadingDeployer"/>
-            <inject bean="BeanDeployer"/>
-            <inject bean="SARDeployer"/>
-            <inject bean="JARDeployer"/>
-         </array>
+         <list>
+            <!-- POJO Deployment -->
+            <bean name="BeanDeployer" class="org.jboss.deployers.plugins.deployers.kernel.BeanDeployer"/>
+            <bean name="KernelDeployer" class="org.jboss.deployers.plugins.deployers.kernel.KernelDeployer">
+               <constructor><parameter><inject bean="jboss.kernel:service=Kernel"/></parameter></constructor>
+            </bean>
+            <!-- JMX Deployment -->
+            <bean name="SARDeployer" class="org.jboss.system.deployers.SARDeployer"/>
+            <bean name="ServiceClassLoaderDeployer" class="org.jboss.system.deployers.ServiceClassLoaderDeployer">
+               <constructor><parameter><inject bean="JMXKernel" property="serviceController"/></parameter></constructor>
+            </bean>
+            <bean name="ServiceDeployer" class="org.jboss.system.deployers.ServiceDeployer">
+               <constructor><parameter><inject bean="JMXKernel" property="serviceController"/></parameter></constructor>
+            </bean>
+         </list>
       </property>
-      <supply>Deployers</supply>
    </bean>
-   <!-- The factory for VFS instances -->
-   <bean name="VFSFactory" class="org.jboss.vfs.file.DefaultVFSFactory">
-   </bean>
    
-   <!-- Deployers. Declaration order defines the deployer chain order
-   -->
-   <bean name="ClassLoadingDeployer" class="org.jboss.deployers.plugins.classloading.ClassLoadingDeployer">
-   </bean>
-   <bean name="BeanDeployer" class="org.jboss.deployers.plugins.bean.BeanDeployer">
-   </bean>
-   <bean name="JARDeployer" class="org.jboss.deployers.plugins.jar.JARDeployer">
-   </bean>
-   
-   <!-- Load the jboss jmx classes -->
-   <bean name="JMXClassLoader" class="org.jboss.vfs.classloading.VFSClassLoader">
-      <constructor factoryClass="org.jboss.vfs.classloading.VFSClassLoaderFactory"
-         factoryMethod="newClassLoader">
-         <parameter class="java.net.URL">${jboss.home.url}</parameter>
-         <parameter>
-            <array class="[Ljava.lang.String;" elementClass="java.lang.String">
-               <value>lib/dom4j.jar</value>
-               <value>lib/jboss-j2se.jar</value>
-               <value>lib/jboss-jmx.jar</value>
-               <value>lib/jboss-mbeans.jar</value>
-               <value>lib/jboss-system-jmx.jar</value>
-               <value>server/${jboss.server.name}/lib/*.jar</value>
-               <value>server/${jboss.server.name}/conf/</value>
-            </array>
-         </parameter>
-         <parameter><inject bean="VFSFactory"/></parameter>
-      </constructor>
-   </bean>
-   <bean name="SARDeployer" class="org.jboss.deployment.SARDeployer">
-      <classloader><inject bean="JMXClassLoader"/></classloader>
-      <property name="useNamespaceAwareParser">true</property>
-      <property name="allowImplicitClasspath">true</property>
-      <property name="server"><inject bean="JMXKernel" property="mbeanServer" /></property>
-      <property name="serviceController"><inject bean="JMXKernel" property="serviceController" /></property>
-   </bean>
-   <!-- A bean that setups a jboss-4.0.x type of jmx kernel to support the
-      the legacy mbean deployments handled by the SARDeployer
-   -->
-   <bean name="JMXKernel" class="org.jboss.system.server.jmx.JMXKernel">
-      <classloader><inject bean="JMXClassLoader"/></classloader>
-      <property name="serverImpl"><inject bean="org.jboss.system.server.Server"/></property>
-   </bean>
-   
    <!-- Hot deployment service that directly uses the MainDeployer -->
-   <bean name="VFSDeploymentScanner" class="org.jboss.deployers.plugins.scanner.VFSDeploymentScannerImpl">
-      <classloader><inject bean="JMXClassLoader"/></classloader>
-      <property name="mainDeployer"><inject bean="MainDeployer"/></property>
-      <property name="VFSFactory"><inject bean="MainDeployer" property="VFSFactory" /></property>
+   <bean name="VFSDeploymentScanner" class="org.jboss.system.server.profileservice.VFSDeploymentScannerImpl">
+      <property name="profileService"><inject bean="ProfileService"/></property>
       <property name="URIList">
          <list elementClass="java.net.URI">
             <!-- Legacy static conf/jboss-service.xml -->
-            <value>${jboss.server.home.url}/conf/jboss-service.xml</value>
+            <value>${jboss.server.home.url}conf/jboss-service.xml</value>
             <!-- Standard hot deployment directory -->
-            <value>${jboss.server.home.url}/deploy/</value>
+            <value>${jboss.server.home.url}deploy/</value>
          </list>
       </property>
-      <property name="scanPeriod"><value>500000</value></property>
-      <demand state="Instantiated">Deployers</demand>
    </bean>
    
 </deployment>

Modified: branches/MC_VDF_WORK/server/src/etc/conf/default/jboss-minimal.xml
===================================================================
--- branches/MC_VDF_WORK/server/src/etc/conf/default/jboss-minimal.xml	2006-09-13 14:01:27 UTC (rev 56796)
+++ branches/MC_VDF_WORK/server/src/etc/conf/default/jboss-minimal.xml	2006-09-13 14:31:25 UTC (rev 56797)
@@ -73,56 +73,4 @@
          proxy-type="attribute">jboss.system:service=ThreadPool</depends>
    </mbean>
 
-   <!-- ==================================================================== -->
-   <!-- Deployment Scanning                                                  -->
-   <!-- ==================================================================== -->
-
-   <!-- An mbean for hot deployment/undeployment of archives.
-   -->
-   <mbean code="org.jboss.deployment.scanner.URLDeploymentScanner"
-      name="jboss.deployment:type=DeploymentScanner,flavor=URL">
-
-      <depends optional-attribute-name="Deployer">jboss.system:service=MainDeployer</depends>
-
-      <!-- The URLComparator can be used to specify a deployment ordering
-           for deployments found in a scanned directory.  The class specified
-           must be an implementation of java.util.Comparator, it must be able
-           to compare two URL objects, and it must have a no-arg constructor.
-           Two deployment comparators are shipped with JBoss:
-             - org.jboss.deployment.DeploymentSorter 
-               Sorts by file extension, as follows:
-                 "sar", "service.xml", "rar", "jar", "war", "wsr", "ear", "zip", 
-                 "*"
-             - org.jboss.deployment.scanner.PrefixDeploymentSorter
-               If the name portion of the url begins with 1 or more digits, those 
-               digits are converted to an int (ignoring leading zeroes), and 
-               files are deployed in that order.  Files that do not start with 
-               any digits will be deployed last, and they will be sorted by
-               extension as above with DeploymentSorter.
-      -->
-      <attribute name="URLComparator">org.jboss.deployment.DeploymentSorter</attribute>
-      <!-- The Filter specifies a java.io.FileFilter for scanned
-           directories.  Any file not accepted by this filter will not be
-           deployed.  The org.jboss.deployment.scanner.DeploymentFilter 
-           rejects the following patterns:
-               "#*", "%*", ",*", ".*", "_$*", "*#", "*$", "*%", "*.BAK", 
-               "*.old", "*.orig", "*.rej", "*.bak", "*,v", "*~", ".make.state", 
-               ".nse_depinfo", "CVS", "CVS.admin", "RCS", "RCSLOG", "SCCS", 
-               "TAGS", "core", "tags"
-      -->
-      <attribute name="Filter">org.jboss.deployment.scanner.DeploymentFilter</attribute>
-
-      <attribute name="ScanPeriod">5000</attribute>
-
-      <!-- URLs are comma seperated and unprefixed arguments are considered
-         file URLs and resolve relative to server home(JBOSS_DIST/server/default)
-         unless the given path is absolute. Any referenced directories cannot
-         be unpackaged archives, use the parent directory of the unpacked
-         archive.
-       -->
-      <attribute name="URLs">
-       deploy/
-      </attribute>
-   </mbean>
-
 </server>

Deleted: branches/MC_VDF_WORK/system/src/main/org/jboss/deployers/spi/Deployment.java
===================================================================
--- branches/MC_VDF_WORK/system/src/main/org/jboss/deployers/spi/Deployment.java	2006-09-13 14:01:27 UTC (rev 56796)
+++ branches/MC_VDF_WORK/system/src/main/org/jboss/deployers/spi/Deployment.java	2006-09-13 14:31:25 UTC (rev 56797)
@@ -1,64 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., 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.deployers.spi;
-
-import java.net.URL;
-import java.util.Set;
-
-import org.jboss.deployers.spi.management.ManagedObject;
-
-/**
- * 
- * @author Scott.Stark at jboss.org
- * @version $Revision$
- */
-public interface Deployment
-{
-   /** The deployment name */
-   public String getName();
-   /** 
-    * The type of the root deployment context. This should correspond to
-    * the JSR88 type for the root DeploymentContext.
-    * @return JSR88 type for the root DeploymentContext
-    */
-   public String getType();
-   /**
-    * A set of all deployment context types
-    * @return
-    */
-   public Set<String> getTypes();
-   /**
-    * The root of the deployment contents
-    * @return the root URL of the deployment contents.
-    */
-   public URL getRootURL();
-   /** The deployment files, jars, resources paths relative to the rootURL */
-   public String[] getFiles();
-
-   public DeploymentContext getRootContext();
-
-   /**
-    * Get the management view used to edit the deployment.
-    * @return deployment management view
-    */
-   public ManagedObject getManagedObject();
-}

Deleted: branches/MC_VDF_WORK/system/src/main/org/jboss/deployers/spi/DeploymentContext.java
===================================================================
--- branches/MC_VDF_WORK/system/src/main/org/jboss/deployers/spi/DeploymentContext.java	2006-09-13 14:01:27 UTC (rev 56796)
+++ branches/MC_VDF_WORK/system/src/main/org/jboss/deployers/spi/DeploymentContext.java	2006-09-13 14:31:25 UTC (rev 56797)
@@ -1,223 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., 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.deployers.spi;
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.CopyOnWriteArraySet;
-import org.jboss.util.JBossObject;
-import org.jboss.vfs.spi.VirtualFile;
-
-/**
- * DeploymentContext represents a deployment aggregate (ear, jar, sar,
- * deployment descriptor) that is processed by one ore more deployers to
- * procude MC beans. 
- * 
- * @author <a href="mailto:dimitris at jboss.org">Dimitris Andreadis</a>
- * @author Scott.Stark at jboss.org
- * @version $Revision: 46234 $
- */
-public class DeploymentContext extends JBossObject
-   implements Serializable
-{
-   private static final long serialVersionUID = 1;
-
-   // Protected Data ------------------------------------------------
-   protected VirtualFile file;
-   protected DeploymentContext parent;
-   protected Set<String> deploymentTypes = new CopyOnWriteArraySet<String>();
-   /** The list of VFS paths that form the classpath */
-   protected List<String> classpath = new ArrayList<String>();
-   protected List<DeploymentContext> subDeployments = new ArrayList<DeploymentContext>();
-   protected ConcurrentHashMap<Serializable, Serializable>
-      contextData = new ConcurrentHashMap<Serializable, Serializable>();
-   /** The current state of the deployment */
-   protected DeploymentState state = DeploymentState.CONSTRUCTED;
-   
-   // Constructors --------------------------------------------------
-   public DeploymentContext()
-   {
-   }
-   public DeploymentContext(VirtualFile file, DeploymentContext parent)
-   {
-      this.file = file;
-      this.parent = parent;
-   }
-
-   // Public --------------------------------------------------------
-
-   public VirtualFile getFile()
-   {
-      return file;
-   }
-   public void setFile(VirtualFile file)
-   {
-      this.file = file;
-   }
-
-   public Map<Serializable, Serializable> getContextData()
-   {
-      return contextData;
-   }
-
-   /**
-    * @return the parent context or null
-    */
-   public DeploymentContext getParentContext()
-   {
-      return parent;
-   }
-   public void setParentContext(DeploymentContext parent)
-   {
-      this.parent = parent;
-   }
-
-   /**
-    * @param state The state to set.
-    */
-   public void setState(DeploymentState state)
-   {
-      this.state = state;
-   }
-   
-   /**
-    * @return Returns the state.
-    */
-   public DeploymentState getState()
-   {
-      return state;
-   }
-
-   public boolean addDeploymentType(String type)
-   {
-      // TODO: if this is the first type should that be the main type?
-      return deploymentTypes.add(type);
-   }
-   public Set<String> getDeploymentTypes()
-   {
-      return deploymentTypes;
-   }
-   public boolean isDeploymentType(String type)
-   {
-      return deploymentTypes.contains(type);
-   }
-
-   /**
-    * Is the relative path in the deployment context classpath. 
-    * @param path - a relative path to the context VirtualFile. If 
-    * @return true if the classpath contains the path, false otherwise.
-    */
-   public boolean isInClasspath(String path)
-   {
-      return classpath.contains(path);
-   }
-
-   /**
-    * @return the classpath
-    */
-   public List<String> getClasspath()
-   {
-      return classpath;
-   }
-   
-   /**
-    * Adds an entry to the classpath
-    *  
-    * @param path the classpath to add
-    * @return true if the classpath has been added
-    */
-   public boolean addClasspathEntry(String path)
-   {
-      return classpath.add(path);
-   }
-   
-   /**
-    * Adds a child subdeployment
-    * 
-    * @param child the subdeployement
-    * @return true if subdeployment has been added
-    */
-   public boolean addSubDeployment(DeploymentContext child)
-   {
-      // add a child subdeployment
-      return subDeployments.add(child);
-   }
-  
-  /** 
-   * Gets the subdeployments of this context
-   * 
-   * @return a copy of the subdeployments
-   */
-  public List<DeploymentContext> getSubDeployments()
-  {
-     return new ArrayList<DeploymentContext>(subDeployments);
-  }   
-   /**
-    * Sets the children subdeployments
-    * 
-    * @param subDeployments
-    */
-   public void setSubDeployments(List<DeploymentContext> subDeployments)
-   {
-      if (subDeployments != null)
-      {
-         this.subDeployments.clear();
-         this.subDeployments.addAll(subDeployments);
-      }
-   }
-   
-   // JBossObject overrides -----------------------------------------
-   
-   public void toShortString(StringBuffer buffer)
-   {
-      // REVISIT
-      buffer.append(super.getClassShortName());
-   }
-   
-   protected void toString(StringBuffer buffer)
-   {
-      buffer.append(file.getPathName());
-   }
-   
-   protected int getHashCode()
-   {
-      return file.hashCode();
-   }
-   
-   // Object overrides ----------------------------------------------
-   
-   public boolean equals(Object other)
-   {
-      boolean equals = false;
-      if (other instanceof DeploymentContext)
-      {
-         DeploymentContext dc = (DeploymentContext) other;
-         equals = file.equals(dc.file);
-      }
-      return equals;
-   }
-
-}

Deleted: branches/MC_VDF_WORK/system/src/main/org/jboss/deployers/spi/DeploymentState.java
===================================================================
--- branches/MC_VDF_WORK/system/src/main/org/jboss/deployers/spi/DeploymentState.java	2006-09-13 14:01:27 UTC (rev 56796)
+++ branches/MC_VDF_WORK/system/src/main/org/jboss/deployers/spi/DeploymentState.java	2006-09-13 14:31:25 UTC (rev 56797)
@@ -1,139 +0,0 @@
-/***************************************
- *                                     *
- *  JBoss: The OpenSource J2EE WebOS   *
- *                                     *
- *  Distributable under LGPL license.  *
- *  See terms of license at gnu.org.   *
- *                                     *
- ***************************************/
-
-package org.jboss.deployers.spi;
-
-import java.io.ObjectStreamException;
-import java.io.Serializable;
-
-/** 
- * A type-safe enumeration for the status of DeploymentContext
- * based on Scott's original class.
- *
- * @author <a href="mailto:dimitris at jboss.org">Dimitris Andreadis</a>
- * @version $Revision: 46233 $
- */
-public class DeploymentState implements Serializable
-{
-   private static final long serialVersionUID = 1;
-
-   // Static --------------------------------------------------------
-   
-   /** DeploymentContext constructed */
-   public static final DeploymentState CONSTRUCTED = new DeploymentState("CONSTRUCTED");
-   
-   /** None of the registered AspectDeployer could analyze the deployment */ 
-   public static final DeploymentState WAITING_DEPLOYER = new DeploymentState("WAITING_DEPLOYER");
-   
-   /** The deployment structure has been analyzed by an AspectDeployer, but not the subdeployments yet */
-   public static final DeploymentState ANALYZED_ROOT = new DeploymentState("ANALYZED_ROOT");
-   
-   /** The deployment structure, including subdeployments, has been analyzed */
-   public static final DeploymentState ANALYZED = new DeploymentState("ANALYZED");   
-   
-//   public static final DeploymentState INIT_DEPLOYER = new DeploymentState("INIT_DEPLOYER");
-//   public static final DeploymentState INITIALIZED = new DeploymentState("INITIALIZED");
-//
-//   public static final DeploymentState CREATE_SUBDEPLOYMENTS = new DeploymentState("CREATE_SUBDEPLOYMENTS");
-//   public static final DeploymentState CREATE_DEPLOYER = new DeploymentState("CREATE_DEPLOYER");
-//   public static final DeploymentState CREATED = new DeploymentState("CREATED");
-//
-//   public static final DeploymentState START_SUBDEPLOYMENTS = new DeploymentState("START_SUBDEPLOYMENTS");
-//   public static final DeploymentState START_DEPLOYER = new DeploymentState("START_DEPLOYER");
-//   public static final DeploymentState STARTED = new DeploymentState("STARTED");
-//
-//   public static final DeploymentState STOPPED = new DeploymentState("STOPPED");
-//   public static final DeploymentState DESTROYED = new DeploymentState("DESTROYED");
-   
-   /** The deployment failed at any point */
-   public static final DeploymentState FAILED = new DeploymentState("FAILED");
-
-   /** 
-    * A factory to translate a string into the corresponding DeploymentState.
-    */
-   public static DeploymentState getDeploymentState(String state)
-   {
-      DeploymentState theState = null;
-
-      state = state.toUpperCase();   
-      if (state.equals("CONSTRUCTED"))
-      {
-         theState = CONSTRUCTED;
-      }
-      else if (state.equals("WAITING_DEPLOYER"))
-      {
-         theState = WAITING_DEPLOYER;
-      }
-      else if (state.equals("ANALYZED_ROOT"))
-      {
-         theState = ANALYZED_ROOT;
-      }
-      else if (state.equals("ANALYZED"))
-      {
-         theState = ANALYZED;
-      }
-      else if (state.equals("FAILED"))
-      {
-         theState = FAILED;
-      }
-//      else if (state.equals("INITIALIZED"))
-//         theState = INITIALIZED;
-//      else if (state.equals("CREATE_SUBDEPLOYMENTS"))
-//         theState = CREATE_SUBDEPLOYMENTS;
-//      else if (state.equals("CREATE_DEPLOYER"))
-//         theState = CREATE_DEPLOYER;
-//      else if (state.equals("CREATED"))
-//         theState = CREATED;
-//      else if (state.equals("START_SUBDEPLOYMENTS"))
-//         theState = START_SUBDEPLOYMENTS;
-//      else if (state.equals("START_DEPLOYER"))
-//         theState = START_DEPLOYER;
-//      else if (state.equals("STARTED"))
-//         theState = STARTED;
-//      else if (state.equals("STOPPED"))
-//         theState = STOPPED;
-//      else if (state.equals("DESTROYED"))
-//         theState = DESTROYED;
-
-      return theState;
-   }
-   
-   // Private Data --------------------------------------------------
-   
-   private String state;
-   
-   // Constructors --------------------------------------------------
-   
-   /**
-    * Private CTOR
-    */
-   private DeploymentState(String state)
-   {
-      this.state = state;
-   }
-
-   // Private -------------------------------------------------------
-   
-   /**
-    * Resolve objects on deserialization to one of the identity objects.
-    */
-   private Object readResolve() throws ObjectStreamException
-   {
-      Object identity = getDeploymentState(state);
-      return identity;
-   }
-    
-   // Object overrides ----------------------------------------------
-   
-   public String toString()
-   {
-      return state;
-   }
-
-}

Deleted: branches/MC_VDF_WORK/system/src/main/org/jboss/deployers/spi/MainDeployer.java
===================================================================
--- branches/MC_VDF_WORK/system/src/main/org/jboss/deployers/spi/MainDeployer.java	2006-09-13 14:01:27 UTC (rev 56796)
+++ branches/MC_VDF_WORK/system/src/main/org/jboss/deployers/spi/MainDeployer.java	2006-09-13 14:31:25 UTC (rev 56797)
@@ -1,144 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., 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.deployers.spi;
-
-import java.net.URI;
-import java.net.URL;
-import java.util.List;
-
-import org.jboss.vfs.VFSFactory;
-
-/**
- * The new MainDeployer service provider interface 
- * 
- * @author <a href="mailto:dimitris at jboss.org">Dimitris Andreadis</a>
- * @author Scott.Stark at jboss.org
- * @version $Revision: 46165 $
- */
-public interface MainDeployer
-{
-   /**
-    * Get the VFSFactory used to handle deployments
-    * @return factory - VFSFactory implementation 
-    */
-   public VFSFactory getVFSFactory();
-   /**
-    * Set the VFSFactory used to handle deployments
-    * @param factory - VFSFactory implementation 
-    */
-   public void setVFSFactory(VFSFactory factory);
-
-   // Deployer registry ---------------------------------------------
-   
-   /**
-    * Register an AspectDeployer
-    * 
-    * @param deployer the AspectDeployer
-    */
-   //void register(AspectDeployer deployer);
-   
-   /**
-    * Unregister an AspectDeployer
-    * 
-    * @param deployer the AspectDeployer
-    */
-   //void unregister(AspectDeployer deployer);
-   
-   /**
-    * Return a copy of the AspectDeployer list
-    * 
-    * @return List<AspectDeployer>
-    */
-   //List<AspectDeployer> listDeployers();
-   
-   /**
-    * Return the ordered list of deployment suffixes
-    * recognized by registered AspectDeployers
-    * 
-    * @return the ordered list of recognized suffixes
-    */
-   public String[] getSuffixes();
-   
-   // Deployment ---------------------------------------
-
-   /**
-    * @return the DeploymentGraphBuilder plugin
-    */
-   //public DeploymentGraphBuilder getGraphBuilder();
-   /**
-    * The plugin that determines the directed graph of DeploymentContexts for
-    * a given Deployment.
-    * 
-    * @param builder - the DeploymentGraphBuilder plugin
-    */
-   //public void setGraphBuilder(DeploymentGraphBuilder builder);
-
-   /**
-    * Translate a deployment archive into a Deployment instance.
-    * @param deployURI - URI for the deployment archive
-    */
-   public Deployment parse(URI deployURI) throws DeploymentException;
-   /**
-    * Translate a deployment archive into a Deployment instance.
-    * @param deployURL - URL for the deployment archive
-    */
-   public Deployment parse(URL deployURL) throws DeploymentException;
-
-   /**
-    * Deploys a component
-    *
-    * @param comp the component to deploy
-    * @throws DeploymentException upon failure
-    */
-   void deploy(Deployment comp) throws DeploymentException;
-
-   /**
-    * Re-deploys a component
-    *
-    * @param comp the component to redeploy
-    * @throws DeploymentException upon failure
-    */
-   void redeploy(Deployment comp) throws DeploymentException;
-   
-   /**
-    * Undeploys a component
-    *
-    * @param comp the component to undeploy
-    * @throws DeploymentException upon failure
-    */
-   void undeploy(Deployment comp) throws DeploymentException;
-
-   /**
-    * Tells you if a component is deployed
-    *
-    * @param comp the component to check if is deployed
-    * @return the deployment status
-    */
-   boolean isDeployed(Deployment comp);
-
-   /**
-    * Undeploy all deployments
-    * @throws DeploymentException upon failure
-    */
-   public void shutdown() throws DeploymentException;
-
-}

Modified: branches/MC_VDF_WORK/system/src/main/org/jboss/profileservice/spi/DeploymentTemplate.java
===================================================================
--- branches/MC_VDF_WORK/system/src/main/org/jboss/profileservice/spi/DeploymentTemplate.java	2006-09-13 14:01:27 UTC (rev 56796)
+++ branches/MC_VDF_WORK/system/src/main/org/jboss/profileservice/spi/DeploymentTemplate.java	2006-09-13 14:31:25 UTC (rev 56797)
@@ -24,7 +24,7 @@
 
 import java.util.Set;
 
-import org.jboss.deployers.spi.Deployment;
+import org.jboss.deployers.spi.structure.DeploymentContext;
 
 /**
  * @author Scott.Stark at jboss.org
@@ -35,5 +35,5 @@
 {
    String getName();
    Set<PropertyInfo> getProperties();
-   Deployment expand(Set<PropertyInfo> values);
+   DeploymentContext expand(Set<PropertyInfo> values);
 }

Modified: branches/MC_VDF_WORK/system/src/main/org/jboss/profileservice/spi/Profile.java
===================================================================
--- branches/MC_VDF_WORK/system/src/main/org/jboss/profileservice/spi/Profile.java	2006-09-13 14:01:27 UTC (rev 56796)
+++ branches/MC_VDF_WORK/system/src/main/org/jboss/profileservice/spi/Profile.java	2006-09-13 14:31:25 UTC (rev 56797)
@@ -22,9 +22,10 @@
 
 package org.jboss.profileservice.spi;
 
+import java.util.Collection;
 import java.util.Map;
 
-import org.jboss.deployers.spi.Deployment;
+import org.jboss.deployers.spi.structure.DeploymentContext;
 
 /**
  * A profile represents a named collection of deployments on a server
@@ -46,7 +47,7 @@
     */
    public DeploymentTemplate getTemplate(String name)
       throws NoSuchDeploymentException;
-   public void addDeployment(Deployment d);
+   public void addDeployment(DeploymentContext d);
    public void removeDeployment(String name);
 
    /**
@@ -56,13 +57,13 @@
     * @return the named Deployment
     * @throws NoSuchDeploymentException - if there is no such deployment
     */
-   public Deployment getDeployment(String name)
+   public DeploymentContext getDeployment(String name)
       throws NoSuchDeploymentException;
 
    /**
     * Get all deployments defined in this profile
     * @return Array of the Deployment instances in this profile.
     */
-   public Deployment[] getDeployments();
+   public Collection<DeploymentContext> getDeployments();
    public Map<String, Object> getConfig();
 }

Modified: branches/MC_VDF_WORK/system/src/main/org/jboss/system/server/ServerLoader.java
===================================================================
--- branches/MC_VDF_WORK/system/src/main/org/jboss/system/server/ServerLoader.java	2006-09-13 14:01:27 UTC (rev 56796)
+++ branches/MC_VDF_WORK/system/src/main/org/jboss/system/server/ServerLoader.java	2006-09-13 14:31:25 UTC (rev 56797)
@@ -77,7 +77,7 @@
     * proper libraries.
     */
    public static final String DEFAULT_BOOT_LIBRARY_LIST =
-      "log4j-boot.jar,jboss-common.jar,jboss-system.jar,jboss-xml-binding.jar,jboss-container.jar,jboss-dependency.jar,jboss-microcontainer.jar";
+      "log4j-boot.jar,jboss-common.jar,jboss-system.jar,jboss-xml-binding.jar,jboss-container.jar,jboss-dependency.jar,jboss-microcontainer.jar,jboss-deployers.jar,dom4j.jar,jboss-j2se.jar,jboss-mbeans.jar,jboss-jmx.jar,jboss-system-jmx.jar";
 
    /** The default server type. */
    public static final String DEFAULT_SERVER_TYPE = "org.jboss.system.server.profileservice.ServerImpl";

Modified: branches/MC_VDF_WORK/system/src/main/org/jboss/system/server/profile/basic/ProfileImpl.java
===================================================================
--- branches/MC_VDF_WORK/system/src/main/org/jboss/system/server/profile/basic/ProfileImpl.java	2006-09-13 14:01:27 UTC (rev 56796)
+++ branches/MC_VDF_WORK/system/src/main/org/jboss/system/server/profile/basic/ProfileImpl.java	2006-09-13 14:31:25 UTC (rev 56797)
@@ -22,10 +22,12 @@
 package org.jboss.system.server.profile.basic;
 
 import java.io.File;
+import java.util.Collection;
+import java.util.Collections;
 import java.util.HashMap;
 import java.util.Map;
 
-import org.jboss.deployers.spi.Deployment;
+import org.jboss.deployers.spi.structure.DeploymentContext;
 import org.jboss.profileservice.spi.DeploymentTemplate;
 import org.jboss.profileservice.spi.NoSuchDeploymentException;
 import org.jboss.profileservice.spi.Profile;
@@ -46,7 +48,7 @@
    private String name;
    /** The directory containing the profiles */
    private File profileRoot;
-   private HashMap<String,Deployment> deployments = new HashMap<String,Deployment>();
+   private HashMap<String,DeploymentContext> deployments = new HashMap<String,DeploymentContext>();
 
    public ProfileImpl(String profileRoot, String name)
    {
@@ -73,7 +75,7 @@
       return null;
    }
 
-   public void addDeployment(Deployment d)
+   public void addDeployment(DeploymentContext d)
    {
       deployments.put(d.getName(), d);
    }
@@ -83,18 +85,16 @@
       deployments.remove(name);
    }
 
-   public Deployment getDeployment(String name)
+   public DeploymentContext getDeployment(String name)
          throws NoSuchDeploymentException
    {
-      Deployment deployment = deployments.get(name);
+      DeploymentContext deployment = deployments.get(name);
       return deployment;
    }
 
-   public Deployment[] getDeployments()
+   public Collection<DeploymentContext> getDeployments()
    {
-      Deployment[] tmp = new Deployment[deployments.size()];
-      deployments.values().toArray(tmp);
-      return tmp;
+      return Collections.unmodifiableCollection(deployments.values());
    }
 
    public Map<String, Object> getConfig()

Modified: branches/MC_VDF_WORK/system/src/main/org/jboss/system/server/profileservice/ManagementViewImpl.java
===================================================================
--- branches/MC_VDF_WORK/system/src/main/org/jboss/system/server/profileservice/ManagementViewImpl.java	2006-09-13 14:01:27 UTC (rev 56796)
+++ branches/MC_VDF_WORK/system/src/main/org/jboss/system/server/profileservice/ManagementViewImpl.java	2006-09-13 14:31:25 UTC (rev 56797)
@@ -26,9 +26,9 @@
 import java.util.HashMap;
 
 import org.jboss.beans.info.spi.PropertyInfo;
-import org.jboss.deployers.spi.Deployment;
 import org.jboss.deployers.spi.management.ManagedObject;
 import org.jboss.deployers.spi.management.ManagementView;
+import org.jboss.deployers.spi.structure.DeploymentContext;
 import org.jboss.profileservice.spi.NoSuchDeploymentException;
 import org.jboss.profileservice.spi.Profile;
 import org.jboss.profileservice.spi.ProfileKey;
@@ -53,9 +53,10 @@
       throws NoSuchProfileException, NoSuchDeploymentException
    {
       Profile profile = ps.getProfile(key);
-      Deployment d = profile.getDeployment(deploymentName);
-      ManagedObject mo = d.getManagedObject();
-      return mo;
+      DeploymentContext d = profile.getDeployment(deploymentName);
+      // TODO ManagedObject mo = d.getManagedObject();
+      // return mo;
+      return null;
    }
 
    public void setView(ProfileKey key, String deploymentName, HashMap<String, PropertyInfo> view)

Modified: branches/MC_VDF_WORK/system/src/main/org/jboss/system/server/profileservice/ProfileServiceBootstrap.java
===================================================================
--- branches/MC_VDF_WORK/system/src/main/org/jboss/system/server/profileservice/ProfileServiceBootstrap.java	2006-09-13 14:01:27 UTC (rev 56796)
+++ branches/MC_VDF_WORK/system/src/main/org/jboss/system/server/profileservice/ProfileServiceBootstrap.java	2006-09-13 14:31:25 UTC (rev 56797)
@@ -22,25 +22,17 @@
 package org.jboss.system.server.profileservice;
 
 import java.net.URL;
+import java.util.Collection;
 import java.util.Enumeration;
 
-import org.jboss.beans.info.spi.BeanInfo;
 import org.jboss.beans.metadata.plugins.AbstractBeanMetaData;
-import org.jboss.beans.metadata.spi.BeanMetaData;
-import org.jboss.dependency.plugins.AbstractControllerContext;
-import org.jboss.dependency.spi.ControllerState;
-import org.jboss.deployers.spi.Deployment;
-import org.jboss.deployers.spi.MainDeployer;
+import org.jboss.dependency.spi.ControllerContext;
+import org.jboss.deployers.spi.deployment.MainDeployer;
+import org.jboss.deployers.spi.structure.DeploymentContext;
 import org.jboss.kernel.Kernel;
 import org.jboss.kernel.plugins.bootstrap.basic.BasicBootstrap;
-import org.jboss.kernel.plugins.dependency.AbstractKernelControllerContext;
-import org.jboss.kernel.plugins.dependency.KernelControllerContextActions;
 import org.jboss.kernel.plugins.deployment.xml.BasicXMLDeployer;
-import org.jboss.kernel.plugins.registry.AbstractKernelRegistryEntry;
-import org.jboss.kernel.spi.config.KernelConfigurator;
 import org.jboss.kernel.spi.dependency.KernelController;
-import org.jboss.kernel.spi.registry.KernelRegistry;
-import org.jboss.kernel.spi.registry.KernelRegistryEntry;
 import org.jboss.profileservice.spi.Profile;
 import org.jboss.profileservice.spi.ProfileKey;
 import org.jboss.profileservice.spi.ProfileService;
@@ -56,25 +48,44 @@
  */
 public class ProfileServiceBootstrap extends BasicBootstrap
 {
+   /** The bootstrap file */
    public static String DEPLOYERS_XML_NAME = "deployer-beans.xml";
+
    /** The name of the profile that is being booted */
    protected String profileName;
+
    /** The Server instance bootstraping the profile service */
    protected Server server;
+
    /** The kernel deployer used to load the server deployers */
    protected BasicXMLDeployer kernelDeployer;
+
    /** The server MainDeployer */
    protected MainDeployer mainDeployer;
+
    /** The server ProfileService */
    protected ProfileService profileService;
+
+   /** The deployer beans prefix */
    protected String deployerBeansPrefix;
+
    /** An explicit deployer-beans.xml URL to deploy */
    protected URL bootstrapURL;
 
+   /**
+    * Create a new ProfileServiceBootstrap.
+    */
    public ProfileServiceBootstrap()
    {
       this("default", null);
    }
+
+   /**
+    * Create a new ProfileServiceBootstrap.
+    * 
+    * @param name the name
+    * @param server the server instance
+    */
    public ProfileServiceBootstrap(String name, Server server)
    {
       this.profileName = name;
@@ -88,22 +99,27 @@
 
    /**
     * Return the MainDeployer bean.
+    * 
     * @return the MainDeployer bean if bootstrap succeeded, null otherwise.
     */
    public MainDeployer getMainDeployer()
    {
       return mainDeployer;
    }
+
    /**
     * Return the ProfileService bean.
+    * 
     * @return the ProfileService bean if bootstrap succeeded, null otherwise
     */
    public ProfileService getProfileService()
    {
       return profileService;
    }
+
    /**
     * Return the bootstrap XML kernel deployer.
+    * 
     * @return BasicXMLDeployer instance.
     */
    public BasicXMLDeployer getKernelDeployer()
@@ -111,27 +127,40 @@
       return kernelDeployer;
    }
 
+   /**
+    * Get the deployer bean prefix
+    * 
+    * @return the prefix
+    */
    public String getDeployerBeansPrefix()
    {
       return deployerBeansPrefix;
    }
+
    /**
     * Set the prefix to add to the DEPLOYERS_XML_NAME in order to create the
     * classpath resource to look for bootstrap descriptors.
+    * 
     * @param prefix - the prefix for the bootstrap descriptor resource. If null
     * or empty, a value of profileName + "/" is used.
     */
    public void setDeployerBeansPrefix(String prefix)
    {
-      if( prefix != null && prefix.length() == 0 )
+      if (prefix != null && prefix.length() == 0)
          prefix = null;
       this.deployerBeansPrefix = prefix;
    }
 
+   /**
+    * Get the bootstrap url
+    * 
+    * @return the bootstrap url
+    */
    public URL getBootstrapURL()
    {
       return bootstrapURL;
    }
+
    /**
     * Set the explicit kernel bootstrap deployer-beans.xml URL. If set, not
     * resource discovery will be preformed.
@@ -143,103 +172,93 @@
       this.bootstrapURL = bootstrapURL;
    }
 
-   /**
-    * Boot the kernel by loading all deployer-beans.xml descriptors available
-    * on the classpath.
-    * 
-    */
+   @Override
    public void bootstrap() throws Throwable
    {
       // Bootstrap the core kernel
       super.bootstrap();
-      
+
       kernelDeployer = new BasicXMLDeployer(getKernel());
 
-      if( bootstrapURL == null )
+      if (bootstrapURL == null)
       {
-	      ClassLoader cl = Thread.currentThread().getContextClassLoader();
-	      String bootstrapResName;
-	      if( deployerBeansPrefix == null )
-		      bootstrapResName = profileName + "/" + DEPLOYERS_XML_NAME;
-	      else
-		      bootstrapResName = deployerBeansPrefix + DEPLOYERS_XML_NAME;
-	      log.debug("Scanning for bootstrap resources: "+bootstrapResName);
-	      Enumeration<URL> descriptors = cl.getResources(bootstrapResName);
-	      while( descriptors.hasMoreElements() )
-	      {
-	         URL url = descriptors.nextElement();
-	         deploy(url);
-	      }
-	
-	      String metaInfBootstrapResName = "META-INF/" + bootstrapResName;
-	      log.debug("Scanning for bootstrap resources: "+metaInfBootstrapResName);
-	      descriptors = cl.getResources(metaInfBootstrapResName);
-	      while( descriptors.hasMoreElements() )
-	      {
-	         URL url = descriptors.nextElement();
-	         deploy(url);
-	      }
+         ClassLoader cl = Thread.currentThread().getContextClassLoader();
+
+         String bootstrapResName;
+         if (deployerBeansPrefix == null)
+            bootstrapResName = profileName + "/" + DEPLOYERS_XML_NAME;
+         else
+            bootstrapResName = deployerBeansPrefix + DEPLOYERS_XML_NAME;
+         
+         log.debug("Scanning for bootstrap resources: " + bootstrapResName);
+         Enumeration<URL> descriptors = cl.getResources(bootstrapResName);
+         while (descriptors.hasMoreElements())
+         {
+            URL url = descriptors.nextElement();
+            deploy(url);
+         }
+
+         String metaInfBootstrapResName = "META-INF/" + bootstrapResName;
+         log.debug("Scanning for bootstrap resources: " + metaInfBootstrapResName);
+         descriptors = cl.getResources(metaInfBootstrapResName);
+         while (descriptors.hasMoreElements())
+         {
+            URL url = descriptors.nextElement();
+            deploy(url);
+         }
       }
       else
       {
-    	  deploy(bootstrapURL);    	  
+         deploy(bootstrapURL);
       }
 
       Kernel kernel = getKernel();
       KernelController controller = kernel.getController();
-      KernelRegistry registry = kernel.getRegistry();
-      KernelConfigurator config = kernel.getConfigurator();
+
       // Register the Server instance in the kernel
-      if( server != null )
+      if (server != null)
       {
-         BeanInfo info = config.getBeanInfo(server.getClass());;
-         AbstractBeanMetaData metaData = new AbstractBeanMetaData("org.jboss.system.server.Server", null);
-         AbstractKernelControllerContext serverEntry = new AbstractKernelControllerContext(info, metaData, server);
-         controller.install(serverEntry);
+         AbstractBeanMetaData metaData = new AbstractBeanMetaData("JBossServer", server.getClass().getName());
+         controller.install(metaData, server);
       }
- 
+
       // Validate that everything is ok
       kernelDeployer.validate();
 
-      // Get the MainDeployer
-      KernelRegistryEntry mdEntry = registry.getEntry("MainDeployer");
-      Object target = mdEntry.getTarget();
-      if( target instanceof MainDeployer )
-      {
-         mainDeployer = (MainDeployer) target;
-      }
-      else
-      {
-         StringBuilder tmp = new StringBuilder("Kernel entry MainDeployer(");
-         tmp.append(mainDeployer);
-         tmp.append(") is not an instanceof ");
-         tmp.append(MainDeployer.class.getName());
-         throw new IllegalStateException(tmp.toString());
-      }
-      log.debug("Using MainDeployer: "+mainDeployer);
+      // 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);
 
-      // Get the ProfileService
-      KernelRegistryEntry psEntry = registry.getEntry("ProfileService");
-      target = psEntry.getTarget();
-      if( target instanceof ProfileService )
-      {
-         profileService = (ProfileService) target;
-      }
-      else
-      {
-         StringBuilder tmp = new StringBuilder("Kernel entry ProfileService(");
-         tmp.append(profileService);
-         tmp.append(") is not an instanceof ");
-         tmp.append(ProfileService.class.getName());
-         throw new IllegalStateException(tmp.toString());
-      }
-      log.debug("Using ProfileService: "+profileService);
-
       // Load the profile beans
       loadProfile(profileName);
    }
 
    /**
+    * Get a bean
+    * 
+    * @param <T> the expected type 
+    * @param controller the controller 
+    * @param name the bean name
+    * @param expectedType the expected type
+    * @return the bean
+    * @throws IllegalStateException if the bean is not installed or has the wrong type
+    */
+   protected <T> T getBean(KernelController controller, Object name, Class<T> expectedType)
+   {
+      ControllerContext context = controller.getInstalledContext(name);
+      if (context == null)
+         throw new IllegalStateException("Context not installed: " + name);
+      Object result = context.getTarget();
+      if (result == null)
+         throw new IllegalStateException("No target for " + name);
+      if (expectedType.isInstance(result) == false)
+         throw new IllegalStateException(name + " expected " + expectedType.getName() + " was " + result.getClass().getName());
+      return expectedType.cast(result);
+   }
+   
+   /**
     * Bootstrap deployment of the 
     *
     * @param url the deployment url
@@ -247,10 +266,10 @@
     */
    protected void deploy(URL url) throws Throwable
    {
-      log.debug("Deploying bootstrap config: "+url);
+      log.debug("Deploying bootstrap config: " + url);
       kernelDeployer.deploy(url);
    }
-   
+
    /**
     * Undeploy a url
     * 
@@ -260,7 +279,7 @@
    {
       try
       {
-         log.debug("Undeploying bootstrap config: "+url);
+         log.debug("Undeploying bootstrap config: " + url);
          kernelDeployer.undeploy(url);
       }
       catch (Throwable t)
@@ -269,10 +288,10 @@
       }
    }
 
-
    /**
     * Load the deployments associated with the named profile and deploy them
     * using the MainDeployer.
+    * 
     * @param name
     * @throws Throwable
     * @throws NullPointerException if either the MainDeployer or ProfileService
@@ -281,21 +300,19 @@
    protected void loadProfile(String name) throws Throwable
    {
       MainDeployer deployer = getMainDeployer();
-      if( deployer == null )
+      if (deployer == null)
          throw new NullPointerException("MainDeployer has not been set");
       ProfileService ps = getProfileService();
-      if( ps == null )
+      if (ps == null)
          throw new NullPointerException("ProfileService has not been set");
 
       // Load the named profile
       ProfileKey key = new ProfileKey(name);
       Profile profile = ps.getProfile(key);
-      Deployment[] profileDeployments = profile.getDeployments();
+      Collection<DeploymentContext> profileDeployments = profile.getDeployments();
       // Deploy the profile deployments
-      for(Deployment d : profileDeployments)
-      {
-         log.debug("Deploying: "+d);
-         deployer.deploy(d);
-      }
+      for (DeploymentContext d : profileDeployments)
+         deployer.addDeploymentContext(d);
+      deployer.process();
    }
 }

Modified: branches/MC_VDF_WORK/system/src/main/org/jboss/system/server/profileservice/ServerImpl.java
===================================================================
--- branches/MC_VDF_WORK/system/src/main/org/jboss/system/server/profileservice/ServerImpl.java	2006-09-13 14:01:27 UTC (rev 56796)
+++ branches/MC_VDF_WORK/system/src/main/org/jboss/system/server/profileservice/ServerImpl.java	2006-09-13 14:31:25 UTC (rev 56797)
@@ -28,7 +28,7 @@
 import java.util.Properties;
 
 import org.jboss.Version;
-import org.jboss.deployers.spi.MainDeployer;
+import org.jboss.deployers.spi.deployment.MainDeployer;
 import org.jboss.kernel.Kernel;
 import org.jboss.kernel.plugins.deployment.BasicKernelDeployer;
 import org.jboss.kernel.spi.event.KernelEvent;

Modified: branches/MC_VDF_WORK/system/src/main/org/jboss/system/server/profileservice/VFSDeploymentScannerImpl.java
===================================================================
--- branches/MC_VDF_WORK/system/src/main/org/jboss/system/server/profileservice/VFSDeploymentScannerImpl.java	2006-09-13 14:01:27 UTC (rev 56796)
+++ branches/MC_VDF_WORK/system/src/main/org/jboss/system/server/profileservice/VFSDeploymentScannerImpl.java	2006-09-13 14:31:25 UTC (rev 56797)
@@ -22,22 +22,19 @@
 package org.jboss.system.server.profileservice;
 
 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.HashSet;
 import java.util.Iterator;
 import java.util.LinkedList;
 import java.util.List;
-import java.util.Set;
+import java.util.Map;
 import java.util.StringTokenizer;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.CopyOnWriteArrayList;
 
-import org.jboss.deployers.spi.Deployment;
-import org.jboss.deployers.spi.MainDeployer;
-import org.jboss.deployment.scanner.VFSDeploymentScanner;
+import org.jboss.deployers.plugins.structure.AbstractDeploymentContext;
+import org.jboss.deployers.spi.structure.DeploymentContext;
 import org.jboss.net.protocol.URLLister;
 import org.jboss.net.protocol.URLLister.URLFilter;
 import org.jboss.profileservice.spi.Profile;
@@ -45,11 +42,9 @@
 import org.jboss.profileservice.spi.ProfileService;
 import org.jboss.util.JBossObject;
 import org.jboss.util.StringPropertyReplacer;
-import org.jboss.vfs.VFSFactory;
-import org.jboss.vfs.spi.ReadOnlyVFS;
-import org.jboss.vfs.spi.VirtualFile;
+import org.jboss.virtual.VFS;
+import org.jboss.virtual.VirtualFile;
 
-
 /**
  * A DeploymentScanner build on top of the VFS and ProfileService. This is a
  * first pass to flesh out the APIs/concepts.
@@ -58,16 +53,11 @@
  * @author Scott.Stark at jboss.org
  * @version $Revision$
  */
-public class VFSDeploymentScannerImpl
-   extends JBossObject
-   implements VFSDeploymentScanner
+public class VFSDeploymentScannerImpl extends JBossObject
 {
    // Private Data --------------------------------------------------
-   private MainDeployer mainDeployer;
-   /** The VFSFactory used to obtain deployment VFS */
-   private VFSFactory factory;
+
    private ProfileService ps;
-   private Profile serverProfile;
 
    private ProfileKey profileKey;
 
@@ -75,21 +65,20 @@
    private URI serverHomeURI;
    
    /** The list of URIs to scan */
-   private List<URI> uriList = Collections.synchronizedList(new ArrayList());
+   private List<URI> uriList = new CopyOnWriteArrayList<URI>();
    
    /** The list of VirtualFiles to scan */
-   private List<VirtualFile> vdfList = Collections.synchronizedList(new ArrayList());
+   private List<VirtualFile> vdfList = new CopyOnWriteArrayList<VirtualFile>();;
    
    /** Allow a filter for scanned directories */
    private URLLister.URLFilter filter;   
 
    /** Whether to search for files inside directories whose names containing no dots */
    private boolean doRecursiveSearch = true;
-   private int scanCount;
+   
+   /** A map of deployed virtual files to their names */
+   private Map<VirtualFile, String> deployedSet = new ConcurrentHashMap<VirtualFile, String>();
 
-   /** A set of scanned VirtualFiles which have been deployed */
-   private Set deployedSet = Collections.synchronizedSet(new HashSet());
-
    // Constructor ---------------------------------------------------
    
    public VFSDeploymentScannerImpl()
@@ -99,27 +88,6 @@
    
    // Attributes ----------------------------------------------------
 
-   public void setMainDeployer(MainDeployer deployer)
-   {
-      this.mainDeployer = deployer;
-      this.factory = mainDeployer.getVFSFactory();
-   }
-
-   /**
-    * @return Returns the factory.
-    */
-   public VFSFactory getVFSFactory()
-   {
-      return this.factory;
-   }
-
-   /**
-    * @param factory The factory to set.
-    */
-   public void setVFSFactory(VFSFactory factory)
-   {
-      this.factory = factory;
-   }
    public void setProfileService(ProfileService ps)
    {
       this.ps = ps;
@@ -128,6 +96,7 @@
    {
       return ps;
    }
+
    public ProfileKey getProfileKey()
    {
       return profileKey;
@@ -137,51 +106,6 @@
       this.profileKey = key;
    }
 
-   /* (non-Javadoc)
-    * @see org.jboss.deployment.scanner.VFSDeploymentScanner#getScanPeriod()
-    */
-   public long getScanPeriod()
-   {
-      // TODO Auto-generated method stub
-      return 0;
-   }
-
-   /* (non-Javadoc)
-    * @see org.jboss.deployment.scanner.VFSDeploymentScanner#isScanEnabled()
-    */
-   public boolean isScanEnabled()
-   {
-      // TODO Auto-generated method stub
-      return false;
-   }
-
-   /* (non-Javadoc)
-    * @see org.jboss.deployment.scanner.VFSDeploymentScanner#setScanEnabled(boolean)
-    */
-   public void setScanEnabled(boolean flag)
-   {
-      // TODO Auto-generated method stub
-      
-   }
-
-   /* (non-Javadoc)
-    * @see org.jboss.deployment.scanner.VFSDeploymentScanner#setScanPeriod(long)
-    */
-   public void setScanPeriod(long period)
-   {
-      // TODO Auto-generated method stub
-      
-   }
-
-   public synchronized int getScanCount()
-   {
-      return scanCount;
-   }
-   public synchronized void resetScanCount()
-   {
-      this.scanCount = 0;
-   }
-
     /**
     * @throws URISyntaxException
     * @throws IOException
@@ -312,13 +236,8 @@
       if( uriList.add(uri) == true )
       {
          log.debug("Added URI: " + uri);
-         if (factory != null)
-         {
-            URL rootURL = uri.toURL();
-            ReadOnlyVFS vfs = factory.getVFS(rootURL);
-            VirtualFile vf = vfs.resolveFile("");
-            vdfList.add(vf);
-         }
+         VirtualFile vf = getVFforURI(uri);
+         vdfList.add(vf);
       }      
    }
 
@@ -332,11 +251,8 @@
       {
          throw new NullPointerException("uri argument cannot be null");
       }
-      if (factory != null)
-      {
-         VirtualFile vf = getVFforURI(uri);
-         vdfList.remove(vf);
-      }
+      VirtualFile vf = getVFforURI(uri);
+      vdfList.remove(vf);
       boolean success = uriList.remove(uri);
       
       if (success)
@@ -361,20 +277,18 @@
    {
       // synchronize uriList and vdfList because only at this point
       // setVirtualFileFactory() injection has been performed
-      if (factory != null)
+      vdfList.clear();
+      for (Iterator<URI> i = uriList.iterator(); i.hasNext(); )
       {
-         vdfList.clear();
-         for (Iterator<URI> i = uriList.iterator(); i.hasNext(); )
-         {
-            URI uri = i.next();
-            VirtualFile vf = this.getVFforURI(uri);
-            vdfList.add(vf);
-         }
+         URI uri = i.next();
+         VirtualFile vf = this.getVFforURI(uri);
+         vdfList.add(vf);
       }
       if( profileKey == null )
       {
          profileKey = new ProfileKey("default");
       }
+      scan();
    }
 
    // AbstractDeploymentScanner overrides ---------------------------
@@ -401,7 +315,6 @@
          for (Iterator i = vdfList.iterator(); i.hasNext();)
          {
             VirtualFile component = (VirtualFile)i.next();
-            
             if (component.isFile())
             {
                // treat this as a deployable unit
@@ -414,7 +327,7 @@
             }
          }
       }
-
+      
       if (trace)
       {
          log.trace("toDeployList");
@@ -429,9 +342,8 @@
       synchronized (deployedSet)
       {
          // remove previously deployed URLs no longer needed
-         for (Iterator i = deployedSet.iterator(); i.hasNext();)
+         for (VirtualFile deployedComponent : deployedSet.keySet())
          {
-            VirtualFile deployedComponent = (VirtualFile)i.next();
             if (toDeployList.contains(deployedComponent))
             {
                toCheckForUpdateList.add(deployedComponent);
@@ -499,7 +411,7 @@
          VirtualFile component = (VirtualFile)i.next();
          
          // if component is not deployed already, deploy it
-         if (!deployedSet.contains(component))
+         if (!deployedSet.containsKey(component))
          {
             deploy(component);
          }
@@ -555,12 +467,10 @@
    private void addDeployments(List<VirtualFile> list, VirtualFile root)
       throws IOException
    {
-      VirtualFile[] components = root.getChildren();
+      List<VirtualFile> components = root.getChildren();
       
-      for (int i = 0; i < components.length; i++)
+      for (VirtualFile component : components)
       {
-         VirtualFile component = components[i];
-         
          if (component.isFile())
          {
             // the first arg in filter.accept is not used!
@@ -599,21 +509,14 @@
          log.trace("Deploying: " + component);
       }
 
-      Deployment deployment = null;
+      DeploymentContext deployment = null;
       try
       {
-         URL componentUrl = component.toURL();
          Profile profile = ps.getProfile(profileKey);
-         // TODO: this is wasteful. Need a way to query the profile for a deployment URL?
-         deployment = mainDeployer.parse(componentUrl);
+         deployment = new AbstractDeploymentContext(component);
          if( profile.getDeployment(deployment.getName()) == null )
             profile.addDeployment(deployment);
       }
-      catch (MalformedURLException e)
-      {
-         log.warn("Cannot convert to URL", e);
-         return;
-      }
       catch (Exception e)
       {
          log.debug("Failed to deploy: " + component, e);
@@ -640,9 +543,9 @@
       }
       //component.setContext(new ComponentContext(watchComponent, deployedLastModified));
    
-      if (!deployedSet.contains(component))
+      if (!deployedSet.containsKey(component))
       {
-         deployedSet.add(component);
+         deployedSet.put(component, deployment.getName());
       }
    }
    
@@ -657,12 +560,9 @@
          {
             log.trace("Undeploying: " + component);
          }
-         deployedSet.remove(component);         
-         URL componentUrl = component.toURL();
+         String name = deployedSet.remove(component);         
          Profile profile = ps.getProfile(profileKey);
-         // TODO: this is wasteful. Need a way to query the profile for a deployment URL?
-         Deployment deployment = mainDeployer.parse(componentUrl);
-         profile.removeDeployment(deployment.getName());
+         profile.removeDeployment(name);
       }
       catch (Exception e)
       {
@@ -674,9 +574,9 @@
     * Helper to get the watchURL for a deployment, if different.
     * Returns null otherwise
     */
-   private String getWatchURL(Deployment deployment)
+   private String getWatchURL(DeploymentContext deployment)
    {
-      String watchPath = (String) deployment.getRootContext().getContextData().get("");
+      String watchPath = (String) deployment.getPredeterminedManagedObjects().getAttachment("WATCH_URL");
       return watchPath;
    }
 
@@ -684,7 +584,7 @@
     * Helper to find out if a deployed component has been modified
     * TODO: How should this be implemented
     */
-   public boolean isModified(VirtualFile component)
+   public boolean isModified(VirtualFile component) throws IOException
    {
       // get the context stored with every deployed component
       ComponentContext cc = null; //(ComponentContext)component.getContext();
@@ -703,14 +603,8 @@
    private VirtualFile getVFforURI(URI uri)
       throws IOException
    {
-      VirtualFile vf = null;
-      if (factory != null)
-      {
-         URL rootURL = uri.toURL();
-         ReadOnlyVFS vfs = factory.getVFS(rootURL);
-         vf = vfs.resolveFile("");
-      }
-      return vf;
+      VFS vfs = VFS.getVFS(uri);
+      return vfs.getRoot();
    }
 
    /**
@@ -728,5 +622,4 @@
          this.deployedLastModified = deployedLastModified;
       }
    }
-
 }

Modified: branches/MC_VDF_WORK/system/src/tests/org/jboss/test/profileservice/simple1/DeploymentImpl.java
===================================================================
--- branches/MC_VDF_WORK/system/src/tests/org/jboss/test/profileservice/simple1/DeploymentImpl.java	2006-09-13 14:01:27 UTC (rev 56796)
+++ branches/MC_VDF_WORK/system/src/tests/org/jboss/test/profileservice/simple1/DeploymentImpl.java	2006-09-13 14:31:25 UTC (rev 56797)
@@ -25,8 +25,6 @@
 import java.net.URL;
 import java.util.Set;
 
-import org.jboss.deployers.spi.Deployment;
-import org.jboss.deployers.spi.DeploymentContext;
 import org.jboss.deployers.spi.management.ManagedObject;
 
 /**
@@ -36,7 +34,7 @@
  * @version $Revision$
  */
 public class DeploymentImpl
-   implements Deployment
+   /* implements Deployment TODO */
 {
    private String type;
    private String name;
@@ -88,11 +86,13 @@
    {
       return managedObject;
    }
+   /* TODO
    public DeploymentContext getRootContext()
    {
       // TODO Auto-generated method stub
       return null;
    }
+   */
    public Set<String> getTypes()
    {
       // TODO Auto-generated method stub

Modified: branches/MC_VDF_WORK/system/src/tests/org/jboss/test/profileservice/simple1/ManagementViewImpl.java
===================================================================
--- branches/MC_VDF_WORK/system/src/tests/org/jboss/test/profileservice/simple1/ManagementViewImpl.java	2006-09-13 14:01:27 UTC (rev 56796)
+++ branches/MC_VDF_WORK/system/src/tests/org/jboss/test/profileservice/simple1/ManagementViewImpl.java	2006-09-13 14:31:25 UTC (rev 56797)
@@ -25,9 +25,9 @@
 import java.io.IOException;
 import java.util.HashMap;
 
-import org.jboss.deployers.spi.Deployment;
 import org.jboss.deployers.spi.management.ManagementView;
 import org.jboss.deployers.spi.management.ManagedObject;
+import org.jboss.deployers.spi.structure.DeploymentContext;
 import org.jboss.profileservice.spi.NoSuchDeploymentException;
 import org.jboss.profileservice.spi.Profile;
 import org.jboss.profileservice.spi.ProfileKey;
@@ -53,9 +53,10 @@
       throws NoSuchProfileException, NoSuchDeploymentException
    {
       Profile profile = ps.getProfile(key);
-      Deployment d = profile.getDeployment(deploymentName);
-      ManagedObject mo = d.getManagedObject();
-      return mo;
+      DeploymentContext d = profile.getDeployment(deploymentName);
+      /** TODO ManagedObject mo = d.getManagedObject();
+      return mo; */
+      return null;
    }
 
    public void setView(ProfileKey key, String deploymentName, HashMap<String, PropertyInfo> view)

Modified: branches/MC_VDF_WORK/system/src/tests/org/jboss/test/profileservice/simple1/ProfileImpl.java
===================================================================
--- branches/MC_VDF_WORK/system/src/tests/org/jboss/test/profileservice/simple1/ProfileImpl.java	2006-09-13 14:01:27 UTC (rev 56796)
+++ branches/MC_VDF_WORK/system/src/tests/org/jboss/test/profileservice/simple1/ProfileImpl.java	2006-09-13 14:31:25 UTC (rev 56797)
@@ -25,6 +25,8 @@
 import java.io.IOException;
 import java.net.URL;
 import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Map;
@@ -34,10 +36,10 @@
 import org.jboss.beans.metadata.plugins.AbstractPropertyMetaData;
 import org.jboss.beans.metadata.spi.BeanMetaData;
 import org.jboss.beans.metadata.spi.DemandMetaData;
+import org.jboss.deployers.spi.structure.DeploymentContext;
 import org.jboss.profileservice.spi.NoSuchDeploymentException;
 import org.jboss.profileservice.spi.Profile;
 import org.jboss.profileservice.spi.DeploymentTemplate;
-import org.jboss.deployers.spi.Deployment;
 
 /**
  * A test profile with a fixed default deployment. The contents of the
@@ -49,11 +51,11 @@
 public class ProfileImpl
    implements Profile
 {
-   private HashMap<String, Deployment> deployments;
+   private HashMap<String, DeploymentContext> deployments;
 
    public ProfileImpl() throws IOException
    {
-      deployments = new HashMap<String, Deployment>();
+      deployments = new HashMap<String, DeploymentContext>();
       String deployDir = SecurityActions.getSystemProperty("jbosstest.deploy.dir");
       URL libURL;
       if( deployDir == null )
@@ -67,11 +69,11 @@
          libURL = new URL(deployDir);
       }
 
-      DeploymentImpl p0 = new DeploymentImpl();
+      /* TODO DeploymentImpl p0 = new DeploymentImpl();
       p0.setName("CoreServices");
       p0.setRootURL(libURL);
       String[] files = {"p0.jar"};
-      p0.setFiles(files);
+      p0.setFiles(files); */
       /*
       ArrayList<DeploymentBean> beans = new ArrayList<DeploymentBean>();
       // NamingService
@@ -103,7 +105,7 @@
       jca.setBeanMetaData(jcaMetaData);
       beans.add(jca);
       */
-      deployments.put("CoreServices", p0);
+      /* TODO deployments.put("CoreServices", p0); */
    }
 
    public String getVersion()
@@ -116,7 +118,7 @@
       return null;
    }
 
-   public void addDeployment(Deployment d)
+   public void addDeployment(DeploymentContext d)
    {
       throw new UnsupportedOperationException("simple1 is read-only");
    }
@@ -126,11 +128,9 @@
       throw new UnsupportedOperationException("simple1 is read-only");
    }
 
-   public Deployment[] getDeployments()
+   public Collection<DeploymentContext> getDeployments()
    {
-      Deployment[] tmp = new Deployment[deployments.size()];
-      deployments.values().toArray(tmp);
-      return tmp;
+      return Collections.unmodifiableCollection(deployments.values());
    }
 
    public Map<String, Object> getConfig()
@@ -138,10 +138,10 @@
       return null;
    }
 
-   public Deployment getDeployment(String name)
+   public DeploymentContext getDeployment(String name)
       throws NoSuchDeploymentException
    {
-      Deployment d = deployments.get(name);
+      DeploymentContext d = deployments.get(name);
       if( d == null )
          throw new NoSuchDeploymentException(name);
       return d;

Modified: branches/MC_VDF_WORK/system/src/tests/org/jboss/test/profileservice/simple1/ProfileImpl2.java
===================================================================
--- branches/MC_VDF_WORK/system/src/tests/org/jboss/test/profileservice/simple1/ProfileImpl2.java	2006-09-13 14:01:27 UTC (rev 56796)
+++ branches/MC_VDF_WORK/system/src/tests/org/jboss/test/profileservice/simple1/ProfileImpl2.java	2006-09-13 14:31:25 UTC (rev 56797)
@@ -1,17 +1,20 @@
 package org.jboss.test.profileservice.simple1;
 
-import org.jboss.beans.metadata.plugins.AbstractBeanMetaData;
-import org.jboss.beans.metadata.spi.BeanMetaData;
-import org.jboss.profileservice.spi.*;
-import org.jboss.deployers.spi.Deployment;
-import org.jboss.deployers.spi.management.ManagedObject;
-
+import java.io.IOException;
+import java.net.URL;
+import java.util.Collection;
+import java.util.Collections;
 import java.util.HashMap;
-import java.util.ArrayList;
 import java.util.Map;
-import java.io.IOException;
-import java.net.URL;
 
+import org.jboss.deployers.spi.management.ManagedObject;
+import org.jboss.deployers.spi.structure.DeploymentContext;
+import org.jboss.profileservice.spi.DeploymentTemplate;
+import org.jboss.profileservice.spi.NoSuchDeploymentException;
+import org.jboss.profileservice.spi.Profile;
+import org.jboss.profileservice.spi.PropertyInfo;
+import org.jboss.profileservice.spi.SimpleType;
+
 /**
  * A test profile for deploying pretend Datasources
  *
@@ -21,11 +24,11 @@
 public class ProfileImpl2
    implements Profile
 {
-   private HashMap<String, Deployment> deployments;
+   private HashMap<String, DeploymentContext> deployments;
 
    public ProfileImpl2() throws IOException
    {
-      deployments = new HashMap<String, Deployment>();
+      deployments = new HashMap<String, DeploymentContext>();
       String deployDir = SecurityActions.getSystemProperty("jbosstest.deploy.dir");
       URL libURL;
       if( deployDir == null )
@@ -219,8 +222,10 @@
 
       // how can we differentiate between the ManagedObject create above, for a LocalTxDataSource,
       // and the one in use now, for a NoTxDataSource?
+      /* TODO
       p1.setManagedObject(notxDataSource);
       deployments.put(p1.getName(), p1);
+      */
    }
 
    public String getVersion()
@@ -233,7 +238,7 @@
       return null;
    }
 
-   public void addDeployment(Deployment d)
+   public void addDeployment(DeploymentContext d)
    {
       throw new UnsupportedOperationException("simple1 is read-only");
    }
@@ -243,11 +248,9 @@
       throw new UnsupportedOperationException("simple1 is read-only");
    }
 
-   public Deployment[] getDeployments()
+   public Collection<DeploymentContext> getDeployments()
    {
-      Deployment[] tmp = new Deployment[deployments.size()];
-      deployments.values().toArray(tmp);
-      return tmp;
+      return Collections.unmodifiableCollection(deployments.values());
    }
 
    public Map<String, Object> getConfig()
@@ -255,10 +258,10 @@
       return null;
    }
 
-   public Deployment getDeployment(String name)
+   public DeploymentContext getDeployment(String name)
       throws NoSuchDeploymentException
    {
-      Deployment d = deployments.get(name);
+      DeploymentContext d = deployments.get(name);
       if( d == null )
          throw new NoSuchDeploymentException(name);
       return d;

Modified: branches/MC_VDF_WORK/system/src/tests/org/jboss/test/profileservice/support/Simple1PSBootstrap.java
===================================================================
--- branches/MC_VDF_WORK/system/src/tests/org/jboss/test/profileservice/support/Simple1PSBootstrap.java	2006-09-13 14:01:27 UTC (rev 56796)
+++ branches/MC_VDF_WORK/system/src/tests/org/jboss/test/profileservice/support/Simple1PSBootstrap.java	2006-09-13 14:31:25 UTC (rev 56797)
@@ -25,7 +25,6 @@
 import java.io.IOException;
 import java.net.URL;
 
-import org.jboss.deployers.spi.Deployment;
 import org.jboss.profileservice.spi.Profile;
 import org.jboss.profileservice.spi.ProfileKey;
 import org.jboss.profileservice.spi.ProfileService;
@@ -74,6 +73,7 @@
       // Load the named profile
       ProfileKey key = new ProfileKey(name);
       Profile profile = profileService.getProfile(key);
+      /* TODO 
       Deployment[] profileDeployments = profile.getDeployments();
       for(Deployment d : profileDeployments)
       {
@@ -90,6 +90,7 @@
          AbstractClassLoaderMetaData clMD = new AbstractClassLoaderMetaData();
          AbstractValueMetaData value = new AbstractValueMetaData(cl);
          clMD.setClassLoader(value);
+         */
          /*
          DeploymentBean<BeanMetaData>[] beans = d.getBeans();
          ArrayList<BeanMetaData> beanFactories = new ArrayList<BeanMetaData>();
@@ -105,8 +106,10 @@
          kernelDeployment.setBeans(beanFactories); // TODO ????
          */
 
+      /* TODO
          deployer.deploy(kernelDeployment);
       }
+      */
 
    }
 

Modified: branches/MC_VDF_WORK/system/src/tests/org/jboss/test/server/profileservice/MainTestCase.java
===================================================================
--- branches/MC_VDF_WORK/system/src/tests/org/jboss/test/server/profileservice/MainTestCase.java	2006-09-13 14:01:27 UTC (rev 56796)
+++ branches/MC_VDF_WORK/system/src/tests/org/jboss/test/server/profileservice/MainTestCase.java	2006-09-13 14:31:25 UTC (rev 56797)
@@ -24,8 +24,8 @@
 import java.net.URL;
 import java.util.ArrayList;
 
-import org.jboss.deployers.spi.Deployment;
-import org.jboss.deployers.spi.MainDeployer;
+import org.jboss.deployers.spi.deployment.MainDeployer;
+import org.jboss.deployers.spi.structure.DeploymentContext;
 import org.jboss.profileservice.spi.Profile;
 import org.jboss.profileservice.spi.ProfileKey;
 import org.jboss.profileservice.spi.ProfileService;
@@ -59,21 +59,21 @@
       ProfileService ps = psb.getProfileService();
       ProfileKey defaultKey = new ProfileKey("default");
       Profile profile = ps.getProfile(defaultKey);
-      Deployment testBeans = profile.getDeployment("test-beans.xml");
+      DeploymentContext testBeans = profile.getDeployment("test-beans.xml");
       if( testBeans == null )
       {
          if( profile == null )
             profile = ps.newProfile(defaultKey);
          MainDeployer deployer = psb.getMainDeployer();
          URL testBeansURL = getResource("test-beans.xml");
-         testBeans = deployer.parse(testBeansURL);
+         // TODO testBeans = deployer.parse(testBeansURL);
          profile.addDeployment(testBeans);
       }
       // Validate the deployment
       testBeans = profile.getDeployment("test-beans.xml");
       assertNotNull(testBeans);
-      String type = testBeans.getType();
-      assertEquals("Deployment type is beans", "beans", type);
+      // TODO String type = testBeans.getType();
+      // assertEquals("Deployment type is beans", "beans", type);
       
    }
 

Modified: branches/MC_VDF_WORK/system/src/tests/org/jboss/test/server/profileservice/MainWithSimpleHotDeployTestCase.java
===================================================================
--- branches/MC_VDF_WORK/system/src/tests/org/jboss/test/server/profileservice/MainWithSimpleHotDeployTestCase.java	2006-09-13 14:01:27 UTC (rev 56796)
+++ branches/MC_VDF_WORK/system/src/tests/org/jboss/test/server/profileservice/MainWithSimpleHotDeployTestCase.java	2006-09-13 14:31:25 UTC (rev 56797)
@@ -23,15 +23,14 @@
 
 import java.security.CodeSource;
 
+import org.jboss.Main;
 import org.jboss.dependency.spi.ControllerState;
-import org.jboss.deployment.scanner.VFSDeploymentScanner;
 import org.jboss.kernel.Kernel;
 import org.jboss.kernel.spi.registry.KernelRegistry;
 import org.jboss.kernel.spi.registry.KernelRegistryEntry;
 import org.jboss.system.server.Server;
 import org.jboss.system.server.profileservice.ServerImpl;
 import org.jboss.test.BaseTestCase;
-import org.jboss.Main;
 
 /**
  * Test of the jboss main loading a bootstrap configuration via the ProfileService
@@ -102,14 +101,14 @@
       assertInstalled(kernel, "VFSDeploymentScanner");
       KernelRegistry registry = kernel.getRegistry();
       KernelRegistryEntry entry = registry.getEntry("VFSDeploymentScanner");
-      VFSDeploymentScanner scanner = (VFSDeploymentScanner) entry.getTarget();
-      // Wait for a deployment scan
+      /** TODO DeploymentScanner scanner = (DeploymentScanner) entry.getTarget();
       synchronized( scanner )
       {
          while( scanner.getScanCount() <= 0 )
             scanner.wait(10000);
       }
       log.info("Notified of scan: "+scanner.getScanCount());
+      */
 
       // Expected hot deployments
       assertInstalled(kernel, "VFSClassLoader");

Modified: branches/MC_VDF_WORK/system-jmx/src/main/org/jboss/system/server/jmx/JMXKernel.java
===================================================================
--- branches/MC_VDF_WORK/system-jmx/src/main/org/jboss/system/server/jmx/JMXKernel.java	2006-09-13 14:01:27 UTC (rev 56796)
+++ branches/MC_VDF_WORK/system-jmx/src/main/org/jboss/system/server/jmx/JMXKernel.java	2006-09-13 14:31:25 UTC (rev 56797)
@@ -41,6 +41,7 @@
 import javax.management.ObjectInstance;
 import javax.management.ObjectName;
 
+import org.jboss.kernel.Kernel;
 import org.jboss.kernel.spi.dependency.KernelControllerContext;
 import org.jboss.kernel.spi.dependency.KernelControllerContextAware;
 import org.jboss.logging.JBossJDKLogManager;
@@ -68,19 +69,19 @@
  * @version $Revision:$
  */
 public class JMXKernel extends JBossObject
-   implements JMXKernelMBean, KernelControllerContextAware
+   implements JMXKernelMBean
 {
    private final static ObjectName DEFAULT_LOADER_NAME =
       ObjectNameFactory.create(ServerConstants.DEFAULT_LOADER_NAME);
 
-   /** The MC kernel context */
-   protected KernelControllerContext kernelContext;
    /** The JMX MBeanServer which will serve as our communication bus. */
    private MBeanServer mbeanServer;
    private Server serverImpl;
    private ServiceController controller;
    private ServerConfig serverConfig;
    private ServerConfigImplMBean serverConfigMBean;
+   /** The kernel */
+   private Kernel kernel;
    /** The NotificationBroadcaster implementation delegate */
    private JBossNotificationBroadcasterSupport broadcasterSupport;
    
@@ -108,6 +109,16 @@
       return mbeanServer;
    }
 
+   /**
+    * Set the kernel.
+    * 
+    * @param kernel the kernel.
+    */
+   public void setKernel(Kernel kernel)
+   {
+      this.kernel = kernel;
+   }
+   
    public void start() throws Exception
    {
       long start = System.currentTimeMillis();
@@ -165,7 +176,7 @@
    
          // Service Controller
          controller = new ServiceController();
-         controller.setKernel(kernelContext.getKernel());
+         controller.setKernel(kernel);
          controller.setMBeanServer(mbeanServer);
          mbeanServer.registerMBean(controller, new ObjectName("jboss.system:service=ServiceController"));
    
@@ -242,20 +253,6 @@
       broadcasterSupport.sendNotification(notification);
    }
 
-   // KernelControllerContextAware implements -----------------------------
-   public void setKernelControllerContext(KernelControllerContext kernelContext)
-      throws Exception
-   {
-      log.debug("Setting kernel kernelContext " + kernelContext);
-      this.kernelContext = kernelContext;
-   }
-   
-   public void unsetKernelControllerContext(KernelControllerContext kernelContext) throws Exception
-   {
-      log.debug("Unsetting kernel kernelContext " + kernelContext);
-      this.kernelContext = null;
-   }
-
    // ServerImplMBean delegation
    public void init(Properties props) throws Exception
    {




More information about the jboss-cvs-commits mailing list