I only allow usage of the EDSL within the abstract method PersistenceModule.configurePersistence(). All EDSL methods have a check as the very first statement to ensure that they are called from within the configurePersistence().

The configurePersistence() itself is a callback which will be called when the injector is created (i.e. during Module.configure() )

I know this is a very strong limitation. I don't know how strict you want to hide guice from the user of the EDSL. If they are awear of guice then they know about the configure() method. So the concept of your own configureXxx() method is nothing new.


On 31.03.2016 01:25, John Gardiner Myers wrote:


On Tuesday, March 29, 2016 at 2:07:30 PM UTC-7, scl wrote:

    OK, I read you post several times still I am not 100% sure if I
    understood your problem entirely.
    Maybe some more code or concrete examples would be helpful...


I was trying to avoid posting a wall of code. A non-working attempt of mine is at https://github.com/johngmyers/platform/commit/ffac3e042bbf530f3af09f7072eba91e742e6471


    From what I think you are trying to achieve I have done something
    similar myself once before.
    Have a look at the following classes:


This looks pretty close to what I am attempting. How do you ensure that Guice doesn't configure your PersistenceModule until all users of the EDSL are done? In my attempt, the ReportCollectionModule is configured immediately upon installation, before the calling Module finishes calling the EDSL methods.

--
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 <mailto:google-guice+unsubscr...@googlegroups.com>. To post to this group, send email to google-guice@googlegroups.com <mailto:google-guice@googlegroups.com>.
Visit this group at https://groups.google.com/group/google-guice.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-guice/583e2768-ac57-4e6a-8702-ab8bb99251fb%40googlegroups.com <https://groups.google.com/d/msgid/google-guice/583e2768-ac57-4e6a-8702-ab8bb99251fb%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 https://groups.google.com/group/google-guice.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-guice/56FC63FD.5010504%40gmx.ch.
For more options, visit https://groups.google.com/d/optout.

Reply via email to