@Service(value=InternalQueueConfiguration.class) @Properties(value={@Property(name="queue.name",label="Name",description="The name of the queue. If matching is used the token {0} can be used to substitute the real value."),@Property(name="queue.topics",unbounded=ARRAY,label="Topics",description="This value is required and lists the topics processed by this queue. The value is a list of strings. If a string ends with a dot, all topics in exactly this package match. If the string ends with a star, all topics in this package and all subpackages match. If the string neither ends with a dot nor with a star, this is assumed to define an exact topic."),@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")},label="Type",description="The queue type."),@Property(name="queue.maxparallel",intValue=15,label="Maximum Parallel Jobs",description="The maximum number of parallel jobs started for this queue. A value of -1 is substituted with the number of available processors."),@Property(name="queue.retries",intValue=10,label="Maximum Retries",description="The maximum number of times a failed job slated for retries is actually retried. If a job has been retried this number of times and still fails, it is not rescheduled and assumed to have failed. The default value is 10."),@Property(name="queue.retrydelay",longValue=2000L,label="Retry Delay",description="The number of milliseconds to sleep between two consecutive retries of a job which failed and was set to be retried. The default value is 2 seconds. This value is only relevant if there is a single failed job in the queue. If there are multiple failed jobs, each job is retried in turn without an intervening delay."),@Property(name="queue.priority",value="NORM",options={@PropertyOption(name="NORM",value="Norm"),@PropertyOption(name="MIN",value="Min"),@PropertyOption(name="MAX",value="Max")},label="Priority",description="The priority for the threads used by this queue. Default is norm."),@Property(name="queue.keepJobs",boolValue=false,label="Keep History",description="If this option is enabled, successful finished jobs are kept to provide a complete history."),@Property(name="queue.preferRunOnCreationInstance",boolValue=false,label="Prefer Creation Instance",description="If this option is enabled, the jobs are tried to be run on the instance where the job was created."),@Property(name="queue.threadPoolSize",intValue=0,label="Thread Pool Size",description="Optional configuration value for a thread pool to be used by this queue. If this is value has a positive number of threads configuration, this queue uses an own thread pool with the configured number of threads."),@Property(name="service.ranking",intValue=0,propertyPrivate=false,label="Ranking",description="Integer value defining the ranking of this queue configuration. If more than one queue matches a job topic, the one with the highest ranking is used."),@Property(name="webconsole.configurationFactory.nameHint",value="Queue: {queue.name}")}) public class InternalQueueConfiguration extends Object implements QueueConfiguration, Comparable<InternalQueueConfiguration>
QueueConfiguration.ThreadPriority, QueueConfiguration.Type
Constructor and Description |
---|
InternalQueueConfiguration() |
Modifier and Type | Method and Description |
---|---|
protected void |
activate(Map<String,Object> params)
Create a new queue configuration
|
int |
compareTo(InternalQueueConfiguration other) |
static InternalQueueConfiguration |
fromConfiguration(Map<String,Object> params)
Create a new configuration from a config
|
String[] |
getApplicationIds()
Deprecated.
|
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.
|
int |
getOwnThreadPoolSize()
Return the size for the optional thread pool for this 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
|
QueueConfiguration.ThreadPriority |
getThreadPriority()
Return the thread priority for the job thread
|
String[] |
getTopics()
The list of topics this queue is bound to.
|
QueueConfiguration.Type |
getType()
Return the queue type.
|
boolean |
isKeepJobs()
Whether successful jobs are kept for a complete history
|
boolean |
isLocalQueue()
Deprecated.
|
boolean |
isPreferRunOnCreationInstance()
Prefer to run the job on the same instance it was created on.
|
boolean |
isValid() |
String |
match(String topic)
Check if the queue processes the event.
|
String |
toString() |
public static InternalQueueConfiguration fromConfiguration(Map<String,Object> params)
@Activate protected void activate(Map<String,Object> params)
public boolean isValid()
public String match(String topic)
topic
- The topic of the eventnull
public String getName()
public long getRetryDelayInMs()
QueueConfiguration
getRetryDelayInMs
in interface QueueConfiguration
QueueConfiguration.getRetryDelayInMs()
public int getMaxRetries()
QueueConfiguration
getMaxRetries
in interface QueueConfiguration
QueueConfiguration.getMaxRetries()
public QueueConfiguration.Type getType()
QueueConfiguration
getType
in interface QueueConfiguration
QueueConfiguration.getType()
public JobUtil.JobPriority getPriority()
QueueConfiguration
getPriority
in interface QueueConfiguration
QueueConfiguration.getPriority()
public int getMaxParallel()
QueueConfiguration
getMaxParallel
in interface QueueConfiguration
QueueConfiguration.getMaxParallel()
@Deprecated public boolean isLocalQueue()
isLocalQueue
in interface QueueConfiguration
public String[] getTopics()
QueueConfiguration
getTopics
in interface QueueConfiguration
QueueConfiguration.getTopics()
public int getRanking()
QueueConfiguration
getRanking
in interface QueueConfiguration
QueueConfiguration.getRanking()
public String getPid()
@Deprecated public String[] getApplicationIds()
getApplicationIds
in interface QueueConfiguration
public boolean isKeepJobs()
QueueConfiguration
isKeepJobs
in interface QueueConfiguration
true
if successful jobs are kept.public int getOwnThreadPoolSize()
QueueConfiguration
getOwnThreadPoolSize
in interface QueueConfiguration
0
if the default thread pool
should be used.public boolean isPreferRunOnCreationInstance()
QueueConfiguration
isPreferRunOnCreationInstance
in interface QueueConfiguration
public int compareTo(InternalQueueConfiguration other)
compareTo
in interface Comparable<InternalQueueConfiguration>
public QueueConfiguration.ThreadPriority getThreadPriority()
QueueConfiguration
getThreadPriority
in interface QueueConfiguration
Copyright © 2007–2015 The Apache Software Foundation. All rights reserved.