cm.undeployTemporaryCoreDestination(dest.isQueue(), dest.getName());
cm.undeployCoreDestination(dest.isQueue(), dest.getName());
   public void deleteTemporaryDestination(JBossDestination dest) throws JMSException   {      if (closed)      {         throw new IllegalStateException("Session is closed");      }      if (!dest.isTemporary())      {         throw new InvalidDestinationException("Destination:" + dest + " is not a temporary destination");      }            //It is illegal to delete a temporary destination if there any active consumers on it      CoreDestination destination = cm.getCoreDestination(dest);            if (destination == null)      {         throw new InvalidDestinationException("Destination:" + dest + " does not exist");               }            if (dest instanceof JBossQueue)      {         if (destination.iterator().hasNext())         {            throw new IllegalStateException("Cannot delete temporary destination, since it has active consumer(s)");         }      }      else if (dest instanceof JBossTopic)      {         Iterator iter = destination.iterator();         while (iter.hasNext())         {            CoreSubscription sub = (CoreSubscription)iter.next();            if (sub.iterator().hasNext())            {               throw new IllegalStateException("Cannot delete temporary destination, since it has active consumer(s)");            }         }      }            cm.undeployTemporaryCoreDestination(dest.isQueue(), dest.getName());      connectionEndpoint.removeTemporaryDestination(dest);   }