mil.dod.th.ose.shared/src/mil/dod/th/ose/shared/ExceptionUtil.java
public static void handleExecutorExceptions(final LoggingService logService, final Runnable runnable, 
            final Throwable throwable) 
    {
        Throwable exception = throwable;
        if (exception == null && runnable instanceof Future<?>) 
        {
            try 
            {
                final Future<?> future = (Future<?>) runnable;
                if (future.isDone())
                {
                    future.get();
                }
            } 
            catch (final CancellationException ce) 
            {
                exception = ce;
            } 
            catch (final ExecutionException ee) 
            {
                exception = ee.getCause();
            }
            catch (final InterruptedException ie) 
            {
                exception = ie;
            }
        }
        if (exception != null)
        {
            logService.error(exception, "Executor threw an exception");
        }
    }
/**
     * Exception logging method used to log an exception thrown by a executor that has completed.
     * 
     * @param logService
     *         the logging service to be used to log the exception
     * @param runnable
     *         the completed runnable
     * @param throwable
     *         the exception or null if the runnable terminated normally
     */
Exception logging method used to log an exception thrown by a executor that has completed.

@param logService
the logging service to be used to log the exception
@param runnable
the completed runnable
@param throwable
the exception or null if the runnable terminated normally
Exception logging method used to log an exception thrown by a executor that has completed . @param logService the logging service to be used to log the exception @param runnable the completed runnable @param throwable the exception or null if the runnable terminated normally
public static void handleExecutorExceptions(final LoggingService logService, final Runnable runnable, 
            final Throwable throwable) 
    {
        Throwable exception = throwable;
        if (exception == null && runnable instanceof Future<?>) 
        {
            try 
            {
                final Future<?> future = (Future<?>) runnable;
                if (future.isDone())
                {
                    future.get();
                }
            } 
            catch (final CancellationException ce) 
            {
                exception = ce;
            } 
            catch (final ExecutionException ee) 
            {
                exception = ee.getCause();
            }
            catch (final InterruptedException ie) 
            {
                exception = ie;
            }
        }
        if (exception != null)
        {
            logService.error(exception, "Executor threw an exception");
        }
    }
public static void handleExecutorExceptions ( final LoggingService logService , final Runnable runnable , final Throwable throwable ) { Throwable exception = throwable ; if ( exception == null && runnable instanceof Future < ? > ) { try { final Future < ? > future = ( Future < ? > ) runnable ; if ( future . isDone ( ) ) { future . get ( ) ; } } catch ( final CancellationException ce ) { exception = ce ; } catch ( final ExecutionException ee ) { exception = ee . getCause ( ) ; } catch ( final InterruptedException ie ) { exception = ie ; } } if ( exception != null ) { logService . error ( exception , "Executor threw an exception" ) ; } }
Exception logging method used to log an exception thrown by a executor that has completed.
Exception logging method used to log an exception thrown by a executor that has completed .