flux.runtimeconfiguration
Interface ConcurrencyConstraint

All Superinterfaces:
java.lang.Cloneable, java.lang.Comparable

public interface ConcurrencyConstraint
extends java.lang.Comparable, java.lang.Cloneable

Controls the number of jobs that are allowed to execute at the same time.

Author:
Copyright 2014 Flux Corporation. All rights reserved.

Method Summary
 java.lang.Object clone()
          Returns a deep copy of this ConcurrencyConstraint object.
 int getLimit()
          Returns the limit for this concurrency constraint, which indicates the maximum number of jobs that can run at the same time in the concurrency constraint's namespace.
 java.lang.String getNamespace()
          Returns the position in the job tree to which this concurrency constraint applies.
 ConcurrencyConstraintOperator getOperator()
          Returns the operator used to compare the number of currently executing jobs in this concurrency constraint's namespace to the maximum number of jobs that are allowed to execute in this concurrency constraint's namespace.
 void setLimit(int limit)
          Sets the limit for this concurrency constraint, which indicates the maximum number of jobs that can run at the same time in the concurrency constraint's namespace.
 void setNamespace(java.lang.String namespace)
          Sets the position in the job tree to which this concurrency constraint applies.
 void setOperator(ConcurrencyConstraintOperator operator)
          Sets the operator used to compare the number of currently executing jobs in this concurrency constraint's namespace to the maximum number of jobs that are allowed to execute in this concurrency constraint's namespace.
 java.lang.String toString()
          Returns this concurrency constraint as a string, which can be used to create a new concurrency constraint.
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Method Detail

clone

java.lang.Object clone()
Returns a deep copy of this ConcurrencyConstraint object.

Returns:
A deep copy of this ConcurrencyConstraint object.

getLimit

int getLimit()
Returns the limit for this concurrency constraint, which indicates the maximum number of jobs that can run at the same time in the concurrency constraint's namespace.

Returns:
The limit for this concurrency constraint.

getNamespace

java.lang.String getNamespace()
Returns the position in the job tree to which this concurrency constraint applies. If the namespace has a trailing "/" symbol, it refers to an entire branch in the job tree. Otherwise, the namespace refers to a specific job.

Returns:
The position in the tree of jobs to which this concurrency constraint applies.

getOperator

ConcurrencyConstraintOperator getOperator()
Returns the operator used to compare the number of currently executing jobs in this concurrency constraint's namespace to the maximum number of jobs that are allowed to execute in this concurrency constraint's namespace.

For example, the concurrency throttle expression "/heavyweight jobs/ <= 5" indicates that as many as 5 jobs from the /heavyweight jobs/ branch of the job tree are allowed to run at the same time.

However, the concurrency throttle expression "/heavyweight jobs/ < 5" indicates that up to but not including 5 jobs from the /heavyweight jobs/ branch of the job tree are allowed to run at the same time.

Returns:
The operator used to compare the number of currently executing jobs in this concurrency constraint's namespace to the maximum number of jobs that are allowed to execute in this concurrency constraint's namespace.

setLimit

void setLimit(int limit)
Sets the limit for this concurrency constraint, which indicates the maximum number of jobs that can run at the same time in the concurrency constraint's namespace.

Parameters:
limit - The limit for this concurrency constraint.
Throws:
java.lang.IllegalArgumentException - If limit is less than 0.

setNamespace

void setNamespace(java.lang.String namespace)
Sets the position in the job tree to which this concurrency constraint applies. If the namespace has a trailing "/" symbol, it refers to an entire branch in the job tree. Otherwise, the namespace refers to a specific job.

Parameters:
namespace - The position in the tree of jobs to which this concurrency constraint applies.
Throws:
java.lang.IllegalArgumentException - If namespace is null, empty, or is invalid.

setOperator

void setOperator(ConcurrencyConstraintOperator operator)
Sets the operator used to compare the number of currently executing jobs in this concurrency constraint's namespace to the maximum number of jobs that are allowed to execute in this concurrency constraint's namespace.

For example, the concurrency throttle expression "/heavyweight jobs/ <= 5" indicates that as many as 5 jobs from the /heavyweight jobs/ branch of the job tree are allowed to run at the same time.

However, the concurrency throttle expression "/heavyweight jobs/ < 5" indicates that up to but not including 5 jobs from the /heavyweight jobs/ branch of the job tree are allowed to run at the same time.

Parameters:
operator - The operator used to compare the number of currently executing jobs in this concurrency constraint's namespace to the maximum number of jobs that are allowed to execute in this concurrency constraint's namespace.
Throws:
java.lang.IllegalArgumentException - If operator is null.

toString

java.lang.String toString()
Returns this concurrency constraint as a string, which can be used to create a new concurrency constraint. This string is a valid concurrency throttle expression.

For example, if this concurrency constraint's namespace is "/lightweights/", its operator is "<=", and its limit is 15, then this concurrency constraint can be expressed as the following string.

/lightweights/ <= 15

Overrides:
toString in class java.lang.Object
Returns:
This concurrency constraint as a string.


© 2014 Flux Corporation. All rights reserved.