Class ChroniclePersistentQueue
java.lang.Object
com.epam.fixengine.jms.storage.queue.ChroniclePersistentQueue
- All Implemented Interfaces:
IQueue
-
Constructor Summary
ConstructorsConstructorDescriptionChroniclePersistentQueue(String storageDir, String sessionID) ChroniclePersistentQueue(String storageDir, String sessionID, net.openhft.chronicle.queue.RollCycle rollCycle) -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(byte[] itemBody) add message to queue.voidadd message to queue.voidclear()Clears the queue.voidcommit(IQueueable item) Removes polled object from the queue.voidcommit(IQueueable[] batchItems, int size) Removes polled objects from the queue.voidfailedProcessing(IQueueable item) Return element to queue.voidfailedProcessing(IQueueable[] batchItems, int size) Return element to queue.voidInitializes queue.booleanisEmpty()Checks if queue is currently empty.protected voidprotected voidpoll()Poll object from the queue (doesn't remove it from queue yet!).voidshutdown()Gracefully shutdowns queue.intsize()Returns current queue size.take()Retrieves and mark as processing the head of this queue, waiting if necessary until an element becomes available.inttake(IQueueable[] batch) Retrieves and mark as processing the batch elements from head of this queue, waiting if necessary until at least one element becomes available.
-
Constructor Details
-
ChroniclePersistentQueue
-
ChroniclePersistentQueue
-
-
Method Details
-
initialize
Description copied from interface:IQueueInitializes queue. That includes restore of previously saved queue content for persistent queues.- Specified by:
initializein interfaceIQueue- Throws:
IOException
-
add
Description copied from interface:IQueueadd message to queue.- Specified by:
addin interfaceIQueue- Throws:
InterruptedExceptionIOException
-
add
Description copied from interface:IQueueadd message to queue.- Specified by:
addin interfaceIQueue- Throws:
InterruptedExceptionIOException
-
onInsert
-
poll
Description copied from interface:IQueuePoll object from the queue (doesn't remove it from queue yet!). Change tem state to processing. -
take
Description copied from interface:IQueueRetrieves and mark as processing the head of this queue, waiting if necessary until an element becomes available. -
take
Description copied from interface:IQueueRetrieves and mark as processing the batch elements from head of this queue, waiting if necessary until at least one element becomes available. -
failedProcessing
Description copied from interface:IQueueReturn element to queue. Item will be available again for handing.- Specified by:
failedProcessingin interfaceIQueue
-
failedProcessing
Description copied from interface:IQueueReturn element to queue. Items will be available again for handing.- Specified by:
failedProcessingin interfaceIQueuesize- the number of items in batch
-
commit
Description copied from interface:IQueueRemoves polled object from the queue.- Specified by:
commitin interfaceIQueue- Throws:
IOException
-
commit
Description copied from interface:IQueueRemoves polled objects from the queue.- Specified by:
commitin interfaceIQueuesize- the number of items in batch- Throws:
IOException
-
onCommit
-
isEmpty
public boolean isEmpty()Description copied from interface:IQueueChecks if queue is currently empty. -
size
public int size()Description copied from interface:IQueueReturns current queue size. -
clear
Description copied from interface:IQueueClears the queue.- Specified by:
clearin interfaceIQueue- Throws:
IOException
-
shutdown
public void shutdown()Description copied from interface:IQueueGracefully shutdowns queue.
-