<?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:si="http://www.springframework.org/schema/integration"
	xmlns:jmx="http://www.springframework.org/schema/integration/jmx"
	xmlns:stream="http://www.springframework.org/schema/integration/stream"
	xmlns:context="http://www.springframework.org/schema/context"
	xsi:schemaLocation="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
		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/stream https://www.springframework.org/schema/integration/stream/spring-integration-stream.xsd">

	<context:mbean-export/>
	<context:mbean-server/>

	<context:component-scan base-package="org.springframework.integration.samples.jmx"/>

	<jmx:attribute-polling-channel-adapter channel="seconds"
			object-name="org.springframework.integration.samples.jmx:type=StopWatch,name=stopWatch"
			attribute-name="Seconds">
		<si:poller max-messages-per-poll="1" fixed-delay="1000"/>
	</jmx:attribute-polling-channel-adapter>

	<si:publish-subscribe-channel id="seconds"/>

	<stream:stdout-channel-adapter channel="seconds" append-newline="true"/>

	<si:filter input-channel="seconds" expression="payload >= 10" output-channel="reset"/>

	<jmx:operation-invoking-channel-adapter id="reset"
			object-name="org.springframework.integration.samples.jmx:type=StopWatch,name=stopWatch"
			operation-name="reset"/>

</beans>
