JBoss Community

Re: Overall control of graceful shutdown

created by Brian Stansberry in JBoss AS7 Development - View the full discussion

The GracefulShutdownTerminator would be registered in start(StartContext). If the shutdown isn't meant to be graceful, the MSC would trigger an overall stop (probably by stopping a root service all the others depend on) and then would immediately invoke all the GracefulShutdownTerminators. So waiting until stop() to register the terminator would not work.

 

I smell a possible race there though even with registering in start().

 

Your question about the deployments/connector gets into the real heart of the issue, how subsystems and services that are part of a deployment can be composed such that the dependencies work out. I think it's worthwhile to think through how to do that, since whether or not the GracefulShutdownTerminator idea makes sense, using the MSC dependency mechanism is very likely going to be needed to get graceful shutdown to work.

 

For example, as *part* of a war deployment there could be a service that monitors the existence of active sessions during shutdown. It depends on some other service in the deployment (e.g. the session manager) and on the connector. The connector will not stop until that service stops. That service registers the GracefulShutdownTerminator.

Reply to this message by going to Community

Start a new discussion in JBoss AS7 Development at Community