Class MThreadPool

  • All Implemented Interfaces:
    ILog, MNlsProvider, Nls, Runnable
    Direct Known Subclasses:
    MThreadPoolDaemon

    public class MThreadPool
    extends MObject
    implements Runnable
    Author:
    hummel To change the template for this generated type comment go to Window>Preferences>Java>Code Generation>Code and Comments
    • Constructor Detail

      • MThreadPool

        public MThreadPool()
      • MThreadPool

        public MThreadPool​(String _name)
      • MThreadPool

        public MThreadPool​(Runnable _task)
    • Method Detail

      • getTask

        protected Runnable getTask()
      • run

        public void run()
        Specified by:
        run in interface Runnable
      • setName

        public void setName​(String _name)
      • getName

        public String getName()
      • setPriority

        public void setPriority​(int _p)
      • getPriority

        public int getPriority()
      • stop

        public void stop()
      • interupt

        public void interupt()
      • sleep

        public static void sleep​(long _millisec)
        Sleeps _millisec milliseconds. On Error (e.g. a break), it prints a stacktrace dump.
        Parameters:
        _millisec -
      • isAlive

        public boolean isAlive()
      • taskError

        public void taskError​(Throwable t)
      • asynchron

        public static void asynchron​(Runnable task)
      • getWithTimeout

        public static <T> T getWithTimeout​(ValueProvider<T> provider,
                                           long timeout,
                                           boolean nullAllowed)
        Try every 200ms to get the value. If the provider throws an error or return null the try will be repeated. If the time out is reached a TimeoutRuntimeException will be thrown.
        Parameters:
        provider -
        timeout -
        nullAllowed -
        Returns:
        The requested value