public void stop() { synchronized(this) { if(fetched) return; } cg.cancel(context); }
@Override void tryCancel() { if(get != null) get.cancel(node.clientCore.clientContext); }
public void kill() { if(revocationGetter != null) revocationGetter.cancel(core.clientContext); }
@Override public void run() { get.cancel(core.clientContext); }
@Override public void run() { getter.cancel(clientContext); if(f != null) f.cancel(); }
protected void abortFetches() { Logger.debug(this, "Trying to stop all fetches..."); if(mFetches != null) synchronized(mFetches) { ClientGetter[] fetches = mFetches.toArray(new ClientGetter[mFetches.size()]); int fcounter = 0; for(ClientGetter fetch : fetches) { /* This calls onFailure which removes the fetch from mFetches on the same thread, therefore we need to copy to an array */ fetch.cancel(mNode.clientCore.clientContext); ++fcounter; } Logger.debug(this, "Stopped " + fcounter + " current fetches."); } }
void kill() { try { ClientGetter c; synchronized(this) { isRunning = false; USK myUsk = USK.create(URI.setSuggestedEdition(currentVersion)); core.uskManager.unsubscribe(myUsk, this); c = cg; cg = null; } c.cancel(core.clientContext); } catch(Exception e) { Logger.minor(this, "Cannot kill NodeUpdater", e); } }
/** Finish the cancel process, freeing the data if necessary. The fetch * must have been removed from the tracker already, so it won't be reused. */ public void finishCancel() { if(logMINOR) Logger.minor(this, "Finishing cancel for "+this+" : "+uri+" : "+maxSize); try { getter.cancel(tracker.context); } catch (Throwable t) { // Ensure we get to the next bit Logger.error(this, "Failed to cancel: "+t, t); } Bucket d; synchronized(this) { d = data; cancelled = true; } if(d != null) { try { d.free(); } catch (Throwable t) { // Ensure we get to the next bit Logger.error(this, "Failed to free: "+t, t); } } }
cancelled.cancel(core.clientContext);
toCancel.cancel(core.clientContext); if(cg != null) { core.clientContext.start(cg);