de.myfoo.commonj.work
Class FooWorkItem

java.lang.Object
  extended by de.myfoo.commonj.work.FooWorkItem
All Implemented Interfaces:
commonj.work.WorkItem, java.lang.Comparable, java.lang.Runnable
Direct Known Subclasses:
FooRemoteWorkItem

public class FooWorkItem
extends java.lang.Object
implements commonj.work.WorkItem, java.lang.Runnable

Implementation of the work item.

Version:
1.0
Author:
Andreas Keldenich

Field Summary
protected  commonj.work.Work work
           
 
Constructor Summary
FooWorkItem(commonj.work.Work work, commonj.work.WorkListener wl)
          Creates a new instance of FooWorkItem.
 
Method Summary
 int compareTo(java.lang.Object arg0)
          Compare to another work item.
 commonj.work.Work getResult()
          Get the result of the work.
 int getStatus()
          Retruns the status of the in-flight work.
 void run()
          Wrapper around the run method of the work.
 void setDaemons(java.util.List daemons)
          Setter for daemon list.
 void setResultCollector(ResultCollector collector)
          Set the ResultCollector to support notification
 void setStatus(int status)
          Set the status of the work.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

work

protected commonj.work.Work work
Constructor Detail

FooWorkItem

public FooWorkItem(commonj.work.Work work,
                   commonj.work.WorkListener wl)
Creates a new instance of FooWorkItem.

Parameters:
work - the work
Method Detail

getResult

public commonj.work.Work getResult()
                            throws commonj.work.WorkException
Get the result of the work.

Specified by:
getResult in interface commonj.work.WorkItem
Returns:
the work.
Throws:
commonj.work.WorkException
See Also:
WorkItem.getResult()

getStatus

public int getStatus()
Retruns the status of the in-flight work.

Specified by:
getStatus in interface commonj.work.WorkItem
See Also:
WorkItem.getStatus()

setStatus

public void setStatus(int status)
Set the status of the work.

Parameters:
status - status of the work.

compareTo

public int compareTo(java.lang.Object arg0)
Compare to another work item.

Specified by:
compareTo in interface java.lang.Comparable
See Also:
Comparable.compareTo(java.lang.Object)

run

public void run()
Wrapper around the run method of the work.

Specified by:
run in interface java.lang.Runnable

setResultCollector

public void setResultCollector(ResultCollector collector)
Set the ResultCollector to support notification

Parameters:
collector - the result collector

setDaemons

public void setDaemons(java.util.List daemons)
Setter for daemon list.

Parameters:
daemons - The daemons to set.