@Override public void stop() { if (this.endpoint != null) { this.endpoint.stop(); } }
@Override public void stop() { if (this.gatherEndpoint != null) { this.gatherEndpoint.stop(); } }
@Override // guarded by super#lifecycleLock protected void doStop() { if (this.replyMessageCorrelator != null) { this.replyMessageCorrelator.stop(); } }
@Override public void stop(Runnable callback) { if (this.endpoint != null) { this.endpoint.stop(callback); } else { callback.run(); } }
@Override @ManagedOperation public final void stop() { this.delegate.stop(); }
@After public void tearDown() { this.serviceActivator.stop(); }
@After public void tearDown() { this.serviceRelay.stop(); }
@After public void tearDown() { this.serviceActivator.stop(); }
@Override public void stop() { if (this.gatherEndpoint != null) { this.gatherEndpoint.stop(); } }
@Override public void stop() { if (this.endpoint != null) { this.endpoint.stop(); } }
@Override // guarded by super#lifecycleLock protected void doStop() { if (this.replyMessageCorrelator != null) { this.replyMessageCorrelator.stop(); } }
public void stop() { if (this.endpoint != null) { this.endpoint.stop(); } }
@Override public void stop() { endpoint.stop(); }
@Override public void stop(Runnable callback) { if (this.endpoint != null) { this.endpoint.stop(callback); } else { callback.run(); } }
@Test public void methodInvokingTransformer() { this.input.send(new GenericMessage<String>("foo")); Message<?> reply = this.output.receive(0); assertEquals("FOO", reply.getPayload()); assertEquals(1, adviceCalled); this.direct.send(new GenericMessage<String>("foo")); reply = this.output.receive(0); assertEquals("FOO", reply.getPayload()); StackTraceElement[] st = (StackTraceElement[]) reply.getHeaders().get("callStack"); assertEquals("doSend", st[6].getMethodName()); // no MethodInvokerHelper this.directRef.send(new GenericMessage<String>("foo")); reply = this.output.receive(0); assertEquals("FOO", reply.getPayload()); st = (StackTraceElement[]) reply.getHeaders().get("callStack"); assertEquals("doSend", st[6].getMethodName()); // no MethodInvokerHelper assertTrue(this.testBean.isRunning()); this.pojoTransformer.stop(); assertFalse(this.testBean.isRunning()); this.pojoTransformer.start(); assertTrue(this.testBean.isRunning()); this.directRef.send(new GenericMessage<String>("bar")); assertNull(this.output.receive(0)); }
@Test public void methodInvokingFilterRejects() { this.input.send(new GenericMessage<String>("foo")); Message<?> reply = this.output.receive(0); assertNull(reply); assertTrue(this.testBean.isRunning()); this.pojoFilter.stop(); assertFalse(this.testBean.isRunning()); this.pojoFilter.start(); assertTrue(this.testBean.isRunning()); }
/** * The service invocation won't succeed. Logs the failed request to the DB and finishes the flow. * @param msg */ public Message<?> handleFailedInvocation(MessageHandlingException exception) { logger.info("Failed to succesfully invoke service. Logging to DB..."); retryAdapter.stop(); return exception.getFailedMessage(); } }
/** * Receives the result from a succesful service invocation. Flow finishes here. * @param msg */ public void handleServiceResult(Message<?> msg) { logger.info("Service result received: {}", ((ClientDataResponse) msg.getPayload()).getConfirmationId()); retryAdapter.stop(); }
@Test public void testSplitterAnnotation() { MessagingAnnotationPostProcessor postProcessor = new MessagingAnnotationPostProcessor(); postProcessor.setBeanFactory(context.getBeanFactory()); postProcessor.afterPropertiesSet(); TestSplitter splitter = new TestSplitter(); postProcessor.postProcessAfterInitialization(splitter, "testSplitter"); context.refresh(); inputChannel.send(new GenericMessage<>("this.is.a.test")); Message<?> message1 = outputChannel.receive(500); assertNotNull(message1); assertEquals("this", message1.getPayload()); Message<?> message2 = outputChannel.receive(500); assertNotNull(message2); assertEquals("is", message2.getPayload()); Message<?> message3 = outputChannel.receive(500); assertNotNull(message3); assertEquals("a", message3.getPayload()); Message<?> message4 = outputChannel.receive(500); assertNotNull(message4); assertEquals("test", message4.getPayload()); assertNull(outputChannel.receive(0)); AbstractEndpoint endpoint = context.getBean(AbstractEndpoint.class); assertTrue(splitter.isRunning()); endpoint.stop(); assertFalse(splitter.isRunning()); endpoint.start(); assertTrue(splitter.isRunning()); context.stop(); }
@Test public void pojoRouter() { Message<?> message1 = MessageBuilder.withPayload(new TestBean("foo")).build(); Message<?> message2 = MessageBuilder.withPayload(new TestBean("bar")).build(); Message<?> message3 = MessageBuilder.withPayload(new TestBean("baz")).build(); pojoRouter.send(message1); assertNotNull(fooChannelForPojo.receive(0)); assertNull(barChannelForPojo.receive(0)); assertNull(defaultChannelForPojo.receive(0)); pojoRouter.send(message2); assertNotNull(barChannelForPojo.receive(0)); assertNull(fooChannelForPojo.receive(0)); assertNull(defaultChannelForPojo.receive(0)); pojoRouter.send(message3); assertNotNull(defaultChannelForPojo.receive(0)); assertNull(fooChannelForPojo.receive(0)); assertNull(barChannelForPojo.receive(0)); assertTrue(this.testBean.isRunning()); this.pojoRouterEndpoint.stop(); assertFalse(this.testBean.isRunning()); this.pojoRouterEndpoint.start(); assertTrue(this.testBean.isRunning()); }