Interface PageSubscription
-
- All Known Implementing Classes:
PageSubscriptionImpl
public interface PageSubscription
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidack(PagedReference ref)voidackTx(Transaction tx, PagedReference position)voidaddPendingDelivery(PagePosition position)voidbookmark(PagePosition position)voidcleanupEntries(boolean completeDelete)voidconfirmPosition(PagePosition ref)voidconfirmPosition(Transaction tx, PagePosition position)booleancontains(PagedReference ref)voiddestroy()voiddisableAutoCleanup()voidenableAutoCleanup()voidflushExecutors()wait all the scheduled runnables to finish their current executionvoidforEachConsumedPage(Consumer<ConsumedPage> pageCleaner)PageSubscriptionCountergetCounter()longgetDeliveredCount()longgetDeliveredSize()ArtemisExecutorgetExecutor()longgetFirstPage()longgetId()longgetMessageCount()PagingStoregetPagingStore()longgetPersistentSize()QueuegetQueue()voidincrementDeliveredSize(long size)booleanisComplete(long page)booleanisPaging()Used as a delegate method toPagingStore.isPaging()booleanisPersistent()PageIteratoriterator()LinkedListIterator<PagedReference>iterator(boolean jumpRemoves)voidlateDeliveryRollback(PagePosition position)voidnotEmpty()This is a callback to inform the PageSubscription that something was routed, so the empty flag can be clearedvoidonDeletePage(Page deletedPage)voidonPageModeCleared(Transaction tx)voidpositionIgnored(PagePosition position)To be called when the cursor decided to ignore a position.voidprintDebug()voidprocessReload()PagedMessagequeryMessage(PagePosition pos)To be used to requery the reference case the Garbage Collection removed it from the PagedReference as it's using WeakReferencesvoidredeliver(PageIterator iterator, PagePosition position)To be used on redeliveriesvoidreloadACK(PagePosition position)booleanreloadPageCompletion(PagePosition position)voidreloadPageInfo(long pageNr)voidreloadPreparedACK(Transaction tx, PagePosition position)To be used to avoid a redelivery of a prepared ACK after loadvoidremovePendingDelivery(PagePosition position)voidscanAck(BooleanSupplier retryBeforeScan, ToIntFunction<PagedReference> scanFunction, Runnable found, Runnable notFound)This method will schedule scanning over Paging, however a retry should be done before the scanning.voidscheduleCleanupCheck()voidsetQueue(Queue queue)voidstop()
-
-
-
Method Detail
-
getPagingStore
PagingStore getPagingStore()
-
stop
void stop()
-
notEmpty
void notEmpty()
This is a callback to inform the PageSubscription that something was routed, so the empty flag can be cleared
-
bookmark
void bookmark(PagePosition position) throws Exception
- Throws:
Exception
-
getCounter
PageSubscriptionCounter getCounter()
-
getMessageCount
long getMessageCount()
-
getPersistentSize
long getPersistentSize()
-
getId
long getId()
-
isPersistent
boolean isPersistent()
-
isPaging
boolean isPaging()
Used as a delegate method toPagingStore.isPaging()
-
iterator
PageIterator iterator()
-
iterator
LinkedListIterator<PagedReference> iterator(boolean jumpRemoves)
-
scheduleCleanupCheck
void scheduleCleanupCheck()
-
onPageModeCleared
void onPageModeCleared(Transaction tx) throws Exception
- Throws:
Exception
-
disableAutoCleanup
void disableAutoCleanup()
-
enableAutoCleanup
void enableAutoCleanup()
-
ack
void ack(PagedReference ref) throws Exception
- Throws:
Exception
-
contains
boolean contains(PagedReference ref) throws Exception
- Throws:
Exception
-
confirmPosition
void confirmPosition(PagePosition ref) throws Exception
- Throws:
Exception
-
ackTx
void ackTx(Transaction tx, PagedReference position) throws Exception
- Throws:
Exception
-
confirmPosition
void confirmPosition(Transaction tx, PagePosition position) throws Exception
- Throws:
Exception
-
scanAck
void scanAck(BooleanSupplier retryBeforeScan, ToIntFunction<PagedReference> scanFunction, Runnable found, Runnable notFound)
This method will schedule scanning over Paging, however a retry should be done before the scanning.- Parameters:
retryBeforeScan- if this function is called and returns true, the scan for this element will not be called. It would be caller's responsibility to call found.scanFunction-found-notFound-
-
getFirstPage
long getFirstPage()
- Returns:
- the first page in use or MAX_LONG if none is in use
-
reloadACK
void reloadACK(PagePosition position)
- Parameters:
position-
-
reloadPageCompletion
boolean reloadPageCompletion(PagePosition position) throws Exception
- Throws:
Exception
-
reloadPageInfo
void reloadPageInfo(long pageNr)
-
positionIgnored
void positionIgnored(PagePosition position)
To be called when the cursor decided to ignore a position.- Parameters:
position-
-
lateDeliveryRollback
void lateDeliveryRollback(PagePosition position)
-
reloadPreparedACK
void reloadPreparedACK(Transaction tx, PagePosition position)
To be used to avoid a redelivery of a prepared ACK after load- Parameters:
position-
-
addPendingDelivery
void addPendingDelivery(PagePosition position)
-
redeliver
void redeliver(PageIterator iterator, PagePosition position)
To be used on redeliveries- Parameters:
position-
-
printDebug
void printDebug()
-
isComplete
boolean isComplete(long page)
- Parameters:
page-- Returns:
-
forEachConsumedPage
void forEachConsumedPage(Consumer<ConsumedPage> pageCleaner)
-
flushExecutors
void flushExecutors()
wait all the scheduled runnables to finish their current execution
-
setQueue
void setQueue(Queue queue)
-
getQueue
Queue getQueue()
-
queryMessage
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- Parameters:
pos-- Returns:
-
getExecutor
ArtemisExecutor getExecutor()
- Returns:
- executor used by the PageSubscription
-
onDeletePage
void onDeletePage(Page deletedPage) throws Exception
- Parameters:
deletedPage-- Throws:
Exception
-
getDeliveredCount
long getDeliveredCount()
-
getDeliveredSize
long getDeliveredSize()
-
incrementDeliveredSize
void incrementDeliveredSize(long size)
-
removePendingDelivery
void removePendingDelivery(PagePosition position)
-
-