|
From: Michael G. <mlg...@gm...> - 2006-07-10 23:18:14
|
Leif,
Well, I finally got back to this.
On 4/24/06, Leif Mortenson <le...@ta...> wrote:
> Michael,
> This is the kind of integration that Method 3 was created for. You
> create a custom implementation of the WrapperListener interface. The
> WrapperListener.start method is called by the Wrapper to launch the application.
After reading the documentation and javadocs, it seems that method 3
is a bit heavy for what we need. It appears that we need to implement
everything that is in the WrapperStartStopApp class, plus the code to
monitor the startup and call WrapperManager.signalStarting as
described in your post.
It seems that it would be a lot easier (certainly for my case) if we
could configure a class that WrapperStartStopApp calls to get the
service status. The class would check the app to see if the startup
is complete and return true or false. Then WrapperStartStopApp could
loop calling signalStarting ...
Given that I can configure a wrapper.startup.listener.class and a
wrapper.startup.timelimit, then the WrapperStartStopApp could simply
call my class to determine if the service has completed startup
procedures. This limits my code writing to a single method
(isReady()) that determines whether the service is fully operational.
boolean appStarted = false;
long startTimeLimit = /* value of wrapper.startup.timelimit property */ ;
while (startTimeLimit > 0) {
if ( /* wrapper.startup.listener.class */ .isReady()) break;
WrapperManager.signalStarting( 5000 );
startTimeLimit = startTimeLimit - 5000;
}
|