Hi Chuck,

Digging through the Cobertura code, it looks like it's making the following
call:

      Runtime.getRuntime().addShutdownHook(new Thread(saveTimer));

it's run() method simply has the call to save the project data.

This should be "guaranteed" to run (with the usual limitations of sudden
errors etc.) when the jvm shuts down, shouldn't it?

cheers,

David
x54680


                                                                           
             "Caldarale,                                                   
             Charles R"                                                    
             <Chuck.Caldarale@                                          To 
             unisys.com>               "Tomcat Users List"                 
                                       <users@tomcat.apache.org>           
             02/20/2007 02:40                                           cc 
             PM                                                            
                                                                   Subject 
                                       RE: Tomcat & Cobertura              
             Please respond to                                             
               "Tomcat Users                                               
                   List"                                                   
             <[EMAIL PROTECTED]                                             
                 che.org>                                                  
                                                                           
                                                                           



> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Subject: RE: Tomcat & Cobertura
>
> Any idea what's hidden in tomcat5.exe that is different from
> running startup.bat, and prevents Cobertura from recognizing
> when the server is shutdown?

The service launcher (tomcat5.exe) has more control over the operation
of the JVM than the standard launcher (java.exe) does.  I have no idea
whether or not the service launcher makes use of that control.

For system properties, you can use the tomcat5w.exe utility to set or
examine the ones in use with the service.  Note that this utility also
has a provision for setting the working directory, although Tomcat
itself makes no use of that.

How is Cobertura supposed to get control during Tomcat termination?  If
it's using a lifetime listener as defined in the servlet spec, that
should function the same regardless of whether Tomcat is run from the
command prompt or as a service.  If Cobertura is relying on some other
mechanism (e.g., System.runFinalization() or
System.runFinalizersOnExit()), that can be problematic, since there's no
guarantee it will ever actually occur.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to