Set durableSubs = sp.getStateManager().loadDurableSubscriptionsForTopic(name); Iterator iter = durableSubs.iterator(); while (iter.hasNext()) { DurableSubscription sub = (DurableSubscription)iter.next();  try { sub.load(); } catch (Exception e) { JMSException e2 = new JMSException("Failed to load durable subscription state"); e2.setLinkedException(e); throw e2; }  sub.subscribe(); }
   void addCoreDestination(Destination jmsDestination) throws JMSException   {      JBossDestination d = (JBossDestination)jmsDestination;      String name = d.getName();      boolean isQueue = d.isQueue();      Distributor c = getCoreDestination(isQueue, name);      if (c != null)      {         throw new JMSException("Destination " + jmsDestination + " already exists");      }      ServerPeer sp = destinationManager.getServerPeer();      // TODO I am using LocalQueues for the time being, switch to distributed Queues      if (isQueue)      {         c = new Queue(name,                       sp.getMessageStore(),                       sp.getPersistenceManager());         queueMap.put(name, c);      }      else      {         // TODO I am using LocalTopics for the time being, switch to distributed Topics         c = new Topic(name);         topicMap.put(name, c);      }            //We also remove all message data here just in case there was any data left around in the database      //from a previous failure      try      {         sp.getPersistenceManager().removeAllMessageData(name);                  //FIXME - Also need to remove any message refs stored in memory for this destination               }      catch (Exception e)      {         log.error("Failed to remove message data", e);      }         }