Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion server/src/main/java/com/cloud/api/doc/ApiXmlDocWriter.java
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,10 @@ private static List<String> setAsyncResponses() {
public static void main(String[] args) {
Set<Class<?>> cmdClasses = ReflectUtil.getClassesWithAnnotation(APICommand.class, new String[] {"org.apache.cloudstack.api", "com.cloud.api",
"com.cloud.api.commands", "com.globo.globodns.cloudstack.api", "org.apache.cloudstack.network.opendaylight.api",
"org.apache.cloudstack.api.command.admin.zone", "org.apache.cloudstack.network.contrail.api.command"});
"org.apache.cloudstack.api.command.admin.zone", "org.apache.cloudstack.network.contrail.api.command",
"org.apache.cloudstack.cloudian.api", "org.apache.cloudstack.framework.extensions.api",
"org.apache.cloudstack.mom.webhook.api.command.user", "org.apache.cloudstack.network.tungsten.api.command",
"org.apache.cloudstack.oauth2.api.command", "org.apache.cloudstack.storage.datastore.util"});

for (Class<?> cmdClass : cmdClasses) {
if(cmdClass.getAnnotation(APICommand.class)==null){
Expand Down
4 changes: 4 additions & 0 deletions utils/src/main/java/com/cloud/utils/ReflectUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
import org.reflections.scanners.TypeAnnotationsScanner;
import org.reflections.util.ClasspathHelper;
import org.reflections.util.ConfigurationBuilder;
import org.reflections.util.FilterBuilder;

import com.cloud.utils.exception.CloudRuntimeException;
import com.google.common.collect.ImmutableSet;
Expand Down Expand Up @@ -70,9 +71,12 @@ public static Set<Class<?>> getClassesWithAnnotation(Class<? extends Annotation>
Reflections reflections;
Set<Class<?>> classes = new HashSet<Class<?>>();
ConfigurationBuilder builder=new ConfigurationBuilder();
FilterBuilder filterBuilder = new FilterBuilder();
for (String packageName : packageNames) {
builder.addUrls(ClasspathHelper.forPackage(packageName));
filterBuilder.includePackage(packageName);
}
builder.filterInputsBy(filterBuilder);
builder.setScanners(new SubTypesScanner(),new TypeAnnotationsScanner());
reflections = new Reflections(builder);
classes.addAll(reflections.getTypesAnnotatedWith(annotation));
Expand Down
Loading