Dispatcher.singleton.registerTarget(connectionID, connAdvised);
JMSDispatcher.instance.registerTarget(Integer.valueOf(connectionID), connAdvised);
   public ConnectionDelegate createConnectionDelegate(String username, String password,                                                      String clientConnectionId) throws JMSException   {      log.debug("creating a new connection for user " + username);            // authenticate the user      serverPeer.getSecurityManager().authenticate(username, password);          // see if there is a preconfigured client id for the user      if (username != null)      {         String preconfClientID =            serverPeer.getDurableSubscriptionStoreDelegate().getPreConfiguredClientID(username);                  if (preconfClientID != null)         {            clientID = preconfClientID;         }      }      // create the corresponding "server-side" connection endpoint and register it with the      // server peer's ClientManager      ServerConnectionEndpoint endpoint =         new ServerConnectionEndpoint(serverPeer, clientID, username, password, clientConnectionId);      String connectionID = endpoint.getConnectionID();      ConnectionAdvised connAdvised = new ConnectionAdvised(endpoint);      Dispatcher.singleton.registerTarget(connectionID, connAdvised);            serverPeer.registerConnection(clientConnectionId, endpoint);      log.debug("created and registered " + endpoint);      ClientConnectionDelegate delegate;      try      {         delegate = new ClientConnectionDelegate(connectionID,                                                                                                  serverPeer.getServerPeerID(),                                                 serverPeer.getVersion());      }      catch (Exception e)      {         throw new JBossJMSException("Failed to create connection stub", e);      }              return delegate;   }