smolnar82 commented on code in PR #620:
URL: https://github.com/apache/knox/pull/620#discussion_r951143339
##########
gateway-server/src/main/java/org/apache/knox/gateway/services/factory/ConcurrentSessionVerifierFactory.java:
##########
@@ -17,21 +17,37 @@
*/
package org.apache.knox.gateway.services.factory;
+import static java.util.Arrays.asList;
+import static java.util.Collections.unmodifiableList;
+
+import java.util.Collection;
+import java.util.Map;
+
import org.apache.knox.gateway.config.GatewayConfig;
import org.apache.knox.gateway.services.GatewayServices;
import org.apache.knox.gateway.services.Service;
import org.apache.knox.gateway.services.ServiceLifecycleException;
import org.apache.knox.gateway.services.ServiceType;
+import org.apache.knox.gateway.session.control.EmptyConcurrentSessionVerifier;
import
org.apache.knox.gateway.session.control.InMemoryConcurrentSessionVerifier;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Map;
-
public class ConcurrentSessionVerifierFactory extends AbstractServiceFactory {
@Override
protected Service createService(GatewayServices gatewayServices, ServiceType
serviceType, GatewayConfig gatewayConfig, Map<String, String> options, String
implementation) throws ServiceLifecycleException {
- return shouldCreateService(implementation) ? new
InMemoryConcurrentSessionVerifier() : null;
+ Service service = null;
+ if (shouldCreateService(implementation)) {
Review Comment:
I agree with @MrtnBalazs on this. It's perfectly ok to return a `null`
service from any of the service factories. That situation is handled by the
caller.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]