INT-2485 Orderly Shutdown
Initial commit - @ManagedOperation on IMBE - can be invoked via JMX, <control-bus/>, or getting a reference to the IMBE from the application context. INT-2485 Updates After Review Comments (JIRA) * Shutdown Schedulers first, and wait for them * Add a force parameter, which overrides thread pool shutdown options * Shutdown Sources/Channels after all thread pools have stopped * Mark other components as OrderlyShutdownCapable (e.g. JMS/AMQP Listener containers) and shut them down first * Wait for remaining time to allow for quiescence Also * remove TimeUnit parameter (not JMX-friendly); time limit is now always milliseconds * If thread pools don't stop in time limit, force them down. INT-2485 Handle Self-Destruction Add shutdown-executor to IMBE. When the shutdown was called on a Spring-Managed thread, the shutdown was not clean because we timed out waiting for the current thread to terminate. After that, we force terminated other components. Now, by providing a dedicated Executor for the shutdown process, it is used for the shutdown instead of the current thread. This Executor is *not* shutdown. It is not necessary to provide an Executor if the stopActiveComponents() method is called on some other thread that is not involved in the shutdown. Also adds executor name to logs, when available. INT-2485 Polishing Fix MBean object name collision when running all tests. INT-2485 Enable TCP Shutdown Make TCP connection factories 'OrderlyShutdownCapable' so they are stopped before schedulers/executors in order for them to release any executor threads they are holding. INT-2485 Polishing Didn't need DirectFieldAccessor - scheduler and executor have an accessor for the native ExecutorService. Copyrights INT-2485 Polishing schemaLocation version. INT-2485 PR Review Polishing
This commit is contained in:
committed by
Oleg Zhurakousky
parent
77e3886a12
commit
0a12a496cc
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2011 the original author or authors.
|
||||
* Copyright 2002-2012 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -17,6 +17,7 @@
|
||||
package org.springframework.integration.jms;
|
||||
|
||||
import org.springframework.beans.factory.DisposableBean;
|
||||
import org.springframework.integration.core.OrderlyShutdownCapable;
|
||||
import org.springframework.integration.endpoint.AbstractEndpoint;
|
||||
import org.springframework.jms.listener.AbstractMessageListenerContainer;
|
||||
import org.springframework.util.Assert;
|
||||
@@ -27,8 +28,10 @@ import org.springframework.util.Assert;
|
||||
*
|
||||
* @author Mark Fisher
|
||||
* @author Oleg Zhurakousky
|
||||
* @author Gary Russell
|
||||
*/
|
||||
public class JmsMessageDrivenEndpoint extends AbstractEndpoint implements DisposableBean {
|
||||
public class JmsMessageDrivenEndpoint extends AbstractEndpoint implements
|
||||
DisposableBean, OrderlyShutdownCapable {
|
||||
|
||||
private final AbstractMessageListenerContainer listenerContainer;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user