package Ġcom . tencent . devops . websocket . listener Ċ Ċ import Ġcom . tencent . devops . common . event . listener . Listener Ċ import Ġcom . tencent . devops . websocket . event . Clear Session Event Ċ import Ġcom . tencent . devops . websocket . serv cie . Websocket Service Ċ import Ġorg . slf 4 j . LoggerFactory Ċ import Ġorg . springframework . beans . factory . annotation . Autowired Ċ import Ġorg . springframework . stereotype . Component Ċ Ċ @ Component Ċ class ĠCache Session Listener Ġ@ Autowired Ġconstructor ( ĊĠĠĠ Ġprivate Ġval Ġwebsocket Service : ĠWeb socket Service Ċ ) Ġ: ĠListener < Clear Session Event > Ġ{ ĊĠĠĠ Ġoverride Ġfun Ġexecute ( event : ĠClear Session Event ) Ġ{ ĊĠĠĠĠĠĠĠ Ġif Ġ( websocket Service . is Cache Session ( event . sessionId )) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġlogger . info (" clear Ġcache Ġsession Ġby Ġm q Ġfan out , ĠuserId [ ${ event . userId }] ĠsessionId [ ${ event . sessionId }] ") ĊĠĠĠĠĠĠĠĠĠĠĠ Ġwebsocket Service . remove Cache Session ( event . sessionId ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġcompanion Ġobject Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġlogger Ġ= ĠLoggerFactory . getLogger ( this :: class . java ) ĊĠĠĠ Ġ} Ċ }