You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by ga...@apache.org on 2008/01/28 19:41:49 UTC

svn commit: r615985 - /geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/ConfigurationUtil.java

Author: gawor
Date: Mon Jan 28 10:41:48 2008
New Revision: 615985

URL: http://svn.apache.org/viewvc?rev=615985&view=rev
Log:
figure out bootDirectory only when needed (GERONIMO-3789)

Modified:
    geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/ConfigurationUtil.java

Modified: geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/ConfigurationUtil.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/ConfigurationUtil.java?rev=615985&r1=615984&r2=615985&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/ConfigurationUtil.java (original)
+++ geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/ConfigurationUtil.java Mon Jan 28 10:41:48 2008
@@ -90,9 +90,9 @@
         configurationMarshaler = marshaler;
     }
     
-    private static final File bootDirectory;
+    private static File bootDirectory;
 
-    static {
+    private static File getStartupDirectory() {
         // guess from the location of the jar
         URL url = ConfigurationUtil.class.getClassLoader().getResource("META-INF/startup-jar");
 
@@ -110,9 +110,17 @@
         } else {
             log.error("Cound not determine the installation directory of Apache Geronimo, because the startup jar could not be found in the current class loader.");
         }
-        bootDirectory = directory;
+        
+        return directory;
     }
-
+    
+    private static File getBootDirectory() {
+        if (bootDirectory == null) {
+            bootDirectory = getStartupDirectory();
+        }        
+        return bootDirectory;
+    }
+    
     public static ConfigurationMarshaler createConfigurationMarshaler(String marshalerClass) throws Exception {
         ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
         Class clazz = null;
@@ -178,7 +186,7 @@
         ArtifactResolver artifactResolver = null;
         if (enableBootRepo) {
             String repository = System.getProperty("Xorg.apache.geronimo.repository.boot.path", "repository");
-            Maven2Repository bootRepository = new Maven2Repository(new File(bootDirectory, repository));
+            Maven2Repository bootRepository = new Maven2Repository(new File(getBootDirectory(), repository));
             repositories = Collections.singleton(bootRepository);
             artifactResolver = new DefaultArtifactResolver(new DefaultArtifactManager(), bootRepository);
         } else {