File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed
main/java/org/springframework/jms/config
test/java/org/springframework/jms/config Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright 2002-2014 the original author or authors.
2
+ * Copyright 2002-2015 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -60,6 +60,8 @@ public abstract class AbstractJmsListenerContainerFactory<C extends AbstractMess
60
60
61
61
private Integer phase ;
62
62
63
+ private Boolean autoStartup ;
64
+
63
65
64
66
/**
65
67
* @see AbstractMessageListenerContainer#setConnectionFactory(ConnectionFactory)
@@ -138,6 +140,12 @@ public void setPhase(int phase) {
138
140
this .phase = phase ;
139
141
}
140
142
143
+ /**
144
+ * @see AbstractMessageListenerContainer#setAutoStartup(boolean)
145
+ */
146
+ public void setAutoStartup (boolean autoStartup ) {
147
+ this .autoStartup = autoStartup ;
148
+ }
141
149
142
150
@ Override
143
151
public C createListenerContainer (JmsListenerEndpoint endpoint ) {
@@ -176,6 +184,9 @@ public C createListenerContainer(JmsListenerEndpoint endpoint) {
176
184
if (this .phase != null ) {
177
185
instance .setPhase (this .phase );
178
186
}
187
+ if (this .autoStartup != null ) {
188
+ instance .setAutoStartup (this .autoStartup );
189
+ }
179
190
180
191
endpoint .setupListenerContainer (instance );
181
192
initializeContainer (instance );
Original file line number Diff line number Diff line change @@ -157,6 +157,7 @@ private void setDefaultJmsConfig(AbstractJmsListenerContainerFactory<?> factory)
157
157
factory .setPubSubDomain (true );
158
158
factory .setSubscriptionDurable (true );
159
159
factory .setClientId ("client-1234" );
160
+ factory .setAutoStartup (false );
160
161
}
161
162
162
163
private void assertDefaultJmsConfig (AbstractMessageListenerContainer container ) {
@@ -168,6 +169,7 @@ private void assertDefaultJmsConfig(AbstractMessageListenerContainer container)
168
169
assertEquals (true , container .isPubSubDomain ());
169
170
assertEquals (true , container .isSubscriptionDurable ());
170
171
assertEquals ("client-1234" , container .getClientId ());
172
+ assertEquals (false , container .isAutoStartup ());
171
173
}
172
174
173
175
private void setDefaultJcaConfig (DefaultJcaListenerContainerFactory factory ) {
You can’t perform that action at this time.
0 commit comments