{
if (wasLive)
{
// if the page was live at any point, we need to
// get the number of messages from the page-cache
PageCache localcache = this.cache.get();
if (localcache == null)
{
localcache = cursorProvider.getPageCache(pageId);
this.cache = new WeakReference<PageCache>(localcache);
}
return localcache.getNumberOfMessages();
}
else
{
return numberOfMessages;
}