Dispatcher.singleton.registerTarget(sessionID, sessionAdvised);
JMSDispatcher.instance.registerTarget(Integer.valueOf(sessionID), sessionAdvised);
   public SessionDelegate createSessionDelegate(boolean transacted,                                                int acknowledgmentMode,                                                boolean isXA)      throws JMSException   {      try      {         closeLock.readLock().acquire();      }      catch (InterruptedException e)      {         //Ignore      }      try      {         if (log.isTraceEnabled()) { log.trace("creating session, transacted=" + transacted + " ackMode=" + ToString.acknowledgmentMode(acknowledgmentMode) + " XA=" + isXA); }                  if (closed)         {            throw new IllegalStateException("Connection is closed");         }                           String sessionID = generateSessionID();                  // create the corresponding server-side session endpoint and register it with this         // connection endpoint instance         ServerSessionEndpoint ep = new ServerSessionEndpoint(sessionID, this, acknowledgmentMode);         putSessionDelegate(sessionID, ep);         SessionAdvised sessionAdvised = new SessionAdvised(ep);         Dispatcher.singleton.registerTarget(sessionID, sessionAdvised);         ClientSessionDelegate d = new ClientSessionDelegate(sessionID);                          log.debug("created session delegate (sessionID=" + Util.guidToString(sessionID) + ")");         log.debug("created and registered " + ep);         return d;      }      finally      {         closeLock.readLock().release();      }   }