public class DualRandomAccessFileQueueStoreDelegate extends AbstractQueueStoreDelegate implements TransactionalQueueStoreDelegate
TransactionalQueueStoreDelegate implementation using two files for storing the queue data.
Entries are stored in the queue file until a certain size in the file. After that size is reached a new file is created and
used to store new entries until the previous file queue entries are consumed, in which case the file is cleaned and reused for
new entries once the second files gets full.| Modifier and Type | Field and Description |
|---|---|
protected org.slf4j.Logger |
logger |
static String |
MAX_LENGTH_PER_FILE_PROPERTY_KEY |
| Constructor and Description |
|---|
DualRandomAccessFileQueueStoreDelegate(String queueName,
String workingDirectory,
MuleContext muleContext,
int capacity) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
add(Serializable item)
Adds an item at the end of the queue
|
protected void |
addFirst(Serializable item)
Adds an object at the beginning of the queue
|
Collection<Serializable> |
allElements() |
void |
close()
Releases all resources managed by this queue without removing the queue data.
|
boolean |
contains(Serializable value)
checks if the given value exists in the queue
Used only during recovery phase which means this method does not require great performance
|
void |
dispose()
Deletes the queue and it's content.
|
protected boolean |
doAddAll(Collection<? extends Serializable> items)
Adds all the items at the end of the queue
|
void |
doClear()
Removes all the items in the queue
|
protected Serializable |
getFirst()
reads the first element in the queue
|
static File |
getFirstQueueFileForTesting(String queueName,
String workingDirectory) |
protected boolean |
isEmpty() |
void |
remove(Serializable value)
Remove the specified value from the queue.
|
protected Serializable |
removeFirst()
removes the first element in the queue
|
int |
size() |
addAll, clear, getSize, offer, peek, poll, putNow, untakepublic static final String MAX_LENGTH_PER_FILE_PROPERTY_KEY
protected final org.slf4j.Logger logger
public DualRandomAccessFileQueueStoreDelegate(String queueName, String workingDirectory, MuleContext muleContext, int capacity)
public static File getFirstQueueFileForTesting(String queueName, String workingDirectory)
protected void addFirst(Serializable item) throws InterruptedException
AbstractQueueStoreDelegateaddFirst in class AbstractQueueStoreDelegateitem - object to addInterruptedExceptionprotected void add(Serializable item)
AbstractQueueStoreDelegateadd in class AbstractQueueStoreDelegateitem - object to addprotected Serializable removeFirst() throws InterruptedException
AbstractQueueStoreDelegateremoveFirst in class AbstractQueueStoreDelegateInterruptedExceptionprotected Serializable getFirst() throws InterruptedException
AbstractQueueStoreDelegategetFirst in class AbstractQueueStoreDelegateInterruptedExceptionpublic int size()
size in class AbstractQueueStoreDelegateprotected boolean isEmpty()
isEmpty in class AbstractQueueStoreDelegatepublic void doClear()
AbstractQueueStoreDelegatedoClear in class AbstractQueueStoreDelegateprotected boolean doAddAll(Collection<? extends Serializable> items)
AbstractQueueStoreDelegatedoAddAll in class AbstractQueueStoreDelegateitems - objects to addpublic Collection<Serializable> allElements()
public void remove(Serializable value)
TransactionalQueueStoreDelegateremove in interface TransactionalQueueStoreDelegatevalue - object to be removedpublic boolean contains(Serializable value)
TransactionalQueueStoreDelegatecontains in interface TransactionalQueueStoreDelegatevalue - object to check if exists in the queuepublic void close()
TransactionalQueueStoreDelegateclose in interface TransactionalQueueStoreDelegatepublic void dispose()
dispose in interface QueueStoreDelegateCopyright © 2003–2017 MuleSoft, Inc.. All rights reserved.