|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.oddjob.jobs.AbstractJob
An abstract implementation of a job which provides commen functionality to concrete sub classes.
| Field Summary | |
protected java.beans.PropertyChangeSupport |
changes
Implement property change support which sub classes can take advantage of. |
protected StatefulChildHelper |
childHelper
Intended to be used by decendent classes to help implement Structural. |
protected boolean |
destroyed
This flag is set once the object is destroyed Methods in subclass should check this flag. |
protected IconHelper |
iconHelper
Used to notify clients of an icon change. |
protected Lock |
lock
This locks the component. |
protected JobStateHandler |
stateHandler
A state handler to delagate state change functionality to. |
protected boolean |
stop
This flag is set by the stop method and should be examined by any Stoppable sub classes in their processing loop. |
| Constructor Summary | |
AbstractJob()
|
|
| Method Summary | |
void |
addIconListener(IconListener listener)
Add an icon listener. |
void |
addJobStateListener(JobStateListener listener)
Add a job state listener. |
void |
addPropertyChangeListener(java.beans.PropertyChangeListener l)
Add a property change listener. |
void |
addStructuralListener(StructuralListener listener)
Add a listener. |
void |
destroy()
Destroy this component. |
protected abstract int |
execute()
Execute this job. |
Location |
getLocation()
|
java.lang.String |
getLogger()
|
java.lang.String |
getName()
Get the job name. |
protected RuntimeConfiguration |
getRuntimeConfigurable()
|
void |
hardReset()
Perform a hard reset on the job. |
IconTip |
iconForId(java.lang.String iconId)
Return an icon tip for a given id. |
JobStateEvent |
lastJobStateEvent()
Returns the last JobState event. |
org.apache.log4j.Logger |
logger()
Allow sub classes access to the logger. |
void |
removeIconListener(IconListener listener)
Remove an icon listener. |
void |
removeJobStateListener(JobStateListener listener)
Remove a job state listener. |
void |
removePropertyChangeListener(java.beans.PropertyChangeListener l)
Remove a property change listener. |
void |
removeStructuralListener(StructuralListener listener)
Remove a listener. |
protected boolean |
reset(StateTransform transform)
Used by subclassses to perform a reset. |
void |
run()
Implement the main execute method for a job. |
void |
setContext(ArooaContext context)
|
protected void |
setJobStateException(java.lang.Throwable ex)
Utility method to set the job state to exception. |
void |
setLogger(java.lang.String logger)
|
void |
setName(java.lang.String name)
Set the job name. |
protected void |
sleep(long waitTime)
Utility method to sleep a certain time. |
void |
softReset()
Perform a soft reset on the job. |
void |
stop()
Allow subclasses to indicate they are stopping. |
java.lang.String |
toString()
Override toString. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected transient java.beans.PropertyChangeSupport changes
protected IconHelper iconHelper
protected transient StatefulChildHelper childHelper
protected JobStateHandler stateHandler
protected transient volatile boolean stop
protected transient volatile boolean destroyed
protected transient Lock lock
| Constructor Detail |
public AbstractJob()
| Method Detail |
public org.apache.log4j.Logger logger()
public void setContext(ArooaContext context)
public Location getLocation()
protected RuntimeConfiguration getRuntimeConfigurable()
protected void setJobStateException(java.lang.Throwable ex)
ex - The exception.protected void sleep(long waitTime)
waitTime - Milliseconds to sleep for.public void stop()
protected abstract int execute()
throws java.lang.Throwable
java.lang.Exception - If the unexpected occurs.
java.lang.Throwable
public final void run()
throws OddjobLockedException
run in interface java.lang.RunnableOddjobLockedExceptionpublic void setName(java.lang.String name)
name - The name of the job.public java.lang.String getName()
public JobStateEvent lastJobStateEvent()
This is not a property so that it can't be accessed directly in scripts.
public void addJobStateListener(JobStateListener listener)
addJobStateListener in interface Statefullistener - The listener.public void removeJobStateListener(JobStateListener listener)
removeJobStateListener in interface Statefullistener - The listener.public void addPropertyChangeListener(java.beans.PropertyChangeListener l)
l - The property change listener.public void removePropertyChangeListener(java.beans.PropertyChangeListener l)
l - The property change listener.protected boolean reset(StateTransform transform)
transform - A state transform.
public void softReset()
softReset in interface Resetablepublic void hardReset()
hardReset in interface Resetablepublic IconTip iconForId(java.lang.String iconId)
iconForId in interface IconiciconId - The icon id.
public void addIconListener(IconListener listener)
addIconListener in interface Iconiclistener - The listener.public void removeIconListener(IconListener listener)
removeIconListener in interface Iconiclistener - The listener.public void addStructuralListener(StructuralListener listener)
listener - The listener.public void removeStructuralListener(StructuralListener listener)
listener - The listner.public java.lang.String toString()
public void destroy()
public java.lang.String getLogger()
public void setLogger(java.lang.String logger)
logger - The logger to set.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||