- All Superinterfaces:
org.mule.runtime.api.meta.NamedObject
@NoImplement
public interface Queue
extends org.mule.runtime.api.meta.NamedObject
Interface for mule queues used for VM.
- Since:
- 1.0
-
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Discards all the elements in the queuevoiddispose()Disposes this queue by releasing it's storage and associated memory and storage.booleanoffer(Serializable object, long timeout) Puts an item to the queue, considering timeout on this operation.peek()poll(long timeout) Takes an element from the queue, with a timeout on this operation.voidput(Serializable object) Puts a new object in this queue and wait if necessary.intsize()take()Blocks and retrieves an object from this queue.voiduntake(Serializable item) Puts back an element in the queue, for example, after a rollback operation.Methods inherited from interface org.mule.runtime.api.meta.NamedObject
getName
-
Method Details
-
size
int size()- Returns:
- the number of elements in this queue.
-
put
Puts a new object in this queue and wait if necessary.- Throws:
InterruptedException
-
take
Blocks and retrieves an object from this queue.- Returns:
- an object.
- Throws:
InterruptedException
-
untake
Puts back an element in the queue, for example, after a rollback operation.- Parameters:
item- the item to untake.- Throws:
InterruptedException
-
peek
- Returns:
- the next element in the Queue.
- Throws:
InterruptedException
-
poll
Takes an element from the queue, with a timeout on this operation.- Parameters:
timeout- (in millis) the timeout to consider for the operation.- Returns:
- an Object.
- Throws:
InterruptedException
-
offer
Puts an item to the queue, considering timeout on this operation.- Parameters:
object- to be offered.timeout- (in millis) to consider to offer the element to the queue.- Returns:
- true if the element could be added to the queue.
- Throws:
InterruptedException
-
clear
Discards all the elements in the queue- Throws:
InterruptedException
-
dispose
Disposes this queue by releasing it's storage and associated memory and storage. If after disposing the queue you try go get it back, you'll get a fresh new one which maintains none of the original one's data- Throws:
org.mule.runtime.api.exception.MuleExceptionInterruptedException
-