On 08.Mar.2003 -- 02:19 PM, Mark H wrote:
> Can anybody tell me how actions work in a multi-user environment. Is an
> action instance shared across multiple requests like a servlet? and hence
> member fields should be avoided in favour of local fields created in the act
> method or use of session attributes ?

Depends on the lifestyle interface implemented by the action. Often,
"ThreadSafe" is implemented, allowing concurrend access to the
instance. AFAIU this does not mean that is it guaranteed to be a
single instance, though. For this, your statement is true. 

Upside is, that the action does not need to be re-instantiated for
each request. Downside is, that single threaded instances might be
simpler to program.

Another interface is "Poolable": "Components implement this interface
if it is reasonable to Pool the object. Components that don't
implement this interface will be created anew via a factory"

Best to have a look at the Apache Avalon docs. We're currently using
the ECM - Excalibur Component Manager - for managing components.

Note that Avalon is heading for a meta data approach instead of marker
interfaces.

        Chris.
-- 
C h r i s t i a n       H a u l
[EMAIL PROTECTED]
    fingerprint: 99B0 1D9D 7919 644A 4837  7D73 FEF9 6856 335A 9E08

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to