Class WorkItemImpl
- java.lang.Object
-
- com.tangosol.coherence.servlet.commonj.impl.WorkItemImpl
-
public class WorkItemImpl extends Object implements WorkItem, Runnable
A WorkItem implementation. This class will wrap a Work object and when executed delegate to the Work object. This is in order to be able to update the status of the work item and invoke the listener when the work has finished execution. Note: For now this class does not support the Comparable interface, which is needed to be Collection-friendly.- Author:
- Torkel Dominique
- See Also:
WorkItem
-
-
Constructor Summary
Constructors Constructor Description WorkItemImpl(Work work, WorkListener listener)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(Object o)
Work
getResult()
int
getStatus()
void
run()
Runs the work represented by this work item and invoke the listener if available.
-
-
-
Constructor Detail
-
WorkItemImpl
public WorkItemImpl(Work work, WorkListener listener)
-
-
Method Detail
-
getResult
public Work getResult() throws WorkException
- Specified by:
getResult
in interfaceWorkItem
- Returns:
- the completed Work or null if the Work is not yet complete
- Throws:
WorkException
- if there is an exception during run then the exception is rethrown here- See Also:
WorkItem.getResult()
-
getStatus
public int getStatus()
- Specified by:
getStatus
in interfaceWorkItem
- Returns:
- one of the events specified on the WorkEvent interface
- See Also:
WorkItem.getStatus()
-
compareTo
public int compareTo(Object o)
-
-