SmartLifecycle default methods for auto-startup in default phase

Issue: SPR-17188
This commit is contained in:
Juergen Hoeller
2018-08-16 12:08:02 +02:00
parent 446a604ad0
commit 2ec8fa9cac
15 changed files with 97 additions and 144 deletions

View File

@@ -66,7 +66,7 @@ public class JmsListenerEndpointRegistry implements DisposableBean, SmartLifecyc
private final Map<String, MessageListenerContainer> listenerContainers =
new ConcurrentHashMap<>();
private int phase = Integer.MAX_VALUE;
private int phase = DEFAULT_PHASE;
@Nullable
private ApplicationContext applicationContext;
@@ -198,11 +198,6 @@ public class JmsListenerEndpointRegistry implements DisposableBean, SmartLifecyc
return this.phase;
}
@Override
public boolean isAutoStartup() {
return true;
}
@Override
public void start() {
for (MessageListenerContainer listenerContainer : getListenerContainers()) {

View File

@@ -66,7 +66,7 @@ public abstract class AbstractJmsListeningContainer extends JmsDestinationAccess
private boolean autoStartup = true;
private int phase = Integer.MAX_VALUE;
private int phase = DEFAULT_PHASE;
@Nullable
private String beanName;
@@ -319,12 +319,6 @@ public abstract class AbstractJmsListeningContainer extends JmsDestinationAccess
}
}
@Override
public void stop(Runnable callback) {
stop();
callback.run();
}
/**
* Notify all invoker tasks and stop the shared Connection, if any.
* @throws JMSException if thrown by JMS API methods