org.apache.sling.event.impl.jobs.config
Class InternalQueueConfiguration

java.lang.Object
  extended by org.apache.sling.event.impl.jobs.config.InternalQueueConfiguration
All Implemented Interfaces:
QueueConfiguration

@Service(value=InternalQueueConfiguration.class)
@Properties(value={@Property(name="queue.name"),@Property(name="queue.type",value="UNORDERED",options={@PropertyOption(name="UNORDERED",value="Parallel"),@PropertyOption(name="ORDERED",value="Ordered"),@PropertyOption(name="TOPIC_ROUND_ROBIN",value="Topic Round Robin"),@PropertyOption(name="IGNORE",value="Ignore")}),@Property(name="queue.topics",unbounded=ARRAY),@Property(name="queue.maxparallel",intValue=15),@Property(name="queue.retries",intValue=10),@Property(name="queue.retrydelay",longValue=2000L),@Property(name="queue.priority",value="NORM",options={@PropertyOption(name="NORM",value="Norm"),@PropertyOption(name="MIN",value="Min"),@PropertyOption(name="MAX",value="Max")}),@Property(name="queue.runlocal",boolValue=false),@Property(name="queue.applicationids",unbounded=ARRAY)})
public class InternalQueueConfiguration
extends Object
implements QueueConfiguration


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.apache.sling.event.jobs.QueueConfiguration
QueueConfiguration.Type
 
Constructor Summary
InternalQueueConfiguration()
           
InternalQueueConfiguration(org.osgi.service.event.Event jobEvent)
           
 
Method Summary
protected  void activate(Map<String,Object> params)
          Create a new queue configuration
static InternalQueueConfiguration fromConfiguration(Map<String,Object> params)
          Create a new configuration from a config
 String[] getApplicationIds()
          Application ids - returns an array of application ids if this queue is bound to some cluster nodes.
 int getMaxParallel()
          Return the max number of parallel processes.
 int getMaxRetries()
          Return the max number of retries, -1 for endless retry!
 String getName()
          Return the name of the queue.
 String getPid()
           
 JobUtil.JobPriority getPriority()
          Return the thread priority for the job thread.
 int getRanking()
          Get the ranking of this configuration.
 long getRetryDelayInMs()
          Return the retry delay in ms
 String[] getTopics()
          The list of topics this queue is bound to.
 QueueConfiguration.Type getType()
          Return the queue type.
 boolean isLocalQueue()
          Is this a local running queue (= processing only jobs started on the same instance.)
 boolean isSkipped(JobEvent event)
          Checks if the event should be skipped.
 boolean isValid()
           
 boolean match(JobEvent event)
          Check if the queue processes the event.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

InternalQueueConfiguration

public InternalQueueConfiguration()

InternalQueueConfiguration

public InternalQueueConfiguration(org.osgi.service.event.Event jobEvent)
Method Detail

fromConfiguration

public static InternalQueueConfiguration fromConfiguration(Map<String,Object> params)
Create a new configuration from a config


activate

@Activate
protected void activate(Map<String,Object> params)
Create a new queue configuration


isValid

public boolean isValid()

match

public boolean match(JobEvent event)
Check if the queue processes the event.

Parameters:
event - The event

getName

public String getName()
Return the name of the queue.


isSkipped

public boolean isSkipped(JobEvent event)
Checks if the event should be skipped. This can happen if - the queue is of type ignore - the queue is bound to some application id - the event is a local event generated with a different application id


getRetryDelayInMs

public long getRetryDelayInMs()
Description copied from interface: QueueConfiguration
Return the retry delay in ms

Specified by:
getRetryDelayInMs in interface QueueConfiguration
See Also:
QueueConfiguration.getRetryDelayInMs()

getMaxRetries

public int getMaxRetries()
Description copied from interface: QueueConfiguration
Return the max number of retries, -1 for endless retry!

Specified by:
getMaxRetries in interface QueueConfiguration
See Also:
QueueConfiguration.getMaxRetries()

getType

public QueueConfiguration.Type getType()
Description copied from interface: QueueConfiguration
Return the queue type.

Specified by:
getType in interface QueueConfiguration
See Also:
QueueConfiguration.getType()

getPriority

public JobUtil.JobPriority getPriority()
Description copied from interface: QueueConfiguration
Return the thread priority for the job thread.

Specified by:
getPriority in interface QueueConfiguration
See Also:
QueueConfiguration.getPriority()

getMaxParallel

public int getMaxParallel()
Description copied from interface: QueueConfiguration
Return the max number of parallel processes.

Specified by:
getMaxParallel in interface QueueConfiguration
See Also:
QueueConfiguration.getMaxParallel()

isLocalQueue

public boolean isLocalQueue()
Description copied from interface: QueueConfiguration
Is this a local running queue (= processing only jobs started on the same instance.)

Specified by:
isLocalQueue in interface QueueConfiguration
See Also:
QueueConfiguration.isLocalQueue()

getApplicationIds

public String[] getApplicationIds()
Description copied from interface: QueueConfiguration
Application ids - returns an array of application ids if this queue is bound to some cluster nodes.

Specified by:
getApplicationIds in interface QueueConfiguration
See Also:
QueueConfiguration.getApplicationIds()

getTopics

public String[] getTopics()
Description copied from interface: QueueConfiguration
The list of topics this queue is bound to.

Specified by:
getTopics in interface QueueConfiguration
See Also:
QueueConfiguration.getTopics()

getRanking

public int getRanking()
Description copied from interface: QueueConfiguration
Get the ranking of this configuration.

Specified by:
getRanking in interface QueueConfiguration
See Also:
QueueConfiguration.getRanking()

getPid

public String getPid()

toString

public String toString()
Overrides:
toString in class Object


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