mirror of https://github.com/apache/cloudstack.git
Fix reflections cmd class loading in ApiServer
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
This commit is contained in:
parent
22e3454ae4
commit
0428b30a5a
|
|
@ -201,14 +201,14 @@ public class ApiServer implements HttpRequestHandler {
|
|||
}
|
||||
|
||||
// Populate api name and cmd class mappings
|
||||
Reflections reflections = new Reflections("org.apache.cloudstack");
|
||||
Reflections reflections = new Reflections("org.apache.cloudstack.api");
|
||||
Set<Class<?>> cmdClasses = reflections.getTypesAnnotatedWith(APICommand.class);
|
||||
reflections = new Reflections("com.cloud.api");
|
||||
cmdClasses.addAll(reflections.getTypesAnnotatedWith(APICommand.class));
|
||||
for(Class<?> cmdClass: cmdClasses) {
|
||||
String apiName = cmdClass.getAnnotation(APICommand.class).name();
|
||||
if (_apiNameCmdClassMap.containsKey(apiName)) {
|
||||
s_logger.error("Cmd class " + cmdClass.getName() + " conflicts on apiname" + apiName);
|
||||
s_logger.error("API Cmd class " + cmdClass.getName() + " has non-unique apiname" + apiName);
|
||||
}
|
||||
_apiNameCmdClassMap.put(apiName, cmdClass);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue