Overview | Package | Class | Use | Tree | Deprecated | Index | Help
|  | Oracle
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## commonj.work
Interface WorkItem

All Superinterfaces:
  Comparable

All Known Subinterfaces:
  RemoteWorkItem

    public interface WorkItem

extends Comparable

This is returned once a Work is submitted to a WorkManager. It can be used to check the status of Work after it's finished and to check any exceptions that it threw. If the Work was serializable and the vendor implementation supports distributed WorkManagers then this object can be cast to RemoteWorkItem where additional APIs are defined to exploit this capability. WorkItem instances can also be used with the `WorkManager.waitForAny(java.util.Collection, long)` or `WorkManager.waitForAll(java.util.Collection, long)` to wait for remote or local WorkItems to complete.

Applications can use the WorkItem as a key to correlate the WorkItem back to the running Work object. The WorkItem should implement the equals, compareTo and hashCode methods and is therefore Collection-friendly.

Since:
  1.0
See Also:
  `WorkManager`, `RemoteWorkItem`, `WorkListener`

Method Summary
`Work` | `getResult()` This returns the Work once it has completed.
`int` | `getStatus()` This returns the current status of dispatching the Work.

Methods inherited from interface java.lang.Comparable
`compareTo`

Method Detail

### getResult

    Work getResult()
                   throws WorkException

  This returns the Work once it has completed. If the Work threw an exception during run then the exception is rethrown here.

  Returns:
    the completed Work or null if the Work is not yet complete.
  Throws:
    `WorkException`
  Since:
    1.1

### getStatus

    int getStatus()

  This returns the current status of dispatching the Work. See WorkEvent for the values.

  Returns:
    one of the events specified on the `WorkEvent` interface.
  Since:
    1.0
  See Also:
    `WorkEvent`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Documentation is available at http://edocs.bea.com/wls/docs103 Copyright 1996,2008, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners.
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD