private void destroy ( ) { final boolean bTrace = TraceComponent . isAnyTracingEnabled ( ) ; if ( bTrace && tc . isEventEnabled ( ) ) { Tr . event ( tc , "Session being destroyed; " + this ) ; } // List<HttpSessionListener> list = this.myConfig.getSessionListeners(); // if (null != list) { // HttpSessionEvent event = new HttpSessionEvent(this); // for (HttpSessionListener listener : list) { // if (bTrace && tc.isDebugEnabled()) { // Tr.debug(tc, "Notifying listener of destroy; " + listener); // } // listener.sessionDestroyed(event); // } // } for ( String key : this . attributes . keySet ( ) ) { Object value = this . attributes . get ( key ) ; HttpSessionBindingEvent event = new HttpSessionBindingEvent ( this , key ) ; if ( value instanceof HttpSessionBindingListener ) { if ( bTrace && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Notifying attribute of removal: " + value ) ; } ( ( HttpSessionBindingListener ) value ) . valueUnbound ( event ) ; } } this . attributes . clear ( ) ; this . myContext = null ; }
Once a session has been invalidated this will perform final cleanup and notifying any listeners .