mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-03 04:12:31 +01:00
server: Fix ApiServer init method, we won't use cfg files and it's not used there
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
This commit is contained in:
parent
dcbb0ecef5
commit
72693ea382
@ -166,23 +166,22 @@ public class ApiServer implements HttpRequestHandler {
|
|||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void initApiServer(String[] apiConfig) {
|
public static void initApiServer() {
|
||||||
if (s_instance == null) {
|
if (s_instance == null) {
|
||||||
//Injection will create ApiServer and all its fields which have @Inject
|
//Injection will create ApiServer and all its fields which have @Inject
|
||||||
s_instance = ComponentLocator.inject(ApiServer.class);
|
s_instance = ComponentLocator.inject(ApiServer.class);
|
||||||
s_instance.init(apiConfig);
|
s_instance.init();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ApiServer getInstance() {
|
public static ApiServer getInstance() {
|
||||||
// Assumption: CloudStartupServlet would initialize ApiServer
|
|
||||||
if (s_instance == null) {
|
if (s_instance == null) {
|
||||||
s_logger.fatal("ApiServer instance failed to initialize");
|
ApiServer.initApiServer();
|
||||||
}
|
}
|
||||||
return s_instance;
|
return s_instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void init(String[] apiConfig) {
|
public void init() {
|
||||||
BaseCmd.setComponents(new ApiResponseHelper());
|
BaseCmd.setComponents(new ApiResponseHelper());
|
||||||
BaseListCmd.configure();
|
BaseListCmd.configure();
|
||||||
|
|
||||||
|
|||||||
@ -48,7 +48,7 @@ public class CloudStartupServlet extends HttpServlet implements ServletContextLi
|
|||||||
s_locator = ComponentLocator.getLocator(ManagementServer.Name);
|
s_locator = ComponentLocator.getLocator(ManagementServer.Name);
|
||||||
ManagementServer ms = (ManagementServer)ComponentLocator.getComponent(ManagementServer.Name);
|
ManagementServer ms = (ManagementServer)ComponentLocator.getComponent(ManagementServer.Name);
|
||||||
ms.enableAdminUser("password");
|
ms.enableAdminUser("password");
|
||||||
ApiServer.initApiServer(ms.getPropertiesFiles());
|
ApiServer.initApiServer();
|
||||||
} catch (InvalidParameterValueException ipve) {
|
} catch (InvalidParameterValueException ipve) {
|
||||||
s_logger.error("Exception starting management server ", ipve);
|
s_logger.error("Exception starting management server ", ipve);
|
||||||
throw new ServletException (ipve.getMessage());
|
throw new ServletException (ipve.getMessage());
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user