Package org.gwizard.services
Class Run
java.lang.Object
org.gwizard.services.Run
@Singleton
public class Run
extends java.lang.Object
A prettier interface to the Guava ServiceManager, with simple start() and stop() methods. Registers a Runtime shutdown hook to stop all services.
You can use the ServiceManager directly instead, but you'll have to register your own shutdown hook.
-
Constructor Summary
Constructors Constructor Description Run(javax.inject.Provider<com.google.common.util.concurrent.ServiceManager> serviceManager) -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
Run
@Inject public Run(javax.inject.Provider<com.google.common.util.concurrent.ServiceManager> serviceManager)
-
-
Method Details
-
start
public void start()Start all services. This is shorthand forserviceManager.startAsync().awaitHealthy(); -
stop
public void stop()Stop all services. This is shorthand forserviceManager.stopAsync().awaitStopped();with the stopTimeoutSeconds wait interval.
-