You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2010/10/26 09:28:16 UTC
DO NOT REPLY [Bug 50157] New: a lot of MapperListener is registered
as ContainerListener of StandardContext
https://issues.apache.org/bugzilla/show_bug.cgi?id=50157
Summary: a lot of MapperListener is registered as
ContainerListener of StandardContext
Product: Tomcat 7
Version: trunk
Platform: PC
OS/Version: Windows XP
Status: NEW
Severity: minor
Priority: P2
Component: Connectors
AssignedTo: dev@tomcat.apache.org
ReportedBy: mashmk02@gmail.com
Created an attachment (id=26213)
--> (https://issues.apache.org/bugzilla/attachment.cgi?id=26213)
patch for MapperListener.java
The same five MapperListener is registered as ContainerListener of
StandardContext.
At first when I add StandardHost by using "Engine addChild operation" via JMX,
same MapperListener is registered as ContainerListener of StandardHost.
StandardEngine.addChild()
->StandardEngine.addChildInternal()
->StandardEngine.fireContainerEvent()
->MapperListener.containerEvent() line: 133 <-- here
...
->MapperListener.containerEvent() line: 135
->MapperListener.registerHost() line: 276 <-- here
Therefore, StandardHost has the same two MapperListener as ContainerListener.
---
Then, starting StandardHost by using "Host start operation", the same five
MapperListener is registered as ContainerListener of StandardContext.
(1)LifecycleState of StandardHost is changed to STARTING.
StandardHost(LifecycleBase).start() line:140
->StandardHost(ContainerBase).startInternal()
...
->StandardHost(ContainerBase).fireContainerEvent <-- fireContainerEvent fire
two times
...
->MapperListener.containerEvent() line:133 <-- here
...
->MapperListener.containerEvent() line:137
->MapperListener.registerContext() line:339 <-- here
(2)LifecycleState of StandardHost is changed to STARTED.
StandardHost(LifecycleBase).start() line:156
...
->MapperListener.registerHost() line:279
->MapperListener.registerContext() line:339 <-- here
---
I think that the memory is wasted a little because of the above issue.
On a related issue, MapperListener is not registered as
Container/LifecycleListener for StandardContext on starting up Tomcat.
I attached the patch for above issues.
Best regards.
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
DO NOT REPLY [Bug 50157] a lot of MapperListener is registered as
ContainerListener of StandardContext
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=50157
Mark Thomas <ma...@apache.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED
--- Comment #1 from Mark Thomas <ma...@apache.org> 2010-10-26 18:12:30 EDT ---
Thanks for the report and the suggested patch.
After some review, I went with a different patch that simplifies when objects
get registered and some additional debug logging. I don't think there are any
code paths where the listener can get registered twice but if you spot any feel
free to re-open this issue.
I also added some debug logging and exposed the listener names via JMX for
easier debugging.
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org