Ok, I've gone through this PR in considerable detail and while I like the direction (and will almost certainly apply it as a starting point), I wonder if Guava Services can be made a little more "guicy" and expose less of Guava's complexity. I'll code up some experiments tomorrow.
I'm thinking something like this:
* Instead of binding services, provide a Services singleton with an add() method. Any guava service can @Inject it and add(this). Services has a start() method that constructs the ServiceManager and runs startAsync().
* Provide a simple wrapper of Services, say, Lifecycle with addStartHook(Runnable) and addStopHook(Runnable) methods. Any class can @Inject this, call those methods, and the result will be a new service is generated. Most services won't have any idea that Guava services exists under the covers and the inheritance chain is unmolested.
* With this, the only special guice behavior an app needs is to bind services as eager singleton. No need for multibinding. This gets nicer with something like Governator's @AutoBindSingleton annotation.
I would love to hear what you think.
Speaking of which, I just stumbled across it for the first time today. @AutoBindSingleton is the only bit that looks appealing to me, but it does look nice. It would be easy to add a similar mechanism as an AutoBindModule. Or anyone could just use Governator as-is.
Jeff