mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
CID-1116546 Fix resource leak
This commit is contained in:
parent
e1d4a329c4
commit
fe0168f6d2
@ -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…
x
Reference in New Issue
Block a user