我目前正在使用Spring Integration Suite(STS)(版本:3.6.4.201412021321-CI-B775,Build Id:201411281415,平台:Eclipse Luna SR1(4.4.1))和Spring Integration 4.1.0。
我有一个Spring配置XML文件,其中包含Spring Integration命名空间。我有一个很大的工作流程很难在集成图上很好地布局,并且自动布局"模式。因此我做了以下事情:
要重现使用此XML上下文。
<?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:int="http://www.springframework.org/schema/integration" xmlns:task="http://www.springframework.org/schema/task" xsi:schemaLocation="http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task.xsd">
<int:inbound-channel-adapter id="fileAdapter" ref="fileReadingMessageSource" method="receive" auto-startup="true" channel="files">
<int:poller fixed-delay="#{T(java.lang.Integer).MAX_VALUE}" />
</int:inbound-channel-adapter>
<bean id="fileReadingMessageSource" class="org.springframework.integration.file.FileReadingMessageSource">
<property name="directory" value="C:/Users/af25830/Desktop/tmg-exchange-gateway-nam/t2" />
</bean>
<int:channel id="files" />
<int:logging-channel-adapter id="logger" level="INFO" logger-name="fileLogger" channel="files" auto-startup="false" />
</beans>
最初的图形如下所示:
.settings/com.springsource.sts.config.flow.prefs
包含:
//com.springsource.sts.config.flow.coordinates\:http\://www.springframework.org/schema/integration\:/spring-integration-test/src/main/resources/META-INF/spring/integration/spring-integration-test-context.xml=<?xml version\="1.0" encoding\="UTF-8"?>\r\n<graph>\r\n<element clazz\="InboundChannelAdapterModelElement" type\="inbound-channel-adapter">\r\n<structure end\="1038" endstart\="1008" start\="809" startend\="939"/>\r\n<bounds height\="118" width\="120" x\="19" y\="17"/>\r\n</element>\r\n<element clazz\="ChannelModelElement" type\="channel">\r\n<structure end\="1280" endstart\="1280" start\="1254" startend\="1280"/>\r\n<bounds height\="118" width\="120" x\="159" y\="17"/>\r\n</element>\r\n<element clazz\="LoggingChannelAdapterModelElement" type\="logging-channel-adapter">\r\n<structure end\="1401" endstart\="1401" start\="1283" startend\="1401"/>\r\n<bounds height\="118" width\="120" x\="299" y\="17"/>\r\n</element>\r\n</graph>
输入&#34;手动布局&#34;并移动一些东西让它看起来像这样:
.settings/com.springsource.sts.config.flow.prefs
包含:
//com.springsource.sts.config.flow.coordinates\:http\://www.springframework.org/schema/integration\:/spring-integration-test/src/main/resources/META-INF/spring/integration/spring-integration-test-context.xml=<?xml version\="1.0" encoding\="UTF-8"?>\r\n<graph>\r\n<element clazz\="InboundChannelAdapterModelElement" type\="inbound-channel-adapter">\r\n<structure end\="1038" endstart\="1008" start\="809" startend\="939"/>\r\n<bounds height\="118" width\="120" x\="19" y\="17"/>\r\n</element>\r\n<element clazz\="ChannelModelElement" type\="channel">\r\n<structure end\="1280" endstart\="1280" start\="1254" startend\="1280"/>\r\n<bounds height\="118" width\="120" x\="159" y\="17"/>\r\n</element>\r\n<element clazz\="LoggingChannelAdapterModelElement" type\="logging-channel-adapter">\r\n<structure end\="1401" endstart\="1401" start\="1283" startend\="1401"/>\r\n<bounds height\="118" width\="120" x\="337" y\="148"/>\r\n</element>\r\n</graph>
转到&#34;来源&#34;选项卡并进行任何更改(删除一个字符并重新添加)。保存文件。
.settings/com.springsource.sts.config.flow.prefs
包含:
//com.springsource.sts.config.flow.coordinates\:http\://www.springframework.org/schema/integration\:/spring-integration-test/src/main/resources/META-INF/spring/integration/spring-integration-test-context.xml=<?xml version\="1.0" encoding\="UTF-8"?>\r\n<graph>\r\n<element clazz\="InboundChannelAdapterModelElement" type\="inbound-channel-adapter">\r\n<structure end\="1038" endstart\="1008" start\="809" startend\="939"/>\r\n<bounds height\="118" width\="120" x\="19" y\="17"/>\r\n</element>\r\n<element clazz\="ChannelModelElement" type\="channel">\r\n<structure end\="1280" endstart\="1280" start\="1254" startend\="1280"/>\r\n<bounds height\="118" width\="120" x\="159" y\="17"/>\r\n</element>\r\n<element clazz\="LoggingChannelAdapterModelElement" type\="logging-channel-adapter">\r\n<structure end\="1401" endstart\="1401" start\="1283" startend\="1401"/>\r\n<bounds height\="118" width\="120" x\="299" y\="17"/>\r\n</element>\r\n</graph>
返回集成图表标签,转到&#34;手动布局&#34;模式,您现在可以看到您的更改已恢复。
这是非常常见的,因此,如果&#34;手动布局&#34;每当编辑原始XML文件时,编辑都不会被恢复。
我错过了一个可以防止这种情况发生的步骤吗?