Class WorkManager.WorkHolder.Event

  • All Implemented Interfaces:
    commonj.work.WorkEvent
    Enclosing class:
    WorkManager.WorkHolder

    protected class WorkManager.WorkHolder.Event
    extends Base
    implements commonj.work.WorkEvent
    A WorkEvent implementation.
    • Constructor Detail

      • Event

        public Event​(int nType)
        Construct a WorkEvent.

        A reason we only need to pass the event type to the constructor is that if some one holds a reference to an Event object, all other information could be retrieved from the parent WorkHolder and is not a subject to change.

        Parameters:
        nType - the event type
    • Method Detail

      • getType

        public int getType()
        Return an event type.
        Specified by:
        getType in interface commonj.work.WorkEvent
        Returns:
        an event type
      • getWorkItem

        public commonj.work.WorkItem getWorkItem()
        Description copied from interface: commonj.work.WorkEvent
        This returns a WorkItem that represents the Work submitted to a WorkManager. This WorkItem may not be the same WorkItem reference that was returned from the WorkManager.schedule() methods.
        Specified by:
        getWorkItem in interface commonj.work.WorkEvent
        Returns:
        the WorkItem that this WorkEvent is for.
      • getException

        public commonj.work.WorkException getException()
        Description copied from interface: commonj.work.WorkEvent
        This returns the exception if any in the case of WORK_COMPLETED.
        Specified by:
        getException in interface commonj.work.WorkEvent
        Returns:
        the WorkException thrown if a Work completed with exception. Null if there is no exception.