throw new JBossJMSException("Failed to create connection factory delegate", e);
throw new MessagingJMSException("Failed to create connection factory delegate", e);
   public synchronized int registerConnectionFactory(String clientID,                                                     JNDIBindings jndiBindings) throws Exception   {      int id = serverPeer.getNextObjectID();      ServerConnectionFactoryEndpoint endpoint =         new ServerConnectionFactoryEndpoint(id, serverPeer, clientID, jndiBindings);      ClientConnectionFactoryDelegate delegate;      try      {         delegate = new ClientConnectionFactoryDelegate(id, serverPeer.getLocatorURI(),                                                        serverPeer.getVersion(),                                                        serverPeer.getServerPeerID());      }      catch (Exception e)      {         throw new JBossJMSException("Failed to create connection factory delegate", e);      }      ConnectionFactoryAdvised connFactoryAdvised = new ConnectionFactoryAdvised(endpoint);            JMSDispatcher.instance.registerTarget(new Integer(id), connFactoryAdvised);      endpoints.put(new Integer(id), endpoint);      JBossConnectionFactory cf = new JBossConnectionFactory(delegate);      if (jndiBindings != null)      {         List jndiNames = jndiBindings.getNames();         for(Iterator i = jndiNames.iterator(); i.hasNext(); )         {            String jndiName = (String)i.next();            JNDIUtil.rebind(initialContext, jndiName, cf);         }      }      factories.put(new Integer(id), cf);      return id;   }