499 IORFactories.getIORTemplateList( orf ) ;
500
501 if (!poaTemplate.isEquivalent( thisTemplate ))
502 throw new WrongAdapter();
503
504 // Extract the ObjectId from the first TaggedProfile in the IOR.
505 // If ior was created in this POA, the same ID was used for
506 // every profile through the profile templates in the currentFactory,
507 // so we will get the same result from any profile.
508 Iterator iter = ior.iterator() ;
509 if (!iter.hasNext())
510 throw iorWrapper().noProfilesInIor() ;
511 TaggedProfile prof = (TaggedProfile)(iter.next()) ;
512 ObjectId oid = prof.getObjectId() ;
513
514 return oid.getId();
515 }
516
517 // Converted from anonymous class to local class
518 // so that we can call performDestroy() directly.
519 static class DestroyThread extends sun.misc.ManagedLocalsThread {
520 private boolean wait ;
521 private boolean etherealize ;
522 private boolean debug ;
523 private POAImpl thePoa ;
524
525 public DestroyThread( boolean etherealize, boolean debug )
526 {
527 this.etherealize = etherealize ;
528 this.debug = debug ;
529 }
530
531 public void doIt( POAImpl thePoa, boolean wait )
532 {
533 if (debug) {
534 ORBUtility.dprint( this,
535 "Calling DestroyThread.doIt(thePOA=" + thePoa +
536 " wait=" + wait + " etherealize=" + etherealize ) ;
537 }
538
539 this.thePoa = thePoa ;
540 this.wait = wait ;
541
542 if (wait) {
543 run() ;
544 } else {
545 // Catch exceptions since setDaemon can cause a
546 // security exception to be thrown under netscape
|
499 IORFactories.getIORTemplateList( orf ) ;
500
501 if (!poaTemplate.isEquivalent( thisTemplate ))
502 throw new WrongAdapter();
503
504 // Extract the ObjectId from the first TaggedProfile in the IOR.
505 // If ior was created in this POA, the same ID was used for
506 // every profile through the profile templates in the currentFactory,
507 // so we will get the same result from any profile.
508 Iterator iter = ior.iterator() ;
509 if (!iter.hasNext())
510 throw iorWrapper().noProfilesInIor() ;
511 TaggedProfile prof = (TaggedProfile)(iter.next()) ;
512 ObjectId oid = prof.getObjectId() ;
513
514 return oid.getId();
515 }
516
517 // Converted from anonymous class to local class
518 // so that we can call performDestroy() directly.
519 static class DestroyThread extends Thread {
520 private boolean wait ;
521 private boolean etherealize ;
522 private boolean debug ;
523 private POAImpl thePoa ;
524
525 public DestroyThread( boolean etherealize, boolean debug )
526 {
527 super(null, null, "POA-Destroy-Thread", 0, false);
528 this.etherealize = etherealize ;
529 this.debug = debug ;
530 }
531
532 public void doIt( POAImpl thePoa, boolean wait )
533 {
534 if (debug) {
535 ORBUtility.dprint( this,
536 "Calling DestroyThread.doIt(thePOA=" + thePoa +
537 " wait=" + wait + " etherealize=" + etherealize ) ;
538 }
539
540 this.thePoa = thePoa ;
541 this.wait = wait ;
542
543 if (wait) {
544 run() ;
545 } else {
546 // Catch exceptions since setDaemon can cause a
547 // security exception to be thrown under netscape
|