Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package org.sonatype.sisu.jetty.thread;

A simple wrapper that simply "detects" did a wrapped runnable "died" or exited cleanly. Once death detected, the flag remains set.

Author(s):
cstamas
Since:
1.3
 
public class RunnableWrapper
    implements Runnable
    private final Runnable runnable;
    static boolean unexpectedThrowable = false;
    public RunnableWrapperfinal Runnable runnable )
    {
        this. = runnable;
    }
    public void run()
    {
        try
        {
            .run();
        }
        catch ( Throwable e )
        {
             = true;
        }
    }
New to GrepCode? Check out our FAQ X