mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-10-08 14:51:49 +00:00
ACE-5052: close spring application context in EmailServer.
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/5.1.N/root@125304 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -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()
|
||||
|
Reference in New Issue
Block a user