Comment #50 on issue 62 by limpbizkit: Lifecycle support
http://code.google.com/p/google-guice/issues/detail?id=62

Dhanji and I discussed this at length this evening. We're thinking about taking a Service interface, inspired by the one in Guava, with these methods. Note that start() is renamed to startAsync() and likewise for stop:
  interface Service {
    boolean isRunning();
    State state();
    Future<State> startAsync();
    void startAndWait();
    Future<State> stopAsync();
    void stopAndWait();
  }
http://code.google.com/p/guava-libraries/source/browse/trunk/src/com/google/common/base/Service.java?r=49

In addition, we'd like to support listeners on services, so objects could register to be notified when a service changes state. The granularity of registration may be by service instance or perhaps by Guice Key.

We were also discussing the interplay between services and scopes. It might be useful to create a scope that's keyed off of a Provider<Service> for a particular service, and whose objects are in scope only while a service is running. This idea isn't fully baked.

--
You received this message because you are subscribed to the Google Groups 
"google-guice-dev" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-guice-dev?hl=en.

Reply via email to