Message Endpoints and the SimpleTaskScheduler now manage their own lifecycles. The ApplicationContextMessageBus is no longer necessary (part of INT-462). The MessagePublishingErrorHandler now detects the default error channel within the beanFactory if necessary (INT-464).

This commit is contained in:
Mark Fisher
2008-11-11 20:11:21 +00:00
parent 7c28053b0f
commit f4ccde6257
52 changed files with 759 additions and 1076 deletions

View File

@@ -23,7 +23,6 @@ import javax.jms.MessageProducer;
import javax.jms.Session;
import org.springframework.beans.factory.DisposableBean;
import org.springframework.context.Lifecycle;
import org.springframework.core.task.TaskExecutor;
import org.springframework.integration.core.Message;
import org.springframework.integration.gateway.SimpleMessagingGateway;
@@ -41,7 +40,7 @@ import org.springframework.util.Assert;
*
* @author Mark Fisher
*/
public class JmsInboundGateway extends SimpleMessagingGateway implements Lifecycle, DisposableBean {
public class JmsInboundGateway extends SimpleMessagingGateway implements DisposableBean {
private volatile AbstractMessageListenerContainer container;
@@ -190,19 +189,19 @@ public class JmsInboundGateway extends SimpleMessagingGateway implements Lifecyc
// Lifecycle implementation
public boolean isRunning() {
return (this.container != null && this.container.isRunning());
}
public void start() {
@Override
protected void doStart() {
this.initialize();
this.container.start();
super.doStart();
}
public void stop() {
@Override
protected void doStop() {
if (this.container != null) {
this.container.stop();
}
super.doStop();
}
// DisposableBean implementation

View File

@@ -81,8 +81,9 @@ public class JmsInboundChannelAdapterParserTests {
try {
new ClassPathXmlApplicationContext("jmsInboundWithDestinationOnly.xml", this.getClass());
}
catch (RuntimeException e) {
assertEquals(NoSuchBeanDefinitionException.class, e.getCause().getClass());
catch (BeanCreationException e) {
Throwable rootCause = e.getRootCause();
assertEquals(NoSuchBeanDefinitionException.class, rootCause.getClass());
throw e;
}
}

View File

@@ -10,8 +10,6 @@
http://www.springframework.org/schema/integration/jms
http://www.springframework.org/schema/integration/jms/spring-integration-jms-1.0.xsd">
<si:message-bus auto-startup="false"/>
<si:channel id="requestChannel">
<si:queue capacity="10"/>
</si:channel>

View File

@@ -10,8 +10,6 @@
http://www.springframework.org/schema/integration/jms
http://www.springframework.org/schema/integration/jms/spring-integration-jms-1.0.xsd">
<si:message-bus auto-startup="false"/>
<si:channel id="requestChannel">
<si:queue capacity="10"/>
</si:channel>

View File

@@ -10,8 +10,6 @@
http://www.springframework.org/schema/integration/jms
http://www.springframework.org/schema/integration/jms/spring-integration-jms-1.0.xsd">
<si:message-bus auto-startup="false"/>
<si:channel id="requestChannel">
<si:queue capacity="10"/>
</si:channel>