<?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:int="http://www.springframework.org/schema/integration"
	xmlns:int-sftp="http://www.springframework.org/schema/integration/sftp"
	xsi:schemaLocation="http://www.springframework.org/schema/beans https://www.springframework.org/schema/beans/spring-beans.xsd
		http://www.springframework.org/schema/integration https://www.springframework.org/schema/integration/spring-integration.xsd
		http://www.springframework.org/schema/integration/sftp https://www.springframework.org/schema/integration/sftp/spring-integration-sftp.xsd">

	<bean id="extraConfig" class="org.springframework.integration.sftp.inbound.RollbackLocalFilterTests$Config" />

	<int-sftp:inbound-channel-adapter id="sftpAdapterAutoCreate"
			session-factory="sftpSessionFactory"
			channel="requestChannel"
			remote-directory-expression="'/sftpSource'"
			local-directory="file:local-test-dir/rollback"
			auto-create-local-directory="true"
			filename-pattern="sftpSource2.txt"
			local-filter="acceptOnceFilter">
		<int:poller fixed-rate="1000" max-messages-per-poll="2" error-channel="nullChannel">
			<int:transactional synchronization-factory="syncFactory" />
		</int:poller>
	</int-sftp:inbound-channel-adapter>

	<int:channel id="requestChannel" />

	<int:service-activator input-channel="requestChannel" ref="crash" method="handle" />

	<bean id="crash" class="org.springframework.integration.sftp.inbound.RollbackLocalFilterTests$Crash" />

	<bean id="acceptOnceFilter" class="org.springframework.integration.file.filters.AcceptOnceFileListFilter" />

	<int:transaction-synchronization-factory id="syncFactory">
		<int:after-rollback expression="@acceptOnceFilter.remove(payload)" />
	</int:transaction-synchronization-factory>

	<bean id="transactionManager" class="org.springframework.integration.transaction.PseudoTransactionManager" />

</beans>
