Class WorkManagerImpl

  • All Implemented Interfaces:
    WorkManager

    public class WorkManagerImpl
    extends Object
    implements WorkManager
    This is a simple implementation of a WorkManager that uses a thread pool to delegate the work to. The number of daemon threads can be configured, but default is 10.
    Author:
    Torkel Dominique
    See Also:
    WorkManager
    • Constructor Detail

      • WorkManagerImpl

        public WorkManagerImpl()
      • WorkManagerImpl

        public WorkManagerImpl​(int minThreads,
                               int maxThreads)
      • WorkManagerImpl

        public WorkManagerImpl​(int minThreads,
                               int maxThreads,
                               int maxQueueSize)
    • Method Detail

      • shutdown

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