Override ApplicationServlet.constructRegistry() and store the registry
somewhere which is accessible from the filter, eg. the servletcontext.
@Override
protected Registry constructRegistry(ServletConfig config)
{
registry = super.constructRegistry(config);
config.getServletContext().setAttribute("SomeAttributeName",
registry);
return registry;
}
Regards,
Norbi
Ovidiu Hurducas wrote:
Greetings,
I’m using Hivemind+Tapestry+Hibernate to build a site. I have a
javax.servlet.Filter object where I need to do some operations with a
Hivemind service that uses Hibernate.
To access the registry from the filter I’m using the example from the
Hivemind documentation:
Registry registry = RegistryBuilder.constructDefaultRegistry();
MyService service = (MyService)
registry.getService("com.mypackage.MyService", MyService.class);
However this is not good. The registry is recreated and the Hibernate
configuration is read again.
There is a way to access an existing registry that is already
initialized? I don’t want to recreate the registry twice.
Thank you,
Ovidiu
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]