From 2afe43dad1a528e0ff47c1436a79bffd310e592f Mon Sep 17 00:00:00 2001 From: Derek Hulley Date: Thu, 10 May 2007 16:15:32 +0000 Subject: [PATCH] Added main() method to check that our application context closes properly git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@5659 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- .../org/alfresco/util/ApplicationContextHelper.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/source/java/org/alfresco/util/ApplicationContextHelper.java b/source/java/org/alfresco/util/ApplicationContextHelper.java index 30aab08dda..535c63ff89 100644 --- a/source/java/org/alfresco/util/ApplicationContextHelper.java +++ b/source/java/org/alfresco/util/ApplicationContextHelper.java @@ -47,4 +47,14 @@ public class ApplicationContextHelper { return new ClassPathXmlApplicationContext(CONFIG_LOCATIONS); } + + public static void main(String ... args) + { + ClassPathXmlApplicationContext ctx = (ClassPathXmlApplicationContext) getApplicationContext(); + synchronized (ctx) + { + try { ctx.wait(10000L); } catch (Throwable e) {} + } + ctx.close(); + } }