You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by jf...@apache.org on 2004/02/04 18:28:28 UTC

cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core StandardContext.java

jfarcand    2004/02/04 09:28:28

  Modified:    catalina/src/share/org/apache/catalina/core
                        StandardContext.java
  Log:
  When using the embedded interface and calling removeChild(..), the mbean wasn't unregistered. That's only occurs when you call removeChild. The mbean is always unregistered when calling addChild (StandardContext.start())
  
  Revision  Changes    Path
  1.115     +4 -1      jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core/StandardContext.java
  
  Index: StandardContext.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core/StandardContext.java,v
  retrieving revision 1.114
  retrieving revision 1.115
  diff -u -r1.114 -r1.115
  --- StandardContext.java	27 Jan 2004 23:18:19 -0000	1.114
  +++ StandardContext.java	4 Feb 2004 17:28:28 -0000	1.115
  @@ -4536,6 +4536,9 @@
           // If you extend this - override this method and make sure to clean up
           children=new HashMap();
           log.debug("resetContext " + oname + " " + mserver);
  +        // Unregister the mbean so when ContainerBase.removeChild() is called
  +        // the associated mbean is unregistered.
  +        destroy();
       }
   
       /**
  
  
  

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


Re: cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core StandardContext.java

Posted by Remy Maucherat <re...@apache.org>.
Jeanfrancois Arcand wrote:
> Remy Maucherat wrote:
> 
>> jfarcand@apache.org wrote:
>>
>>> jfarcand    2004/02/04 09:28:28
>>>
>>> Modified:    catalina/src/share/org/apache/catalina/core 
>>> StandardContext.java Log: When using the embedded interface and
>>> calling removeChild(..), the mbean wasn't unregistered. That's only
>>> occurs when you call removeChild. The mbean is always unregistered
>>> when calling addChild (StandardContext.start())
>>
>> That's not good. stop shouldn't remove the MBean, you'll have to call 
>> destroy elsewhere. If you create the Context through JMX, then you'd 
>> have no way to do further operations on it, since the MBean is gone.
> 
> Yes, I've  realized that after I've committed. I shoud think before 
> committing.....

No, there's indeed bad stuff there (my unregister + register thingie in 
start() to be able to send the new welcome files to the mapper :-( I 
think this should be done with a notification instead, but it kinda 
works right now, so I never bothered doing it :) ). One register on 
init, one unregegister on destroy would be really good overall :)

Rémy


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


Re: cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core StandardContext.java

Posted by Jeanfrancois Arcand <jf...@apache.org>.

Remy Maucherat wrote:

> jfarcand@apache.org wrote:
>
>> jfarcand    2004/02/04 09:28:28
>>
>> Modified:    catalina/src/share/org/apache/catalina/core 
>> StandardContext.java Log: When using the embedded interface and
>> calling removeChild(..), the mbean wasn't unregistered. That's only
>> occurs when you call removeChild. The mbean is always unregistered
>> when calling addChild (StandardContext.start())
>
>
> That's not good. stop shouldn't remove the MBean, you'll have to call 
> destroy elsewhere. If you create the Context through JMX, then you'd 
> have no way to do further operations on it, since the MBean is gone.

Yes, I've  realized that after I've committed. I shoud think before 
committing.....

-- Jeanfrancois

>
> Rémy
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org
>
>


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


Re: cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core StandardContext.java

Posted by Remy Maucherat <re...@apache.org>.
jfarcand@apache.org wrote:
> jfarcand    2004/02/04 09:28:28
> 
> Modified:    catalina/src/share/org/apache/catalina/core 
> StandardContext.java Log: When using the embedded interface and
> calling removeChild(..), the mbean wasn't unregistered. That's only
> occurs when you call removeChild. The mbean is always unregistered
> when calling addChild (StandardContext.start())

That's not good. stop shouldn't remove the MBean, you'll have to call 
destroy elsewhere. If you create the Context through JMX, then you'd 
have no way to do further operations on it, since the MBean is gone.

Rémy

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