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 TypeMethodDescriptionvoid
add
(byte[] itemBody) add message to queue.void
add message to queue.void
clear()
Clears the queue.void
commit
(IQueueable item) Removes polled object from the queue.void
commit
(IQueueable[] batchItems, int size) Removes polled objects from the queue.void
failedProcessing
(IQueueable item) Return element to queue.void
failedProcessing
(IQueueable[] batchItems, int size) Return element to queue.void
Initializes queue.boolean
isEmpty()
Checks if queue is currently empty.protected void
protected void
poll()
Poll object from the queue (doesn't remove it from queue yet!).void
shutdown()
Gracefully shutdowns queue.int
size()
Returns current queue size.take()
Retrieves and mark as processing the head of this queue, waiting if necessary until an element becomes available.int
take
(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:IQueue
Initializes queue. That includes restore of previously saved queue content for persistent queues.- Specified by:
initialize
in interfaceIQueue
- Throws:
IOException
-
add
Description copied from interface:IQueue
add message to queue.- Specified by:
add
in interfaceIQueue
- Throws:
InterruptedException
IOException
-
add
Description copied from interface:IQueue
add message to queue.- Specified by:
add
in interfaceIQueue
- Throws:
InterruptedException
IOException
-
onInsert
-
poll
Description copied from interface:IQueue
Poll object from the queue (doesn't remove it from queue yet!). Change tem state to processing. -
take
Description copied from interface:IQueue
Retrieves and mark as processing the head of this queue, waiting if necessary until an element becomes available. -
take
Description copied from interface:IQueue
Retrieves 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:IQueue
Return element to queue. Item will be available again for handing.- Specified by:
failedProcessing
in interfaceIQueue
-
failedProcessing
Description copied from interface:IQueue
Return element to queue. Items will be available again for handing.- Specified by:
failedProcessing
in interfaceIQueue
size
- the number of items in batch
-
commit
Description copied from interface:IQueue
Removes polled object from the queue.- Specified by:
commit
in interfaceIQueue
- Throws:
IOException
-
commit
Description copied from interface:IQueue
Removes polled objects from the queue.- Specified by:
commit
in interfaceIQueue
size
- the number of items in batch- Throws:
IOException
-
onCommit
-
isEmpty
public boolean isEmpty()Description copied from interface:IQueue
Checks if queue is currently empty. -
size
public int size()Description copied from interface:IQueue
Returns current queue size. -
clear
Description copied from interface:IQueue
Clears the queue.- Specified by:
clear
in interfaceIQueue
- Throws:
IOException
-
shutdown
public void shutdown()Description copied from interface:IQueue
Gracefully shutdowns queue.
-