2.0-beta-6 released with Spring injection annotations (@Autowired, @Qualifier) along with JPA's @PersistenceContext and @PreDestroy from JSR 250

10 views
Skip to first unread message

James Strachan

unread,
Apr 14, 2009, 6:30:12 AM4/14/09
to guice...@googlegroups.com
The new 2.0-beta-6 release is out now - get it while its hot! Full
list of new features, enhancements and bug fixes on the download
page...

http://code.google.com/p/guiceyfruit/wiki/Download


--
James
-------
http://macstrac.blogspot.com/

Open Source Integration
http://fusesource.com/

Aleksey Didik

unread,
Apr 14, 2009, 8:49:51 AM4/14/09
to guiceyfruit
Hello James,
I'm glad to catch the new guceyfruit release)

Some questions:

1) What about @PreDestroy? As I have read, Guice folks have no answer
on your question "how to find the scope of an injectee in
InjectionListener?"
As I can see in beta-6 sources, tryCloseJitBindings trick is
working yet.

2) GucieyFruitModule.bindMethodHandler use InjectableType.Listener but
in last Guice trunk we already have another singnature of bindListener
method.
Do you know about it? In last guice changes we can register member
injector which will work after native guice member injector. It means
bindMethodHandler could be refactored :)

3) And what about @PostConstruct specific matcher instead of any() in
'bindMethodHandler'? Something like membersAnnotatedWith(Class<?
extends Annotation> ann)? As I know, Guice calculate listeners on
initialization step. Using matchers will be faster. If your want, I
could create an issue in bag tracking.

What's is your future plans?

Best regards,
Aleksey.

James Strachan

unread,
Apr 14, 2009, 9:24:32 AM4/14/09
to guice...@googlegroups.com
Hi Aleksey!

2009/4/14 Aleksey Didik <alekse...@gmail.com>:


>
> Hello James,
> I'm glad to catch the new guceyfruit release)
>
> Some questions:
>
> 1) What about @PreDestroy? As I have read, Guice folks have no answer
> on your question "how to find the scope of an injectee in
> InjectionListener?"
>    As I can see in beta-6 sources, tryCloseJitBindings trick is
> working yet.

Its working right now; I applied my patch to the guice jars included
in the GuiceyFruit distro for 2.0-beta-6
http://code.google.com/p/google-guice/issues/detail?id=354&can=5

still no word yet from the Guicers on the official way to support this though :(


> 2) GucieyFruitModule.bindMethodHandler use InjectableType.Listener but
> in last Guice trunk we already have another singnature of bindListener
> method.
>    Do you know about it? In last guice changes we can register member
> injector which will work after native guice member injector. It means
> bindMethodHandler     could be refactored :)

I just spotted this today; I've setup a git mirror of Guice (I found
the previous use of svn/svm/svk to be way too painful)...
http://github.com/jstrachan/guicey/tree/master

am just waiting for Jesse to finish changing the code & hoping he
applies some kind of patch for
http://code.google.com/p/google-guice/issues/detail?id=351&can=5

then I'll only need to apply a patch for 354 until hopefully at some
point there's some solution in Guice trunk

So 2.0-beta-7 will hopefully be using the latest trunk of guice.
2.0-beta-6 is about a week behind currently.


> 3) And what about @PostConstruct specific matcher instead of any() in
> 'bindMethodHandler'? Something like membersAnnotatedWith(Class<?
> extends Annotation> ann)? As I know, Guice calculate listeners on
> initialization step. Using matchers will be faster. If your want, I
> could create an issue in bag tracking.

That would be awesome! Do you fancy taking a stab? I've made you a
committer on the project so you can dive in on anything you like :)

We'll probably need to use the latest Guice snapshot for a little
while until the git mirror can be updated with issue 354 applied.

FWIW last time I looked the matcher stuff wasn't usable with the
injectable type stuff due to type clashes between Matchers and the
listener API - though maybe thats fixed in the new refactor?


> What's is your future plans?

Long term I'd love to remove as many custom patches from Guice as possible :).

There's a few open issues in the issue tracker such as this one which
would be handy..
http://code.google.com/p/guiceyfruit/issues/detail?id=13


I'd also like to be able to use other annotations to inject
constructors to remove the Guice limitation on mandatory @Inject on
constructors.

e.g. using code like this

public Cheese {
@Autowired
public Cheese(DataSource dataSource) {...}
}

public Cheese {
@Resource
public Cheese(DataSource dataSource) {...}
}

which would make it easier to use GuiceyFruit/Guice with code written
for J2EE or Spring without littering @Inject everywhere.

Also the spring XML converter could use some refactoring
http://code.google.com/p/guiceyfruit/issues/detail?id=16


Other than that its mostly a case of using it and figuring out what
could be improved over time. Is there anything missing from
GuiceyFruit today you'd really like to see - (other than the points
you've raised so far in this thread)?

James Strachan

unread,
Apr 15, 2009, 11:39:31 AM4/15/09
to guice...@googlegroups.com
2009/4/14 James Strachan <james.s...@gmail.com>:

> Hi Aleksey!
>
> 2009/4/14 Aleksey Didik <alekse...@gmail.com>:
>>
>> Hello James,
>> I'm glad to catch the new guceyfruit release)
>>
>> Some questions:
>>
>> 1) What about @PreDestroy? As I have read, Guice folks have no answer
>> on your question "how to find the scope of an injectee in
>> InjectionListener?"
>>    As I can see in beta-6 sources, tryCloseJitBindings trick is
>> working yet.
>
> Its working right now; I applied my patch to the guice jars included
> in the GuiceyFruit distro for 2.0-beta-6
> http://code.google.com/p/google-guice/issues/detail?id=354&can=5
>
> still no word yet from the Guicers on the official way to support this though :(

BTW I've refactored the patch and applied it to the git mirror...
http://github.com/jstrachan/guicey/commits/master

and have switched trunk of GuiceyFruit to using this - which is based
on the latest trunk of google guice plus my patch for 354.

Aleksey Didik

unread,
Apr 20, 2009, 7:46:06 AM4/20/09
to guiceyfruit
Hi James,
Looks like I have found a way to release @PreDestroy for different
scopes without Guice patching,
but a Gucie bug (may be it's not a bug) don't allow me to release it.
I'have posted the issue to Guice: http://code.google.com/p/google-guice/issues/detail?id=360&can=6
but it's no answered.
Look at it, may be you have some comments.

Best regards,
Aleksey.



On Apr 15, 8:39 pm, James Strachan <james.strac...@gmail.com> wrote:
> 2009/4/14 James Strachan <james.strac...@gmail.com>:
>
>
>
> > Hi Aleksey!
>
> > 2009/4/14 Aleksey Didik <aleksey.di...@gmail.com>:
>
> >> Hello James,
> >> I'm glad to catch the new guceyfruit release)
>
> >> Some questions:
>
> >> 1) What about @PreDestroy? As I have read, Guice folks have no answer
> >> on your question "how to find the scope of an injectee in
> >> InjectionListener?"
> >>    As I can see in beta-6 sources, tryCloseJitBindings trick is
> >> working yet.
>
> > Its working right now; I applied my patch to the guice jars included
> > in the GuiceyFruit distro for 2.0-beta-6
> >http://code.google.com/p/google-guice/issues/detail?id=354&can=5
>
> > still no word yet from the Guicers on the official way to support this though :(
>
> BTW I've refactored the patch and applied it to the git mirror...http://github.com/jstrachan/guicey/commits/master
>
> and have switched trunk of GuiceyFruit to using this - which is based
> on the latest trunk of google guice plus my patch for 354.
> --
> James
Reply all
Reply to author
Forward
0 new messages