INT-2515 More Orderly Shutdown

* Add beginShutdown() and endShutdown() to OrderlyShutdownCapable
* JMS/AMQP stop listener containers
* TCP (server side)
** after beginShutdown() disallow new connections, drop (log) new messages
** after endShutdown() close server socket
* HTTP (server side)
** after beginShutdown() disallow any new requests (503 Service Unavailable)

* Docbook updates
** What's new section
** Orderly Shutdown section.
This commit is contained in:
Gary Russell
2012-06-19 15:21:53 -04:00
committed by Gunnar Hillert
parent da858b7451
commit ae0abc4f6c
17 changed files with 516 additions and 140 deletions

View File

@@ -25,7 +25,7 @@ import org.springframework.util.Assert;
/**
* A message-driven endpoint that receive JMS messages, converts them into
* Spring Integration Messages, and then sends the result to a channel.
*
*
* @author Mark Fisher
* @author Oleg Zhurakousky
* @author Gary Russell
@@ -65,13 +65,15 @@ public class JmsMessageDrivenEndpoint extends AbstractEndpoint implements
listener.setComponentName(this.getComponentName());
}
@Override
protected void doStart() {
this.listener.start();
if (!this.listenerContainer.isRunning()) {
this.listenerContainer.start();
this.listenerContainer.start();
}
}
@Override
protected void doStop() {
this.listenerContainer.stop();
this.listener.stop();
@@ -84,4 +86,15 @@ public class JmsMessageDrivenEndpoint extends AbstractEndpoint implements
this.listenerContainer.destroy();
}
public int beforeShutdown() {
this.stop();
return 0;
}
public int afterShutdown() {
return 0;
}
}