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/e234fcff
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/e234fcff
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/e234fcff

Branch: refs/heads/4.1
Commit: e234fcff5ab4cdc32be70a85d93eab341de44696
Parents: 20b7424
Author: Rohit Yadav <[email protected]>
Authored: Wed Feb 6 16:54:00 2013 +0530
Committer: Rohit Yadav <[email protected]>
Committed: Wed Feb 6 16:56:48 2013 +0530

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


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/e234fcff/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