activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jstrac...@apache.org
Subject svn commit: r465235 - in /incubator/activemq/activemq-dotnet/trunk/src/main/csharp: ActiveMQ/MessageConsumer.cs ActiveMQ/Session.cs NMS/ISession.cs
Date Wed, 18 Oct 2006 12:32:59 GMT
Author: jstrachan
Date: Wed Oct 18 05:32:58 2006
New Revision: 465235

URL: http://svn.apache.org/viewvc?view=rev&rev=465235
Log:
added a bunch of default properties onto ISession to allow consumers to be configured such
as retroactive or exclusive consumers etc

Modified:
    incubator/activemq/activemq-dotnet/trunk/src/main/csharp/ActiveMQ/MessageConsumer.cs
    incubator/activemq/activemq-dotnet/trunk/src/main/csharp/ActiveMQ/Session.cs
    incubator/activemq/activemq-dotnet/trunk/src/main/csharp/NMS/ISession.cs

Modified: incubator/activemq/activemq-dotnet/trunk/src/main/csharp/ActiveMQ/MessageConsumer.cs
URL: http://svn.apache.org/viewvc/incubator/activemq/activemq-dotnet/trunk/src/main/csharp/ActiveMQ/MessageConsumer.cs?view=diff&rev=465235&r1=465234&r2=465235
==============================================================================
--- incubator/activemq/activemq-dotnet/trunk/src/main/csharp/ActiveMQ/MessageConsumer.cs (original)
+++ incubator/activemq/activemq-dotnet/trunk/src/main/csharp/ActiveMQ/MessageConsumer.cs Wed
Oct 18 05:32:58 2006
@@ -81,6 +81,7 @@
             get { return redeliveryTimeout; }
             set { redeliveryTimeout = value; }
         }
+
         
         public void RedeliverRolledBackMessages()
         {

Modified: incubator/activemq/activemq-dotnet/trunk/src/main/csharp/ActiveMQ/Session.cs
URL: http://svn.apache.org/viewvc/incubator/activemq/activemq-dotnet/trunk/src/main/csharp/ActiveMQ/Session.cs?view=diff&rev=465235&r1=465234&r2=465235
==============================================================================
--- incubator/activemq/activemq-dotnet/trunk/src/main/csharp/ActiveMQ/Session.cs (original)
+++ incubator/activemq/activemq-dotnet/trunk/src/main/csharp/ActiveMQ/Session.cs Wed Oct 18
05:32:58 2006
@@ -32,6 +32,11 @@
         private long consumerCounter;
         private long producerCounter;
         private int prefetchSize = 1000;
+        private int maximumPendingMessageLimit;
+        private byte priority;
+        private bool dispatchAsync;
+        private bool exclusive;
+        private bool retroactive;
         private IDictionary consumers = Hashtable.Synchronized(new Hashtable());
         private TransactionContext transactionContext;
         
@@ -43,6 +48,41 @@
             transactionContext = new TransactionContext(this);
         }
         
+        public int PrefetchSize
+        {
+            get { return prefetchSize; }
+            set { this.prefetchSize = value; }            
+        }
+
+        public int MaximumPendingMessageLimit
+        {
+            get { return maximumPendingMessageLimit; }
+            set { this.maximumPendingMessageLimit = value; }            
+        }
+
+        public bool DispatchAsync
+        {
+            get { return dispatchAsync; }
+            set { this.dispatchAsync = value; }            
+        }
+
+        public bool Exclusive
+        {
+            get { return exclusive; }
+            set { this.exclusive = value; }            
+        }
+
+        public bool Retroactive
+        {
+            get { return retroactive; }
+            set { this.retroactive = value; }            
+        }
+
+        public byte Priority
+        {
+            get { return priority; }
+            set { this.priority = value; }            
+        }
         
         public void Dispose()
         {
@@ -316,6 +356,10 @@
             answer.Destination = ActiveMQDestination.Transform(destination);
             answer.Selector = selector;
             answer.PrefetchSize = prefetchSize;
+            answer.Priority = priority;
+            answer.Exclusive = exclusive;
+            answer.DispatchAsync = dispatchAsync;
+            answer.Retroactive = retroactive;
             
             // If the destination contained a URI query, then use it to set public properties
             // on the ConsumerInfo

Modified: incubator/activemq/activemq-dotnet/trunk/src/main/csharp/NMS/ISession.cs
URL: http://svn.apache.org/viewvc/incubator/activemq/activemq-dotnet/trunk/src/main/csharp/NMS/ISession.cs?view=diff&rev=465235&r1=465234&r2=465235
==============================================================================
--- incubator/activemq/activemq-dotnet/trunk/src/main/csharp/NMS/ISession.cs (original)
+++ incubator/activemq/activemq-dotnet/trunk/src/main/csharp/NMS/ISession.cs Wed Oct 18 05:32:58
2006
@@ -14,110 +14,136 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-namespace NMS
-{
-	/// <summary>
-	/// Represents a single unit of work on an IConnection.
-	/// So the ISession can be used to perform transactional receive and sends
-	/// </summary>
-	public interface ISession : System.IDisposable
-    {
-        
+namespace NMS {
         /// <summary>
-        /// Creates a producer of messages
+        /// Represents a single unit of work on an IConnection.
+        /// So the ISession can be used to perform transactional receive and sends
         /// </summary>
-        IMessageProducer CreateProducer();
-        
-        /// <summary>
-        /// Creates a producer of messages on a given destination
-        /// </summary>
-        IMessageProducer CreateProducer(IDestination destination);
-        
-        /// <summary>
-        /// Creates a consumer of messages on a given destination
-        /// </summary>
-        IMessageConsumer CreateConsumer(IDestination destination);
-        
-        /// <summary>
-        /// Creates a consumer of messages on a given destination with a selector
-        /// </summary>
-        IMessageConsumer CreateConsumer(IDestination destination, string selector);
-        
-        /// <summary>
-        /// Creates a named durable consumer of messages on a given destination with a selector
-        /// </summary>
-        IMessageConsumer CreateDurableConsumer(ITopic destination, string name, string selector,
bool noLocal);
-		
-        /// <summary>
-        /// Returns the queue for the given name
-        /// </summary>
-        IQueue GetQueue(string name);
-        
-        /// <summary>
-        /// Returns the topic for the given name
-        /// </summary>
-        ITopic GetTopic(string name);
-        
-        
-        /// <summary>
-        /// Creates a temporary queue
-        /// </summary>
-        ITemporaryQueue CreateTemporaryQueue();
-		
-        /// <summary>
-        /// Creates a temporary topic
-        /// </summary>
-        ITemporaryTopic CreateTemporaryTopic();
-		
-        
-        // Factory methods to create messages
-        
-        /// <summary>
-        /// Creates a new message with an empty body
-        /// </summary>
-        IMessage CreateMessage();
-        
-        /// <summary>
-        /// Creates a new text message with an empty body
-        /// </summary>
-        ITextMessage CreateTextMessage();
-        
-        /// <summary>
-        /// Creates a new text message with the given body
-        /// </summary>
-        ITextMessage CreateTextMessage(string text);
-        
-        /// <summary>
-        /// Creates a new Map message which contains primitive key and value pairs
-        /// </summary>
-        IMapMessage CreateMapMessage();
-        
-        /// <summary>
-        /// Creates a new binary message
-        /// </summary>
-        IBytesMessage CreateBytesMessage();
-        
-        /// <summary>
-        /// Creates a new binary message with the given body
-        /// </summary>
-        IBytesMessage CreateBytesMessage(byte[] body);
-		
-		
-        // Transaction methods
-        
-        /// <summary>
-        /// If this is a transactional session then commit all message
-        /// send and acknowledgements for producers and consumers in this session
-        /// </summary>
-        void Commit();
-        
-        /// <summary>
-        /// If this is a transactional session then rollback all message
-        /// send and acknowledgements for producers and consumers in this session
-        /// </summary>
-        void Rollback();
-        
-    }
-}
+        public interface ISession : System.IDisposable
+        {
+
+                /// <summary>
+                /// Creates a producer of messages
+                /// </summary>
+                IMessageProducer CreateProducer();
+
+                /// <summary>
+                /// Creates a producer of messages on a given destination
+                /// </summary>
+                IMessageProducer CreateProducer(IDestination destination);
+
+                /// <summary>
+                /// Creates a consumer of messages on a given destination
+                /// </summary>
+                IMessageConsumer CreateConsumer(IDestination destination);
+
+                /// <summary>
+                /// Creates a consumer of messages on a given destination with a selector
+                /// </summary>
+                IMessageConsumer CreateConsumer(IDestination destination, string selector);
+
+                /// <summary>
+                /// Creates a named durable consumer of messages on a given destination with
a selector
+                /// </summary>
+                IMessageConsumer CreateDurableConsumer(ITopic destination, string name, string
selector, bool noLocal);
+
+                /// <summary>
+                /// Returns the queue for the given name
+                /// </summary>
+                IQueue GetQueue(string name);
+
+                /// <summary>
+                /// Returns the topic for the given name
+                /// </summary>
+                ITopic GetTopic(string name);
+
+
+                /// <summary>
+                /// Creates a temporary queue
+                /// </summary>
+                ITemporaryQueue CreateTemporaryQueue();
+
+                /// <summary>
+                /// Creates a temporary topic
+                /// </summary>
+                ITemporaryTopic CreateTemporaryTopic();
+
+
+                // Factory methods to create messages
+
+                /// <summary>
+                /// Creates a new message with an empty body
+                /// </summary>
+                IMessage CreateMessage();
+
+                /// <summary>
+                /// Creates a new text message with an empty body
+                /// </summary>
+                ITextMessage CreateTextMessage();
 
+                /// <summary>
+                /// Creates a new text message with the given body
+                /// </summary>
+                ITextMessage CreateTextMessage(string text);
 
+                /// <summary>
+                /// Creates a new Map message which contains primitive key and value pairs
+                /// </summary>
+                IMapMessage CreateMapMessage();
+
+                /// <summary>
+                /// Creates a new binary message
+                /// </summary>
+                IBytesMessage CreateBytesMessage();
+
+                /// <summary>
+                /// Creates a new binary message with the given body
+                /// </summary>
+                IBytesMessage CreateBytesMessage(byte[] body);
+
+
+                // Transaction methods
+
+                /// <summary>
+                /// If this is a transactional session then commit all message
+                /// send and acknowledgements for producers and consumers in this session
+                /// </summary>
+                void Commit();
+
+                /// <summary>
+                /// If this is a transactional session then rollback all message
+                /// send and acknowledgements for producers and consumers in this session
+                /// </summary>
+                void Rollback();
+
+
+
+
+                /// <summary>
+                /// Sets the prefetch size, the maximum number of messages a broker will
dispatch to consumers
+                /// until acknowledgements are received.
+                /// </summary>
+                int PrefetchSize { get; set; } 
+
+                /// <summary>
+                /// Enables or disables whether asynchronous dispatch should be used by the
broker
+                /// </summary>
+                bool DispatchAsync { get; set; } 
+
+                /// <summary>
+                /// Enables or disables exclusive consumers when using queues. An exclusive
consumer means
+                /// only one instance of a consumer is allowed to process messages on a queue
to preserve order
+                /// </summary>
+                bool Exclusive { get; set; } 
+
+                /// <summary>
+                /// Enables or disables retroactive mode for consumers; i.e. do they go back
in time or not?
+                /// </summary>
+                bool Retroactive { get; set; } 
+
+                /// <summary>
+                /// Sets the default consumer priority for consumers
+                /// </summary>
+                byte Priority { get; set; } 
+        }
+}



Mime
View raw message