INT-2702 Mail ThreadLocal Polishing

Change set(null) to remove()

Eliminate folder close from destroy() method. It no longer makes
sense to do that there.
This commit is contained in:
Gary Russell
2012-08-15 16:00:13 -04:00
committed by Oleg Zhurakousky
parent 1edac11fba
commit 0da9baf26d

View File

@@ -321,7 +321,6 @@ public abstract class AbstractMailReceiver extends IntegrationObjectSupport impl
}
public synchronized void destroy() throws Exception {
MailTransportUtils.closeFolder(this.contextHolder.get().getFolder(), this.shouldDeleteMessages);
MailTransportUtils.closeService(this.store);
this.store = null;
this.initialized = false;
@@ -411,7 +410,7 @@ public abstract class AbstractMailReceiver extends IntegrationObjectSupport impl
}
Folder folder = context.getFolder();
MailTransportUtils.closeFolder(folder, this.shouldDeleteMessages);
this.contextHolder.set(null);
this.contextHolder.remove();
if (exceptionToThrow != null) {
throw exceptionToThrow;
}
@@ -420,7 +419,7 @@ public abstract class AbstractMailReceiver extends IntegrationObjectSupport impl
public void closeContextAfterFailure(MailReceiverContext context) {
Assert.notNull(context, "Mail Reader Context cannot be null");
MailTransportUtils.closeFolder(context.getFolder(), false);
this.contextHolder.set(null);
this.contextHolder.remove();
}
}