]> source.dussan.org Git - archiva.git/commitdiff
destroy context on close
authorBrett Porter <brett@apache.org>
Wed, 30 Jul 2014 03:11:23 +0000 (13:11 +1000)
committerBrett Porter <brett@apache.org>
Wed, 30 Jul 2014 03:11:23 +0000 (13:11 +1000)
archiva-cli/src/main/java/org/apache/archiva/cli/ArchivaCli.java

index 102f4bfe80170b8476aa0130ad636ccfb764b704..4bb426a62c6d2c7ba0cbe1d808705ebe54e9f87c 100644 (file)
@@ -110,7 +110,20 @@ public class ArchivaCli
             return;
         }
 
-        new ArchivaCli().execute( command );
+        ArchivaCli cli = new ArchivaCli();
+        try
+        {
+            cli.execute( command );
+        }
+        finally
+        {
+            cli.destroy();
+        }
+    }
+
+    private void destroy()
+    {
+        applicationContext.destroy();
     }
 
     private void execute( Commands command )