Class QueueEnqueueImpl
- java.lang.Object
-
- org.eclipse.ecf.core.sharedobject.util.QueueEnqueueImpl
-
- All Implemented Interfaces:
IQueueEnqueue
public class QueueEnqueueImpl extends Object implements IQueueEnqueue
-
-
Constructor Summary
Constructors Constructor Description QueueEnqueueImpl(SimpleFIFOQueue impl)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidenqueue(Event element)Enqueue a given Event onto the underlying queuevoidenqueue(Event[] elements)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 viaIQueueEnqueue.enqueue_prepare(Event[])voidenqueue_commit(Object enqueue_key)Commit a set of Event instances previously prepared viaIQueueEnqueue.enqueue_prepare(Event[])booleanenqueue_lossy(Event element)Enqueue the given event with lossy enqueuing.Objectenqueue_prepare(Event[] elements)Prepare an enqueue of a set of Event instances.IEnqueueProcessorgetEnqueueProcessor()Get enqueue processor for this queue.voidsetEnqueueProcessor(IEnqueueProcessor pred)Set enqueue processor for this queue.intsize()Return size of contents in queue
-
-
-
Constructor Detail
-
QueueEnqueueImpl
public QueueEnqueueImpl(SimpleFIFOQueue impl)
-
-
Method Detail
-
enqueue
public void enqueue(Event element) throws QueueException
Description copied from interface:IQueueEnqueueEnqueue a given Event onto the underlying queue- Specified by:
enqueuein interfaceIQueueEnqueue- Parameters:
element-- Throws:
QueueException- not thrown by this implementation.
-
enqueue
public void enqueue(Event[] elements) throws QueueException
Description copied from interface:IQueueEnqueueEnqueue a set of events Event onto the underlying queue- Specified by:
enqueuein interfaceIQueueEnqueue- Parameters:
elements- the Events to enqueue- Throws:
QueueException- thrown if events cannot be enqueued
-
enqueue_prepare
public Object enqueue_prepare(Event[] elements) throws QueueException
Description copied from interface:IQueueEnqueuePrepare an enqueue of a set of Event instances. The Object returned should subsequently be used to either commit the prepared enqueue transaction (IQueueEnqueue.enqueue_commit(Object), or to abort the prepared enqueue transactionIQueueEnqueue.enqueue_abort(Object)- Specified by:
enqueue_preparein interfaceIQueueEnqueue- Parameters:
elements-- Returns:
- Object
- Throws:
QueueException- not thrown by this implementation.
-
enqueue_commit
public void enqueue_commit(Object enqueue_key)
Description copied from interface:IQueueEnqueueCommit a set of Event instances previously prepared viaIQueueEnqueue.enqueue_prepare(Event[])- Specified by:
enqueue_commitin interfaceIQueueEnqueue- Parameters:
enqueue_key- the transaction key previously returned from the call toIQueueEnqueue.enqueue_prepare(Event[])
-
enqueue_abort
public void enqueue_abort(Object enqueue_key)
Description copied from interface:IQueueEnqueueAbort the commit of a set of Event instances previously prepared viaIQueueEnqueue.enqueue_prepare(Event[])- Specified by:
enqueue_abortin interfaceIQueueEnqueue- Parameters:
enqueue_key- the transaction key previously returned from the call toIQueueEnqueue.enqueue_prepare(Event[])
-
enqueue_lossy
public boolean enqueue_lossy(Event element)
Description copied from interface:IQueueEnqueueEnqueue the given event with lossy enqueuing.- Specified by:
enqueue_lossyin interfaceIQueueEnqueue- Parameters:
element- the event to- Returns:
- true if enqueued successfully, false if not
-
setEnqueueProcessor
public void setEnqueueProcessor(IEnqueueProcessor pred)
Description copied from interface:IQueueEnqueueSet 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- Specified by:
setEnqueueProcessorin interfaceIQueueEnqueue- Parameters:
pred- the IEnqueueProcessor for this queue. Should not be null.
-
getEnqueueProcessor
public IEnqueueProcessor getEnqueueProcessor()
Description copied from interface:IQueueEnqueueGet enqueue processor for this queue. Returns the enqueue processor previously assigned via theIQueueEnqueue.setEnqueueProcessor(IEnqueueProcessor). Returns null if no enqueue processor previously assigned- Specified by:
getEnqueueProcessorin interfaceIQueueEnqueue- Returns:
- IEnqueueProcessor previously assigned via
IQueueEnqueue.setEnqueueProcessor(IEnqueueProcessor)
-
size
public int size()
Description copied from interface:IQueueEnqueueReturn size of contents in queue- Specified by:
sizein interfaceIQueueEnqueue- Returns:
- int size of queue contents. Zero if empty
-
-