mirror of https://github.com/apache/cloudstack.git
CID-1116546 Fix resource leak
(cherry picked from commit fe0168f6d2)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
This commit is contained in:
parent
7de7885a54
commit
6fc97f9181
|
|
@ -25,7 +25,6 @@ import org.apache.commons.daemon.DaemonInitException;
|
|||
import org.apache.log4j.Logger;
|
||||
import org.apache.log4j.PropertyConfigurator;
|
||||
import org.apache.log4j.xml.DOMConfigurator;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.support.ClassPathXmlApplicationContext;
|
||||
import org.springframework.util.Log4jConfigurer;
|
||||
|
||||
|
|
@ -36,7 +35,8 @@ public class UsageServer implements Daemon {
|
|||
private static final Logger s_logger = Logger.getLogger(UsageServer.class.getName());
|
||||
public static final String Name = "usage-server";
|
||||
|
||||
UsageManager mgr;
|
||||
private UsageManager mgr;
|
||||
private ClassPathXmlApplicationContext appContext;
|
||||
|
||||
/**
|
||||
* @param args
|
||||
|
|
@ -54,7 +54,8 @@ public class UsageServer implements Daemon {
|
|||
|
||||
@Override
|
||||
public void start() {
|
||||
ApplicationContext appContext = new ClassPathXmlApplicationContext("usageApplicationContext.xml");
|
||||
|
||||
appContext = new ClassPathXmlApplicationContext("usageApplicationContext.xml");
|
||||
|
||||
try {
|
||||
ComponentContext.initComponentsLifeCycle();
|
||||
|
|
@ -73,7 +74,7 @@ public class UsageServer implements Daemon {
|
|||
|
||||
@Override
|
||||
public void stop() {
|
||||
|
||||
appContext.close();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
Loading…
Reference in New Issue