activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jstrac...@apache.org
Subject svn commit: r509556 - in /activemq/activemq-dotnet/trunk/src/main/csharp: ActiveMQ/MessageProducer.cs NMS/IMessageProducer.cs
Date Tue, 20 Feb 2007 13:42:34 GMT
Author: jstrachan
Date: Tue Feb 20 05:42:33 2007
New Revision: 509556

URL: http://svn.apache.org/viewvc?view=rev&rev=509556
Log:
added message factory methods to IMessageProducer so that a client does not have to depend
on both IMessageProducer and ISession to be able to send messages

Modified:
    activemq/activemq-dotnet/trunk/src/main/csharp/ActiveMQ/MessageProducer.cs
    activemq/activemq-dotnet/trunk/src/main/csharp/NMS/IMessageProducer.cs

Modified: activemq/activemq-dotnet/trunk/src/main/csharp/ActiveMQ/MessageProducer.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/trunk/src/main/csharp/ActiveMQ/MessageProducer.cs?view=diff&rev=509556&r1=509555&r2=509556
==============================================================================
--- activemq/activemq-dotnet/trunk/src/main/csharp/ActiveMQ/MessageProducer.cs (original)
+++ activemq/activemq-dotnet/trunk/src/main/csharp/ActiveMQ/MessageProducer.cs Tue Feb 20
05:42:33 2007
@@ -25,7 +25,6 @@
     /// </summary>
     public class MessageProducer : IMessageProducer
     {
-        
         private Session session;
         private ProducerInfo info;
         private long messageCounter;
@@ -124,5 +123,39 @@
             set { this.disableMessageTimestamp = value; }
         }
         
+		public IMessage CreateMessage()
+		{
+			return session.CreateMessage();
+		}
+		
+		public ITextMessage CreateTextMessage()
+		{
+			return session.CreateTextMessage();
+		}
+		
+		public ITextMessage CreateTextMessage(String text)
+		{
+			return session.CreateTextMessage(text);
+		}
+		
+		public IMapMessage CreateMapMessage()
+		{
+			return session.CreateMapMessage();
+		}
+		
+		public IObjectMessage CreateObjectMessage(Object body)
+		{
+			return session.CreateObjectMessage(body);
+		}
+		
+		public IBytesMessage CreateBytesMessage()
+		{
+			return session.CreateBytesMessage();
+		}
+		
+		public IBytesMessage CreateBytesMessage(byte[] body)
+		{
+			return session.CreateBytesMessage(body);
+		}
     }
 }

Modified: activemq/activemq-dotnet/trunk/src/main/csharp/NMS/IMessageProducer.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/trunk/src/main/csharp/NMS/IMessageProducer.cs?view=diff&rev=509556&r1=509555&r2=509556
==============================================================================
--- activemq/activemq-dotnet/trunk/src/main/csharp/NMS/IMessageProducer.cs (original)
+++ activemq/activemq-dotnet/trunk/src/main/csharp/NMS/IMessageProducer.cs Tue Feb 20 05:42:33
2007
@@ -75,6 +75,43 @@
 			get;
 			set;
 		}
+		
+		// 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 Object message containing the given .NET object as the body
+		/// </summary>
+		IObjectMessage CreateObjectMessage(object body);
+		
+		/// <summary>
+		/// Creates a new binary message
+		/// </summary>
+		IBytesMessage CreateBytesMessage();
+		
+		/// <summary>
+		/// Creates a new binary message with the given body
+		/// </summary>
+		IBytesMessage CreateBytesMessage(byte[] body);
     }
 }
 



Mime
View raw message