protected void checkClosed ( ) throws JMSException { if ( getState ( ) == CLOSED ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "This Connection is closed." ) ; throw ( javax . jms . IllegalStateException ) JmsErrorUtils . newThrowable ( javax . jms . IllegalStateException . class , "CONNECTION_CLOSED_CWSIA0021" , null , tc ) ; } }
This method is called at the beginning of every method that should not work if the Connection has been closed . It prevents further execution by throwing a JMSException with a suitable I m closed message .