google-code-export / gwt-dispatch

Automatically exported from code.google.com/p/gwt-dispatch
1 stars 0 forks source link

ActionHandlers can only be bound to Guice with Singleton scope #22

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
It would be nice if I was able bind a handler
with a scope. That way I would be able to choose on a handler by
handler basis what scope they had and consequently be able to inject
other scoped objects into the handler. Guice could then be used to
manage all the session/request scoped objects. 

The attached code allows this to be done by installing a different
ActionHandlerRegistry implementation:

install(new ServerDispatchModule(DefaultDispatch.class,
ScopedActionHandlerRegistry.class));

ActionHandlers are bound in a similar fashion as before but the Action has
to be specified when binding. The scope can be specified in a standard
Guice way.

bindHandler(FeedRequest.class,
FeedRequestHandler.class).in(ServletScopes.SESSION);

Original issue reported on code.google.com by pillingworthz on 3 Dec 2009 at 2:21

Attachments:

GoogleCodeExporter commented 9 years ago
Thanks for this, will take a look at it soon.

Original comment by Bitmei...@gmail.com on 3 Dec 2009 at 4:39

GoogleCodeExporter commented 9 years ago
Will look at this for 2.0. Mostly wanting to fix bugs for 1.1 to get an 
official release out.

Original comment by Bitmei...@gmail.com on 28 Apr 2010 at 2:55

GoogleCodeExporter commented 9 years ago

Original comment by Bitmei...@gmail.com on 18 Aug 2010 at 7:04