com.gargoylesoftware.htmlunit.javascript.background
Class JavaScriptJob

java.lang.Object
  extended by com.gargoylesoftware.htmlunit.javascript.background.JavaScriptJob
All Implemented Interfaces:
Comparable<JavaScriptJob>, Runnable
Direct Known Subclasses:
JavaScriptExecutionJob

public abstract class JavaScriptJob
extends Object
implements Runnable, Comparable<JavaScriptJob>

A JavaScript-triggered background job managed by a JavaScriptJobManager.

Version:
$Revision: 5592 $
Author:
Daniel Gredler, Amit Manjhi

Constructor Summary
JavaScriptJob()
          Creates a new job instance that executes once, immediately.
JavaScriptJob(int initialDelay, Integer period)
          Creates a new job instance.
 
Method Summary
 int compareTo(JavaScriptJob other)
          
 Integer getId()
          Returns the job ID.
 int getInitialDelay()
          Returns the initial amount of time to wait before executing this job.
 Integer getPeriod()
          Returns the amount of time to wait between executions of this job (may be null).
 long getTargetExecutionTime()
          Returns the target execution time of the job.
 boolean isPeriodic()
          Returns true if this job executes periodically.
 void setId(Integer id)
          Sets the job ID.
 void setTargetExecutionTime(long targetExecutionTime)
          Sets the target execution time of the job.
 String toString()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.lang.Runnable
run
 

Constructor Detail

JavaScriptJob

public JavaScriptJob()
Creates a new job instance that executes once, immediately.


JavaScriptJob

public JavaScriptJob(int initialDelay,
                     Integer period)
Creates a new job instance.

Parameters:
initialDelay - the initial amount of time to wait before executing this job
period - the amount of time to wait between executions of this job (may be null)
Method Detail

setId

public void setId(Integer id)
Sets the job ID.

Parameters:
id - the job ID

getId

public Integer getId()
Returns the job ID.

Returns:
the job ID

getInitialDelay

public int getInitialDelay()
Returns the initial amount of time to wait before executing this job.

Returns:
the initial amount of time to wait before executing this job

getPeriod

public Integer getPeriod()
Returns the amount of time to wait between executions of this job (may be null).

Returns:
the amount of time to wait between executions of this job (may be null)

isPeriodic

public boolean isPeriodic()
Returns true if this job executes periodically.

Returns:
true if this job executes periodically

toString

public String toString()

Overrides:
toString in class Object

compareTo

public int compareTo(JavaScriptJob other)

Specified by:
compareTo in interface Comparable<JavaScriptJob>

getTargetExecutionTime

public long getTargetExecutionTime()
Returns the target execution time of the job.

Returns:
the target execution time in ms

setTargetExecutionTime

public void setTargetExecutionTime(long targetExecutionTime)
Sets the target execution time of the job.

Parameters:
targetExecutionTime - the new target execution time.


Copyright © 2002-2011 Gargoyle Software Inc.. All Rights Reserved.