INT-1431, added SimpleMessageProducingHandlerMonitor to maintain semantics of some MessageHandlers also being MessageProducers

This commit is contained in:
Oleg Zhurakousky
2010-09-15 13:50:16 -04:00
parent d99739a6bf
commit b2533c0788
6 changed files with 144 additions and 4 deletions

View File

@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration-2.0.xsd"
xmlns:int="http://www.springframework.org/schema/integration"
xmlns:p="http://www.springframework.org/schema/p">
<int:channel id="controlChannel" />
<bean id="controlBus" class="org.springframework.integration.control.ControlBus">
<constructor-arg ref="mbeanExporter" />
<constructor-arg ref="mbeanServer" />
<constructor-arg ref="controlChannel" />
</bean>
<bean id="mbeanExporter"
class="org.springframework.integration.monitor.IntegrationMBeanExporter"
p:server-ref="mbeanServer" p:domain="forum" />
<bean id="mbeanServer" class="org.springframework.jmx.support.MBeanServerFactoryBean"
p:locateExistingServerIfPossible="true" />
<int:chain input-channel="inputChannel">
<int:transformer>
<bean class="org.springframework.integration.monitor.ChainWithMessageProducingHandlersTests.SampleProducer" />
</int:transformer>
<int:service-activator>
<bean class="org.springframework.integration.monitor.ChainWithMessageProducingHandlersTests.SampleService" />
</int:service-activator>
</int:chain>
</beans>

View File

@@ -0,0 +1,40 @@
/**
*
*/
package org.springframework.integration.monitor;
import static junit.framework.Assert.assertNotNull;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
/**
* @author Oleg Zhurakousky
*
*/
@ContextConfiguration
@RunWith(SpringJUnit4ClassRunner.class)
public class ChainWithMessageProducingHandlersTests {
@Autowired
private ApplicationContext applicationContext;
@Test
public void testSuccessfullApplicationContext(){
// this is all we need to do. Until INT-1431 was solved initialization of this AC would fail.
assertNotNull(applicationContext);
}
public static class SampleProducer{
public String echo(String value){
return value;
}
}
public static class SampleService{
public void echo(String value){}
}
}