Merge pull request #21 from garyrussell/INTSAMPLES-39
INTSAMPLES-39 Synchronize Context Creation
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user