pzampino commented on a change in pull request #358: URL: https://github.com/apache/knox/pull/358#discussion_r452234789
########## File path: gateway-server/src/main/java/org/apache/knox/gateway/services/factory/AliasServiceFactory.java ########## @@ -44,22 +41,17 @@ public Service create(GatewayServices gatewayServices, ServiceType serviceType, final AliasService defaultAliasService = new DefaultAliasService(); ((DefaultAliasService) defaultAliasService).setMasterService(getMasterService(gatewayServices)); ((DefaultAliasService) defaultAliasService).setKeystoreService(getKeystoreService(gatewayServices)); - defaultAliasService.init(gatewayConfig, options); //invoking init on DefaultAliasService twice is ok (in case implementation is set to 'default') - switch (implementation) { - case DEFAULT_IMPLEMENTATION_NAME: - case "": + defaultAliasService.init(gatewayConfig, options); // invoking init on DefaultAliasService twice is ok (in case implementation is set to 'default') + + if (matchesImplementation(implementation, DefaultAliasService.class, true)) { Review comment: Why is the DefaultAliasService always created and initialized? Could this not be done only when there is no implementation, or if the specified implementation is the default one? ########## File path: gateway-server/src/main/java/org/apache/knox/gateway/services/factory/RemoteRegistryClientServiceFactory.java ########## @@ -26,20 +26,26 @@ import org.apache.knox.gateway.services.ServiceLifecycleException; import org.apache.knox.gateway.services.ServiceType; import org.apache.knox.gateway.services.config.client.RemoteConfigurationRegistryClientService; +import org.apache.knox.gateway.services.security.AliasService; // There are two implementations of 'RemoteConfigurationRegistryClientService': // - LocalFileSystemRemoteConfigurationRegistryClientService // - CuratorClientService // However, the first one - local - is for test-only purposes public class RemoteRegistryClientServiceFactory extends AbstractServiceFactory { + private final AliasServiceFactory aliasServiceFactory = new AliasServiceFactory(); + @Override public Service create(GatewayServices gatewayServices, ServiceType serviceType, GatewayConfig gatewayConfig, Map<String, String> options, String implementation) Review comment: Can this implementation not be overridden? ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org