I have an existing framework for which I am looking at Avalon as a possible 
replacement.  One of the things the current framework does, and which is imperative in 
any replacement, is the concept of a session or calling-context.  The idea being that 
all actions occur within the context of a client session.  And subsequently, the 
requirements require this session to be avaiable to all other components in the 
framework for every call.

But I am basically stumbling trying to figure out how to best model this within the 
Avalon framework.  I am guessing that their needs to be a Session component.  But my 
two main sticking points:

1) How should the Session component "get bound" to each incoming request?
2) How can I ensure that the Session has been set prior to access being allowed to any 
of the "dependant" components?

A first thought was to borrow the J2EE way of handling this through a "context" 
(possibly even writing a custom InitialContextFactory).  Then a client would obtain a 
Context which could manage a reference to a session component through a selector.  I 
could then force access to all of the dependent components through the Session 
component via Context lookups.

Does this seem reasonable, or is there (hopefully) a better approach using Avalon?

Thanks in advance,
Steve

Reply via email to