Search in sources :

Example 6 with PluggableService

use of com.cloud.utils.component.PluggableService in project cosmic by MissionCriticalCloud.

the class ApiDiscoveryServiceImpl method start.

@Override
public boolean start() {
    if (s_apiNameDiscoveryResponseMap == null) {
        final long startTime = System.nanoTime();
        s_apiNameDiscoveryResponseMap = new HashMap<>();
        final Set<Class<?>> cmdClasses = new HashSet<>();
        for (final PluggableService service : _services) {
            s_logger.debug(String.format("getting api commands of service: %s", service.getClass().getName()));
            cmdClasses.addAll(service.getCommands());
        }
        cmdClasses.addAll(this.getCommands());
        cacheResponseMap(cmdClasses);
        final long endTime = System.nanoTime();
        s_logger.info("Api Discovery Service: Annotation, docstrings, api relation graph processed in " + (endTime - startTime) / 1000000.0 + " ms");
    }
    return true;
}
Also used : PluggableService(com.cloud.utils.component.PluggableService) HashSet(java.util.HashSet)

Aggregations

PluggableService (com.cloud.utils.component.PluggableService)6 HashSet (java.util.HashSet)3 CloudRuntimeException (com.cloud.utils.exception.CloudRuntimeException)2 LinkedHashSet (java.util.LinkedHashSet)2 APICommand (org.apache.cloudstack.api.APICommand)2 ConfigurationVO (com.cloud.framework.config.impl.ConfigurationVO)1 VMTemplateVO (com.cloud.storage.VMTemplateVO)1 VirtualMachineTemplate (com.cloud.template.VirtualMachineTemplate)1 RoleType (org.apache.cloudstack.acl.RoleType)1 ApiDiscoveryResponse (org.apache.cloudstack.api.response.ApiDiscoveryResponse)1 BouncyCastleProvider (org.bouncycastle.jce.provider.BouncyCastleProvider)1