private boolean okayToSendServerStopping ( ) { // Removed the synchronized modifier of this method, as its only setting one private variable _sentServerStopping, // If its synchronized, then notification thread gets blocked here until JsActivationThread returns and so it doesnot set _sentServerStopping to true if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) // To enable the JsActivationThread to check for serverStopping notification while its still running, this method should not be synchronized. SibTr . entry ( tc , "okayToSendServerStopping" , this ) ; synchronized ( lockObject ) { // This should be run in a synchronized context if ( ! _sentServerStopping ) { if ( ( _state == STATE_STARTED || _state == STATE_AUTOSTARTING || _state == STATE_STARTING ) && _mainImpl . isServerStopping ( ) ) { // Adding additional ME states( STARTING and AUTOSTARTING) , so that sever stopping notification is also sent when ME is in those states. _sentServerStopping = true ; } } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "okayToSendServerStopping" , new Boolean ( _sentServerStopping ) ) ; return _sentServerStopping ; }
Determine whether the conditions permitting a server stopping notification to be sent are met . The ME state can be STARTED AUTOSTARTING or in STARTING state to receive server stopping notification