Monday, August 27, 2012

Re: Gin module binding using annotatedWith and AsyncProvider

Well, I have to apologize - I have it working now, although I don't think I actually changed anything related to the problem.  FYI, the error message I printed was incorrect and not the cause of the problem - the actual annotation I was using was indeed @Async and not @Special, which I changed in the code examples I gave to avoid any implication that it wasn't just a made-up annotation.

As an aside, I also got a Provider version working, which was a pretty ugly, and not something that seems easily reusable. I ended up creating a proxy class that wrapped an instance of the class I wanted (and implemented the same interface), passed all the methods through to the contained object, then added another method to kick off the runAsync call.  Two things I don't like about that approach are:
  • I ended up explicitly instantiating my class in the runAsync call, which seems to render some of the injection concept moot
  • because of my additional method to load the proxy, I either had to add that to my base interface, or typecast what I got from the provider, to the proxy class, in order to invoke it.  I chose the latter.

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/wut0xvRnYMUJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

No comments:

Post a Comment