roboguice.util
Class SafeAsyncTask.Task<ResultT>

java.lang.Object
  extended by roboguice.util.SafeAsyncTask.Task<ResultT>
All Implemented Interfaces:
java.util.concurrent.Callable<java.lang.Void>
Direct Known Subclasses:
RoboAsyncTask.RoboTask
Enclosing class:
SafeAsyncTask<ResultT>

public static class SafeAsyncTask.Task<ResultT>
extends java.lang.Object
implements java.util.concurrent.Callable<java.lang.Void>


Field Summary
protected  android.os.Handler handler
           
protected  SafeAsyncTask<ResultT> parent
           
 
Constructor Summary
SafeAsyncTask.Task(SafeAsyncTask parent)
           
 
Method Summary
 java.lang.Void call()
           
protected  ResultT doCall()
           
protected  void doException(java.lang.Exception e)
           
protected  void doFinally()
           
protected  void doPreExecute()
           
protected  void doSuccess(ResultT r)
           
protected  void postToUiThreadAndWait(java.util.concurrent.Callable c)
          Posts the specified runnable to the UI thread using a handler, and waits for operation to finish.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

parent

protected SafeAsyncTask<ResultT> parent

handler

protected android.os.Handler handler
Constructor Detail

SafeAsyncTask.Task

public SafeAsyncTask.Task(SafeAsyncTask parent)
Method Detail

call

public java.lang.Void call()
                    throws java.lang.Exception
Specified by:
call in interface java.util.concurrent.Callable<java.lang.Void>
Throws:
java.lang.Exception

doPreExecute

protected void doPreExecute()
                     throws java.lang.Exception
Throws:
java.lang.Exception

doCall

protected ResultT doCall()
                  throws java.lang.Exception
Throws:
java.lang.Exception

doSuccess

protected void doSuccess(ResultT r)
                  throws java.lang.Exception
Throws:
java.lang.Exception

doException

protected void doException(java.lang.Exception e)
                    throws java.lang.Exception
Throws:
java.lang.Exception

doFinally

protected void doFinally()
                  throws java.lang.Exception
Throws:
java.lang.Exception

postToUiThreadAndWait

protected void postToUiThreadAndWait(java.util.concurrent.Callable c)
                              throws java.lang.Exception
Posts the specified runnable to the UI thread using a handler, and waits for operation to finish. If there's an exception, it captures it and rethrows it.

Parameters:
c - the callable to post
Throws:
java.lang.Exception - on error


Copyright © 2011. All Rights Reserved.