SGF-570 - Respect manual-start on Gateway Senders/Receivers but no longer couple the start/stop lifecycle to the Spring container.

(cherry picked from commit 6d8bee2b3461e088b04120f982ec56378ee64c9a)
Signed-off-by: John Blum <jblum@pivotal.io>
This commit is contained in:
John Blum
2016-11-18 19:43:09 -08:00
parent 7683d5434c
commit f02622cfa8
6 changed files with 68 additions and 158 deletions

View File

@@ -62,7 +62,6 @@ public class GatewayReceiverAutoStartNamespaceTest {
public void testAuto() throws Exception {
assertNotNull("The 'Auto' GatewayReceiverFactoryBean was not properly configured and initialized!",
autoGatewayReceiverFactory);
assertTrue(autoGatewayReceiverFactory.isAutoStartup());
GatewayReceiver autoGatewayReceiver = autoGatewayReceiverFactory.getObject();

View File

@@ -62,7 +62,6 @@ public class GatewayReceiverDefaultStartNamespaceTest {
public void testDefault() throws Exception {
assertNotNull("The 'Default' GatewayReceiverFactoryBean was not properly configured and initialized!",
defaultGatewayReceiverFactory);
assertTrue(defaultGatewayReceiverFactory.isAutoStartup());
GatewayReceiver defaultGatewayReceiver = defaultGatewayReceiverFactory.getObject();

View File

@@ -61,7 +61,6 @@ public class GatewayReceiverManualStartNamespaceTest {
public void testManual() throws Exception {
assertNotNull("The 'Manual' GatewayReceiverFactoryBean was not properly configured and initialized!",
manualGatewayReceiverFactory);
assertFalse(manualGatewayReceiverFactory.isAutoStartup());
GatewayReceiver manualGatewayReceiver = manualGatewayReceiverFactory.getObject();
@@ -74,5 +73,4 @@ public class GatewayReceiverManualStartNamespaceTest {
assertFalse(manualGatewayReceiver.isRunning());
assertEquals(8192, manualGatewayReceiver.getSocketBufferSize());
}
}

View File

@@ -141,6 +141,7 @@ public class StubGatewayReceiverFactory implements GatewayReceiverFactory {
@Override
public GatewayReceiverFactory setManualStart(final boolean manualStart) {
this.manualStart = manualStart;
this.running = !manualStart;
return this;
}