Package org.apache.sling.event.impl.jobs.queues

# Class QueueManager

java.lang.Object
org.apache.sling.event.impl.jobs.queues.QueueManager

All Implemented Interfaces:
  `Runnable`, `ConfigurationChangeListener`, `org.osgi.service.event.EventHandler`

public class QueueManager extends Object implements Runnable, org.osgi.service.event.EventHandler, ConfigurationChangeListener
Implementation of the queue manager.

## Constructor Summary

Constructors
Constructor
Description
`QueueManager()`

## Method Summary

Modifier and Type
Method
Description
`protected void`
`activate(Map<String,Object> props)`
Activate this component.
`protected void`
`bindThreadPool(org.apache.sling.event.impl.EventingThreadPool etp)`
`void`
`configurationChanged(boolean active)`
This method is called whenever the topology or queue configurations change.
`protected void`
`deactivate()`
Deactivate this component.
`org.apache.sling.event.jobs.Queue`
`getQueue(String name)`
`Iterable<org.apache.sling.event.jobs.Queue>`
`getQueues()`
`void`
`handleEvent(org.osgi.service.event.Event event)`
`static QueueManager`
`newForTest(org.osgi.service.event.EventAdmin eventAdmin, JobConsumerManager jobConsumerManager, org.apache.sling.event.jobs.jmx.QueuesMBean queuesMBean, org.apache.sling.commons.threads.ThreadPoolManager threadPoolManager, org.apache.sling.commons.threads.ThreadPool threadPool, JobManagerConfiguration configuration, StatisticsManager statisticsManager)`
`void`
`run()`
This method is invoked periodically by the scheduler.
`protected void`
`unbindThreadPool(org.apache.sling.event.impl.EventingThreadPool etp)`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### QueueManager

public QueueManager()

## Method Details

### newForTest

public static QueueManager newForTest(org.osgi.service.event.EventAdmin eventAdmin, JobConsumerManager jobConsumerManager, org.apache.sling.event.jobs.jmx.QueuesMBean queuesMBean, org.apache.sling.commons.threads.ThreadPoolManager threadPoolManager, org.apache.sling.commons.threads.ThreadPool threadPool, JobManagerConfiguration configuration, StatisticsManager statisticsManager)

### activate

protected void activate(Map<String,Object> props)
Activate this component.

Parameters:
  `props` - Configuration properties

### deactivate

protected void deactivate()
Deactivate this component.

### run

public void run()
This method is invoked periodically by the scheduler. In the default configuration every minute

Specified by:
  `run` in interface `Runnable`
See Also:
  - `Runnable.run()`

### getQueue

public org.apache.sling.event.jobs.Queue getQueue(String name)

Parameters:
  `name` - The queue name
Returns:
  The queue or `null`.
See Also:
  - `JobManager.getQueue(java.lang.String)`

### getQueues

public Iterable<org.apache.sling.event.jobs.Queue> getQueues()

Returns:
  An iterator for the available queues.
See Also:
  - `JobManager.getQueues()`

### configurationChanged

public void configurationChanged(boolean active)
This method is called whenever the topology or queue configurations change.

Specified by:
  `configurationChanged` in interface `ConfigurationChangeListener`
Parameters:
  `active` - Whether the job handling is active atm.

### handleEvent

public void handleEvent(org.osgi.service.event.Event event)

Specified by:
  `handleEvent` in interface `org.osgi.service.event.EventHandler`
See Also:
  - `EventHandler.handleEvent(org.osgi.service.event.Event)`

### bindThreadPool

protected void bindThreadPool(org.apache.sling.event.impl.EventingThreadPool etp)

### unbindThreadPool

protected void unbindThreadPool(org.apache.sling.event.impl.EventingThreadPool etp)