From: Brett Porter Date: Wed, 30 Jul 2014 03:11:23 +0000 (+1000) Subject: destroy context on close X-Git-Tag: archiva-2.1.1~30 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=e7663d04db01ada3f3b87660b6ec49701fe3a750;p=archiva.git destroy context on close --- diff --git a/archiva-cli/src/main/java/org/apache/archiva/cli/ArchivaCli.java b/archiva-cli/src/main/java/org/apache/archiva/cli/ArchivaCli.java index 102f4bfe8..4bb426a62 100644 --- a/archiva-cli/src/main/java/org/apache/archiva/cli/ArchivaCli.java +++ b/archiva-cli/src/main/java/org/apache/archiva/cli/ArchivaCli.java @@ -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 )