Merged 5.2.N (5.2.1) to HEAD (5.2)

125437 amorarasu: Merged 5.1.N (5.1.2) to 5.2.N (5.2.1)
      125304 mward: ACE-5052: close spring application context in EmailServer.


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@127781 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Alan Davis
2016-06-03 16:09:15 +00:00
parent 7fb3e192ac
commit ee08a52aee

View File

@@ -303,18 +303,8 @@ public abstract class EmailServer extends AbstractLifecycleBean
usage();
return;
}
AbstractApplicationContext context = null;
try
{
context = new ClassPathXmlApplicationContext(args);
} catch (BeansException e)
{
System.err.println("Erro create context: " + e);
usage();
return;
}
try
try (AbstractApplicationContext context = new ClassPathXmlApplicationContext(args))
{
if (!context.containsBean("emailServer"))
{
@@ -342,14 +332,14 @@ public abstract class EmailServer extends AbstractLifecycleBean
}
}
}
catch (BeansException e)
{
System.err.println("Error creating context: " + e);
usage();
}
catch (InterruptedException e)
{
}
finally
{
context.close();
}
}
private static void usage()