Interface WorkManager

  • All Known Implementing Classes:
    WorkManagerImpl

    public interface WorkManager
    This is a work manager API based on CommonJ. It has been adjusted to support running outside a JEE container.
    Author:
    Torkel Dominique
    See Also:
    WorkManager
    • Method Detail

      • schedule

        WorkItem schedule​(Work work)
                   throws WorkException,
                          IllegalArgumentException
        Parameters:
        work - the Work to execute
        Returns:
        The workitem representing the asynchronous work. If the Work is serializable then a RemoteWorkItem is always returned.
        Throws:
        WorkException - If queuing this up results in an exception then a WorkException is thrown
        IllegalArgumentException
        See Also:
        WorkManager.schedule(commonj.work.Work)
      • schedule

        WorkItem schedule​(Work work,
                          WorkListener wl)
                   throws WorkException,
                          IllegalArgumentException
        Parameters:
        work - the Work to execute
        wl - an optional WorkListener
        Returns:
        The workitem representing the asynchronous work. If the Work is serializable then a RemoteWorkItem is always returned.
        Throws:
        WorkException - If queuing this up results in an exception then a WorkException is thrown
        IllegalArgumentException
        See Also:
        WorkManager.schedule(commonj.work.Work, commonj.work.WorkListener)
      • shutdown

        boolean shutdown​(long timeout)
        This method is not part of CommonJ but is needed here since our implementation creates threads that needs to be cleaned up.
        Parameters:
        timeout - The number of milliseconds until the shutdown is aborted.
        Returns:
        true if shutdown was successful, otherwise false.