Example usage for org.springframework.integration.context OrderlyShutdownCapable afterShutdown

List of usage examples for org.springframework.integration.context OrderlyShutdownCapable afterShutdown

Introduction

In this page you can find the example usage for org.springframework.integration.context OrderlyShutdownCapable afterShutdown.

Prototype

int afterShutdown();

Source Link

Document

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.

Usage

From source file:hello.MetricsActivator.java

protected final void orderlyShutdownCapableComponentsAfter() {
    logger.debug("Finalizing stop OrderlyShutdownCapable components");
    Map<String, OrderlyShutdownCapable> components = this.applicationContext
            .getBeansOfType(OrderlyShutdownCapable.class);
    for (Entry<String, OrderlyShutdownCapable> componentEntry : components.entrySet()) {
        OrderlyShutdownCapable component = componentEntry.getValue();
        int n = component.afterShutdown();
        if (logger.isInfoEnabled()) {
            logger.info(//  w w  w  .  j  av a 2  s .  c  o  m
                    "Finalized stop for component " + component + "; it reported " + n + " active messages");
        }
    }
    logger.debug("Finalized stop OrderlyShutdownCapable components");
}

From source file:org.springframework.integration.monitor.IntegrationMBeanExporter.java

protected final void orderlyShutdownCapableComponentsAfter() {
    logger.debug("Finalizing stop OrderlyShutdownCapable components");
    Map<String, OrderlyShutdownCapable> components = this.applicationContext
            .getBeansOfType(OrderlyShutdownCapable.class);
    for (Entry<String, OrderlyShutdownCapable> componentEntry : components.entrySet()) {
        OrderlyShutdownCapable component = componentEntry.getValue();
        int n = component.afterShutdown();
        if (logger.isInfoEnabled()) {
            logger.info(/*from   www. j  a  v  a2s  .c o  m*/
                    "Finalized stop for component " + component + "; it reported " + n + " active messages");
        }
    }
    logger.debug("Initiated stop OrderlyShutdownCapable components");
}