|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sourceforge.basher.TaskConfiguration
public class TaskConfiguration
Container class for holding task configuration options and manipulating certain aspects of it.
Constructor Summary | |
---|---|
TaskConfiguration()
|
Method Summary | |
---|---|
void |
addApplicablePhase(Phase phase)
Adds the specified phase to the set of applicable phases. |
void |
clearApplicablePhases()
Clears the list of applicable phases. |
boolean |
equals(Object o)
|
List<Phase> |
getApplicablePhases()
Retrieves the Phase s in which this Task is run. |
Double |
getInertia()
Retrieves the inertia of this TaskConfiguration . |
Integer |
getMaxInvocations()
Retrieves the maximum number of times the task should be invoked. |
Integer |
getMaxTime()
Returns the default max time for Task s. |
Long |
getRunFrom()
Retrieves the default time from which this task should run. |
Long |
getStopAfter()
Retrieves the default time from which this task should stop running. |
String |
getTaskName()
Retrieves the name that the Task instance should be known as. |
Integer |
getWeight()
Retrieves the weight of this AbstractTask . |
int |
hashCode()
|
void |
initialize(TaskConfiguration taskConfiguration)
|
void |
reCalculateWeight()
Recalculates the weight of this Task . |
void |
reset()
Resets the weight calculattions of this TaskConfiguration instance. |
void |
setInertia(Double inertia)
Sets the inertia of this AbstractTask . |
void |
setMaxInvocations(Integer maxInvocations)
Sets the maximum number of times the task should be invoked. |
void |
setMaxTime(Integer maxTime)
|
void |
setRunFrom(Long runFrom)
Sets the time from which this task should run. |
void |
setStopAfter(Long stopAfter)
Sets the default time from which this task should stop running. |
void |
setTaskName(String taskName)
Sets the name that the Task instance should be known as. |
void |
setWeight(Integer weight)
Sets the weight for the task. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public TaskConfiguration()
Method Detail |
---|
public Integer getWeight()
AbstractTask
. This could be used by certain schedulers to allow for
more fine grained control of task scheduling
public Double getInertia()
TaskConfiguration
.
See setInertia(Double)
.
public void setInertia(Double inertia)
AbstractTask
. This is used to control the change of
the weight assocaited with this task, calculated for each invocation of the task (if it is
not 1.0).
inertia
- The inertia to give this instance. This should be a value between 0.1 and 2.0.public void reset()
TaskConfiguration
instance.
public void setWeight(Integer weight)
Task
.
weight
- The weight of the task. Should be a value between 1 and 100.public void setMaxInvocations(Integer maxInvocations)
getMaxInvocations()
for more information.
maxInvocations
- The number of invocations to do. A value of 0 (zero) or less indicates that the task
should always be invoked.public Integer getMaxInvocations()
Task
.
public void reCalculateWeight()
Task
. This will take the inertia and multiply it with the current
weight and cast the result to an integer.
public Long getRunFrom()
public Long getStopAfter()
Long.MAX_VALUE
(run forever) unless overridden by sub-class.public void setRunFrom(Long runFrom)
runFrom
- The time from which this task should run. 0 indicates run from start, otherwise specifies the seconds from
start of the run phase.public void setStopAfter(Long stopAfter)
stopAfter
- The time from which this task should stop running. Always returns Long.MAX_VALUE
(run forever) unless overridden by sub-class.public void clearApplicablePhases()
public void addApplicablePhase(Phase phase)
phase
- The phases to addpublic List<Phase> getApplicablePhases()
Phase
s in which this Task
is run. This, by default, returns only
Phase.RUN
.
Task
should run in - only RUN phase is included by defaultpublic Integer getMaxTime()
Task
s.
public void setMaxTime(Integer maxTime)
public String getTaskName()
Task
instance should be known as.
public void setTaskName(String taskName)
Task
instance should be known as.
taskName
- The name of the instance.public void initialize(TaskConfiguration taskConfiguration)
taskConfiguration
- public boolean equals(Object o)
equals
in class Object
public int hashCode()
hashCode
in class Object
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |