src/java.corba/share/classes/com/sun/corba/se/impl/oa/poa/POAManagerImpl.java

Print this page
rev 757 : 8148863: Remove sun.misc.ManagedLocalsThread from corba
Reviewed-by: alanb, coffeys


 340                 if ( state.value() == State._INACTIVE )
 341                     throw new org.omg.PortableServer.POAManagerPackage.AdapterInactive();
 342 
 343                 state = State.INACTIVE;
 344 
 345                 pihandler.adapterManagerStateChanged( myId, getORTState() ) ;
 346 
 347                 // Notify any invocations that were waiting because the previous
 348                 // state was HOLDING. Those invocations will then be rejected with
 349                 // an OBJ_ADAPTER exception. Also notify any threads that were waiting
 350                 // inside hold_requests() or discard_requests().
 351                 notifyWaiters();
 352             }
 353 
 354             POAManagerDeactivator deactivator = new POAManagerDeactivator( this,
 355                 etherealize_objects, debug ) ;
 356 
 357             if (wait_for_completion)
 358                 deactivator.run() ;
 359             else {
 360                 Thread thr = new sun.misc.ManagedLocalsThread(deactivator) ;
 361                 thr.start() ;
 362             }
 363         } finally {
 364             synchronized(this) {
 365                 if (debug) {
 366                     ORBUtility.dprint( this,
 367                         "Exiting deactivate on POAManager " + this ) ;
 368                 }
 369             }
 370         }
 371     }
 372 
 373     private class POAManagerDeactivator implements Runnable
 374     {
 375         private boolean etherealize_objects ;
 376         private POAManagerImpl pmi ;
 377         private boolean debug ;
 378 
 379         POAManagerDeactivator( POAManagerImpl pmi, boolean etherealize_objects,
 380             boolean debug )




 340                 if ( state.value() == State._INACTIVE )
 341                     throw new org.omg.PortableServer.POAManagerPackage.AdapterInactive();
 342 
 343                 state = State.INACTIVE;
 344 
 345                 pihandler.adapterManagerStateChanged( myId, getORTState() ) ;
 346 
 347                 // Notify any invocations that were waiting because the previous
 348                 // state was HOLDING. Those invocations will then be rejected with
 349                 // an OBJ_ADAPTER exception. Also notify any threads that were waiting
 350                 // inside hold_requests() or discard_requests().
 351                 notifyWaiters();
 352             }
 353 
 354             POAManagerDeactivator deactivator = new POAManagerDeactivator( this,
 355                 etherealize_objects, debug ) ;
 356 
 357             if (wait_for_completion)
 358                 deactivator.run() ;
 359             else {
 360                 Thread thr = new Thread(null, deactivator, "Deactivator-Thread", 0, false) ;
 361                 thr.start() ;
 362             }
 363         } finally {
 364             synchronized(this) {
 365                 if (debug) {
 366                     ORBUtility.dprint( this,
 367                         "Exiting deactivate on POAManager " + this ) ;
 368                 }
 369             }
 370         }
 371     }
 372 
 373     private class POAManagerDeactivator implements Runnable
 374     {
 375         private boolean etherealize_objects ;
 376         private POAManagerImpl pmi ;
 377         private boolean debug ;
 378 
 379         POAManagerDeactivator( POAManagerImpl pmi, boolean etherealize_objects,
 380             boolean debug )