mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-10-15 15:02:20 +00:00
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/BRANCHES/DEV/5.2.N/root@125437 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -303,18 +303,8 @@ public abstract class EmailServer extends AbstractLifecycleBean
|
|||||||
usage();
|
usage();
|
||||||
return;
|
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"))
|
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)
|
catch (InterruptedException e)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
finally
|
|
||||||
{
|
|
||||||
context.close();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void usage()
|
private static void usage()
|
||||||
|
Reference in New Issue
Block a user