private void CreateTemporaryLink(TemporaryDestination temporaryDestination) { TemporaryLink link = new TemporaryLink(temporaryLinks.Session, temporaryDestination); link.Attach(); temporaryLinks.AddLink(temporaryDestination, link); }
internal void DestroyTemporaryDestination(TemporaryDestination destination) { ThrowIfClosed(); foreach (Session session in GetSessions()) { if (session.IsDestinationInUse(destination)) { throw new IllegalStateException("Cannot delete Temporary Destination, {0}, while consuming messages."); } } try { TemporaryLink link = temporaryLinks.RemoveLink(destination); if (link != null && !link.IsClosed) { link.Close(); } } catch (Exception e) { throw ExceptionSupport.Wrap(e); } }