Joel,
If I take your last approach, will Hivemind be able to handle thread
clean-up and such if I don't use the HiveMindFilter (that is, I don't
set it
up in the web.xml)?
No it won't. If you use the threaded or pooled service model
then you need a filter that calls setupThread and cleanupThread.
I'm guessing your option to subclass HiveMindFilter is the most correct
one,
although I'm vague on where to store the registry into the
ServletContext,
and whether the sequence of bootstrapping will work correctly?
Put
_filterConfig.getServletContext().setAttribute(REQUEST_KEY, _registry);
in the doFilter method and change getRegistry in the same way.
You are probably right, there is no guarantee on the order in
which servlets and filters are initialized.
I would suggest a mixture of both approaches: 1. Setup the
registry in the IWebApplicationFactory and store it in the ServletContext.
2. Write a custom filter that retrieves the registry from
the ServletContext. Do nothing if none is present.
Call setupThread and cleanupThread otherwise.
Achim
Thanks,
Joel
Achim Hügen wrote:
Do you try to implement the IWebApplicationFactory interface
or what is the place where a Servlet class is passed in?
You could build a custom version of the HiveMindFilter class
that stores the registry reference in an attribute of the ServletContext
instead of the ServletRequest.
The ServletContext can be retrieved from the Servlet reference then.
As alternative you could ignore HiveMindFilter, setup the HiveMind
registry in your implementation of IWebApplicationFactory and then store
it
in your application class.
Achim
Am Tue, 19 Dec 2006 19:37:00 +0100 schrieb joeltt <[EMAIL PROTECTED]>:
I'm trying to find out how to integrate Wicket with Hivemind. I'd like
to
instantiate the Wicket Application class using Hivemind, but to do so
Wicket
only passes in the Servlet class not an HttpServletRequest. Is there a
way I
can accomplish this?
Joel