Interface IQueueEnqueue
-
- All Known Subinterfaces:
IQueue
- All Known Implementing Classes:
QueueEnqueueImpl
public interface IQueueEnqueueQueue enqueing semantics
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidenqueue(Event event)Enqueue a given Event onto the underlying queuevoidenqueue(Event[] events)Enqueue a set of events Event onto the underlying queuevoidenqueue_abort(Object enqueue_key)Abort the commit of a set of Event instances previously prepared viaenqueue_prepare(Event[])voidenqueue_commit(Object enqueue_key)Commit a set of Event instances previously prepared viaenqueue_prepare(Event[])booleanenqueue_lossy(Event event)Enqueue the given event with lossy enqueuing.Objectenqueue_prepare(Event[] events)Prepare an enqueue of a set of Event instances.IEnqueueProcessorgetEnqueueProcessor()Get enqueue processor for this queue.voidsetEnqueueProcessor(IEnqueueProcessor processor)Set enqueue processor for this queue.intsize()Return size of contents in queue
-
-
-
Method Detail
-
enqueue
void enqueue(Event event) throws QueueException
Enqueue a given Event onto the underlying queue- Parameters:
event- the Event to enqueue- Throws:
QueueException- thrown if event cannot be enqueued
-
enqueue
void enqueue(Event[] events) throws QueueException
Enqueue a set of events Event onto the underlying queue- Parameters:
events- the Events to enqueue- Throws:
QueueException- thrown if events cannot be enqueued
-
enqueue_prepare
Object enqueue_prepare(Event[] events) throws QueueException
Prepare an enqueue of a set of Event instances. The Object returned should subsequently be used to either commit the prepared enqueue transaction (enqueue_commit(Object), or to abort the prepared enqueue transactionenqueue_abort(Object)- Parameters:
events- the events to enqueue- Returns:
- Object representing the transaction
- Throws:
QueueException- if preparation for enqueue cannot occur
-
enqueue_commit
void enqueue_commit(Object enqueue_key)
Commit a set of Event instances previously prepared viaenqueue_prepare(Event[])- Parameters:
enqueue_key- the transaction key previously returned from the call toenqueue_prepare(Event[])
-
enqueue_abort
void enqueue_abort(Object enqueue_key)
Abort the commit of a set of Event instances previously prepared viaenqueue_prepare(Event[])- Parameters:
enqueue_key- the transaction key previously returned from the call toenqueue_prepare(Event[])
-
enqueue_lossy
boolean enqueue_lossy(Event event)
Enqueue the given event with lossy enqueuing.- Parameters:
event- the event to- Returns:
- true if enqueued successfully, false if not
-
setEnqueueProcessor
void setEnqueueProcessor(IEnqueueProcessor processor)
Set enqueue processor for this queue. The given processor, if non-null, will be consulted when and enqueue operation is requested to determine whether the enqueue should occur or not- Parameters:
processor- the IEnqueueProcessor for this queue. Should not be null.
-
getEnqueueProcessor
IEnqueueProcessor getEnqueueProcessor()
Get enqueue processor for this queue. Returns the enqueue processor previously assigned via thesetEnqueueProcessor(IEnqueueProcessor). Returns null if no enqueue processor previously assigned- Returns:
- IEnqueueProcessor previously assigned via
setEnqueueProcessor(IEnqueueProcessor)
-
size
int size()
Return size of contents in queue- Returns:
- int size of queue contents. Zero if empty
-
-