[jboss-cvs] JBossAS SVN: r59638 - trunk/system/src/main/org/jboss/system/server/profileservice/repository.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Mon Jan 15 00:58:47 EST 2007


Author: scott.stark at jboss.org
Date: 2007-01-15 00:58:45 -0500 (Mon, 15 Jan 2007)
New Revision: 59638

Modified:
   trunk/system/src/main/org/jboss/system/server/profileservice/repository/SerializableDeploymentRepository.java
Log:
Hack around needing to load conf/jboss-serivce.xml rather than a bootstrap dir.

Modified: trunk/system/src/main/org/jboss/system/server/profileservice/repository/SerializableDeploymentRepository.java
===================================================================
--- trunk/system/src/main/org/jboss/system/server/profileservice/repository/SerializableDeploymentRepository.java	2007-01-15 05:34:13 UTC (rev 59637)
+++ trunk/system/src/main/org/jboss/system/server/profileservice/repository/SerializableDeploymentRepository.java	2007-01-15 05:58:45 UTC (rev 59638)
@@ -354,7 +354,11 @@
       // server/{name}/bootstrap
       bootstrapDir = new File(profileRoot, "bootstrap");
       if( bootstrapDir.exists() == false )
-         throw new FileNotFoundException("Profile contains no bootstrap dir: "+bootstrapDir);
+      {
+         //throw new FileNotFoundException("Profile contains no bootstrap dir: "+bootstrapDir);
+         // fallback to conf/jboss-service.xml for now
+         bootstrapDir = null;
+      }
 
       // server/{name}/deployers
       deployersDir = new File(profileRoot, "deployers");
@@ -368,8 +372,16 @@
 
       adminEditsRoot = new File(profileRoot, "profile/edits");
 
-      VFS bootstrapVFS = VFS.getVFS(bootstrapDir.toURI());
-      loadBootstraps(bootstrapVFS.getRoot());
+      if( bootstrapDir != null )
+      {
+         VFS bootstrapVFS = VFS.getVFS(bootstrapDir.toURI());
+         loadBootstraps(bootstrapVFS.getRoot());
+      }
+      else
+      {
+         // hack to load conf/jboss-service.xml until its removed
+         loadBootstraps(null);         
+      }
       VFS deployersVFS = VFS.getVFS(deployersDir.toURI());
       loadDeployers(deployersVFS.getRoot());
       VFS deployVFS = VFS.getVFS(applicationDir.toURI());
@@ -569,12 +581,25 @@
    private void loadBootstraps(VirtualFile bootstrapDir)
       throws IOException
    {
-      List<VirtualFile> children = bootstrapDir.getChildren();
-      for(VirtualFile vf : children)
+      if( bootstrapDir != null )
       {
-         DeploymentContext vfCtx = loadDeploymentData(vf);
-         bootstrapCtxs.put(vf.getPathName(), vfCtx);       
+         List<VirtualFile> children = bootstrapDir.getChildren();
+         for(VirtualFile vf : children)
+         {
+            DeploymentContext vfCtx = loadDeploymentData(vf);
+            bootstrapCtxs.put(vf.getPathName(), vfCtx);       
+         }
       }
+      else
+      {
+         // fallback to conf/jboss-service.xml for now
+         File profileRoot = new File(root, key.getName());
+         File confDir = new File(profileRoot, "conf");
+         VirtualFile confVF = VFS.getRoot(confDir.toURI());
+         VirtualFile jbossServiceVF = confVF.findChild("jboss-service.xml");
+         DeploymentContext vfCtx = loadDeploymentData(jbossServiceVF);
+         bootstrapCtxs.put(jbossServiceVF.getPathName(), vfCtx);                
+      }
    }
 
    /**




More information about the jboss-cvs-commits mailing list