Inheritance: BaseCommand
Ejemplo n.º 1
0
        public MessageProducer(Session session, ProducerId id, ActiveMQDestination destination, TimeSpan requestTimeout)
        {
            this.session = session;
            this.RequestTimeout = requestTimeout;

            this.info = new ProducerInfo();
            this.info.ProducerId = id;
            this.info.Destination = destination;
            this.info.WindowSize = session.Connection.ProducerWindowSize;

            this.messageTransformation = session.Connection.MessageTransformation;

            // If the destination contained a URI query, then use it to set public
            // properties on the ProducerInfo
            if(destination != null && destination.Options != null)
            {
                URISupport.SetProperties(this.info, destination.Options, "producer.");
            }

            // Version Three and higher will send us a ProducerAck, but only if we
            // have a set producer window size.
            if(session.Connection.ProtocolVersion >= 3 && this.info.WindowSize > 0)
            {
                Tracer.Debug("MessageProducer created with a Window Size of: " + this.info.WindowSize);
                this.usage = new MemoryUsage(this.info.WindowSize);
            }
        }
Ejemplo n.º 2
0
		public ProducerState(ProducerInfo info)
		{
			this.info = info;
		}
Ejemplo n.º 3
0
		public void addProducer(ProducerInfo info)
		{
			checkShutdown();
			producers.Add(info.ProducerId, new ProducerState(info));
		}
Ejemplo n.º 4
0
 public override Response processAddProducer(ProducerInfo info)
 {
     if(info != null && info.ProducerId != null)
     {
         SessionId sessionId = info.ProducerId.ParentId;
         if(sessionId != null)
         {
             ConnectionId connectionId = sessionId.ParentId;
             if(connectionId != null)
             {
                 ConnectionState cs = connectionStates[connectionId];
                 if(cs != null)
                 {
                     SessionState ss = cs[sessionId];
                     if(ss != null)
                     {
                         ss.addProducer(info);
                     }
                 }
             }
         }
     }
     return TRACKED_RESPONSE_MARKER;
 }
Ejemplo n.º 5
0
 public virtual Response processAddProducer(ProducerInfo info)
 {
     return null;
 }
Ejemplo n.º 6
0
		protected void disposeOf(ITransport transport, ProducerInfo producer)
		{
			transport.Oneway(new RemoveInfo() { ObjectId = producer.ProducerId });
		}