Package org.eclipse.ecf.core.sharedobject.util

# Interface IQueueEnqueue

All Known Subinterfaces:
  `IQueue`

All Known Implementing Classes:
  `QueueEnqueueImpl`

public interface IQueueEnqueue
Queue enqueing semantics

## Method Summary

Modifier and Type
Method
Description
`void`
`enqueue(Event event)`
Enqueue a given Event onto the underlying queue
`void`
`enqueue(Event[] events)`
Enqueue a set of events Event onto the underlying queue
`void`
`enqueue_abort(Object enqueue_key)`
Abort the commit of a set of Event instances previously prepared via `enqueue_prepare(Event[])`
`void`
`enqueue_commit(Object enqueue_key)`
Commit a set of Event instances previously prepared via `enqueue_prepare(Event[])`
`boolean`
`enqueue_lossy(Event event)`
Enqueue the given event with lossy enqueuing.
`Object`
`enqueue_prepare(Event[] events)`
Prepare an enqueue of a set of Event instances.
`IEnqueueProcessor`
`getEnqueueProcessor()`
Get enqueue processor for this queue.
`void`
`setEnqueueProcessor(IEnqueueProcessor processor)`
Set enqueue processor for this queue.
`int`
`size()`
Return size of contents in queue

## Method Details

### 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 transaction `enqueue_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 via `enqueue_prepare(Event[])`

Parameters:
  `enqueue_key` - the transaction key previously returned from the call to `enqueue_prepare(Event[])`

### enqueue_abort

void enqueue_abort(Object enqueue_key)
Abort the commit of a set of Event instances previously prepared via `enqueue_prepare(Event[])`

Parameters:
  `enqueue_key` - the transaction key previously returned from the call to `enqueue_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 the `setEnqueueProcessor(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