[Jboss-cvs] JBossAS SVN: r56839 - in branches/MC_VDF_WORK: system system/src/main/org/jboss/system/server/profileservice system-jmx/src/main/org/jboss/system/deployers

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Sep 14 06:22:54 EDT 2006


Author: adrian at jboss.org
Date: 2006-09-14 06:22:43 -0400 (Thu, 14 Sep 2006)
New Revision: 56839

Added:
   branches/MC_VDF_WORK/system-jmx/src/main/org/jboss/system/deployers/SARArchiveFilter.java
Modified:
   branches/MC_VDF_WORK/system-jmx/src/main/org/jboss/system/deployers/SARDeployer.java
   branches/MC_VDF_WORK/system-jmx/src/main/org/jboss/system/deployers/ServiceClassLoaderDeployer.java
   branches/MC_VDF_WORK/system-jmx/src/main/org/jboss/system/deployers/ServiceDeployer.java
   branches/MC_VDF_WORK/system-jmx/src/main/org/jboss/system/deployers/ServiceDeployment.java
   branches/MC_VDF_WORK/system/build.xml
   branches/MC_VDF_WORK/system/src/main/org/jboss/system/server/profileservice/ServerImpl.java
Log:
[JBMICROCONT-5] - Working version of service classloaders.
Minimal now boots. Although there is an NPE from the UCL at shutdown.

Modified: branches/MC_VDF_WORK/system/build.xml
===================================================================
--- branches/MC_VDF_WORK/system/build.xml	2006-09-14 10:20:27 UTC (rev 56838)
+++ branches/MC_VDF_WORK/system/build.xml	2006-09-14 10:22:43 UTC (rev 56839)
@@ -162,6 +162,10 @@
         <include name="dtd/**"/>
       </fileset>
     </jar>
+
+    <jar jarfile="${build.lib}/${jar.client.name}" manifest="${build.etc}/default.mf">
+       <fileset dir="${build.classes}" includes="${jar.client.includes}"/>
+    </jar>
     
     <!-- Build jboss-boot.jar -->
     <jar jarfile="${build.lib}/jboss-boot.jar" manifest="${build.etc}/default.mf">

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-14 10:20:27 UTC (rev 56838)
+++ branches/MC_VDF_WORK/system/src/main/org/jboss/system/server/profileservice/ServerImpl.java	2006-09-14 10:22:43 UTC (rev 56839)
@@ -150,7 +150,7 @@
       initURLHandlers();
       config.initURLs();
 
-      log.info("Starting JBoss (MicroContainer)...");
+      log.info("Starting JBoss (Microcontainer)...");
 
       if (jbossPackage != null)
       {
@@ -358,22 +358,19 @@
       if( deployerBeansPrefix != null )
       {
          bootstrap.setDeployerBeansPrefix(deployerBeansPrefix);
-         log.info("Starting MicroContainer, deployerBeansPrefix="+deployerBeansPrefix);         
+         log.info("Starting Microcontainer, deployerBeansPrefix="+deployerBeansPrefix);         
       }
       else
       {
          URL configURL = config.getServerConfigURL();
          URL bootstrapURL = new URL(configURL, ProfileServiceBootstrap.DEPLOYERS_XML_NAME);
-         log.info("Starting MicroContainer, bootstrapURL="+bootstrapURL);
+         log.info("Starting Microcontainer, bootstrapURL="+bootstrapURL);
          bootstrap.setBootstrapURL(bootstrapURL);
       }
 
-      bootstrap.run();
-
       // Install the shutdown hook
       shutdownHook = new ShutdownHook(bootstrap);
       shutdownHook.setDaemon(true);
-
       try
       {
          Runtime.getRuntime().addShutdownHook(shutdownHook);
@@ -384,6 +381,8 @@
          log.warn("Failed to add shutdown hook; ignoring", e);
       }
 
+      bootstrap.run();
+
       lifeThread = new LifeThread();
       lifeThread.start();
 
@@ -398,7 +397,7 @@
       if (jbossPackage != null)
       {
          // Tell the world how fast it was =)
-         log.info("JBoss (MicroContainer) [" + jbossPackage.getImplementationVersion() +
+         log.info("JBoss (Microcontainer) [" + jbossPackage.getImplementationVersion() +
                   "] Started in " + watch);
       }
       else
@@ -732,8 +731,8 @@
          log.info("JBoss SHUTDOWN: Undeploying all packages");
          shutdownDeployments();
 
-         log.debug("Shutting down MicroContainer");
-         System.out.println("Shutting down MicroContainer");
+         log.debug("Shutting down Microcontainer");
+         System.out.println("Shutting down Microcontainer");
 
          // Shutdown the core kernel
          shutdownKernel();
@@ -747,7 +746,8 @@
          try
          {
             MainDeployer deployer = bootstrap.getMainDeployer();
-            deployer.shutdown();
+            if (deployer != null)
+               deployer.shutdown();
          }
          catch (Exception e)
          {
@@ -764,7 +764,8 @@
          try
          {
             BasicKernelDeployer deployer = bootstrap.getKernelDeployer();
-            deployer.shutdown();
+            if (deployer != null)
+               deployer.shutdown();
          }
          catch (Exception e)
          {

Added: branches/MC_VDF_WORK/system-jmx/src/main/org/jboss/system/deployers/SARArchiveFilter.java
===================================================================
--- branches/MC_VDF_WORK/system-jmx/src/main/org/jboss/system/deployers/SARArchiveFilter.java	2006-09-14 10:20:27 UTC (rev 56838)
+++ branches/MC_VDF_WORK/system-jmx/src/main/org/jboss/system/deployers/SARArchiveFilter.java	2006-09-14 10:22:43 UTC (rev 56839)
@@ -0,0 +1,72 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, 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.system.deployers;
+
+import java.util.HashSet;
+import java.util.Set;
+import java.util.StringTokenizer;
+
+import org.jboss.virtual.VirtualFile;
+import org.jboss.virtual.VirtualFileFilter;
+
+/**
+ * SARArchiveFilter.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class SARArchiveFilter implements VirtualFileFilter
+{
+   /** The patterns */
+   private final Set<String> patterns;
+   
+   /** Whether there is the accept all wildcard */
+   private final boolean allowAll;
+   
+   /**
+    * Create a new SARArchiveFilter.
+    * 
+    * @param patternsString the pattern string
+    * @throws IllegalArgumentException for a null string
+    */
+   public SARArchiveFilter(String patternsString)
+   {
+      if (patternsString == null)
+         throw new IllegalArgumentException("Null patternsString");
+
+      StringTokenizer tokens = new StringTokenizer (patternsString, ",");
+      patterns = new HashSet<String>(tokens.countTokens());
+      for (int i=0; tokens.hasMoreTokens (); ++i)
+      {
+         String token = tokens.nextToken();
+         patterns.add(token.trim());
+      }
+      allowAll = patterns.contains("*");
+   }
+   
+   public boolean accepts(VirtualFile file)
+   {
+      if (allowAll)
+         return true;
+      return patterns.contains(file.getName());
+   }
+}

Modified: branches/MC_VDF_WORK/system-jmx/src/main/org/jboss/system/deployers/SARDeployer.java
===================================================================
--- branches/MC_VDF_WORK/system-jmx/src/main/org/jboss/system/deployers/SARDeployer.java	2006-09-14 10:20:27 UTC (rev 56838)
+++ branches/MC_VDF_WORK/system-jmx/src/main/org/jboss/system/deployers/SARDeployer.java	2006-09-14 10:22:43 UTC (rev 56839)
@@ -22,6 +22,9 @@
 package org.jboss.system.deployers;
 
 import java.io.InputStream;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.List;
 
 import javax.xml.parsers.DocumentBuilder;
 import javax.xml.parsers.DocumentBuilderFactory;
@@ -29,12 +32,18 @@
 import org.jboss.deployers.plugins.deployers.helpers.AbstractParsingDeployer;
 import org.jboss.deployers.spi.DeploymentException;
 import org.jboss.deployers.spi.deployer.DeploymentUnit;
+import org.jboss.deployers.spi.structure.DeploymentContext;
 import org.jboss.mx.loading.LoaderRepositoryFactory;
 import org.jboss.mx.loading.LoaderRepositoryFactory.LoaderRepositoryConfig;
+import org.jboss.system.server.ServerConfig;
+import org.jboss.system.server.ServerConfigLocator;
+import org.jboss.util.StringPropertyReplacer;
 import org.jboss.util.xml.JBossEntityResolver;
+import org.jboss.virtual.VFS;
 import org.jboss.virtual.VirtualFile;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
+import org.w3c.dom.Node;
 import org.w3c.dom.NodeList;
 import org.xml.sax.InputSource;
 
@@ -51,6 +60,9 @@
  */
 public class SARDeployer extends AbstractParsingDeployer<ServiceDeployment>
 {
+   /** Use a namespace aware parser */
+   private boolean useNamespaceAwareParser;
+   
    /**
     * Create a new SARDeployer.
     * 
@@ -66,6 +78,26 @@
       return 1000;
    }
 
+   /**
+    * Get the useNamespaceAwareParser.
+    * 
+    * @return the useNamespaceAwareParser.
+    */
+   public boolean isUseNamespaceAwareParser()
+   {
+      return useNamespaceAwareParser;
+   }
+
+   /**
+    * Set the useNamespaceAwareParser.
+    * 
+    * @param useNamespaceAwareParser the useNamespaceAwareParser.
+    */
+   public void setUseNamespaceAwareParser(boolean useNamespaceAwareParser)
+   {
+      this.useNamespaceAwareParser = useNamespaceAwareParser;
+   }
+
    protected ServiceDeployment parse(DeploymentUnit unit, VirtualFile file) throws Exception
    {
       if (file == null)
@@ -78,15 +110,14 @@
       try
       {
          DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
-         // TODO factory.setNamespaceAware(useNamespaceAwareParser);
+         factory.setNamespaceAware(useNamespaceAwareParser);
          DocumentBuilder parser = factory.newDocumentBuilder();
          InputSource source = new InputSource(is);
          source.setSystemId(parsed.getName());
          parser.setEntityResolver(new JBossEntityResolver());
          Document document = parser.parse(is);
 
-         // In case there is a dependent classpath defined parse it
-         // TODO parseXMLClasspath(di);
+         parseXMLClasspath(unit.getDeploymentContext(), document);
 
          // Check for a custom loader-repository for scoping
          NodeList loaders = document.getElementsByTagName("loader-repository");
@@ -94,7 +125,8 @@
          {
             Element loader = (Element) loaders.item(0);
             LoaderRepositoryConfig config = LoaderRepositoryFactory.parseRepositoryConfig(loader);
-            parsed.setRepositoryInfo(config);
+            if (config != null)
+               unit.addAttachment(LoaderRepositoryConfig.class.getName(), config);
          }
 
          // We can't parse the services yet, because it requires the classloader
@@ -129,4 +161,72 @@
    public void undeploy(DeploymentUnit unit)
    {
    }
+
+   /**
+    * Parse the xml classpath
+    * 
+    * @param context the context
+    * @param document the document
+    * @throws Exception for any error
+    */
+   private void parseXMLClasspath(DeploymentContext context, Document document) throws Exception
+   {
+      ArrayList<VirtualFile> classpath = new ArrayList<VirtualFile>();
+
+      NodeList children = document.getDocumentElement().getChildNodes();
+      for (int i = 0; i < children.getLength(); ++i)
+      {
+         if (children.item(i).getNodeType() == Node.ELEMENT_NODE)
+         {
+            Element classpathElement = (Element)children.item(i);
+            if (classpathElement.getTagName().equals("classpath"))
+            {
+               log.debug("Found classpath element: " + classpathElement);
+               if (classpathElement.hasAttribute("codebase") == false)
+                  throw new DeploymentException("Invalid classpath element missing codebase: " + classpathElement);
+
+               String codebase = classpathElement.getAttribute("codebase").trim();
+               codebase = StringPropertyReplacer.replaceProperties(codebase);
+
+               String archives = null;
+               if (classpathElement.hasAttribute("archives"))
+               {
+                  archives = classpathElement.getAttribute("archives").trim();
+                  archives = StringPropertyReplacer.replaceProperties(archives);
+                  if ("".equals(archives))
+                     archives = null;
+               }
+
+               log.debug("Processing classpath: " + context.getName() + " codebase=" + codebase + " archives=" + archives);
+               VirtualFile codebaseFile = context.getRoot();
+               if (".".equals(codebase) == false)
+               {
+                  ServerConfig config = ServerConfigLocator.locate();
+                  URL codeBaseURL = new URL(config.getServerHomeURL(), codebase);
+                  codebaseFile = VFS.getVirtualFile(codeBaseURL, "");
+               }
+
+               if (codebaseFile == null)
+                  throw new DeploymentException("Cannot use classpath without a root: " + context.getName());
+
+               if (archives == null)
+               {
+                  classpath.add(codebaseFile);
+                  log.debug("Using codebase as classpath: " + context.getName());
+               }
+               else
+               {
+                  SARArchiveFilter filter = new SARArchiveFilter(archives);
+                  List<VirtualFile> archiveFiles = codebaseFile.getChildren(filter);
+                  classpath.addAll(archiveFiles);
+               }
+            }
+         }
+      }
+
+      List<VirtualFile> origClassPath = context.getClassPath();
+      if (origClassPath != null)
+         classpath.addAll(origClassPath);
+      context.setClassPath(classpath);
+   }
 }

Modified: branches/MC_VDF_WORK/system-jmx/src/main/org/jboss/system/deployers/ServiceClassLoaderDeployer.java
===================================================================
--- branches/MC_VDF_WORK/system-jmx/src/main/org/jboss/system/deployers/ServiceClassLoaderDeployer.java	2006-09-14 10:20:27 UTC (rev 56838)
+++ branches/MC_VDF_WORK/system-jmx/src/main/org/jboss/system/deployers/ServiceClassLoaderDeployer.java	2006-09-14 10:22:43 UTC (rev 56839)
@@ -21,14 +21,23 @@
 */
 package org.jboss.system.deployers;
 
+import java.net.MalformedURLException;
+import java.net.URL;
 import java.util.Set;
 
 import javax.management.MBeanServer;
+import javax.management.ObjectName;
 
-import org.jboss.deployers.plugins.deployers.helpers.AbstractRealDeployer;
+import org.jboss.deployers.plugins.deployers.helpers.AbstractTopLevelClassLoaderDeployer;
+import org.jboss.deployers.plugins.deployers.helpers.ClassPathVisitor;
 import org.jboss.deployers.spi.DeploymentException;
 import org.jboss.deployers.spi.deployer.DeploymentUnit;
+import org.jboss.deployers.spi.structure.DeploymentContext;
+import org.jboss.mx.loading.LoaderRepositoryFactory;
+import org.jboss.mx.loading.RepositoryClassLoader;
+import org.jboss.mx.loading.LoaderRepositoryFactory.LoaderRepositoryConfig;
 import org.jboss.system.ServiceController;
+import org.jboss.virtual.VirtualFile;
 
 /**
  * ServiceClassLoaderDeployer.<p>
@@ -36,11 +45,10 @@
  * This deployer is responsible for creating classloaders for services of
  * type {@link ServiceDeployment}.
  * 
- * TODO make this work
  * @author <a href="adrian at jboss.com">Adrian Brock</a>
  * @version $Revision: 1.1 $
  */
-public class ServiceClassLoaderDeployer extends AbstractRealDeployer<ServiceDeployment>
+public class ServiceClassLoaderDeployer extends AbstractTopLevelClassLoaderDeployer
 {
    /** The service controller */
    private final ServiceController controller;
@@ -53,9 +61,8 @@
     */
    public ServiceClassLoaderDeployer(ServiceController controller)
    {
-      super(ServiceDeployment.class);
       if (controller == null)
-         throw new IllegalArgumentException("Null kernel");
+         throw new IllegalArgumentException("Null controller");
       this.controller = controller;
    }
    
@@ -64,43 +71,130 @@
       return 2000;
    }
 
-   public void deploy(DeploymentUnit unit) throws DeploymentException
+   public ClassLoader createTopLevelClassLoader(DeploymentContext context) throws Exception
    {
       MBeanServer server = controller.getMBeanServer();
-      Set<ServiceDeployment> deployments = getAllMetaData(unit);
-      for (ServiceDeployment deployment : deployments)
+      DeploymentUnit unit = context.getDeploymentUnit();
+      
+      // Try to determine a root url
+      VirtualFile root = context.getRoot();
+      URL url = null;
+      try
       {
-         try
+         if (root != null)
+            url = trimJARURL(root.toURL());
+      }
+      catch (Exception ignored)
+      {
+         log.debug("Unable to get URL for " + context.getName() + " reason=" + ignored);
+      }
+
+      // Check the loader repository config
+      LoaderRepositoryConfig config = unit.getAttachment(LoaderRepositoryConfig.class);
+      if (config == null)
+         config = new LoaderRepositoryConfig();
+      LoaderRepositoryFactory.createLoaderRepository(server, config);
+
+      // Create the classloader
+      Object[] args = { url, url, Boolean.TRUE };
+      String[] sig =  { "java.net.URL", "java.net.URL", "boolean" };
+      RepositoryClassLoader ucl = (RepositoryClassLoader) server.invoke(config.repositoryName, "newClassLoader", args, sig);
+
+      // Add in the classpath
+      try
+      {
+         ClassPathVisitor visitor = new ClassPathVisitor();
+         context.visit(visitor);
+         Set<VirtualFile> classpath = visitor.getClassPath();
+         for (VirtualFile path : classpath)
          {
-            /* TODO Create ClassLoader 
-            ObjectName uclName = di.ucl.getObjectName();
-            if (server.isRegistered(uclName) == false )
-            {
-               log.debug("Registering service UCL="+uclName);
-               server.registerMBean(di.ucl, uclName);
-            }
-            */
+            // TODO Weed duplicates from other deployments
+            if (path != root)
+               ucl.addURL(trimJARURL(path.toURL()));
          }
-         catch (Throwable t)
-         {
-            throw DeploymentException.rethrowAsDeploymentException("Error creating classloader: " + deployment.getName(), t);
-         }
+
+         // Register the classloader with the MBeanServer
+         ObjectName uclName = ucl.getObjectName();
+         if (server.isRegistered(uclName) == false)
+            server.registerMBean(ucl, uclName);
       }
+      catch (Throwable t)
+      {
+         internalRemoveClassLoader(context, ucl);
+         throw DeploymentException.rethrowAsDeploymentException("Error creating classloader: " + context.getName(), t);
+      }
+
+      return ucl;
    }
 
-   public void undeploy(DeploymentUnit unit)
+   public void removeTopLevelClassLoader(DeploymentContext context)
    {
-      Set<ServiceDeployment> deployments = getAllMetaData(unit);
-      for (ServiceDeployment deployment : deployments)
+      RepositoryClassLoader ucl = (RepositoryClassLoader) context.getClassLoader();
+      if (ucl == null)
+         return;
+      internalRemoveClassLoader(context, ucl);
+   }
+   
+   /**
+    * Remove the classloader
+    * 
+    * @param context the deployment context
+    * @param ucl the unified classloader
+    */
+   private void internalRemoveClassLoader(DeploymentContext context, RepositoryClassLoader ucl)
+   {
+      MBeanServer server = controller.getMBeanServer();
+
+      // Remove the classloader from the MBeanServer
+      try
       {
-         try
+         ObjectName uclName = ucl.getObjectName();
+         if (server.isRegistered(uclName) == true )
+            server.unregisterMBean(uclName);
+      }
+      catch (Throwable t)
+      {
+         log.warn("Error unregistering classloader mbean: " + ucl + " for " + context.getName(), t);
+      }
+
+      // Remove the classloader from the loader repository
+      try
+      {
+         ucl.unregister();
+      }
+      catch (Throwable t)
+      {
+         log.warn("Error unregistering ucl: " + ucl + " for " + context.getName(), t);
+      }
+
+      // Remove the loader repository
+      try
+      {
+
+         DeploymentUnit unit = context.getDeploymentUnit();
+         ServiceDeployment deployment = unit.getAttachment(ServiceDeployment.class);
+         if (deployment != null)
          {
-            //TODO remove classloader
+            LoaderRepositoryConfig config = unit.getAttachment(LoaderRepositoryConfig.class);
+            if (config != null)
+               LoaderRepositoryFactory.destroyLoaderRepository(server, config.repositoryName);
          }
-         catch (Throwable t)
-         {
-            log.warn("Error removing classloader:" + deployment.getName(), t);
-         }
       }
+      catch (Throwable t)
+      {
+         log.warn("Error removing classloader from repository: " + ucl + " for " + context.getName(), t);
+      }
    }
+
+   // TODO figure out why this is necessary
+   private URL trimJARURL(URL url) throws MalformedURLException
+   {
+      String temp = url.toString();
+      if (temp.startsWith("jar:") && temp.endsWith("!/"))
+      {
+         temp = temp.substring(4, temp.length()-2);
+         return new URL(temp);
+      }
+      return url;
+   }
 }

Modified: branches/MC_VDF_WORK/system-jmx/src/main/org/jboss/system/deployers/ServiceDeployer.java
===================================================================
--- branches/MC_VDF_WORK/system-jmx/src/main/org/jboss/system/deployers/ServiceDeployer.java	2006-09-14 10:20:27 UTC (rev 56838)
+++ branches/MC_VDF_WORK/system-jmx/src/main/org/jboss/system/deployers/ServiceDeployer.java	2006-09-14 10:22:43 UTC (rev 56839)
@@ -29,6 +29,7 @@
 import org.jboss.deployers.plugins.deployers.helpers.AbstractRealDeployer;
 import org.jboss.deployers.spi.DeploymentException;
 import org.jboss.deployers.spi.deployer.DeploymentUnit;
+import org.jboss.mx.loading.RepositoryClassLoader;
 import org.jboss.system.ServiceController;
 import org.jboss.system.metadata.ServiceMetaData;
 import org.w3c.dom.Element;
@@ -69,6 +70,13 @@
          try
          {
             ObjectName loaderName = deployment.getLoaderName();
+            if (loaderName == null)
+            {
+               ClassLoader cl = unit.getClassLoader();
+               if (cl != null && cl instanceof RepositoryClassLoader)
+                  loaderName = ((RepositoryClassLoader) cl).getObjectName();
+            }
+               
             List<ServiceMetaData> services = deployment.getServices();
             Element config = deployment.getConfig();
             List<ObjectName> names = null;
@@ -93,12 +101,13 @@
                catch (Throwable t)
                {
                   stop(names);
-                  throw t;
+                  destroy(names);
                }
             }
             catch (Throwable t)
             {
-               destroy(names);
+               remove(names);
+               deployment.setServices(null);
             }
          }
          catch (Throwable t)
@@ -120,6 +129,7 @@
          stop(names);
          destroy(names);
          remove(names);
+         deployment.setServices(null);
       }
    }
    
@@ -137,8 +147,9 @@
    
    protected void stop(List<ObjectName> names)
    {
-      for (ObjectName name : names)
+      for (int i = names.size()-1; i >=0 ; --i)
       {
+         ObjectName name = names.get(i);
          try
          {
             controller.stop(name);
@@ -152,8 +163,9 @@
    
    protected void destroy(List<ObjectName> names)
    {
-      for (ObjectName name : names)
+      for (int i = names.size()-1; i >=0 ; --i)
       {
+         ObjectName name = names.get(i);
          try
          {
             controller.destroy(name);
@@ -167,8 +179,9 @@
    
    protected void remove(List<ObjectName> names)
    {
-      for (ObjectName name : names)
+      for (int i = names.size()-1; i >=0 ; --i)
       {
+         ObjectName name = names.get(i);
          try
          {
             controller.remove(name);

Modified: branches/MC_VDF_WORK/system-jmx/src/main/org/jboss/system/deployers/ServiceDeployment.java
===================================================================
--- branches/MC_VDF_WORK/system-jmx/src/main/org/jboss/system/deployers/ServiceDeployment.java	2006-09-14 10:20:27 UTC (rev 56838)
+++ branches/MC_VDF_WORK/system-jmx/src/main/org/jboss/system/deployers/ServiceDeployment.java	2006-09-14 10:22:43 UTC (rev 56839)
@@ -25,7 +25,6 @@
 
 import javax.management.ObjectName;
 
-import org.jboss.mx.loading.LoaderRepositoryFactory.LoaderRepositoryConfig;
 import org.jboss.system.metadata.ServiceMetaData;
 import org.w3c.dom.Element;
 
@@ -49,9 +48,6 @@
    /** The loader object name */
    private ObjectName loaderName;
    
-   /** The repository info */
-   private LoaderRepositoryConfig repositoryInfo;
-   
    /** The config */
    private Element config;
    
@@ -136,26 +132,6 @@
    }
 
    /**
-    * Get the repositoryInfo.
-    * 
-    * @return the repositoryInfo.
-    */
-   public LoaderRepositoryConfig getRepositoryInfo()
-   {
-      return repositoryInfo;
-   }
-
-   /**
-    * Set the repositoryInfo.
-    * 
-    * @param repositoryInfo the repositoryInfo.
-    */
-   public void setRepositoryInfo(LoaderRepositoryConfig repositoryInfo)
-   {
-      this.repositoryInfo = repositoryInfo;
-   }
-
-   /**
     * Get the config.
     * 
     * @return the config.




More information about the jboss-cvs-commits mailing list