Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.quartz
Class JobDetail  view JobDetail download JobDetail.java

java.lang.Object
  extended byorg.quartz.JobDetail
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable

public class JobDetail
extends java.lang.Object
implements java.lang.Cloneable, java.io.Serializable

Conveys the detail properties of a given Job instance.

Quartz does not store an actual instance of a Job class, but instead allows you to define an instance of one, through the use of a JobDetail.

Job s have a name and group associated with them, which should uniquely identify them within a single Scheduler.

Trigger s are the 'mechanism' by which Job s are scheduled. Many Trigger s can point to the same Job, but a single Trigger can only point to one Job.


Field Summary
private  java.lang.String description
           
private  boolean durability
           
private  java.lang.String group
           
private  java.lang.Class jobClass
           
private  JobDataMap jobDataMap
           
private  java.util.ArrayList jobListeners
           
private  java.lang.String name
           
private  boolean shouldRecover
           
private  boolean volatility
           
 
Constructor Summary
JobDetail()
           Create a JobDetail with no specified name or group, and the default settings of all the other properties.
JobDetail(java.lang.String name, java.lang.String group, java.lang.Class jobClass)
           Create a JobDetail with the given name, and group, and the default settings of all the other properties.
JobDetail(java.lang.String name, java.lang.String group, java.lang.Class jobClass, boolean volatility, boolean durability, boolean recover)
           Create a JobDetail with the given name, and group, and the given settings of all the other properties.
 
Method Summary
 void addJobListener(java.lang.String name)
           Add the specified name of a JobListener to the end of the Job's list of listeners.
 java.lang.Object clone()
          This method may be called to create a new copy of the Object.
 java.lang.String getDescription()
           Return the description given to the Job instance by its creator (if any).
 java.lang.String getFullName()
           Returns the 'full name' of the Trigger in the format "group.name".
 java.lang.String getGroup()
           Get the group of this Job.
 java.lang.Class getJobClass()
           Get the instance of Job that will be executed.
 JobDataMap getJobDataMap()
           Get the JobDataMap that is associated with the Job.
 java.lang.String[] getJobListenerNames()
           Returns an array of String s containing the names of all JobListener s assigned to the Job, in the order in which they should be notified.
 java.lang.String getName()
           Get the name of this Job.
 boolean isDurable()
           Whether or not the Job should remain stored after it is orphaned (no Triggers point to it).
 boolean isStateful()
           Whether or not the Job implements the interface StatefulJob.
 boolean isVolatile()
           Whether or not the Job should not be persisted in the org.quartz.spi.JobStore for re-use after program restarts.
 boolean removeJobListener(java.lang.String name)
           Remove the specified name of a JobListener from the Job's list of listeners.
 boolean requestsRecovery()
           Instructs the Scheduler whether or not the Job should be re-executed if a 'recovery' or 'fail-over' situation is encountered.
 void setDescription(java.lang.String description)
           Set a description for the Job instance - may be useful for remembering/displaying the purpose of the job, though the description has no meaning to Quartz.
 void setDurability(boolean durability)
           Set whether or not the Job should remain stored after it is orphaned (no Triggers point to it).
 void setGroup(java.lang.String group)
           Set the group of this Job.
 void setJobClass(java.lang.Class jobClass)
           Set the instance of Job that will be executed.
 void setJobDataMap(JobDataMap jobDataMap)
           Set the JobDataMap to be associated with the Job.
 void setName(java.lang.String name)
           Set the name of this Job.
 void setRequestsRecovery(boolean shouldRecover)
           Set whether or not the the Scheduler should re-execute the Job if a 'recovery' or 'fail-over' situation is encountered.
 void setVolatility(boolean volatility)
           Set whether or not the Job should be persisted in the org.quartz.spi.JobStore for re-use after program restarts.
 java.lang.String toString()
           Return a simple string representation of this object.
 void validate()
           Validates whether the properties of the JobDetail are valid for submission into a Scheduler.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

name

private java.lang.String name

group

private java.lang.String group

description

private java.lang.String description

jobClass

private java.lang.Class jobClass

jobDataMap

private JobDataMap jobDataMap

volatility

private boolean volatility

durability

private boolean durability

shouldRecover

private boolean shouldRecover

jobListeners

private java.util.ArrayList jobListeners
Constructor Detail

JobDetail

public JobDetail()

Create a JobDetail with no specified name or group, and the default settings of all the other properties.

Note that the setName(String) 55 ,setGroup(String) 55 and setJobClass(Class) 55 methods must be called before the job can be placed into a Scheduler


JobDetail

public JobDetail(java.lang.String name,
                 java.lang.String group,
                 java.lang.Class jobClass)

Create a JobDetail with the given name, and group, and the default settings of all the other properties.


JobDetail

public JobDetail(java.lang.String name,
                 java.lang.String group,
                 java.lang.Class jobClass,
                 boolean volatility,
                 boolean durability,
                 boolean recover)

Create a JobDetail with the given name, and group, and the given settings of all the other properties.

Method Detail

getName

public java.lang.String getName()

Get the name of this Job.


setName

public void setName(java.lang.String name)

Set the name of this Job.


getGroup

public java.lang.String getGroup()

Get the group of this Job.


setGroup

public void setGroup(java.lang.String group)

Set the group of this Job.


getFullName

public java.lang.String getFullName()

Returns the 'full name' of the Trigger in the format "group.name".


getDescription

public java.lang.String getDescription()

Return the description given to the Job instance by its creator (if any).


setDescription

public void setDescription(java.lang.String description)

Set a description for the Job instance - may be useful for remembering/displaying the purpose of the job, though the description has no meaning to Quartz.


getJobClass

public java.lang.Class getJobClass()

Get the instance of Job that will be executed.


setJobClass

public void setJobClass(java.lang.Class jobClass)

Set the instance of Job that will be executed.


getJobDataMap

public JobDataMap getJobDataMap()

Get the JobDataMap that is associated with the Job.


setJobDataMap

public void setJobDataMap(JobDataMap jobDataMap)

Set the JobDataMap to be associated with the Job.


validate

public void validate()
              throws SchedulerException

Validates whether the properties of the JobDetail are valid for submission into a Scheduler.


setVolatility

public void setVolatility(boolean volatility)

Set whether or not the Job should be persisted in the org.quartz.spi.JobStore for re-use after program restarts.

If not explicitly set, the default value is false.


setDurability

public void setDurability(boolean durability)

Set whether or not the Job should remain stored after it is orphaned (no Triggers point to it).

If not explicitly set, the default value is false.


setRequestsRecovery

public void setRequestsRecovery(boolean shouldRecover)

Set whether or not the the Scheduler should re-execute the Job if a 'recovery' or 'fail-over' situation is encountered.

If not explicitly set, the default value is false.


isVolatile

public boolean isVolatile()

Whether or not the Job should not be persisted in the org.quartz.spi.JobStore for re-use after program restarts.

If not explicitly set, the default value is false.


isDurable

public boolean isDurable()

Whether or not the Job should remain stored after it is orphaned (no Triggers point to it).

If not explicitly set, the default value is false.


isStateful

public boolean isStateful()

Whether or not the Job implements the interface StatefulJob.


requestsRecovery

public boolean requestsRecovery()

Instructs the Scheduler whether or not the Job should be re-executed if a 'recovery' or 'fail-over' situation is encountered.

If not explicitly set, the default value is false.


addJobListener

public void addJobListener(java.lang.String name)

Add the specified name of a JobListener to the end of the Job's list of listeners.


removeJobListener

public boolean removeJobListener(java.lang.String name)

Remove the specified name of a JobListener from the Job's list of listeners.


getJobListenerNames

public java.lang.String[] getJobListenerNames()

Returns an array of String s containing the names of all JobListener s assigned to the Job, in the order in which they should be notified.


toString

public java.lang.String toString()

Return a simple string representation of this object.


clone

public java.lang.Object clone()
Description copied from class: java.lang.Object
This method may be called to create a new copy of the Object. The typical behavior is as follows:
  • o == o.clone() is false
  • o.getClass() == o.clone().getClass() is true
  • o.equals(o) is true

However, these are not strict requirements, and may be violated if necessary. Of the three requirements, the last is the most commonly violated, particularly if the subclass does not override Object.equals(Object)>Object.equals(Object) 55 .

If the Object you call clone() on does not implement java.lang.Cloneable (which is a placeholder interface), then a CloneNotSupportedException is thrown. Notice that Object does not implement Cloneable; this method exists as a convenience for subclasses that do.

Object's implementation of clone allocates space for the new Object using the correct class, without calling any constructors, and then fills in all of the new field values with the old field values. Thus, it is a shallow copy. However, subclasses are permitted to make a deep copy.

All array types implement Cloneable, and override this method as follows (it should never fail):

 public Object clone()
 {
   try
     {
       super.clone();
     }
   catch (CloneNotSupportedException e)
     {
       throw new InternalError(e.getMessage());
     }
 }