|
From: Andrew D. <and...@hs...> - 2004-09-13 02:30:45
|
Leif Mortenson <leif@...> writes: > What exactly are you having problems with on Shutdown. You can do a > controlled > shutdown with the WrapperSimpleApp class by registering a shutdown > hook. This is > a good option as your application will shutdown cleanly even when not > using the > Wrapper. Leif, thanks for your feedback. I have not tried a shutdown hook yet. I can look into this. > I used the 3rd method when I first created the Wrapper. But once the > other two methods > were created, I have not even once found it necessary to use method #3 > again. I am > interested the exact problems you are encountering that make you feel > you need to use > method #3. When using WrapperSimpleApp, the start method only waits two seconds before reporting that "all is fine" to the Wrapper Manager (assuming service has not failed already). This generally results in the service manager showing that the service has started successfully, yet the service may still stop immediately due to an initialisation error. This could be a problem for an inattentive system administrator, or a startup script. What I prefer to do is have a service wrapper that has a reference to the service application instance, so that health checks can be performed during initialisation. Once the service itself has reported that "all is fine", then start can return. I guess some other options are: 1. Have WrapperSimpleApp receive another parameter through the .conf, to set the start method wait time. However, this would not be as reliable. 2. Have a wrapper.filter.trigger set to catch a fatal exception and SHUTDOWN the Wrapper Manager. I am not sure how this would look to the service manager. I would also need to be more careful with my use of exception types in this case... :-) There is always the chance I am making this more complex than it needs to be, but it does seem like a gap in functionality. If I am missing some other way to do this, please let me know. Also, thanks for providing this very useful tool. |