phet commented on code in PR #3899:
URL: https://github.com/apache/gobblin/pull/3899#discussion_r1540294045


##########
gobblin-service/src/main/java/org/apache/gobblin/service/modules/core/GobblinServiceManager.java:
##########
@@ -251,12 +252,23 @@ public static GobblinServiceManager create(String 
serviceName, String serviceId,
   }
 
   public static GobblinServiceManager create(GobblinServiceConfiguration 
serviceConfiguration) {
-    GobblinServiceGuiceModule guiceModule = new 
GobblinServiceGuiceModule(serviceConfiguration);
+    GOBBLIN_SERVICE_GUICE_MODULE = new 
GobblinServiceGuiceModule(serviceConfiguration);
 
-    Injector injector = Guice.createInjector(Stage.PRODUCTION, guiceModule);
+    Injector injector = Guice.createInjector(Stage.PRODUCTION, 
GOBBLIN_SERVICE_GUICE_MODULE);
     return injector.getInstance(GobblinServiceManager.class);
   }
 
+  /**
+   *
+   * @param classToGet
+   * @return a new object if the class type is not marked with @Singleton, 
otherwise the same instance of the class
+   * @param <T>
+   */
+  public static <T> T getClass(Class<T> classToGet) {
+    Injector injector = Guice.createInjector(Stage.PRODUCTION, 
GOBBLIN_SERVICE_GUICE_MODULE);
+    return injector.getInstance(classToGet);
+  }

Review Comment:
   sounds like a plan... will review



-- 
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]

Reply via email to