Hi Peter,
One way of doing this is to access the HiveMind Registry object that
Tapestry creates, from within your listener class, so that you can then
access the ApplicationStateManager, and from that access your ASO.
However, you have to use a little magic to access the Registry object:
1. From the sessionCreated/sessionDestroyed method you have access to
the HttpSessionEvent object.
2. From the HttpSessionEvent object you have access to the HttpSession
object.
3. From the HttpSession object you have access to the ServletContext
4. From the ServletContext object you can look up the HiveMind Registry
using the getAttribute method with the key
"org.apache.tapestry.Registry:SERVLET_NAME" where SERVLET_NAME is the
name of the Tapestry application servlet you have specified in your
web.xml (this is the magic bit since it requires knowing how Tapestry
squirrels away the Registry object).
5. You can then get the ApplicationStateManager object from the
Registry, and finally your ASO.
Hope that helps
Richard.
Peter Stavrinides wrote:
What is the best approach for the following scenario:
I have a listener class that listens for session activity, its
configured only in my web.xml (not for instance in hivemind)
I have a state object that I need to inject into the listener class,
but since I cannot make the listener class abstract how will I inject
my state object? or what can I do otherwise?
Thanks
Peter
---------------------------------------------------------------------
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]