org.apache.felix.ipojo.extender.queue

## Interface QueueService

All Known Subinterfaces:
  LifecycleQueueService

All Known Implementing Classes:
  AbstractQueueService, EnforcedQueueService, ExecutorQueueService, ForwardingQueueService, PreferenceQueueService, SynchronousQueueService

    public interface QueueService

Definition of the queue service. The queue service is used to enqueue the bundle processing job. The processing order is depending of the implementation.

### Field Summary

Fields
`static java.lang.String` `ASYNCHRONOUS_QUEUE_MODE` Asynchronous queue mode.
`static java.lang.String` `GLOABL_QUEUE_SCOPE` Global queue scope.
`static java.lang.String` `PREFERENCE_QUEUE_MODE` Preference queue mode.
`static java.lang.String` `QUEUE_MODE_PROPERTY` The service property specifying the queue mode (sync/async/pref).
`static java.lang.String` `QUEUE_SCOPE_PROPERTY` The service property specifying the queue scope (global/...).
`static java.lang.String` `SYNCHRONOUS_QUEUE_MODE` Synchronous queue mode.

### Method Summary

All Methods Instance Methods Abstract Methods
`void` `addQueueListener(QueueListener listener)` Add a `QueueListener` that will be notified on events relative to this `QueueService`.
`int` `getCurrents()`
`int` `getFinished()`
`int` `getWaiters()`
`java.util.List<JobInfo>` `getWaitersInfo()`
`void` `removeQueueListener(QueueListener listener)` Remove a `QueueListener` from this `QueueService`.
`<T> java.util.concurrent.Future<T>` `submit(Job<T> callable)` Submits a job to the queue service.
`<T> java.util.concurrent.Future<T>` `submit(Job<T> callable, Callback<T> callback, java.lang.String description)` Submits a job to the queue service.
`<T> java.util.concurrent.Future<T>` `submit(Job<T> callable, java.lang.String description)` Submits a job to the queue service.

### Field Detail

#### QUEUE_MODE_PROPERTY

    static final java.lang.String QUEUE_MODE_PROPERTY

The service property specifying the queue mode (sync/async/pref).

See Also:
  Constant Field Values

#### SYNCHRONOUS_QUEUE_MODE

    static final java.lang.String SYNCHRONOUS_QUEUE_MODE

Synchronous queue mode.

See Also:
  Constant Field Values

#### ASYNCHRONOUS_QUEUE_MODE

    static final java.lang.String ASYNCHRONOUS_QUEUE_MODE

Asynchronous queue mode.

See Also:
  Constant Field Values

#### PREFERENCE_QUEUE_MODE

    static final java.lang.String PREFERENCE_QUEUE_MODE

Preference queue mode.

See Also:
  Constant Field Values

#### QUEUE_SCOPE_PROPERTY

    static final java.lang.String QUEUE_SCOPE_PROPERTY

The service property specifying the queue scope (global/...).

See Also:
  Constant Field Values

#### GLOABL_QUEUE_SCOPE

    static final java.lang.String GLOABL_QUEUE_SCOPE

Global queue scope.

See Also:
  Constant Field Values

### Method Detail

#### getFinished

    int getFinished()

Returns:
  the number of jobs that have been executed entirely (including successful and erroneous jobs).

#### getWaiters

    int getWaiters()

Returns:
  the number of jobs scheduled but not yet started.

#### getCurrents

    int getCurrents()

Returns:
  the number of jobs currently executed (started but not finished).

#### getWaitersInfo

    java.util.List<JobInfo> getWaitersInfo()

Returns:
  a snapshot of the currently waiting jobs.

#### submit

    <T> java.util.concurrent.Future<T> submit(Job<T> callable,
                                              Callback<T> callback,
                                              java.lang.String description)

Submits a job to the queue service.

Parameters:
  `callable` - the job
  `callback` - callback called when the job is processed
  `description` - a description of the job
Returns:
  the future object to retrieve the result

#### submit

    <T> java.util.concurrent.Future<T> submit(Job<T> callable,
                                              java.lang.String description)

Submits a job to the queue service.

Parameters:
  `callable` - the job
  `description` - a description of the job
Returns:
  the future object to retrieve the result

#### submit

    <T> java.util.concurrent.Future<T> submit(Job<T> callable)

Submits a job to the queue service.

Parameters:
  `callable` - the job
Returns:
  the future object to retrieve the result

#### addQueueListener

    void addQueueListener(QueueListener listener)

Add a `QueueListener` that will be notified on events relative to this `QueueService`.

Parameters:
  `listener` - added listener

#### removeQueueListener

    void removeQueueListener(QueueListener listener)

Remove a `QueueListener` from this `QueueService`.

Parameters:
  `listener` - removed listener