Maybe you want to make CacheMonitor an optional dependency?

See: https://github.com/google/guice/wiki/Injections#optional-injections

On Thu, Sep 10, 2015 at 7:00 AM Michiel ten Hagen <michieltenha...@gmail.com>
wrote:

> All
>
> I have two classes, Cache and CacheMonitor.  If someone binds the Cache I
> want the CacheMonitor to be initiated.
>
> Currently I have the Cache class depend on the CacheMonitor but this
> creates a unnecassary dependency, the Cache should be able to be used
> without the CacheMonitor.
>
> Is there a way to specify that CacheMonitor should be loaded only if the
> Cache is binded?
>
> Regards,
>
> Michiel
>
>
> --
> 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 google-guice+unsubscr...@googlegroups.com.
> To post to this group, send email to google-guice@googlegroups.com.
> Visit this group at http://groups.google.com/group/google-guice.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/google-guice/9a306fd5-1170-4496-af05-372fb09b05a2%40googlegroups.com
> <https://groups.google.com/d/msgid/google-guice/9a306fd5-1170-4496-af05-372fb09b05a2%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 google-guice+unsubscr...@googlegroups.com.
To post to this group, send email to google-guice@googlegroups.com.
Visit this group at http://groups.google.com/group/google-guice.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-guice/CAHNex9-J2Yow58v%3D9dU%2BnZ-ZdN2V51-5%3D2qJi3gmTbNu_H9PvA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to