struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Laurie Harper <>
Subject Re: Interceptors and thread-safety
Date Mon, 16 Apr 2007 06:48:21 GMT
Shahak Nagiel wrote:
> The "Writing Interceptors" guide pretty clearly states that "Interceptors are shared
between requests and must be thread-safe."   However, there are some Interceptors--such as
execAndWait and roles--which accept parameters (e.g. "delay" and "allowedRoles") and which,
ostensibly at least--use simple setter methods to apply these to instance variables.  So,
how can these be thread-safe if new Interceptors aren't being instantiated for every request?

Because the parameters don't come from (or vary with) the request. 
Interceptor parameters are passed in once, when the interceptor is 
instantiated. That same instance is then applied to each request for 
which it's configured.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message