|
Currently, the source code is accessible at: http://code.google.com/p/warp-datagrid/source/browse/#svn/trunk/warp-servlet It will almost certainly move from there when it finds a good home =) What does warp-servlet do?- Provides ctor-injection for Filters, Servlets
- Provides the full Guice idiom for Filters, Servlets (AOP, Cyclical DI, etc.)
- Regular Expression mapping for Servlets/Filters to URLs
- Request, Session, Flash & Conversation scope (see below)
Integration- warp-servlet's StrutsFactory is a version of the guice-struts plugin that uses an injector created from warp-servlet rather than create one itself. This allows for much more flexibility including taking advantage of warp-persist, Tim's DWR module, other guice-created filters, and so forth.
- Basic Apache Wicket integration along similar lines.
ConversationsConversations are roughly based around issue #5 in the Guice tracker. They are designed as follows: - A simple scope which any key can be bound to
- URLs are rewritten an ;wconvid=... addendum
- This conv id is stripped from the URL prior to dispatch to the filter pipeline
- Users should process emitted URLs using the Conversation.rewrite() utility
- Conversations need to be explicitly started and ended using Conversation.begin() and .end()
ExtensibilityConversations can be persisted in a user-provided data store by creating custom impls for ConversationManager and ConversationContext. The former is the storage service that starts, retrieves and destroys convs. ConversationContext is a logical representation of a single conversation instance (unique by conv key). RoadMapThese are things that should be improved before conversations are release-ready: - More tests around conversation scope
- Request queueing (multiple requests to the same conv should be processed one by one, atomically)
Lingering Design Questions- Conv keys are generated using UUID.randomUUID(). Do we need to change this?
- Request sequencing? (prevent steps in a logical workflow from being accessed out of sequence)
- If a conv is not found for a key (i.e. it has been ended previously, or is invalid), a new conv is automatically created. Is this desirable?
- Deferred conversation begin. For example: Conversation.beginFrom("/workflow/step1");
FinallyDo email me (dhanji@gmail.com) if you have any questions. Please post comments and suggestions on this page.
|
There are a few other things on my wish list, as said in the Guice issue that tracks this integration effort (issue 239):
- Support for multiple WS modules per injector: this is crucial for third party
extensions, for example my HttpInvoker port: http://code.google.com/p/garbagecollected/wiki/GuiceHttpInvoker- A revised DSL (optional). I don't like the filters() in:
Servlets.configure().filters().servlets().serve("*.html").with(MyServlet.class)Besides that, I think we should also discuss timing. If we're going to align WS's release cycle with Guice's, then we should think about what we want to support and maybe cut features we intend to change. For example, we should probably also spend some time on Javadoc, perhaps some tests and an API review.