{ log.info("Broken client connection, clearing up its state " + sessionId, t);  if (log.isTraceEnabled()) { log.trace("Clearing up server resources for this connection"); }
{
   public void handleConnectionException(Throwable t, Client client)   {      String sessionId = client.getSessionId();      if (sessionId == null)      {         log.warn("Session id is null for client " + client);      }      else      {         if (t instanceof ClientDisconnectedException)         {            // This is OK            if (log.isTraceEnabled()) { log.trace("client " + client + " has disconnected"); }         }         else         {            log.info("Broken client connection, clearing up its state " + sessionId, t);            if (log.isTraceEnabled()) { log.trace("Clearing up server resources for this connection"); }            ServerConnectionEndpoint endpoint =               (ServerConnectionEndpoint)connections.remove(sessionId);            if (endpoint == null)            {               log.error("Cannot find ServerConnectionEndpoint for session id " + sessionId);            }            else            {               try               {                  endpoint.close();               }               catch (JMSException e)               {                  log.error("Failed to close connection", e);               }            }            log.info("Cleared up state for connection");         }      }   }