tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Thomas <ma...@apache.org>
Subject Re: svn commit: r1042482 - in /tomcat/trunk: ./ conf/ java/org/apache/catalina/core/ java/org/apache/catalina/loader/ java/org/apache/tomcat/util/threads/ res/confinstall/ webapps/ webapps/docs/ webapps/docs/config/
Date Mon, 06 Dec 2010 21:17:58 GMT
On 06/12/2010 21:01, Sylvain Laurent wrote:
> I fixed most of your points except one, see below.

>>> +    protected void processContainerRemoveChild(Container parent, Container child)
{
>>> +
>>> +        if (log.isDebugEnabled())
>>> +            log.debug("Process removeChild[parent=" + parent + ",child="
>>> +                    + child + "]");
>>> +
>>> +        try {
>>> +            if (child instanceof Context) {
>>> +                Context context = (Context) child;
>>> +                context.removeLifecycleListener(this);
>>> +            } else if (child instanceof Host) {
>>> +                Host host = (Host) child;
>>> +                host.removeContainerListener(this);
>>> +            } else if (child instanceof Engine) {
>>> +                Engine engine = (Engine) child;
>>> +                engine.removeContainerListener(this);
>>> +            }
>> Why all this? Just use:
>> child.removeLifecycleListener(this);
> 
> No, it's not the same. The listener is interested in both LifeCycle events for Context,
and Container events for Host and Engine. These are not the same things.

You can still drop the casts though and just call
child.removeLifecycleListener() and child.removeContainerListener()

Some of the other fixes still look a little odd. I suspect the Eclipse
formatter. I'll highlight those in a separate e-mail.

Mark

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message