IBM WebSphere Application ServerTM
Release 8

com.ibm.websphere.asynchbeans
Interface WorkItem


public interface WorkItem

This is returned once a Work is accepted for dispatcher. This is used to retrieve the Work after it's finished and to check any exceptions that it threw.

See Also:
WorkManager

Method Summary
 java.lang.Object getEventTrigger(java.lang.Class listenerInterface)
          This returns an event proxy.
 Work getResult()
          This returns the Work once the Work completes.
 int getStatus()
          This returns the current status of dispatching the Work.
 

Method Detail

getStatus

int getStatus()
This returns the current status of dispatching the Work. See WorkEvent for the values.

See Also:
WorkEvent

getResult

Work getResult()
               throws WorkException
This returns the Work once the Work completes. It can be interrogated by the application. If the Work threw an exception during run then the exception is rethrown here.

Throws:
WorkException

getEventTrigger

java.lang.Object getEventTrigger(java.lang.Class listenerInterface)
This returns an event proxy. When a method on this proxy is called then if the Work object implements that interface then the corresponding method on the Work object is invoked. The J2EE context of the Work starter is used when invoking the method. The event is executed using an independent transaction.

If the method called on the proxy returns a value then the return value from the Work object method is returned to the proxy caller.

If the event method on the target Work object throws an exception while processing the event then this is not propogated to the event publisher. The normal EventSource mechanism of reporting the exception to all listeners implementing EventSourceEvents is used. The only listener on the EventSource associated with a Work object is the Work object it-self. Therefore, if you want to log such exceptions then the Work object should implement EventSourceEvents and the listenerExceptionThrown method will be called if any event method on the Work throws an exception.

Parameters:
listenerInterface - This is the type which the returned proxy emulates. The event will only be fired if the Work object implements this interface.
See Also:
EventSource

IBM WebSphere Application ServerTM
Release 8