diff options
| author | Rupert Smith <rupertlssmith@apache.org> | 2008-01-21 14:53:17 +0000 |
|---|---|---|
| committer | Rupert Smith <rupertlssmith@apache.org> | 2008-01-21 14:53:17 +0000 |
| commit | 91b6324b623c7dfc9fe32d3d041aa93a62ed9fc8 (patch) | |
| tree | 2a6dc1a156d77d1ebc32ad31d501878dca9a6a20 /dotnet/Qpid.Messaging | |
| parent | fb555743c2ea148a176522400a2e835a4dbf7c25 (diff) | |
| download | qpid-python-91b6324b623c7dfc9fe32d3d041aa93a62ed9fc8.tar.gz | |
Qpid-727. Added closeable interface to connections, channels, producers and consumers. Previously there was no way to close these things in their interfaces.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/branches/M2.1@613911 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'dotnet/Qpid.Messaging')
| -rw-r--r-- | dotnet/Qpid.Messaging/IChannel.cs | 2 | ||||
| -rw-r--r-- | dotnet/Qpid.Messaging/ICloseable.cs | 33 | ||||
| -rw-r--r-- | dotnet/Qpid.Messaging/IConnection.cs | 2 | ||||
| -rw-r--r-- | dotnet/Qpid.Messaging/IMessageConsumer.cs | 58 | ||||
| -rw-r--r-- | dotnet/Qpid.Messaging/IMessagePublisher.cs | 2 |
5 files changed, 65 insertions, 32 deletions
diff --git a/dotnet/Qpid.Messaging/IChannel.cs b/dotnet/Qpid.Messaging/IChannel.cs index 4da41a773d..10225d156b 100644 --- a/dotnet/Qpid.Messaging/IChannel.cs +++ b/dotnet/Qpid.Messaging/IChannel.cs @@ -31,7 +31,7 @@ namespace Apache.Qpid.Messaging /// You can create a channel by using the CreateChannel() method /// of the connection object. /// </remarks> - public interface IChannel : IDisposable + public interface IChannel : IDisposable, ICloseable { /// <summary> /// Acknowledge mode for messages received diff --git a/dotnet/Qpid.Messaging/ICloseable.cs b/dotnet/Qpid.Messaging/ICloseable.cs new file mode 100644 index 0000000000..139dc8bf45 --- /dev/null +++ b/dotnet/Qpid.Messaging/ICloseable.cs @@ -0,0 +1,33 @@ +/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+using System;
+
+namespace Apache.Qpid.Messaging
+{
+ /// <summary>An ICloseable is a resource that can be explicitly closed. Generally speaking a closed resource can no longer be used, and the
+ /// act of closing a resource is usually interpreted as a signal that the closed item can have its resource cleaned up and de-allocated.
+ /// </summary>
+ public interface ICloseable
+ {
+ /// <summary> Close the resource. </summary>
+ void Close();
+ }
+}
diff --git a/dotnet/Qpid.Messaging/IConnection.cs b/dotnet/Qpid.Messaging/IConnection.cs index 420228fa8e..f664137e02 100644 --- a/dotnet/Qpid.Messaging/IConnection.cs +++ b/dotnet/Qpid.Messaging/IConnection.cs @@ -24,7 +24,7 @@ namespace Apache.Qpid.Messaging { public delegate void ExceptionListenerDelegate(Exception ex); - public interface IConnection : IDisposable + public interface IConnection : IDisposable, ICloseable { /// <summary> /// The connection listener that has been registered with this connection. diff --git a/dotnet/Qpid.Messaging/IMessageConsumer.cs b/dotnet/Qpid.Messaging/IMessageConsumer.cs index 82d697bf61..46cc681d92 100644 --- a/dotnet/Qpid.Messaging/IMessageConsumer.cs +++ b/dotnet/Qpid.Messaging/IMessageConsumer.cs @@ -22,35 +22,35 @@ using System; namespace Apache.Qpid.Messaging { - /// <summary> - /// Describes an object that can be used to receive (consume) - /// messages from an AMQP queue. - /// </summary> - /// <remarks> - /// Consumers are created using either - /// <see cref="IChannel.CreateConsumer"/> or using - /// the builder pattern (preferred) with - /// <see cref="IChannel.CreateConsumerBuilder"/>. - /// - /// <para> - /// Consumers offer two different ways of receiving messages: - /// You can attach a delegate to the <see cref="OnMessage"/> - /// event and be notified when a message arrives, or you can - /// use the <see cref="Receive"/> and <see cref="ReceiveNoWait"/> - /// methods to control when you receive messages. Be aware that you can use - /// one or the other, but not both at the same time. - /// </para> - /// <para> - /// Regardless of which method you choose, the prefetch settings - /// specified when creating the channel will still control when messages - /// are actually received from the AMQP broker. Any messages that arrive - /// between the prefetch window will be queued by the channel - /// until they can be delivered to the consumer (either though the event - /// or until the consumer actively calls <see cref="Receive"/>). - /// </para> - /// </remarks> - public interface IMessageConsumer : IDisposable - { + /// <summary> + /// Describes an object that can be used to receive (consume) + /// messages from an AMQP queue. + /// </summary> + /// <remarks> + /// Consumers are created using either + /// <see cref="IChannel.CreateConsumer"/> or using + /// the builder pattern (preferred) with + /// <see cref="IChannel.CreateConsumerBuilder"/>. + /// + /// <para> + /// Consumers offer two different ways of receiving messages: + /// You can attach a delegate to the <see cref="OnMessage"/> + /// event and be notified when a message arrives, or you can + /// use the <see cref="Receive"/> and <see cref="ReceiveNoWait"/> + /// methods to control when you receive messages. Be aware that you can use + /// one or the other, but not both at the same time. + /// </para> + /// <para> + /// Regardless of which method you choose, the prefetch settings + /// specified when creating the channel will still control when messages + /// are actually received from the AMQP broker. Any messages that arrive + /// between the prefetch window will be queued by the channel + /// until they can be delivered to the consumer (either though the event + /// or until the consumer actively calls <see cref="Receive"/>). + /// </para> + /// </remarks> + public interface IMessageConsumer : IDisposable, ICloseable + { /// <summary> /// Fired when a message is received from the broker by the consumer /// </summary> diff --git a/dotnet/Qpid.Messaging/IMessagePublisher.cs b/dotnet/Qpid.Messaging/IMessagePublisher.cs index fab0df0c2b..d895a9749b 100644 --- a/dotnet/Qpid.Messaging/IMessagePublisher.cs +++ b/dotnet/Qpid.Messaging/IMessagePublisher.cs @@ -32,7 +32,7 @@ namespace Apache.Qpid.Messaging /// using the builder pattern (preferred) with /// <see cref="IChannel.CreatePublisherBuilder"/> /// </remarks> - public interface IMessagePublisher : IDisposable + public interface IMessagePublisher : IDisposable, ICloseable { /// <summary> /// Default delivery mode to use with this publisher |
