@PreDestroy protected void deregisterSessionScope(){
  for (  Entry<Serializable,String> sessionUser : sessionUsers.entrySet()) {
    socketUsers.deregister(sessionUser.getKey(),sessionUser.getValue());
  }
  socketSessions.deregister(sessionScope.values());
}

@ PreDestroy protected void deregisterSessionScope ( ) { for ( Entry < Serializable , String > sessionUser : sessionUsers . entrySet ( ) ) { socketUsers . deregister ( sessionUser . getKey ( ) , sessionUser . getValue ( ) ) ; } socketSessions . deregister ( sessionScope . values ( ) ) ; }
when current session scope is about to be destroyed , deregister all session scope channels and explicitly close any open web sockets associated with it to avoid stale websockets . if any , also deregister session users .
