Re: [5.0] No sessions purged in Context with backgroundProcessorDelay 0?

2003-10-15 Thread Remy Maucherat
Jan Luehe wrote:

I may be totally wrong here, but it seems that if the
backgroundProcessorDelay property on a StandardContext is set to
something greater than zero (default is -1, inherited from
ContainerBase), the context's sessions are never purged.
This is because in ContainerBase$ContainerBackgroundProcessor,
processChildren() is implemented as follows:
for (int i = 0; i  children.length; i++) {
if (children[i].getBackgroundProcessorDelay() = 0) {
processChildren(children[i], cl);
}
}
So when invoked from the ContainerBackgroundProcessor of a
StandardHost, only the sessions of those StandardContexts with a
backgroundProcessorDelay =0 will get purged.
I think the assumption is that if a StandardContext has a
backgroundProcessorDelay  0, it would have its own
ContainerBackgroundProcessor spawn at startup. However, unlike
StandardEngine/Host/Wrapper, StandardContext.start() does not invoke
super.start(), and therefore a ContainerBackgroundProcessor is never
created for a StandardContext.
Arg, stupid me, I forgot about that. We need to add the code which 
starts the backgroud thread in StandardContext.start.
So we need to call super.startThread() and super.stopThread. This 
doesn't seem too hard.

Remy



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


Re: [5.0] No sessions purged in Context with backgroundProcessorDelay 0?

2003-10-15 Thread Jan Luehe
Thanks for confirming, Remy!

I'll make these changes.

Jan

Remy Maucherat wrote:
Jan Luehe wrote:

I may be totally wrong here, but it seems that if the
backgroundProcessorDelay property on a StandardContext is set to
something greater than zero (default is -1, inherited from
ContainerBase), the context's sessions are never purged.
This is because in ContainerBase$ContainerBackgroundProcessor,
processChildren() is implemented as follows:
for (int i = 0; i  children.length; i++) {
if (children[i].getBackgroundProcessorDelay() = 0) {
processChildren(children[i], cl);
}
}
So when invoked from the ContainerBackgroundProcessor of a
StandardHost, only the sessions of those StandardContexts with a
backgroundProcessorDelay =0 will get purged.
I think the assumption is that if a StandardContext has a
backgroundProcessorDelay  0, it would have its own
ContainerBackgroundProcessor spawn at startup. However, unlike
StandardEngine/Host/Wrapper, StandardContext.start() does not invoke
super.start(), and therefore a ContainerBackgroundProcessor is never
created for a StandardContext.


Arg, stupid me, I forgot about that. We need to add the code which 
starts the backgroud thread in StandardContext.start.
So we need to call super.startThread() and super.stopThread. This 
doesn't seem too hard.

Remy



-
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]