Details
-
Enhancement
-
Resolution: Done
-
Major
-
None
-
None
-
None
-
Service Team 2 - Sprint 8, Service Team 2 - Sprint 11, Service Team 2 - Sprint 12
-
13
Description
Today all ServiceModule are being created by MobileCore on getInstance method
public <T extends ServiceModule> T getInstance(final Class<T> serviceClass, final ServiceConfiguration serviceConfiguration) throws InitializationException { nonNull(serviceClass, "serviceClass"); if (services.containsKey(serviceClass)) { return (T) services.get(serviceClass); } try { final ServiceModule serviceModule = serviceClass.newInstance(); ServiceConfiguration serviceCfg = serviceConfiguration; if (serviceCfg == null) { serviceCfg = getServiceConfiguration(serviceModule.type()); } if (serviceCfg == null && serviceModule.requiresConfiguration()) { throw new ConfigurationNotFoundException( serviceModule.type() + " not found on " + this.configFileName); } serviceModule.configure(this, serviceCfg); services.put(serviceClass, serviceModule); return (T) serviceModule; } catch (IllegalAccessException | InstantiationException e) { throw new InitializationException(e.getMessage(), e); } }
It maybe was a good decision in the past but I can't see any value in it anymore, also it is blocking was to provide a non-openshift experience. For now all services should be self-managed and communicate with mobilecore when need something like service config, http layer or anything else.