How to intercept instances construction in Guice: one solution

16 views
Skip to first unread message

Jean-Francois Poilpret

unread,
Jul 27, 2008, 10:43:00 AM7/27/08
to google...@googlegroups.com

Hello,

 

After searching in several directions to answer this question, I have finally found one solution (not perfect but OK) to this problem; I have just blogged on it there:

http://jfpoilpret.blogspot.com/2008/07/how-to-intercept-guice-instance.html

 

I just thought it might be of interest to several reader of this list (it works with Guice 1.0 with no patch; I did not try it with the current TRUNK).

 

Feel free to comment if you have improvement ideas or different ways to solve that problem (I would be glad to hear about it, because it has cost me quite a lot of sweat to come to that solution;-)).

 

Cheers

 

Jean-Francois

tzwoenn

unread,
Jul 30, 2008, 12:19:10 PM7/30/08
to google-guice
I am also working on a solution, that incorporates Guice scopes for
lifecycle hooking. In additions to post-create events I also realized
some kind of pre-destroy, that can be used for resource pooling or
simply destruction listeners. And there is one more difference: My
code is based on the upcoming 2.0 version of Guice ;)

I hope to complete the extension framework for Guice shortly after a
final v2.0 is published. Just have a look at
de.kamalook.guice.scope.LifeCycleListenerScope at
http://www.kamalook.de/maven/de/kamalook/guice/guicex/1.0-SNAPSHOT/guicex-1.0-20080730.104451-4-sources.jar


Greets, Sven


On Jul 27, 4:43 pm, "Jean-Francois Poilpret" <jfpoilp...@yahoo.fr>
wrote:
> Hello,
>
> After searching in several directions to answer this question, I have
> finally found one solution (not perfect but OK) to this problem; I have just
> blogged on it there:
>
> http://jfpoilpret.blogspot.com/2008/07/how-to-intercept-guice-instanc...
Reply all
Reply to author
Forward
0 new messages