|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.mule.util.queue.AbstractQueueStoreDelegate
org.mule.util.queue.DualRandomAccessFileQueueStoreDelegate
public class DualRandomAccessFileQueueStoreDelegate
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.
| Field Summary | |
|---|---|
protected org.apache.commons.logging.Log |
logger
|
static int |
ONE_MEGABYTE
|
| Constructor Summary | |
|---|---|
DualRandomAccessFileQueueStoreDelegate(String queueName,
String workingDirectory,
MuleContext muleContext,
int capacity)
|
|
| Method Summary | |
|---|---|
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 |
getFirstQueueFile(String queueName,
String workingDirectory)
|
static File |
getSecondQueueFile(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()
|
| Methods inherited from class org.mule.util.queue.AbstractQueueStoreDelegate |
|---|
addAll, clear, getSize, offer, peek, poll, putNow, untake |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.mule.util.queue.QueueStoreDelegate |
|---|
addAll, clear, getSize, offer, peek, poll, putNow, untake |
| Field Detail |
|---|
public static final int ONE_MEGABYTE
protected final org.apache.commons.logging.Log logger
| Constructor Detail |
|---|
public DualRandomAccessFileQueueStoreDelegate(String queueName,
String workingDirectory,
MuleContext muleContext,
int capacity)
| Method Detail |
|---|
public static File getFirstQueueFile(String queueName,
String workingDirectory)
public static File getSecondQueueFile(String queueName,
String workingDirectory)
protected void addFirst(Serializable item)
throws InterruptedException
AbstractQueueStoreDelegate
addFirst in class AbstractQueueStoreDelegateitem - object to add
InterruptedExceptionprotected void add(Serializable item)
AbstractQueueStoreDelegate
add in class AbstractQueueStoreDelegateitem - object to add
protected Serializable removeFirst()
throws InterruptedException
AbstractQueueStoreDelegate
removeFirst in class AbstractQueueStoreDelegateInterruptedException
protected Serializable getFirst()
throws InterruptedException
AbstractQueueStoreDelegate
getFirst in class AbstractQueueStoreDelegateInterruptedExceptionpublic int size()
size in class AbstractQueueStoreDelegateprotected boolean isEmpty()
isEmpty in class AbstractQueueStoreDelegatepublic void doClear()
AbstractQueueStoreDelegate
doClear in class AbstractQueueStoreDelegateprotected boolean doAddAll(Collection<? extends Serializable> items)
AbstractQueueStoreDelegate
doAddAll in class AbstractQueueStoreDelegateitems - objects to add
public Collection<Serializable> allElements()
public void remove(Serializable value)
TransactionalQueueStoreDelegate
remove in interface TransactionalQueueStoreDelegatevalue - object to be removedpublic boolean contains(Serializable value)
TransactionalQueueStoreDelegate
contains in interface TransactionalQueueStoreDelegatevalue - object to check if exists in the queuepublic void close()
TransactionalQueueStoreDelegate
close in interface TransactionalQueueStoreDelegatepublic void dispose()
QueueStoreDelegate
dispose in interface QueueStoreDelegate
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||