|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.codehaus.activemq.message.util.MemoryBoundedQueue
MemoryBoundedQueue is a queue bounded by memory usage for Packets
Constructor Summary | |
(package private) |
MemoryBoundedQueue(String name,
MemoryBoundedQueueManager manager)
Constructor |
Method Summary | |
void |
clear()
remove any Packets in the queue |
void |
close()
close and remove this queue from the MemoryBoundedQueueManager |
Packet |
dequeue()
|
Packet |
dequeue(long timeInMillis)
Dequeues a Packet from the head of the queue |
Packet |
dequeueNoWait()
dequeues a Packet from the head of the queue |
void |
enqueue(Packet packet)
Enqueue a Packet to this queue |
void |
enqueueFirst(Packet packet)
Enqueue a Packet to the head of the queue |
void |
enqueueFirstNoBlock(Packet packet)
Enqueue a packet to the head of the queue with total disregard for memory constraints |
void |
enqueueNoBlock(Packet packet)
Enqueue a Packet without checking memory usage limits |
Packet |
get(int index)
retrieve a Packet at an indexed position in the queue |
List |
getContents()
Retrieve a shallow copy of the contents as a list |
long |
getLocalMemoryUsedByThisQueue()
|
String |
getName()
|
boolean |
isEmpty()
|
boolean |
isStarted()
|
boolean |
remove(Packet packet)
Remove a packet from the queue |
Packet |
remove(String id)
Remove a Packet 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 |
Constructor Detail |
MemoryBoundedQueue(String name, MemoryBoundedQueueManager manager)
name
- manager
- Method Detail |
public String getName()
getName
in interface BoundedPacketQueue
public String toString()
public int size()
size
in interface BoundedPacketQueue
public long getLocalMemoryUsedByThisQueue()
public void close()
close
in interface BoundedPacketQueue
public void enqueueNoBlock(Packet packet)
enqueueNoBlock
in interface BoundedPacketQueue
packet
- public void enqueue(Packet packet)
enqueue
in interface BoundedPacketQueue
packet
- public final void enqueueFirstNoBlock(Packet packet)
packet
- public void enqueueFirst(Packet packet) throws InterruptedException
packet
-
InterruptedException
public Packet dequeue() throws InterruptedException
dequeue
in interface BoundedPacketQueue
InterruptedException
public Packet dequeue(long timeInMillis) throws InterruptedException
dequeue
in interface BoundedPacketQueue
timeInMillis
- time to wait for a Packet to be available
InterruptedException
public Packet dequeueNoWait() throws InterruptedException
dequeueNoWait
in interface BoundedPacketQueue
InterruptedException
public boolean isStarted()
isStarted
in interface BoundedPacketQueue
public void stop()
stop
in interface BoundedPacketQueue
public void start()
start
in interface BoundedPacketQueue
public boolean remove(Packet packet)
packet
-
public Packet remove(String id)
id
-
public void clear()
clear
in interface BoundedPacketQueue
public boolean isEmpty()
isEmpty
in interface BoundedPacketQueue
public Packet get(int index)
index
-
public List getContents()
getContents
in interface BoundedPacketQueue
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |