Hi Cliff,
I've worked out an implementation with some inspirations from SpringMVC with application of FrontController pattern to Servlets.
https://github.com/sshams/Entitlement (Customer/Product Demo)
There are three major integration points to connect the Servlet (Router) to the PureMVC apparatus.
1. ServletContextListener on contextInitialized instantiates the ShellFacade and passes servletContextEvent to startup.
StartupCommand then instantiates modules (and plumbs) and registers them with the ServletContext using attributes.
https://github.com/sshams/Entitlement/blob/master/src/Application.java2. common/PipeAwareModule includes
acceptRouter function which then sends out the notification with router in it's body.
RouterMediator responds to this notification to and sets the router as it's
viewComponent and sets itself as a Delegate.
a)
https://github.com/sshams/Entitlement/blob/master/src/common/PipeAwareModule.java b)
https://github.com/sshams/Entitlement/blob/master/src/modules/entitlement/view/RouterMediator.java3. Servlet (Router) on
init method retrieves it's related Module from Servlet Content and calls
acceptRouter and passes itself.
https://github.com/sshams/Entitlement/blob/master/src/modules/entitlement/view/components/Router.javaEach additional module will have it's own Servlet/Router defining it's own set of URI's and will receive the Router via
acceptRouter just like above.
So far it worked out fine but I'm open to any ideas, any other strategies that can polish it further from you or the community.