Methods Summary |
---|
public void | doSleep(long millis)sleep for a period of time
try {
Thread.sleep(millis);
} catch (InterruptedException ie) {
// Ignore Exception
}
|
public void | execute()Executes this build task. Throws org.apache.tools.ant.BuildException
if there is an error during task execution.
try {
validate();
long sleepTime = getSleepTime();
log("sleeping for " + sleepTime + " milliseconds",
Project.MSG_VERBOSE);
doSleep(sleepTime);
} catch (Exception e) {
if (failOnError) {
throw new BuildException(e);
} else {
String text = e.toString();
log(text, Project.MSG_ERR);
}
}
|
private long | getSleepTime()return time to sleep
return ((((long) hours * 60) + minutes) * 60 + seconds) * 1000
+ milliseconds;
|
public void | setFailOnError(boolean failOnError)flag controlling whether to break the build on an error.
this.failOnError = failOnError;
|
public void | setHours(int hours)hours to add to the sleep time.
this.hours = hours;
|
public void | setMilliseconds(int milliseconds)milliseconds to add to the sleep time
this.milliseconds = milliseconds;
|
public void | setMinutes(int minutes)minutes to add to the sleep time
this.minutes = minutes;
|
public void | setSeconds(int seconds)seconds to add to the sleep time
this.seconds = seconds;
|
public void | validate()verify parameters
if (getSleepTime() < 0) {
throw new BuildException("Negative sleep periods are not "
+ "supported");
}
|