|
From: Leif M. <le...@ta...> - 2003-10-01 15:30:26
|
Richard, > When a wrapper on windows is not being run in console mode is > there a way to send a ctrl-break event to it? > If so, then why is the call to the method requestDumpJVMState() > in the file wrapper_win.c commented out in the method > wrapperConsoleHandler(..)? That is commented out because it is not needed. If that call is made then two stack traces would actually be dumped. When CTRL-BREAK is pressed, both the Java and Wrapper processes get the signal. I had not known that when I first implemented the feature. I should really just remove it completely. > I know one can call requestDumpJVMState() via the JMX > interface. I am interested in knowing if there is any other > way. There is no way to directly send a CTRL-BREAK signal to an NT service. (without using a third party program). The Wrapper does provide a few ways to work around it though. The first is to use JMX, the method that you already found. The second is to instantiate the WrapperActionServer class and connect via telnet to request a thread dump. (You can see an example of this by looking at the TestWrapper app source code or the javadocs) The third is to call WrapperManager.requestThreadDump() method directly from within your application. The WrapperActionServer is probably the easiest to get working as it just requires a few lines of isolated code that can really exist pretty much anywhere in your program. If you have any other ideas, they may make good features for a future version. Cheers, Leif |