protected static < C extends Component < C , I > , I extends IInterface > void load ( final Context context , final Descriptor < C , I > descriptor , final ConnectionCallback < C > callback ) { Utils . notNull ( context , "context must not be null" ) ; Utils . notNull ( descriptor , "context must not be null" ) ; if ( AccessTokenManager . get ( context ) . hasToken ( ) ) { bindToService ( context , descriptor , callback ) ; } else { AccessTokenManager . get ( context ) . requireAccessToken ( context , new AccessTokenManager . RegistrationCallback ( ) { @ Override public void onRegistrationSuccessful ( ) { Log . d ( "Component" , "Access Toekn: " + descriptor ) ; bindToService ( context , descriptor , callback ) ; } @ Override public void onRegistrationError ( SPFError errorMsg ) { callback . onError ( errorMsg ) ; } } ) ; } }
Loads a local component asynchronously .