private Session getCurrentSession ( ) { //no logging allowed, since this is called by logging process itself //this won't work in a remote component synchronized ( requestsByThreadId ) { StandardRequest request = ( StandardRequest ) requestsByThreadId . get ( Thread . currentThread ( ) . hashCode ( ) ) ; if ( request != null ) { return request . getSession ( false ) ; } } return null ; }
Returns current session which only exists if request was bound previously passing a valid session token .