geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdil...@apache.org
Subject svn commit: r428840 - in /geronimo/sandbox/svkmerge/m2migration/modules/kernel/src: ./ java/org/apache/geronimo/kernel/config/SimpleConfigurationManager.java
Date Fri, 04 Aug 2006 18:38:08 GMT
Author: jdillon
Date: Fri Aug  4 11:38:07 2006
New Revision: 428840

URL: http://svn.apache.org/viewvc?rev=428840&view=rev
Log:
 r639@jason-dillons-computer (orig r428809):  jdillon | 2006-08-04 11:15:28 -0700
  r635@jason-dillons-computer (orig r428535):  ammulder | 2006-08-03 14:36:04 -0700
  Merge fixes for GERONIMO-2269 and GERONIMO-2270 to trunk.
  May want to rethink these as part of subsequent refactoring efforts,
    but better to not have the bugs for now.
  
 

Modified:
    geronimo/sandbox/svkmerge/m2migration/modules/kernel/src/   (props changed)
    geronimo/sandbox/svkmerge/m2migration/modules/kernel/src/java/org/apache/geronimo/kernel/config/SimpleConfigurationManager.java

Propchange: geronimo/sandbox/svkmerge/m2migration/modules/kernel/src/
------------------------------------------------------------------------------
--- svk:merge (original)
+++ svk:merge Fri Aug  4 11:38:07 2006
@@ -1 +1 @@
-13f79535-47bb-0310-9956-ffa450edef68:/geronimo/sandbox/svkmerge/trunk/modules/kernel/src:428807
+13f79535-47bb-0310-9956-ffa450edef68:/geronimo/sandbox/svkmerge/trunk/modules/kernel/src:428809

Modified: geronimo/sandbox/svkmerge/m2migration/modules/kernel/src/java/org/apache/geronimo/kernel/config/SimpleConfigurationManager.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/svkmerge/m2migration/modules/kernel/src/java/org/apache/geronimo/kernel/config/SimpleConfigurationManager.java?rev=428840&r1=428839&r2=428840&view=diff
==============================================================================
--- geronimo/sandbox/svkmerge/m2migration/modules/kernel/src/java/org/apache/geronimo/kernel/config/SimpleConfigurationManager.java
(original)
+++ geronimo/sandbox/svkmerge/m2migration/modules/kernel/src/java/org/apache/geronimo/kernel/config/SimpleConfigurationManager.java
Fri Aug  4 11:38:07 2006
@@ -53,6 +53,15 @@
     protected final Collection repositories;
     protected final Collection watchers;
 
+    /**
+     * When this is not null, it points to the "new" configuration that is
+     * part of an in-process reload operation.  This configuration will
+     * definitely be loaded, but might not be started yet.  It shold never be
+     * populated outside the scope of a reload operation.
+     */
+    private Configuration reloadingConfiguration;
+
+
     public SimpleConfigurationManager(Collection stores, ArtifactResolver artifactResolver,
Collection repositories) {
         this(stores, artifactResolver, repositories, Collections.EMPTY_SET);
     }
@@ -86,6 +95,9 @@
         if(!configId.isResolved()) {
             throw new IllegalArgumentException("Artifact "+configId+" is not fully resolved");
         }
+        if(reloadingConfiguration != null && reloadingConfiguration.getId().equals(configId))
{
+            return true;
+        }
         return configurationModel.isLoaded(configId);
     }
 
@@ -228,6 +240,9 @@
         if(!configurationId.isResolved()) {
             throw new IllegalArgumentException("Artifact "+configurationId+" is not fully
resolved");
         }
+        if(reloadingConfiguration != null && reloadingConfiguration.getId().equals(configurationId))
{
+            return reloadingConfiguration;
+        }
         return (Configuration) configurations.get(configurationId);
     }
 
@@ -769,11 +784,11 @@
         }
     }
 
-    public LifecycleResults reloadConfiguration(ConfigurationData configurationData) throws
LifecycleException, NoSuchConfigException {
+    public synchronized LifecycleResults reloadConfiguration(ConfigurationData configurationData)
throws LifecycleException, NoSuchConfigException {
         return reloadConfiguration(configurationData, NullLifecycleMonitor.INSTANCE);
     }
 
-    public LifecycleResults reloadConfiguration(ConfigurationData configurationData, LifecycleMonitor
monitor) throws LifecycleException, NoSuchConfigException {
+    public synchronized LifecycleResults reloadConfiguration(ConfigurationData configurationData,
LifecycleMonitor monitor) throws LifecycleException, NoSuchConfigException {
         Configuration configuration = getConfiguration(configurationData.getId());
         if (configuration == null) {
             throw new NoSuchConfigException(configurationData.getId());
@@ -942,6 +957,7 @@
 
                     if (configurationId.equals(newConfigurationId)) {
                         newConfiguration = configuration;
+                        reloadingConfiguration = configuration;
                     } else {
                         loadedParents.put(configurationId, configuration);
                     }
@@ -1049,7 +1065,7 @@
                     configuration = load(existingUnloadedConfiguration.getConfigurationData(),
                             existingUnloadedConfiguration.getResolvedParentIds(),
                             Collections.EMPTY_MAP);
-
+                    reloadingConfiguration = configuration;
                     // if the configuration was started before restart it
                     if (started.contains(existingConfigurationId)) {
                         start(configuration);
@@ -1081,6 +1097,8 @@
 
                     throw new LifecycleException("reload", newConfigurationId, results);
                 }
+            } finally {
+                reloadingConfiguration = null;
             }
         }
 
@@ -1113,6 +1131,7 @@
                 if (resolvedParentIds != null) {
                     monitor.loading(configurationId);
                     configuration = load(unloadedConfiguration.getConfigurationData(), resolvedParentIds,
Collections.EMPTY_MAP);
+                    reloadingConfiguration = configuration;
                     monitor.succeeded(configurationId);
 
 
@@ -1163,6 +1182,8 @@
 
                     skip.add(failedId);
                 }
+            } finally {
+                reloadingConfiguration = null;
             }
         }
 



Mime
View raw message