Hi Yuri,
I'd be glad to submit a patch but I'd like to get some more input on how
the solution should be structured.
Basically we'd need to refactor ServerRpcProvider to separate servlet
registration from running the internal server.
The method startWebSocketServer for instance does too much, it starts
the http server and registers the websocket servlets along with the
static handlers.
In ServerMain we register all the others servlets.
I'd like to move this registration to somewhere else (like
RPCServletModule) and extend ServletModule, perhaps having two modules
to separate the WebSocket stuff from the the rest,
I'd also move most of the stuff in ServerMain to a
GuiceServletContextListener and put the http server creation in
ServerMain along with the guice listener and filter registration.
This way our ServletContextListener would start everything ( robots,
federation, etc ..) and our main would just start an ambedded Jetty and
rely on the listener to get things started.
Since I'm not that familiar with Guice I'd like to get some feedback
before tackling this.
On 28-03-2011 16:52, Yuri Z wrote:
In fact, patch
http://code.google.com/p/wave-protocol/source/detail?r=c6765f3b3f67e2cdd80faa06b8e4290de1b89260
already
allows to use web.xml. Use of Guice servlet registration was also discussed
at http://codereview.waveprotocol.org/552005/show in the context of enabling
easier integration of WIAB with other projects.
Nelson, it seems like you already advances toward the solution, would you
like to submit an official patch? You can find instructions at:
http://www.waveprotocol.org/get-involved
<http://www.waveprotocol.org/get-involved>Yuri
2011/3/28 Nelson Silva<[email protected]>
Sorry, forgot to add my addServlet method which would be something like:
@Override
public void addServlet(String s, Class<? extends HttpServlet> servlet) {
LOG.info("Serving " + s + " with " + servlet.getSimpleName());
serve(s).with(servlet);
}