ARTEMIS-2224 Javadoc changes after the paging lock changes

This commit is contained in:
Clebert Suconic 2019-01-14 11:38:46 -05:00
parent e6fe9f9d92
commit 4bcad4bf47
2 changed files with 6 additions and 6 deletions

View File

@ -69,6 +69,11 @@ public interface PagingStore extends ActiveMQComponent, RefCountMessageListener
void applySetting(AddressSettings addressSettings);
/** This method will look if the current state of paging is not paging,
* without using a lock.
* For cases where you need absolutely atomic results, check it directly on the internal variables while requiring a readLock.
*
* It's ok to look for this with an estimate on starting a task or not, but you will need to recheck on actual paging operations. */
boolean isPaging();
/**

View File

@ -493,12 +493,7 @@ public class PagingStoreImpl implements PagingStore {
lock.readLock().lock();
try {
// I'm not calling isPaging() here because
// isPaging will perform extra steps.
// at this context it doesn't really matter what policy we are using
// since this method is only called when paging.
// Besides that isPaging() will perform lock.readLock() again which is not needed here
// for that reason the attribute is used directly here.
// I'm not calling isPaging() here because i need to be atomic and hold a lock.
if (paging) {
return false;
}