|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.phleisch.app.itsucks.job.impl.AbstractJob
public abstract class AbstractJob
A job is a single task to be done. This is the abstract class for the basic functionality.
| Field Summary | |
|---|---|
protected Context |
mGroupContext
|
protected JobManager |
mJobManager
|
| Fields inherited from interface de.phleisch.app.itsucks.job.Job |
|---|
JOB_PRIORITY_PROPERTY, JOB_STATE_PROPERTY, MAX_PRIORITY, MIN_PRIORITY, STATE_ALREADY_PROCESSED, STATE_ASSIGNED, STATE_CLOSED, STATE_ERROR, STATE_FAILED, STATE_FINISHED, STATE_IGNORED, STATE_IN_PROGRESS, STATE_IN_PROGRESS_RETRY, STATE_OPEN, STATE_REOPEN |
| Constructor Summary | |
|---|---|
AbstractJob()
|
|
| Method Summary | |
|---|---|
abstract void |
abort()
Aborts the job when running. |
void |
addPropertyChangeListener(java.beans.PropertyChangeListener pListener)
Adds a PropertyChangeListener to the listener list. |
protected java.beans.PropertyChangeEvent |
firePropertyChange(java.lang.String propertyName,
java.lang.Object oldValue,
java.lang.Object newValue)
|
Context |
getGroupContext()
The context for this job group. |
int |
getId()
Returns the unique id of this job. |
JobManager |
getJobManager()
The job manager the job is managed by. |
java.lang.String |
getName()
Gets the name of the job |
JobParameter |
getParameter(java.lang.String pKey)
Returns the parameter under the given key or null. |
java.util.List<JobParameter> |
getParameterList()
Get a list of all job parameter |
int |
getPriority()
The higher the number, the higher the priority, max is 999, min is 0 Default is 500 |
int |
getState()
Returns the current state of the Job. |
int |
hashCode()
|
boolean |
isClosed()
Returns true when the job is closed. |
boolean |
isIgnoreFilter()
Returns true when the filter should not be applied for this job. |
void |
removePropertyChangeListener(java.beans.PropertyChangeListener pListener)
Removes a PropertyChangeListener from the listener list. |
abstract void |
run()
Starts the execution of the job. |
void |
setGroupContext(Context pContext)
Sets the context for this job group. |
void |
setId(int pJobId)
Sets the id of this job. |
void |
setIgnoreFilter(boolean pIgnoreFilter)
When set to true, the JobFilter will not filter out this job. |
void |
setJobManager(JobManager pJobManager)
Sets the jobManager for this job. |
void |
setName(java.lang.String pName)
Sets the name of the job |
void |
setParameter(JobParameter pParameter)
Set a parameter to the job |
void |
setPriority(int pPriority)
The higher the number, the higher the priority, max is 999, min is 0 Default is 500 |
void |
setState(int pState)
Sets the current state of the job. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected transient Context mGroupContext
protected transient JobManager mJobManager
| Constructor Detail |
|---|
public AbstractJob()
| Method Detail |
|---|
public abstract void run()
throws java.lang.Exception
Job
run in interface Jobjava.lang.Exceptionpublic boolean isClosed()
Job
isClosed in interface Jobpublic JobManager getJobManager()
Job
getJobManager in interface Jobpublic void setJobManager(JobManager pJobManager)
Job
setJobManager in interface Jobpublic Context getGroupContext()
Job
getGroupContext in interface Jobpublic void setGroupContext(Context pContext)
Job
setGroupContext in interface JobpContext - the context the job belongs.public boolean isIgnoreFilter()
Job
isIgnoreFilter in interface Jobpublic void setIgnoreFilter(boolean pIgnoreFilter)
Job
setIgnoreFilter in interface Jobpublic int getState()
Job
getState in interface Jobpublic void setState(int pState)
Job
setState in interface Jobpublic int getPriority()
Job
getPriority in interface Jobpublic void setPriority(int pPriority)
Job
setPriority in interface Jobpublic int getId()
Job
getId in interface Jobpublic void setId(int pJobId)
Job
setId in interface Jobpublic java.lang.String getName()
Job
getName in interface Jobpublic void setName(java.lang.String pName)
Job
setName in interface Jobpublic void setParameter(JobParameter pParameter)
Job
setParameter in interface Jobpublic JobParameter getParameter(java.lang.String pKey)
Job
getParameter in interface Jobpublic java.util.List<JobParameter> getParameterList()
Job
getParameterList in interface Jobpublic abstract void abort()
Job
abort in interface Jobpublic void addPropertyChangeListener(java.beans.PropertyChangeListener pListener)
Job
addPropertyChangeListener in interface JobpListener - The PropertyChangeListener to be addedJob.JOB_PRIORITY_PROPERTY,
Job.JOB_STATE_PROPERTYpublic void removePropertyChangeListener(java.beans.PropertyChangeListener pListener)
Job
removePropertyChangeListener in interface JobpListener - The PropertyChangeListener to be removed
protected java.beans.PropertyChangeEvent firePropertyChange(java.lang.String propertyName,
java.lang.Object oldValue,
java.lang.Object newValue)
public int hashCode()
hashCode in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||