JMSDispatcher.instance.registerTarget(new Integer(sessionID), sessionAdvised);
Integer iSessionID = new Integer(sessionID);  serverPeer.addSession(iSessionID, ep);  JMSDispatcher.instance.registerTarget(iSessionID, sessionAdvised);
   public SessionDelegate createSessionDelegate(boolean transacted,                                                int acknowledgmentMode,                                                boolean isXA)      throws JMSException   {      try      {         log.debug("creating session " + (transacted ? "transacted" :"non transacted")+ ", " + ToString.acknowledgmentMode(acknowledgmentMode) + ", " + (isXA ? "XA": "non XA"));         if (closed)         {            throw new IllegalStateException("Connection is closed");         }                           int sessionID = serverPeer.getNextObjectID();                    // create the corresponding server-side session endpoint and register it with this         // connection endpoint instance         ServerSessionEndpoint ep = new ServerSessionEndpoint(sessionID, this);                  synchronized (sessions)         {            sessions.put(new Integer(sessionID), ep);         }                  SessionAdvised sessionAdvised = new SessionAdvised(ep);                  JMSDispatcher.instance.registerTarget(new Integer(sessionID), sessionAdvised);         ClientSessionDelegate d = new ClientSessionDelegate(sessionID);                          log.debug("created " + d);         log.debug("created and registered " + ep);         return d;      }      catch (Throwable t)      {         throw ExceptionUtil.handleJMSInvocation(t, this + " createSessionDelegate");               }   }