On 6/26/06, Jonathan Barker <[EMAIL PROTECTED]> wrote:
I have a Tapestry4 / Tapestry4Spring / Spring / Acegi / Hibernate application where I need to access an session-scoped Application State Object from within a Hibernate interceptor that I am using for auditing. In general, I have tried to figure out how to access Hivemind-managed objects from within Spring-managed objects. I haven't had much luck. In this case, if I can get at the WebRequest, or HTTPServletRequest, I can take it from there, but again, I can't figure out how to get at those. To clarify a little, the ASO I need is configured in the usual Hivemind way. The hibernate interceptor uses a Hibernate Session configured through Spring. I'm about to peruse the Acegi source because I am using the SecurityContext to get some of the logging information I need, so one solution lurks in there. I'm just wondering if anyone has any creative solutions. Any suggestions?
One trick could be to create the interceptor in hivemind... This way you can inject anything you want. Also you could use some other patterns to create a bridge between the spring and hivemind world. What is currently easy is injecting spring objects in hivemind. If you want to access your spring registry, you could always create an empty spring hivemindregistryholder bean, and inject the registry into that bean with hivemind. Thanks, Henri.