geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xuhaih...@apache.org
Subject svn commit: r1081670 - /geronimo/server/trunk/framework/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/Deployer.java
Date Tue, 15 Mar 2011 05:41:13 GMT
Author: xuhaihong
Date: Tue Mar 15 05:41:13 2011
New Revision: 1081670

URL: http://svn.apache.org/viewvc?rev=1081670&view=rev
Log:
Add clean up codes for DeploymentContext

Modified:
    geronimo/server/trunk/framework/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/Deployer.java

Modified: geronimo/server/trunk/framework/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/Deployer.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/Deployer.java?rev=1081670&r1=1081669&r2=1081670&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/Deployer.java
(original)
+++ geronimo/server/trunk/framework/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/Deployer.java
Tue Mar 15 05:41:13 2011
@@ -223,6 +223,8 @@ public class Deployer implements GBeanLi
         JarFile module = getModule(inPlace, moduleFile);
 
         ModuleIDBuilder idBuilder = new ModuleIDBuilder();
+
+        DeploymentContext context = null;
         try {
             Object plan = null;
             ConfigurationBuilder builder = null;
@@ -247,7 +249,7 @@ public class Deployer implements GBeanLi
             ConfigurationStore store = getConfigurationStore(targetConfigurationStore);
 
             // It's our responsibility to close this context, once we're done with it...
-            DeploymentContext context = builder.buildConfiguration(inPlace, configID, plan,
module, stores, artifactResolver, store);
+            context = builder.buildConfiguration(inPlace, configID, plan, module, stores,
artifactResolver, store);
             // Copy the external plan to the META-INF folder with the uniform name plan.xml
if there is nothing there already
             if (planFile != null && !context.getTargetFile(PLAN_LOCATION).exists())
{
                 context.addFile(PLAN_LOCATION, planFile);
@@ -274,6 +276,14 @@ public class Deployer implements GBeanLi
 //                targetFile.delete();
 //            }
 
+            //Clean Up the created deploymentContext, as some initial work might be done
in the buildConfiguration invocation
+            if (context != null) {
+                try {
+                    context.close();
+                } catch (Exception ingore) {
+                }
+            }
+
             if (e instanceof Error) {
                 log.error("Deployment failed due to ", e);
                 throw (Error) e;



Mime
View raw message