org.oddjob.jobs.structural
Class FolderJob

java.lang.Object
  extended byorg.oddjob.jobs.structural.FolderJob
All Implemented Interfaces:
Iconic, Stoppable, Structural

public class FolderJob
extends java.lang.Object
implements Structural, Iconic, Stoppable

Description:
Holds a colection of child job but does not execute them. Used to collect and organise jobs. The jobs can either be scheduled by a scheduler or run manually.

A folder has no state, it can't be run and it can't be stopped.

Example:
 <folder name="My Jobs">
   <exec name="Morning Job" command="etc..." >/>
   <exec name="Afternoon Job" command="etc..." >/>
   <exec name="Manual Cleanup" command="etc..." >/>
 </folder>
 
Author:
Rob Gordon

Field Summary
protected  ChildHelper childHelper
          Child helper.
protected  boolean destroyed
          This flag is set once the object is destroyed Methods in subclass should check this flag.
 
Constructor Summary
FolderJob()
           
 
Method Summary
 void addComponent(java.lang.Object child)
          Add a child.
 void addIconListener(IconListener listener)
          Add an icon listener.
 void addStructuralListener(StructuralListener listener)
          Add a listener.
 void destroy()
          Destroy this component.
 java.lang.String getName()
          Get the job name.
 IconTip iconForId(java.lang.String iconId)
          Return an icon tip for a given id.
 void removeIconListener(IconListener listener)
          Remove an icon listener.
 void removeStructuralListener(StructuralListener listener)
          Remove a listener.
 void setName(java.lang.String name)
          Set the job name.
 void stop()
          Stop executing.
 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

childHelper

protected transient ChildHelper childHelper
Child helper.


destroyed

protected transient volatile boolean destroyed
This flag is set once the object is destroyed Methods in subclass should check this flag.

Constructor Detail

FolderJob

public FolderJob()
Method Detail

setName

public void setName(java.lang.String name)
Set the job name. Used by subclasses to set the job name.

Parameters:
name - The name of the job.

getName

public java.lang.String getName()
Get the job name.

Returns:
The job name.

addComponent

public void addComponent(java.lang.Object child)
Add a child.

Oddjob Element:
Any
Description:
The child jobs.
Required:
No, but pointless if missing.
Parameters:
child - A child

addStructuralListener

public void addStructuralListener(StructuralListener listener)
Add a listener. The listener will immediately recieve add notifications for all existing children.

Specified by:
addStructuralListener in interface Structural
Parameters:
listener - The listener.

removeStructuralListener

public void removeStructuralListener(StructuralListener listener)
Remove a listener.

Specified by:
removeStructuralListener in interface Structural
Parameters:
listener - The listner.

toString

public java.lang.String toString()
Override toString.


iconForId

public IconTip iconForId(java.lang.String iconId)
Return an icon tip for a given id. Part of the Iconic interface.

Specified by:
iconForId in interface Iconic
Parameters:
iconId - The icon id.
Returns:
The IconTip or null if it doesn't exist.

addIconListener

public void addIconListener(IconListener listener)
Add an icon listener. Part of the Iconic interface.

Specified by:
addIconListener in interface Iconic
Parameters:
listener - The listener.

removeIconListener

public void removeIconListener(IconListener listener)
Remove an icon listener. Part of the Iconic interface.

Specified by:
removeIconListener in interface Iconic
Parameters:
listener - The listener.

stop

public void stop()
Description copied from interface: Stoppable
Stop executing.

Specified by:
stop in interface Stoppable

destroy

public void destroy()
Destroy this component.