s243a

BaseManifestPutter.stat

Jun 7th, 2015
481
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.00 KB | None | 0 0
  1. //Line 829 of https://github.com/freenet/fred/blob/next/src/freenet/client/async/BaseManifestPutter.java
  2.     public void start(ClientContext context) throws InsertException {
  3. 830         if (logMINOR)
  4. 831             Logger.minor(this, "Starting " + this+" persistence="+persistent()+ " containermode="+containerMode);
  5. 832         PutHandler[] running;
  6. 833         PutHandler[] containers;
  7. 834
  8.  
  9. 835         synchronized (this) {
  10. 836             running = runningPutHandlers.toArray(new PutHandler[runningPutHandlers.size()]);
  11. 837             if (containerMode) {
  12. 838                 containers = getContainersToStart(running.length > 0);
  13. 839             } else {
  14. 840                 containers = null;
  15. 841             }
  16. 842         }
  17. 843
  18.  
  19. 844         try {
  20. 845             for (int i = 0; i < running.length; i++) {
  21. 846                 running[i].start(context);
  22. 847                 if (logMINOR)
  23. 848                     Logger.minor(this, "Started " + i + " of " + running.length);
  24. 849                 if (isFinished()) {
  25. 850                     if (logMINOR)
  26. 851                         Logger.minor(this, "Already finished, killing start() on " + this);
  27. 852                     return;
  28. 853                 }
  29. 854             }
  30. 855             if (logMINOR)
  31. 856                 Logger.minor(this, "Started " + running.length + " PutHandler's for " + this);
  32. 857
  33.  
  34. 858             if (containerMode) {
  35. 859                 for (int i = 0; i < containers.length; i++) {
  36. 860                     containers[i].start(context);
  37. 861                     if (logMINOR)
  38. 862                         Logger.minor(this, "Started " + i + " of " + containers.length);
  39. 863                     if (isFinished()) {
  40. 864                         if (logMINOR)
  41. 865                             Logger.minor(this, "Already finished, killing start() on " + this);
  42. 866                         return;
  43. 867                     }
  44. 868                 }
  45. 869                 if (logMINOR)
  46. 870                     Logger.minor(this, "Started " + containers.length + " PutHandler's (containers) for " + this);
  47. 871
  48.  
  49. 872             }
  50. 873             if (!containerMode && running.length == 0) {
  51. 874                 gotAllMetadata(context);
  52. 875             }
  53. 876         } catch (InsertException e) {
  54. 877             synchronized(this) {
  55. 878                 finished = true;
  56. 879             }
  57. 880             cancelAndFinish(context);
  58. 881             throw e;
  59. 882         }
  60. 883         //debugDecompose("Start - End");
  61. 884     }
Advertisement
Add Comment
Please, Sign In to add comment