ApiDiscovery: Discovery apis provided by PluggableServices as well

Signed-off-by: Rohit Yadav <[email protected]>


Project: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/commit/1b9e5c30
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/1b9e5c30
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/1b9e5c30

Branch: refs/heads/master
Commit: 1b9e5c3006b5b9ee6b301d65fc8d81675914c826
Parents: dfcd9b0
Author: Rohit Yadav <[email protected]>
Authored: Wed Feb 6 16:54:00 2013 +0530
Committer: Rohit Yadav <[email protected]>
Committed: Wed Feb 6 16:54:46 2013 +0530

----------------------------------------------------------------------
 .../discovery/ApiDiscoveryServiceImpl.java         |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/1b9e5c30/plugins/api/discovery/src/org/apache/cloudstack/discovery/ApiDiscoveryServiceImpl.java
----------------------------------------------------------------------
diff --git 
a/plugins/api/discovery/src/org/apache/cloudstack/discovery/ApiDiscoveryServiceImpl.java
 
b/plugins/api/discovery/src/org/apache/cloudstack/discovery/ApiDiscoveryServiceImpl.java
index 7689ba4..e3bc4d3 100644
--- 
a/plugins/api/discovery/src/org/apache/cloudstack/discovery/ApiDiscoveryServiceImpl.java
+++ 
b/plugins/api/discovery/src/org/apache/cloudstack/discovery/ApiDiscoveryServiceImpl.java
@@ -67,6 +67,8 @@ public class ApiDiscoveryServiceImpl implements 
ApiDiscoveryService {
             //TODO: Fix and use PluggableService to get the classes
             Set<Class<?>> cmdClasses = 
ReflectUtil.getClassesWithAnnotation(APICommand.class,
                     new String[]{"org.apache.cloudstack.api", 
"com.cloud.api"});
+            for(PluggableService service: _services)
+                cmdClasses.addAll(service.getCommands());
             cacheResponseMap(cmdClasses);
             long endTime = System.nanoTime();
             s_logger.info("Api Discovery Service: Annotation, docstrings, api 
relation graph processed in " + (endTime - startTime) / 1000000.0 + " ms");

Reply via email to