tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@lexmark.com
Subject RE: Tomcat & Cobertura
Date Tue, 20 Feb 2007 20:01:37 GMT
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"                                                   
             <users@tomcat.apa                                             
                 che.org>                                                  
                                                                           
                                                                           



> From: dhay@lexmark.com [mailto:dhay@lexmark.com]
> 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: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org



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


Mime
View raw message