Merge pull request #21 from garyrussell/INTSAMPLES-39

INTSAMPLES-39 Synchronize Context Creation
This commit is contained in:
Gunnar Hillert
2011-12-16 12:14:35 -08:00

View File

@@ -46,6 +46,14 @@ public class DynamicFtpChannelResolver {
* @return a channel
*/
public MessageChannel resolve(String customer) {
MessageChannel channel = this.channels.get(customer);
if (channel == null) {
channel = createNewCustomerChannel(customer);
}
return channel;
}
private synchronized MessageChannel createNewCustomerChannel(String customer) {
MessageChannel channel = this.channels.get(customer);
if (channel == null) {
ConfigurableApplicationContext ctx = new ClassPathXmlApplicationContext(