|
From: <TEI...@te...> - 2006-06-16 09:06:56
|
Thanks, David!
I don't think that's the case. I'll try to draw it with more detail. I de=
veloped my application without Wrapper in mind in the first=20
instance. Lets call the first app "Server" and "Manager" would be the secon=
d one.=20
Server is an event driven application, there's an event queue from where =
it pops events. When a "shutdown" event is read, Server stops=20
reading events, asks avery of its working threads (non daemon threads) to s=
top (they will close connections) and waits until all of them=20
have stopped (this doesn't take more than 5s).
Server logs almost every meaningful event/action it takes.
The whole system, running alone, outside the wrapper, would log something=
like this.
1. Server: Start=20
2. Server: Launching a "connector" thread to handle incoming connections=
.
3. Server: Trying to connect to other applications (more threads and con=
nections)
...
4. Server: Receiving an incoming connection -> a worker thread is launch=
ed in order to handle it.
...
At this moment a number of (non daemon) threads are running.
...
5. Manager: Connected to the server, sent a shutdown command, closed con=
nection and finish.
6. Server: ( ... keeps doing its thing ...) A "shutdown" command/event w=
as read.
7. Server: Ask avery single thread to stop (threads will close connectio=
ns as soon as possible).
8. Server: Wait for every single thread to stop.
9. Server: Finish
The whole system, running into the wrapper
1. Server: Start=20
2. Server: Launching a "connector" thread to handle incoming connections=
.
3. Server: Trying to connect to other applications - more threads and co=
nnections
...
4. Server: Receiving an incoming connection -> a worker thread is launch=
ed in order to handle it.
...
At this moment a number of (non daemon) threads are running.
...
5. Manager: Connected to the server, sent a shutdown command, closed con=
nection and finish.
6. Server: ( ... keeps doing its thing ...) A "shutdown" command/event w=
as read.
At this moment Manager is already dead and WrapperStartStopApp seems =
has decided to kill Server too, cause logging output was=20
truncated
I added a Thread.sleep(5000) to make sure Manager's death was after Serve=
r's, the resulting logging output was the same as if the system=20
were running alone, that is, not into WrapperStartStopApp.
Further comments, please!
Prueba el correo Terra ( http://www.terra.es/correo ); Seguro, r=C3=A1pido,=
fiable.
|