geronimo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jeremy Boynes" <jer...@coredevelopers.net>
Subject RE: cvs commit: incubator-geronimo/modules/core/src/java/org/apache/geronimo/lock LockInterceptor.java
Date Sun, 24 Aug 2003 05:45:02 GMT
> From: Dain Sundstrom [mailto:dain@coredevelopers.net] 
> On Saturday, August 23, 2003, at 05:09 PM, jboynes@apache.org wrote:
> 
> >        public final void addInterceptor(Interceptor interceptor) {
> >   -        if (getStateInstance() != State.STOPPED) {
> >   -            throw new 
> IllegalStateException("Interceptors cannot be 
> > added unless the Container is stopped");
> >   +        if (getStateInstance() == State.RUNNING) {
> >   +            throw new 
> IllegalStateException("Interceptors cannot be 
> > added if the Container is running");
> >            }
> 
> You shouldn't be able to modify the interceptor stack while the 
> container is stopping state either.  A container may want to allow 
> invocations in while stopping to unwind current work.
> 

If I am building the stack in doStart(), then I would be clearing it in
doStop() when the state is STOPPING. 

Also, the (final) invoke method prevents any invocations from starting
in the STOPPING state, so the only race condition I see is if the
container tweaked the chain during stop, which it doesn't - it just
drops its reference to it so the stack will die (become eligible for GC)
when the last inflight invocation exits.

--
Jeremy


Mime
View raw message