Thanks for the additional hint. Your guess is close, except that I am
trying to handle the startup phase, not the shutdown phase. So, I'm still
in search for something a little bit different.

Jochen



On Mon, Sep 30, 2013 at 8:35 AM, Tim Boudreau <[email protected]> wrote:

> You can certainly do what's recommended here, but I find it's usually more
> readable and flexible to write some sort of "registry" of things, and
> invoke that - certainly if there's any chance you'll need to consume the
> collection in more than one place, or perform the same operation on all
> elements of it.
>
> If you do that, you can then either keep using multi-binding for
> registration, or you can have a register() method on your "registry", and
> bind the things that must register themselves as eager singletons and have
> them register themselves in their constructor.
>
> If my guess about what "LifecycleAware" could be is right, this may be
> similar to what you are writing:
>
> https://github.com/timboudreau/giulius/blob/master/giulius/src/main/java/com/mastfrog/giulius/ShutdownHookRegistry.java
> and it has the additional advantage that you can call it programmatically
> from a test harness to do cleanup on test completion rather than VM
> shutdown.
>
> -Tim
>
>  --
> You received this message because you are subscribed to a topic in the
> Google Groups "google-guice" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/google-guice/EUnNStmrhOk/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/google-guice.
> For more options, visit https://groups.google.com/groups/opt_out.
>



-- 
"That's what prayers are ... it's frightened people trying to make friends
with the bully!"

Terry Pratchett. The Last Hero

-- 
You received this message because you are subscribed to the Google Groups 
"google-guice" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-guice.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to