Android Open Source - sqldb Exception Throwing Future Task






From Project

Back to project page sqldb.

License

The source code is released under:

MIT License

If you think the Android project sqldb listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package prj.sqldb.threading;
//from ww  w.  j av a  2 s  . c o m
import java.util.concurrent.FutureTask;

public class ExceptionThrowingFutureTask extends FutureTask<Object>
{
    public ExceptionThrowingFutureTask(Runnable r)
    {
        super(r, null);
    }

    @Override
    protected void done()
    {
        try
        {
            if (!isCancelled())
            {
                get();
            }
        }
        catch (final Exception e)
        {
            /* This is done to ensure that the exception is not eaten by the executor */
            Thread thread = new Thread(new Runnable()
            {
                @Override
                public void run()
                {
                    throw new RuntimeException(e.getMessage(),e);
                }
            });
            thread.start();
        }
    }
}




Java Source Code List

prj.sqldb.CursorHandler.java
prj.sqldb.DBCallback.java
prj.sqldb.MultipleCursorHandler.java
prj.sqldb.QueryParams.java
prj.sqldb.QueryResult.java
prj.sqldb.SequentialCursorProcessor.java
prj.sqldb.SqlDb.java
prj.sqldb.threading.ExceptionThrowingFutureTask.java
prj.sqldb.threading.Later.java
prj.sqldb.threading.SqlDBThreads.java