public final class PageSubscriptionImpl extends Object implements PageSubscription
Modifier and Type | Class and Description |
---|---|
class |
PageSubscriptionImpl.PageCursorInfo
This will hold information about the pending ACKs towards a page.
|
Modifier and Type | Method and Description |
---|---|
void |
ack(PagedReference reference) |
void |
ackTx(Transaction tx,
PagedReference reference) |
void |
addPendingDelivery(PagePosition position) |
void |
bookmark(PagePosition position) |
void |
cleanupEntries(boolean completeDelete)
It will cleanup all the records for completed pages
|
void |
confirmPosition(PagePosition position) |
void |
confirmPosition(Transaction tx,
PagePosition position) |
boolean |
contains(PagedReference ref) |
void |
destroy()
All the data associated with the cursor should go away here
|
void |
disableAutoCleanup() |
void |
enableAutoCleanup() |
void |
flushExecutors()
wait all the scheduled runnables to finish their current execution
|
PageSubscriptionCounter |
getCounter() |
long |
getDeliveredCount() |
long |
getDeliveredSize() |
ArtemisExecutor |
getExecutor() |
long |
getFirstPage() |
long |
getId() |
long |
getMessageCount() |
PageSubscriptionImpl.PageCursorInfo |
getPageInfo(long pageNr) |
PagingStore |
getPagingStore() |
long |
getPersistentSize() |
PageCursorProvider |
getProvider() |
Queue |
getQueue() |
void |
incrementDeliveredSize(long size) |
boolean |
isComplete(long page) |
boolean |
isPaging()
Used as a delegate method to
PagingStore.isPaging() |
boolean |
isPersistent() |
PageIterator |
iterator() |
PageIterator |
iterator(boolean browsing) |
void |
lateDeliveryRollback(PagePosition position) |
void |
notEmpty()
This is a callback to inform the PageSubscription that something was routed, so the empty flag can be cleared
|
void |
onDeletePage(Page deletedPage) |
void |
onPageModeCleared(Transaction tx) |
void |
positionIgnored(PagePosition position)
To be called when the cursor decided to ignore a position.
|
void |
printDebug() |
void |
printDebug(String msg) |
void |
processReload() |
PagedMessage |
queryMessage(PagePosition pos)
To be used to requery the reference case the Garbage Collection removed it from the PagedReference as it's using WeakReferences
|
void |
redeliver(PageIterator iterator,
PagePosition position)
To be used on redeliveries
|
void |
reloadACK(PagePosition position)
Theres no need to synchronize this method as it's only called from journal load on startup
|
boolean |
reloadPageCompletion(PagePosition position)
A page marked as complete will be ignored until it's cleared.
|
void |
reloadPageInfo(long pageNr) |
void |
reloadPreparedACK(Transaction tx,
PagePosition position)
To be used to avoid a redelivery of a prepared ACK after load
|
void |
removePendingDelivery(PagePosition position) |
void |
scheduleCleanupCheck() |
void |
setQueue(Queue queue) |
void |
stop() |
String |
toString() |
public PagingStore getPagingStore()
getPagingStore
in interface PageSubscription
public Queue getQueue()
getQueue
in interface PageSubscription
public boolean isPaging()
PageSubscription
PagingStore.isPaging()
isPaging
in interface PageSubscription
public void setQueue(Queue queue)
setQueue
in interface PageSubscription
public void disableAutoCleanup()
disableAutoCleanup
in interface PageSubscription
public void enableAutoCleanup()
enableAutoCleanup
in interface PageSubscription
public PageCursorProvider getProvider()
public void notEmpty()
PageSubscription
notEmpty
in interface PageSubscription
public void bookmark(PagePosition position) throws Exception
bookmark
in interface PageSubscription
Exception
public long getMessageCount()
getMessageCount
in interface PageSubscription
public long getPersistentSize()
getPersistentSize
in interface PageSubscription
public PageSubscriptionCounter getCounter()
getCounter
in interface PageSubscription
public boolean reloadPageCompletion(PagePosition position) throws Exception
Usually paging is a stream of messages but in certain scenarios (such as a pending prepared TX) we may have big holes on the page streaming, and we will need to ignore such pages on the cursor/subscription.
reloadPageCompletion
in interface PageSubscription
Exception
public void scheduleCleanupCheck()
scheduleCleanupCheck
in interface PageSubscription
public void onPageModeCleared(Transaction tx) throws Exception
onPageModeCleared
in interface PageSubscription
Exception
public void cleanupEntries(boolean completeDelete) throws Exception
cleanupEntries
in interface PageSubscription
Exception
public PageIterator iterator()
iterator
in interface PageSubscription
public PageIterator iterator(boolean browsing)
iterator
in interface PageSubscription
public void confirmPosition(Transaction tx, PagePosition position) throws Exception
confirmPosition
in interface PageSubscription
Exception
public void ackTx(Transaction tx, PagedReference reference) throws Exception
ackTx
in interface PageSubscription
Exception
public void ack(PagedReference reference) throws Exception
ack
in interface PageSubscription
Exception
public boolean contains(PagedReference ref) throws Exception
contains
in interface PageSubscription
Exception
public void confirmPosition(PagePosition position) throws Exception
confirmPosition
in interface PageSubscription
Exception
public long getFirstPage()
getFirstPage
in interface PageSubscription
public void addPendingDelivery(PagePosition position)
addPendingDelivery
in interface PageSubscription
public void removePendingDelivery(PagePosition position)
removePendingDelivery
in interface PageSubscription
public void redeliver(PageIterator iterator, PagePosition position)
PageSubscription
redeliver
in interface PageSubscription
public PagedMessage queryMessage(PagePosition pos)
PageSubscription
queryMessage
in interface PageSubscription
public void reloadACK(PagePosition position)
reloadACK
in interface PageSubscription
public void reloadPreparedACK(Transaction tx, PagePosition position)
PageSubscription
reloadPreparedACK
in interface PageSubscription
public void positionIgnored(PagePosition position)
PageSubscription
positionIgnored
in interface PageSubscription
public void lateDeliveryRollback(PagePosition position)
lateDeliveryRollback
in interface PageSubscription
public boolean isComplete(long page)
isComplete
in interface PageSubscription
public void destroy() throws Exception
destroy
in interface PageSubscription
Exception
public long getId()
getId
in interface PageSubscription
public boolean isPersistent()
isPersistent
in interface PageSubscription
public void processReload() throws Exception
processReload
in interface PageSubscription
Exception
public void flushExecutors()
PageSubscription
flushExecutors
in interface PageSubscription
public void stop()
stop
in interface PageSubscription
public void printDebug()
printDebug
in interface PageSubscription
public void printDebug(String msg)
public void onDeletePage(Page deletedPage) throws Exception
onDeletePage
in interface PageSubscription
Exception
public ArtemisExecutor getExecutor()
getExecutor
in interface PageSubscription
public void reloadPageInfo(long pageNr)
reloadPageInfo
in interface PageSubscription
public PageSubscriptionImpl.PageCursorInfo getPageInfo(long pageNr)
public long getDeliveredCount()
getDeliveredCount
in interface PageSubscription
public long getDeliveredSize()
getDeliveredSize
in interface PageSubscription
public void incrementDeliveredSize(long size)
incrementDeliveredSize
in interface PageSubscription
Copyright © 2019 JBoss by Red Hat. All rights reserved.