|
From: Leif M. <le...@ta...> - 2008-06-09 05:40:26
|
Philipp, I just went back and tested this out again and it appears to be working correctly for me. Could you please set the wrapper.debug=true property in your configuration and try this again? Stop your service by executing "net stop myapp". You should see something like the following in your log: --- DEBUG | wrapper | 2008/06/09 14:37:24 | ServiceControlHandler(1) DEBUG | wrapperp | 2008/06/09 14:37:24 | send a packet SERVICE_CONTROL_CODE : 1 DEBUG | wrapper | 2008/06/09 14:37:24 | SERVICE_CONTROL_STOP DEBUG | wrapper | 2008/06/09 14:37:24 | wrapperStopProcess(0) called. INFO | jvm 1 | 2008/06/09 14:37:24 | WrapperManager Debug: Received a packet SERVICE_CONTROL_CODE : 1 INFO | jvm 1 | 2008/06/09 14:37:24 | WrapperManager Debug: ServiceControlCode from Wrapper with code 1 INFO | jvm 1 | 2008/06/09 14:37:24 | Received event: WrapperServiceControlEvent[serviceControlCode=1] DEBUG | wrapper | 2008/06/09 14:37:24 | Sending stop signal to JVM --- The line "Received event:..." is being output by my event handler. If this is not what you are seeing, could you please post your wrapper.log file for several seconds before and after you stop the service? Thanks, Leif On Wed, Jun 4, 2008 at 4:18 AM, Philipp Kursawe <phi...@gm...> wrote: > Hello! > > I am using the WrapperSimpleApp and register in my own code a > WrapperEventListener like this: > > WrapperManager.addWrapperEventListener(this, > WrapperEventListener.EVENT_FLAG_CONTROL > | WrapperEventListener.EVENT_FLAG_SERVICE > | WrapperEventListener.EVENT_FLAG_CORE); > > it should be therefore informed about all events. However only tick > events from CORE are sent. > I guess the WrapperSimpleApp kills the event notifications by calling > WrapperManager.stop() inside its controlEvent method. > My assumption was that before WrapperSimpleApp gets the event > delivered all listeners are informed about it before-hand or otherwise > they have no possibility to react and cleanly exit in case of a > service shutdown. > Interestingly the CTRL+C event is delivered when running in console mode. > > I am currently building a Extender for this wrapper for an OSGi > environment where you need to cleanly shut down the OSGi framework and > not just System.exit(). Willing to contribute the final bundle I first > need to get this issue worked out. > Any ideas Leif? > > Thanks in advance, > Phil > -- |