void checkNotClosed ( ) throws JMSException { int currentState ; synchronized ( stateLock ) { currentState = state ; } if ( currentState == CLOSED ) { throw ( javax . jms . IllegalStateException ) JmsErrorUtils . newThrowable ( javax . jms . IllegalStateException . class , "SESSION_CLOSED_CWSIA0049" , null , tc ) ; } }
This method is called at the beginning of every method that should not work if the Session has been closed . It prevents further execution by throwing a JMSException with a suitable I m closed message .