Documentation of 'visad.util.ThreadManager' Java class
ThreadManager
visad.util

Class ThreadManager



  • public class ThreadManager
    extends java.lang.Object
    This class provides support for running a collection of Runnables concurrently. It will collect and then throw any exceptions that are thrown. It uses the static maxThreads as the number of threads to run. The default is 1, resulting in sequential execution.
    • Field Detail

      • debug

        public boolean debug
    • Constructor Detail

      • ThreadManager

        public ThreadManager()
      • ThreadManager

        public ThreadManager(java.lang.String theName)
        Constructor with name specified
        Parameters:
        theName -
      • ThreadManager

        public ThreadManager(int maxThreads)
        Parameters:
        maxThreads -
    • Method Detail

      • setGlobalMaxThreads

        public static void setGlobalMaxThreads(int max)
        Parameters:
        max -
      • debug

        public void debug(java.lang.String msg)
      • clearTimes

        public static void clearTimes()
      • handleException

        public void handleException(java.lang.Exception exc)
        Parameters:
        exc -
      • runnableStopped

        public void runnableStopped()
      • runnableStarted

        public void runnableStarted()
      • getNumRunnables

        public int getNumRunnables()
        Returns:
        count of Runnables
      • runInParallel

        public void runInParallel(int maxThreads)
                           throws VisADException,
                                  java.rmi.RemoteException
        Parameters:
        maxThreads -
        Throws:
        java.rmi.RemoteException
        VisADException
      • runSequentially

        public void runSequentially()
                             throws VisADException,
                                    java.rmi.RemoteException
        Throws:
        java.rmi.RemoteException
        VisADException
      • runAllParallel

        public void runAllParallel()
                            throws VisADException,
                                   java.rmi.RemoteException
        Throws:
        java.rmi.RemoteException
        VisADException
      • runInParallel

        public void runInParallel()
                           throws VisADException,
                                  java.rmi.RemoteException
        Throws:
        java.rmi.RemoteException
        VisADException
      • runInParallel

        public void runInParallel(boolean doAverage)
                           throws VisADException,
                                  java.rmi.RemoteException
        Parameters:
        doAverage -
        Throws:
        java.rmi.RemoteException
        VisADException
      • getExceptions

        public java.util.List<java.lang.Exception> getExceptions()
        Return the list of any exceptions that were thrown when running the threads
        Returns:
        The exceptions that were thrown
      • doWork

        public static final void doWork(int amt,
                                        int[] A)
      • main

        public static void main(java.lang.String[] args)
                         throws java.lang.Exception
        Main method for testing
        Parameters:
        args - args
        Throws:
        java.lang.Exception

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.