public static <T> void registerServiceFactory(ServiceFactory<T> factory)
Required call to register a ServiceFactory for a given service of type T.
ServiceFactory instance is cached.
In case a service is called without its ServiceFactory being registered first,
a Runtime Exception will be thrown
T - The type of service
factory - The ServiceFactory instance
public static <T> java.util.Optional<T> get(java.lang.Class<T> service)
Returns an optional with a service, if previously a ServiceFactory was registered.
Otherwise, it will try to find a service factory in the same package as the service, and
otherwise a Runtime Exception will be thrown.
Both serviceFactory and service instances are cached, so only one service
is created for the given factory