<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xmlns:context="http://www.springframework.org/schema/context"
	xmlns:si="http://www.springframework.org/schema/integration"
	xmlns:jmx="http://www.springframework.org/schema/integration/jmx"
	xsi:schemaLocation="http://www.springframework.org/schema/beans
			https://www.springframework.org/schema/beans/spring-beans.xsd
			http://www.springframework.org/schema/context
			https://www.springframework.org/schema/context/spring-context.xsd
			http://www.springframework.org/schema/integration
			https://www.springframework.org/schema/integration/spring-integration.xsd
			http://www.springframework.org/schema/integration/jmx
			https://www.springframework.org/schema/integration/jmx/spring-integration-jmx.xsd">

	<context:mbean-export server="mbeanServer"/>

	<bean id="mbeanServer" class="org.springframework.jmx.support.MBeanServerFactoryBean"/>

	<si:channel id="withReplyChannel">
		<si:queue/>
	</si:channel>

	<si:channel id="withReplyChannelOutput">
		<si:queue/>
	</si:channel>

	<si:channel id="withNoReplyChannel"/>

	<jmx:operation-invoking-outbound-gateway request-channel="withReplyChannel"
			reply-channel="withReplyChannelOutput"
			object-name="org.springframework.integration.jmx.config:type=TestBean,name=testBeanGateway"
			operation-name="testWithReturn">
		<si:poller fixed-delay="100"/>
		<jmx:request-handler-advice-chain>
			<bean class="org.springframework.integration.jmx.config.OperationInvokingOutboundGatewayTests.FooAdvice" />
		</jmx:request-handler-advice-chain>
	</jmx:operation-invoking-outbound-gateway>

	<si:channel id="primitiveChannel"/>

	<jmx:operation-invoking-outbound-gateway request-channel="primitiveChannel"
			reply-channel="withReplyChannelOutput"
			object-name="org.springframework.integration.jmx.config:type=TestBean,name=testBeanGateway"
			operation-name="testPrimitiveArgs"
			requires-reply="false" />

	<si:chain id="operationInvokingWithinChain" input-channel="jmxOutboundGatewayInsideChain" output-channel="withReplyChannelOutput">
		<jmx:operation-invoking-outbound-gateway operation-name="testWithReturn" requires-reply="true"
						object-name="org.springframework.integration.jmx.config:type=TestBean,name=testBeanGateway"/>
	</si:chain>

	<jmx:operation-invoking-outbound-gateway request-channel="withNoReplyChannel"
			object-name="org.springframework.integration.jmx.config:type=TestBean,name=testBeanGateway"
			operation-name="test"
			requires-reply="false"/>

	<bean id="testBeanGateway" class="org.springframework.integration.jmx.config.TestBean"/>
</beans>
