Peter,

This was your earlier comment on children holding references to their parents:

> I guess what I am trying to say is things like getParent() are
> generally considered bad practice when trying to isolate
> resources/computations. When they are available they are admitted
> failings or protected by SecurityExceptions or similar.
> 
> 
> Consider if two completely separate servlets were in same servlet
> engine.  One servlet gets passed a logger (via
> ServletContext/JNDI/other). Now if the loggers where in same hierarchy
> and getParent() was supported it could fake log messages from other
> servlet engine via something like
> 
> 
> newLogger =
>   logger.getParent().getParent().get( "some-other.servlet" ) 
> 
> 
> newLogger.warn( "I am invading other servlets logs by doing this" );

Here is my response.

Two completely separate servlets in different web-applications will be loaded by 
different classloaders. They will be living in different universes. Your argument 
about children holding references to their parents is not applicable here.

If the servlets are in the same web-application then one can assume that they mutually 
trust each other.

But even if the servlets are in the same web-application but do not trust each other, 
I still do not see the problem. 

In log4j, anyone can retrieve a category by name. You can simply write:

Categoty log = Category.getInstance("some-other.servlet")

this has nothing to do with the parent/child relationship. Am I missing something? Ceki


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

Reply via email to