stub = new ConnectionStub(scd.getConnectionID(), serverPeer.getLocator());
stub = new ConnectionStub(scd.getConnectionID(), serverPeer.getLocator(), serverPeer.getServerPeerID());
   public ConnectionDelegate createConnectionDelegate(String username, String password)      throws JMSException   {      log.debug("Creating a new connection with username=" + 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.getStateManager().getPreConfiguredClientID(username);         if (preconfClientID != null)         {            clientID = preconfClientID;         }      }      // create the corresponding "server-side" ConnectionDelegate and register it with the      // server peer's ClientManager      ServerConnectionEndpoint scd = new ServerConnectionEndpoint(serverPeer, clientID, username, password);            serverPeer.getClientManager().putConnectionDelegate(scd.getConnectionID(), scd);               Dispatcher.singleton.registerTarget(scd.getConnectionID(), new ConnectionEndpointDelegate(scd));               ConnectionStub stub;      try      {         stub = new ConnectionStub(scd.getConnectionID(), serverPeer.getLocator());      }      catch (Exception e)      {         throw new JBossJMSException("Failed to create connection stub", e);      }              return stub;   }