[ 
https://issues.apache.org/jira/browse/KNOX-2399?focusedWorklogId=458641&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-458641
 ]

ASF GitHub Bot logged work on KNOX-2399:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 14/Jul/20 14:14
            Start Date: 14/Jul/20 14:14
    Worklog Time Spent: 10m 
      Work Description: smolnar82 commented on a change in pull request #361:
URL: https://github.com/apache/knox/pull/361#discussion_r454387621



##########
File path: 
gateway-server/src/main/java/org/apache/knox/gateway/services/factory/AbstractServiceFactory.java
##########
@@ -47,22 +52,38 @@ public Service create(GatewayServices gatewayServices, 
ServiceType serviceType,
   @Override
   public Service create(GatewayServices gatewayServices, ServiceType 
serviceType, GatewayConfig gatewayConfig, Map<String, String> options, String 
implementation)
       throws ServiceLifecycleException {
-    Service service = null;
-    if (getServiceType() == serviceType) {
-      service = createService(gatewayServices, serviceType, gatewayConfig, 
options, implementation);
-      if (service == null && StringUtils.isNotBlank(implementation)) {
-        // no known service implementation created, try to create the custom 
one
-        try {
-          service = 
Service.class.cast(Class.forName(implementation).newInstance());
-          logServiceUsage(implementation, serviceType);
-        } catch (InstantiationException | IllegalAccessException | 
ClassNotFoundException e) {
-          throw new ServiceLifecycleException("Errror while instantiating " + 
serviceType.getShortName() + " service implementation " + implementation, e);
+    Service service = fetchFromCache(serviceType, implementation);
+    if (service == null) {
+      if (getServiceType() == serviceType) {
+        service = createService(gatewayServices, serviceType, gatewayConfig, 
options, implementation);
+        if (service == null && StringUtils.isNotBlank(implementation)) {
+          // no known service implementation created, try to create the custom 
one
+          try {
+            service = 
Service.class.cast(Class.forName(implementation).newInstance());

Review comment:
       I believe this depends on personal tasting. I like the one I added 
before too.




----------------------------------------------------------------
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:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 458641)
    Time Spent: 0.5h  (was: 20m)

> Implement ZK token state service
> --------------------------------
>
>                 Key: KNOX-2399
>                 URL: https://issues.apache.org/jira/browse/KNOX-2399
>             Project: Apache Knox
>          Issue Type: Task
>    Affects Versions: 1.4.0
>            Reporter: Sandor Molnar
>            Assignee: Sandor Molnar
>            Priority: Major
>             Fix For: 1.5.0
>
>          Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> Implement a new {{TokenStateService}} implementation which stores/fetches 
> token related metadata in Zookeeper. The new service should be configurable 
> to directly go to Zookeeper or use some local cache (e.g. a local alias 
> service).



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to