/** Called when we first send a request to the network. Ensures that it really is the first time and * passes on to innerToNetwork(). */ public void toNetwork(ClientContext context) { synchronized(this) { if(sentToNetwork) return; sentToNetwork = true; } innerToNetwork(context); }
/** Called by onResume() once and only once after restarting. Must be overridden, and must call * super.innerOnResume(). * @throws ResumeFailedException */ protected void innerOnResume(ClientContext context) throws ResumeFailedException { ClientBaseCallback cb = getCallback(); client = cb.getRequestClient(); assert(client.persistent()); if(sentToNetwork) innerToNetwork(context); }