Hi Everyone.
I’m attempting to use Guice with Restlet to inject session beans from
EJB3 so that unit and module testing will be easier down the road. I
found this helpful site with some code examples for getting started on
this:
http://tembrel.blogspot.com/2008/07/resource-dependency-injection-in.html

However, now I’m at the part where I want to attach multiple finders/
resources to different paths of my app. So my application looks
something like:

FinderFactory factory = RestletGuice.createInjector(new DelegateModule
()).getInstance(FinderFactory.class);

Finder finder = factory.finderFor(Key.get(Handler.class,
InjectableResource.class));

router.attach("/policies", InsuredPolicyResource.class);
router.attach("/policies/{id}", InsuredPolicyResource.class);
router.attach("/vehicles", VehicleResource.class);
router.attach("/vehicles/{id}", VehicleResource.class);
router.attach("/garages", GarageResource.class);
router.attach("/garages/{id}", GarageResource.class);

return router;

I’m not sure how I can create multiple finders that lookup the right
resource to attach to the router. The “InjectableResource” above is
just a tag annotation, but the example on the web page has one
annotation for the one resource.

If anyone has any suggestions or examples for specifying which
Resource to grab from the finder, I’d really appreciate it.
Thanks,
Brian

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"google-guice" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/google-guice?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to