@Override public boolean start() { if (s_apiNameDiscoveryResponseMap == null) { long startTime = System.nanoTime(); s_apiNameDiscoveryResponseMap = new HashMap<String, ApiDiscoveryResponse>(); Set<Class<?>> cmdClasses = new HashSet<Class<?>>(); for (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); long endTime = System.nanoTime(); s_logger.info("Api Discovery Service: Annotation, docstrings, api relation graph processed in " + (endTime - startTime) / 1000000.0 + " ms"); } return true; }
@Override public void stop() { for (Object obj : beans) { if (obj instanceof PluggableService) { for (Class<?> cmd : ((PluggableService)obj).getCommands()) { ComponentContext.removeDelegateContext(cmd); } } } super.stop(); }
@Override public void start() { super.start(); for (Object obj : beans) { if (obj instanceof PluggableService) { for (Class<?> cmd : ((PluggableService)obj).getCommands()) { ComponentContext.addDelegateContext(cmd, applicationContext); } } } }
@Override public boolean start() { for (PluggableService service : services) { for (Class<?> clz : service.getCommands()) { APICommand command = clz.getAnnotation(APICommand.class); for (RoleType role : command.authorized()) { Set<String> commands = annotationRoleBasedApisMap.get(role); if (!commands.contains(command.name())) commands.add(command.name()); } if (!commandNames.contains(command.name())) { commandNames.add(command.name()); } } } return super.start(); }
@Override public boolean start() { for (PluggableService service : services) { for (Class<?> clz : service.getCommands()) { APICommand command = clz.getAnnotation(APICommand.class); for (RoleType role : command.authorized()) { addApiToRoleBasedAnnotationsMap(role, command.name()); } } } return super.start(); }
cmdClasses.addAll(pluggableService.getCommands()); if (s_logger.isDebugEnabled()) { s_logger.debug("Discovered plugin " + pluggableService.getClass().getSimpleName());
@Override public void start() { super.start(); for (final Object obj : beans) { if (obj instanceof PluggableService) { for (final Class<?> cmd : ((PluggableService) obj).getCommands()) { ComponentContext.addDelegateContext(cmd, applicationContext); } } } }
@Override public void stop() { for (final Object obj : beans) { if (obj instanceof PluggableService) { for (final Class<?> cmd : ((PluggableService) obj).getCommands()) { ComponentContext.removeDelegateContext(cmd); } } } super.stop(); } }