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

@@ -16,15 +16,33 @@
package org.springframework.integration.core;
/**
* Marker interface for components that wish to be considered for
* an orderly shutdown using management interfaces. Components that
* implement this interface will be stopped before schedulers,
* executors etc, in order for them to free up any execution
* threads they may be holding.
* Interface for components that wish to be considered for
* an orderly shutdown using management interfaces. beforeShuddown()
* will be called before schedulers, executors etc, are stopped.
* afterShutdown() is called after the shutdown delay.
*
* @author Gary Russell
* @since 2.2
*
*/
public interface OrderlyShutdownCapable {
/**
* Called before shutdown begins. Implementations should
* stop accepting new messages. Can optionally return the
* number of active messages in process.
* @return The number of active messages if available.
*/
int beforeShutdown();
/**
* Called after normal shutdown of schedulers, executors etc,
* and after the shutdown delay has elapsed, but before any
* forced shutdown of any remaining active scheduler/executor
* threads.Can optionally return the number of active messages
* still in process.
* @return The number of active messages if available.
*/
int afterShutdown();
}