protected void checkValidForWrite ( ) throws IllegalStateException { checkLocked ( ) ; if ( state == State . INVALID ) { throw new IllegalStateException ( "Not valid for write: session " + this ) ; } if ( state == State . INVALIDATING ) { return ; // in the process of being invalidated, listeners may try to remove attributes } if ( ! isResident ( ) ) { throw new IllegalStateException ( "Not valid for write: session " + this ) ; } }
Check that the session can be modified .