A task for sleeping a short period of time, useful when a build or deployment process requires an interval between tasks.
A negative value can be supplied to any of attributes provided the total sleep time is positive, pending fundamental changes in physics and JVM execution times
Note that sleep times are always hints to be interpreted by the OS how it feels small times may either be ignored or rounded up to a minimum timeslice. Note also that the system clocks often have a fairly low granularity too, which complicates measuring how long a sleep actually took.
| Modifier and Type | Field and Description |
|---|---|
| private boolean | failOnError
failure flag |
| private int | hours
sleep hours |
| private int | milliseconds
sleep milliseconds |
| private int | minutes
sleep minutes |
| private int | seconds
sleep seconds |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public void | |
| private long | |
| public void | setFailOnError(boolean
The new FailOnError value failOnError)flag controlling whether to break the build on an error. |
| public void | |
| public void | |
| public void | |
| public void | |
| public void |
| failOnError | back to summary |
|---|---|
| private boolean failOnError failure flag | |
| hours | back to summary |
|---|---|
| private int hours sleep hours | |
| milliseconds | back to summary |
|---|---|
| private int milliseconds sleep milliseconds | |
| minutes | back to summary |
|---|---|
| private int minutes sleep minutes | |
| seconds | back to summary |
|---|---|
| private int seconds sleep seconds | |
| Sleep | back to summary |
|---|---|
| public Sleep() Creates new instance | |
| doSleep | back to summary |
|---|---|
| public void doSleep(long millis) sleep for a period of time
| |
| execute | back to summary |
|---|---|
| public void execute() throws BuildException Overrides org. Executes this build task.
| |
| getSleepTime | back to summary |
|---|---|
| private long getSleepTime() return time to sleep
| |
| setFailOnError | back to summary |
|---|---|
| public void setFailOnError(boolean failOnError) flag controlling whether to break the build on an error.
| |
| setHours | back to summary |
|---|---|
| public void setHours(int hours) hours to add to the sleep time.
| |
| setMilliseconds | back to summary |
|---|---|
| public void setMilliseconds(int milliseconds) milliseconds to add to the sleep time
| |
| setMinutes | back to summary |
|---|---|
| public void setMinutes(int minutes) minutes to add to the sleep time
| |
| setSeconds | back to summary |
|---|---|
| public void setSeconds(int seconds) seconds to add to the sleep time
| |
| validate | back to summary |
|---|---|
| public void validate() throws BuildException verify parameters
| |