FileDocCategorySizeDatePackage
Registrant.javaAPI DocAndroid 5.1 API2568Thu Mar 12 22:22:10 GMT 2015android.os

Registrant

public class Registrant extends Object
hide

Fields Summary
WeakReference
refH
int
what
Object
userObj
Constructors Summary
public Registrant(android.os.Handler h, int what, Object obj)

        refH = new WeakReference(h);
        this.what = what;
        userObj = obj;
    
Methods Summary
public voidclear()

        refH = null;
        userObj = null;
    
public android.os.HandlergetHandler()

        if (refH == null)
            return null;

        return (Handler) refH.get();
    
voidinternalNotifyRegistrant(java.lang.Object result, java.lang.Throwable exception)

        Handler h = getHandler();

        if (h == null) {
            clear();
        } else {
            Message msg = Message.obtain();

            msg.what = what;
            
            msg.obj = new AsyncResult(userObj, result, exception);
            
            h.sendMessage(msg);
        }
    
public android.os.MessagemessageForRegistrant()
NOTE: May return null if weak reference has been collected

        Handler h = getHandler();

        if (h == null) {
            clear();

            return null;
        } else {
            Message msg = h.obtainMessage();

            msg.what = what;
            msg.obj = userObj;

            return msg;
        }
    
public voidnotifyException(java.lang.Throwable exception)

        internalNotifyRegistrant (null, exception);
    
public voidnotifyRegistrant()

        internalNotifyRegistrant (null, null);
    
public voidnotifyRegistrant(AsyncResult ar)
This makes a copy of @param ar

        internalNotifyRegistrant (ar.result, ar.exception);
    
public voidnotifyResult(java.lang.Object result)

        internalNotifyRegistrant (result, null);