|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.activemq.io.util.MemoryBoundedQueue
MemoryBoundedQueue is a queue bounded by memory usage for MemoryManageable s
Field Summary | |
protected boolean |
closed
|
protected Object |
inLock
|
protected Object |
outLock
|
protected boolean |
stopped
|
protected static int |
WAIT_TIMEOUT
|
Constructor Summary | |
MemoryBoundedQueue(MemoryBoundedQueueManager manager,
String name)
Constructor |
Method Summary | |
void |
clear()
remove any MemoryManageable s in the queue |
void |
close()
close and remove this queue from the MemoryBoundedQueueManager |
protected void |
decrementMemoryUsed(MemoryManageable packet)
|
MemoryManageable |
dequeue()
|
MemoryManageable |
dequeue(long timeInMillis)
Dequeues a MemoryManageable from the head of the queue |
MemoryManageable |
dequeueNoWait()
dequeues a MemoryManageable from the head of the queue |
void |
enqueue(MemoryManageable packet)
Enqueue a MemoryManageable to this queue |
void |
enqueueAllFirstNoBlock(List packets)
Enqueue an array of packets to the head of the queue with total disregard for memory constraints |
void |
enqueueFirst(MemoryManageable packet)
Enqueue a MemoryManageable to the head of the queue |
void |
enqueueFirstNoBlock(MemoryManageable packet)
Enqueue a packet to the head of the queue with total disregard for memory constraints |
void |
enqueueNoBlock(MemoryManageable packet)
Enqueue a MemoryManageable without checking memory usage limits |
MemoryManageable |
get(int index)
retrieve a MemoryManageable at an indexed position in the queue |
List |
getContents()
Retrieve a shallow copy of the contents as a list |
long |
getLocalMemoryUsedByThisQueue()
|
String |
getName()
|
protected void |
incrementMemoryUsed(MemoryManageable packet)
|
boolean |
isEmpty()
|
boolean |
isStarted()
|
boolean |
remove(MemoryManageable packet)
Remove a packet from the queue |
MemoryManageable |
remove(Object id)
Remove a MemoryManageable by it's id |
int |
size()
|
void |
start()
enable dequeueing |
void |
stop()
disable dequeueing |
String |
toString()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected static final int WAIT_TIMEOUT
protected final Object outLock
protected final Object inLock
protected boolean stopped
protected boolean closed
Constructor Detail |
public MemoryBoundedQueue(MemoryBoundedQueueManager manager, String name)
name
- manager
- Method Detail |
public String toString()
public int size()
public long getLocalMemoryUsedByThisQueue()
public void close()
close
in interface MemoryBoundedObject
public void enqueueNoBlock(MemoryManageable packet)
packet
- public void enqueue(MemoryManageable packet)
packet
- public void enqueueFirstNoBlock(MemoryManageable packet)
packet
- public void enqueueAllFirstNoBlock(List packets)
packets
- public void enqueueFirst(MemoryManageable packet) throws InterruptedException
packet
-
InterruptedException
public MemoryManageable dequeue() throws InterruptedException
InterruptedException
public MemoryManageable dequeue(long timeInMillis) throws InterruptedException
timeInMillis
- time to wait for a MemoryManageable to be available
InterruptedException
public MemoryManageable dequeueNoWait() throws InterruptedException
InterruptedException
public boolean isStarted()
public void stop()
public void start()
public boolean remove(MemoryManageable packet)
packet
-
public MemoryManageable remove(Object id)
id
-
public void clear()
public boolean isEmpty()
public MemoryManageable get(int index)
index
-
public List getContents()
protected void incrementMemoryUsed(MemoryManageable packet)
protected void decrementMemoryUsed(MemoryManageable packet)
public String getName()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |