Ejemplo n.º 1
0
 /// <summary>
 /// Converts an IBM XMS temporary topic interface
 /// into an NMS temporary topic interface.
 /// </summary>
 /// <param name="xmsTemporaryTopic">XMS destination of type
 /// <c>DestinationType.Topic</c>.</param>
 /// <returns>Apache NMS temporary topic interface.</returns>
 // Couldn't find a means to test whether a XMS destination is temporary.
 public static Apache.NMS.ITemporaryTopic ToNMSTemporaryTopic(
     IBM.XMS.IDestination xmsTemporaryTopic)
 {
     if ((xmsTemporaryTopic != null) &&
         (xmsTemporaryTopic.TypeId != IBM.XMS.DestinationType.Queue))
     {
         throw new ArgumentException(
                   "Cannot convert IBM XMS destination to NMS destination: invalid destination type id.",
                   "xmsTemporaryTopic");
     }
     return(xmsTemporaryTopic != null
                         ? new Apache.NMS.XMS.TemporaryTopic(xmsTemporaryTopic)
                         : null);
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Converts an IBM XMS queue interface
 /// into an NMS queue interface.
 /// </summary>
 /// <param name="xmsQueue">XMS destination of type
 /// <c>DestinationType.Queue</c>.</param>
 /// <returns>Apache NMS queue interface.</returns>
 public static Apache.NMS.IQueue ToNMSQueue(
     IBM.XMS.IDestination xmsQueue)
 {
     if ((xmsQueue != null) &&
         (xmsQueue.TypeId != IBM.XMS.DestinationType.Queue))
     {
         throw new ArgumentException(
                   "Cannot convert IBM XMS destination to NMS destination: invalid destination type id.",
                   "xmsQueue");
     }
     return(xmsQueue != null
                         ? new Apache.NMS.XMS.Queue(xmsQueue)
                         : null);
 }
Ejemplo n.º 3
0
        /// <summary>
        /// Converts an IBM XMS destination interface
        /// into an NMS destination interface.
        /// </summary>
        /// <param name="xmsDestination">XMS destination.</param>
        /// <param name="isTemporary">Destination is temporary.</param>
        /// <returns>Apache NMS destination interface.</returns>
        public static Apache.NMS.IDestination ToNMSDestination(
            IBM.XMS.IDestination xmsDestination,
            bool isTemporary)
        {
            if (xmsDestination.TypeId == IBM.XMS.DestinationType.Queue)
            {
                return(isTemporary ? ToNMSTemporaryQueue(xmsDestination)
                                                                        : ToNMSQueue(xmsDestination));
            }

            if (xmsDestination.TypeId == IBM.XMS.DestinationType.Topic)
            {
                return(isTemporary ? ToNMSTemporaryTopic(xmsDestination)
                                                                        : ToNMSTopic(xmsDestination));
            }

            return(null);
        }
Ejemplo n.º 4
0
 /// <summary>
 /// Constructs a <c>Queue</c> object.
 /// </summary>
 /// <param name="queue">IBM XMS queue</param>
 /// <param name="isTemporary">Whether the queue is temporary</param>
 public Queue(IBM.XMS.IDestination queue, bool isTemporary)
     : base(queue, isTemporary)
 {
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Constructs a <c>Queue</c> object.
 /// </summary>
 /// <param name="queue">IBM XMS queue</param>
 public Queue(IBM.XMS.IDestination queue)
     : base(queue)
 {
 }
Ejemplo n.º 6
0
 /// <summary>
 /// Constructs a destination object specifying if the destination is
 /// temporary.
 /// </summary>
 /// <param name="destination">IBM XMS destination.</param>
 /// <param name="isTemporary">Whether the destination is temporary.
 /// </param>
 public Destination(IBM.XMS.IDestination destination, bool isTemporary)
 {
     this.xmsDestination = destination;
     this.isTemporary    = isTemporary;
 }
Ejemplo n.º 7
0
 /// <summary>
 /// Constructs a destination object.
 /// </summary>
 /// <param name="destination">IBM XMS destination.</param>
 public Destination(IBM.XMS.IDestination destination)
 {
     this.xmsDestination = destination;
 }
Ejemplo n.º 8
0
 /// <summary>
 /// Converts an IBM XMS destination interface
 /// into an NMS destination interface.
 /// </summary>
 /// <param name="xmsDestination">XMS destination.</param>
 /// <returns>Apache NMS destination interface.</returns>
 public static Apache.NMS.IDestination ToNMSDestination(
     IBM.XMS.IDestination xmsDestination)
 {
     return(ToNMSDestination(xmsDestination, false));
 }
Ejemplo n.º 9
0
 /// <summary>
 /// Constructs a <c>Topic</c> object.
 /// </summary>
 /// <param name="topic">IBM XMS topic</param>
 /// <param name="isTemporary">Whether the topic is temporary</param>
 public Topic(IBM.XMS.IDestination topic, bool isTemporary)
     : base(topic, isTemporary)
 {
 }
Ejemplo n.º 10
0
 /// <summary>
 /// Constructs a <c>Topic</c> object.
 /// </summary>
 /// <param name="topic">IBM XMS topic</param>
 public Topic(IBM.XMS.IDestination topic)
     : base(topic)
 {
 }