public class ArchiveJob extends BasePrimary implements java.lang.Runnable, java.io.Serializable, Stoppable, Resetable, Stateful, Structural
ArchiveBrowserJob
can be used to browse an archive created with this job.<oddjob id="this"> <job> <sequential> <jobs> <scheduling:timer id="the-timer" xmlns:scheduling="http://rgordon.co.uk/oddjob/scheduling"> <clock> <value value="${clock}"/> </clock> <schedule> <schedules:count count="3" xmlns:schedules="http://rgordon.co.uk/oddjob/schedules"> <refinement> <schedules:interval interval="00:00:00.100"/> </refinement> </schedules:count> </schedule> <job> <archive archiveName="Batch_01"> <archiver> <file-persister dir="${this.args[0]}"/> </archiver> <archiveIdentifier> <format date="${the-timer.current.fromDate}" format="mm_ss_SSS"/> </archiveIdentifier> <job> <echo>Run at ${the-timer.current.fromDate}</echo> </job> </archive> </job> </scheduling:timer> </jobs> </sequential> </job> </oddjob>
Modifier and Type | Field and Description |
---|---|
protected boolean |
stop
Stop flag.
|
Constructor and Description |
---|
ArchiveJob()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addStructuralListener(StructuralListener listener)
Add a listener.
|
protected void |
execute() |
protected void |
fireDestroyedState()
Internal method to fire state.
|
java.lang.Object |
getArchiveIdentifier() |
java.lang.String |
getArchiveName() |
OddjobPersister |
getArchiver() |
protected StateChanger<ParentState> |
getStateChanger() |
boolean |
hardReset()
Perform a hard reset on the job.
|
protected IconHelper |
iconHelper()
Subclasses must provide a
IconHelper . |
protected void |
onDestroy()
Subclasses override this method to clear up resources.
|
void |
removeStructuralListener(StructuralListener listener)
Remove a listener.
|
void |
run()
Implement the main execute method for a job.
|
void |
setArchiveIdentifier(java.lang.Object archive) |
void |
setArchiveName(java.lang.String path) |
void |
setArchiver(OddjobPersister archiver) |
void |
setJob(java.lang.Runnable job) |
boolean |
softReset()
Perform a soft reset on the job.
|
protected ParentStateHandler |
stateHandler()
Subclasses must provide a
StateHandler . |
void |
stop()
Implementation for a typical stop.
|
configure, getName, logger, logger, loggerName, save, setName, toString
addIconListener, addPropertyChangeListener, addStateListener, configure, destroy, firePropertyChange, getArooaSession, iconForId, initialise, lastStateEvent, onConfigured, onInitialised, removeIconListener, removePropertyChangeListener, removeStateListener, save, setArooaContext, setArooaSession
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addStateListener, lastStateEvent, removeStateListener
protected ParentStateHandler stateHandler()
BaseComponent
StateHandler
.stateHandler
in class BaseComponent
protected IconHelper iconHelper()
BaseComponent
IconHelper
.iconHelper
in class BaseComponent
protected StateChanger<ParentState> getStateChanger()
public final void run()
run
in interface java.lang.Runnable
protected void execute() throws java.lang.Throwable
java.lang.Throwable
public void stop() throws FailedToStopException
This stop implementation doesn't check that the job is executing as stop messages must cascade down the hierarchy to manually started jobs.
stop
in interface Stoppable
FailedToStopException
public boolean softReset()
public boolean hardReset()
public java.lang.Object getArchiveIdentifier()
public void setArchiveIdentifier(java.lang.Object archive)
public java.lang.String getArchiveName()
public void setArchiveName(java.lang.String path)
public OddjobPersister getArchiver()
public void setArchiver(OddjobPersister archiver)
public void addStructuralListener(StructuralListener listener)
addStructuralListener
in interface Structural
listener
- The listener.public void removeStructuralListener(StructuralListener listener)
removeStructuralListener
in interface Structural
listener
- The listener.public void setJob(java.lang.Runnable job)
Property: job
Description: The child job.
Required: No, but pointless if missing.
job
- protected void onDestroy()
BaseComponent
onDestroy
in class BaseComponent
protected void fireDestroyedState()
fireDestroyedState
in class BaseComponent