org.apache.sling.event.jobs
Interface Queue


public interface Queue

This is a job queue processing job events.

Since:
3.0

Method Summary
 void clear()
          Remove all outstanding jobs from the queue.
 QueueConfiguration getConfiguration()
          Get the corresponding configuration.
 String getName()
          Get the queue name.
 Object getState(String key)
          For monitoring purposes and possible extensions from the different queue types.
 String getStateInfo()
          Return some information about the current state of the queue.
 Statistics getStatistics()
          Return statistics information about this queue.
 boolean isSuspended()
          Is the queue currently suspended?
 void removeAll()
          Remove all outstanding jobs and delete them.
 void resume()
          Resume a suspended queue.
 void suspend()
          Suspend the queue - when a queue is suspended it stops processing jobs - however already started jobs are finished (but not rescheduled).
 

Method Detail

getName

String getName()
Get the queue name.


getStatistics

Statistics getStatistics()
Return statistics information about this queue.


getConfiguration

QueueConfiguration getConfiguration()
Get the corresponding configuration.


suspend

void suspend()
Suspend the queue - when a queue is suspended it stops processing jobs - however already started jobs are finished (but not rescheduled). Depending on the queue implementation, the queue is only suspended for a specific time. A queue can be resumed with resume().


resume

void resume()
Resume a suspended queue. suspend(). If the queue is not suspended, calling this method has no effect. Depending on the queue implementation, if a job failed a job queue might sleep for a configured time, before a new job is processed. By calling this method, the job queue can be woken up and force an immediate reprocessing. This feature is only supported by ordered queues at the moment. If a queue does not support this feature, calling this method has only an effect if the queue is really supsended.


isSuspended

boolean isSuspended()
Is the queue currently suspended?


clear

void clear()
Remove all outstanding jobs from the queue. This does not delete the jobs. The jobs are either processed by a different cluster node or on restart.


removeAll

void removeAll()
Remove all outstanding jobs and delete them. This actually cancels all outstanding jobs (but no notifications are send).


getStateInfo

String getStateInfo()
Return some information about the current state of the queue. This method is meant to see the internal state of the queue for debugging or monitoring purposes.


getState

Object getState(String key)
For monitoring purposes and possible extensions from the different queue types. This method allows to query state information.



Copyright © 2007-2011 The Apache Software Foundation. All Rights Reserved.