As mentioned here , the Guava ServiceManager can be obtained
ServiceManager manager = injector.getInstance(ServiceManager.class);
To make this work, I added the following to my Guice module:
@Provides public Set<Service> services(){ return ImmutableSet.<Service>of(MyService()); }
In my main class
ServiceManager manager = injector.getInstance(ServiceManager.class); manager.startAsync().awaitHealthy();
How to get instances of running services?
ps Setting up the services that will be @Singleton looks like a hack.
source share