Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // From line 419 of https://github.com/freenet/fred/blob/next/src/freenet/client/async/BaseManifestPutter.java
- public void start(ClientContext context) throws InsertException {
- 420 //new Error("trace start "+this).printStackTrace();
- 421 if (logDEBUG)
- 422 Logger.debug(this, "Starting a PutHandler for '"+this.itemName+"' "+ this);
- 423
- 424 if (origSFI == null) {
- 425 fail(new IllegalStateException("origSFI is null on start(), impossible"), context);
- 426 }
- 427
- 428 if ((!(this instanceof MetaPutHandler)) && (metadata != null)) {
- 429 fail(new IllegalStateException("metdata=" + metadata + " on start(), impossible"), context);
- 430 }
- 431
- 432 boolean ok;
- 433 if ((this instanceof ContainerPutHandler) || (this instanceof ArchivePutHandler)) {
- 434 if (this != rootContainerPutHandler) {
- 435 synchronized (containerPutHandlers) {
- 436 ok = containerPutHandlers.contains(this);
- 437 }
- 438 if (!ok) {
- 439 throw new IllegalStateException("Starting a PutHandler thats not in 'containerPutHandlers'! "+this);
- 440 }
- 441 }
- 442 } else {
- 443 if (this != rootMetaPutHandler) {
- 444 synchronized (runningPutHandlers) {
- 445 ok = runningPutHandlers.contains(this);
- 446 }
- 447 if (!ok) {
- 448 throw new IllegalStateException("Starting a PutHandler thats not in 'runningPutHandlers'! "+this);
- 449 }
- 450 }
- 451 }
- 452
- 453 synchronized (putHandlerWaitingForBlockSets) {
- 454 ok = putHandlerWaitingForBlockSets.contains(this);
- 455 }
- 456 if (!ok) {
- 457 Logger.error(this, "Starting a PutHandler thats not in 'waitingForBlockSets'! "+this, new Error("error"));
- 458 //throw new IllegalStateException("Starting a PutHandler thats not in 'waitingForBlockSets'! "+this);
- 459 }
- 460
- 461 ClientPutState sfi;
- 462 synchronized(this) {
- 463 sfi = origSFI;
- 464 currentState = sfi;
- 465 origSFI = null;
- 466 }
- 467 sfi.schedule(context);
- 468 }
- 469
- 470 @Override
Advertisement
Add Comment
Please, Sign In to add comment