Fixed up some comments.

git-svn-id: https://svn.apache.org/repos/asf/incubator/activemq/trunk@383314 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Hiram R. Chirino 2006-03-05 13:07:48 +00:00
parent 8f8bfee0be
commit bfe91884be
37 changed files with 172 additions and 186 deletions

View File

@ -17,13 +17,12 @@
using ActiveMQ.Commands; using ActiveMQ.Commands;
using JMS; using JMS;
/// <summary>
/// Exception thrown when the broker returns an error
/// </summary>
namespace ActiveMQ namespace ActiveMQ
{ {
/// <summary>
/// Exception thrown when the broker returns an error
/// </summary>
public class BrokerException : JMSException public class BrokerException : JMSException
{ {

View File

@ -17,12 +17,12 @@
using ActiveMQ.Commands; using ActiveMQ.Commands;
using System; using System;
/// <summary>
/// Summary description for AbstractCommand.
/// </summary>
namespace ActiveMQ.Commands namespace ActiveMQ.Commands
{ {
/// <summary>
/// Summary description for AbstractCommand.
/// </summary>
public abstract class AbstractCommand : Command public abstract class AbstractCommand : Command
{ {
private short commandId; private short commandId;

View File

@ -17,14 +17,12 @@
using ActiveMQ.Commands; using ActiveMQ.Commands;
using JMS; using JMS;
using System; using System;
/// <summary>
/// Summary description for ActiveMQDestination.
/// </summary>
namespace ActiveMQ.Commands namespace ActiveMQ.Commands
{ {
/// <summary>
/// Summary description for ActiveMQDestination.
/// </summary>
public abstract class ActiveMQDestination : AbstractCommand, IDestination public abstract class ActiveMQDestination : AbstractCommand, IDestination
{ {

View File

@ -18,12 +18,12 @@ using ActiveMQ.Commands;
using JMS; using JMS;
using System; using System;
/// <summary>
/// Summary description for ActiveMQQueue.
/// </summary>
namespace ActiveMQ.Commands namespace ActiveMQ.Commands
{ {
/// <summary>
/// Summary description for ActiveMQQueue.
/// </summary>
public class ActiveMQQueue : ActiveMQDestination, IQueue public class ActiveMQQueue : ActiveMQDestination, IQueue
{ {
public const byte ID_ActiveMQQueue = 100; public const byte ID_ActiveMQQueue = 100;

View File

@ -18,12 +18,12 @@ using ActiveMQ.Commands;
using JMS; using JMS;
using System; using System;
/// <summary>
/// A Temporary Queue
/// </summary>
namespace ActiveMQ.Commands namespace ActiveMQ.Commands
{ {
/// <summary>
/// A Temporary Queue
/// </summary>
public class ActiveMQTempQueue : ActiveMQTempDestination, ITemporaryQueue public class ActiveMQTempQueue : ActiveMQTempDestination, ITemporaryQueue
{ {
public const byte ID_ActiveMQTempQueue = 102; public const byte ID_ActiveMQTempQueue = 102;

View File

@ -18,12 +18,12 @@ using ActiveMQ.Commands;
using JMS; using JMS;
using System; using System;
/// <summary>
/// A Temporary Topic
/// </summary>
namespace ActiveMQ.Commands namespace ActiveMQ.Commands
{ {
/// <summary>
/// A Temporary Topic
/// </summary>
public class ActiveMQTempTopic : ActiveMQTempDestination, ITemporaryTopic public class ActiveMQTempTopic : ActiveMQTempDestination, ITemporaryTopic
{ {
public const byte ID_ActiveMQTempTopic = 103; public const byte ID_ActiveMQTempTopic = 103;

View File

@ -18,12 +18,12 @@ using ActiveMQ.Commands;
using JMS; using JMS;
using System; using System;
/// <summary>
/// Summary description for ActiveMQTopic.
/// </summary>
namespace ActiveMQ.Commands namespace ActiveMQ.Commands
{ {
/// <summary>
/// Summary description for ActiveMQTopic.
/// </summary>
public class ActiveMQTopic : ActiveMQDestination, ITopic public class ActiveMQTopic : ActiveMQDestination, ITopic
{ {
public const byte ID_ActiveMQTopic = 101; public const byte ID_ActiveMQTopic = 101;

View File

@ -28,14 +28,10 @@ namespace ActiveMQ.Commands
public string MethodName; public string MethodName;
public int LineNumber; public int LineNumber;
} }
}
/// <summary>
/// <summary> /// Represents an exception on the broker
/// Represents an exception on the broker /// </summary>
/// </summary>
namespace ActiveMQ.Commands
{
public class BrokerError : AbstractCommand public class BrokerError : AbstractCommand
{ {
private string message; private string message;

View File

@ -16,12 +16,12 @@
*/ */
using ActiveMQ.Commands; using ActiveMQ.Commands;
/// <summary>
/// An OpenWire command
/// </summary>
namespace ActiveMQ.Commands namespace ActiveMQ.Commands
{ {
/// <summary>
/// An OpenWire command
/// </summary>
public interface Command : DataStructure public interface Command : DataStructure
{ {
short CommandId short CommandId

View File

@ -14,14 +14,12 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
/// <summary>
/// An OpenWire command
/// </summary>
namespace ActiveMQ.Commands namespace ActiveMQ.Commands
{ {
/// <summary>
/// An OpenWire command
/// </summary>
public interface DataStructure public interface DataStructure
{ {

View File

@ -16,12 +16,12 @@
*/ */
using ActiveMQ.Commands; using ActiveMQ.Commands;
/// <summary>
/// Summary description for DataStructureSupport.
/// </summary>
namespace ActiveMQ.Commands namespace ActiveMQ.Commands
{ {
/// <summary>
/// Summary description for DataStructureSupport.
/// </summary>
public abstract class DataStructureSupport : DataStructure public abstract class DataStructureSupport : DataStructure
{ {

View File

@ -16,12 +16,12 @@
*/ */
using ActiveMQ.OpenWire; using ActiveMQ.OpenWire;
/// <summary>
/// Represents a marshallable entity
/// </summary>
namespace ActiveMQ.Commands namespace ActiveMQ.Commands
{ {
/// <summary>
/// Represents a marshallable entity
/// </summary>
public interface MarshallAware public interface MarshallAware
{ {

View File

@ -20,12 +20,12 @@ using System;
using System.Collections; using System.Collections;
using System.Threading; using System.Threading;
/// <summary>
/// Handles the multi-threaded dispatching between the transport and the consumers
/// </summary>
namespace ActiveMQ namespace ActiveMQ
{ {
/// <summary>
/// Handles the multi-threaded dispatching between the transport and the consumers
/// </summary>
public class Dispatcher public class Dispatcher
{ {
Queue queue = new Queue(); Queue queue = new Queue();

View File

@ -18,12 +18,12 @@ using ActiveMQ.Commands;
using System; using System;
using System.Threading; using System.Threading;
/// <summary>
/// Handles asynchronous responses
/// </summary>
namespace ActiveMQ.Transport namespace ActiveMQ.Transport
{ {
/// <summary>
/// Handles asynchronous responses
/// </summary>
public class FutureResponse : IAsyncResult public class FutureResponse : IAsyncResult
{ {

View File

@ -19,14 +19,14 @@ using ActiveMQ.Transport;
using JMS; using JMS;
using System; using System;
/// <summary>
/// Represents the logical networking transport layer.
/// </summary>
namespace ActiveMQ.Transport namespace ActiveMQ.Transport
{ {
public delegate void CommandHandler(ITransport sender, Command command); public delegate void CommandHandler(ITransport sender, Command command);
public delegate void ExceptionHandler(ITransport sender, Exception command); public delegate void ExceptionHandler(ITransport sender, Exception command);
/// <summary>
/// Represents the logical networking transport layer.
/// </summary>
public interface ITransport : IStartable, IDisposable public interface ITransport : IStartable, IDisposable
{ {
void Oneway(Command command); void Oneway(Command command);
@ -35,12 +35,12 @@ namespace ActiveMQ.Transport
Response Request(Command command); Response Request(Command command);
CommandHandler Command{ CommandHandler Command {
get; get;
set; set;
} }
ExceptionHandler Exception{ ExceptionHandler Exception {
get; get;
set; set;
} }

View File

@ -19,11 +19,12 @@ using ActiveMQ.Transport;
using JMS; using JMS;
using System; using System;
/// <summary>
/// A Transport filter that is used to log the commands sent and received.
/// </summary>
namespace ActiveMQ.Transport namespace ActiveMQ.Transport
{ {
/// <summary>
/// A Transport filter that is used to log the commands sent and received.
/// </summary>
public class LoggingTransport : TransportFilter public class LoggingTransport : TransportFilter
{ {
public LoggingTransport(ITransport next) : base(next) { public LoggingTransport(ITransport next) : base(next) {
@ -31,12 +32,12 @@ namespace ActiveMQ.Transport
protected override void OnCommand(ITransport sender, Command command) { protected override void OnCommand(ITransport sender, Command command) {
Console.WriteLine("RECEIVED: " + command); Console.WriteLine("RECEIVED: " + command);
this.command(sender, command); this.commandHandler(sender, command);
} }
protected override void OnException(ITransport sender, Exception error) { protected override void OnException(ITransport sender, Exception error) {
Console.WriteLine("RECEIVED Exception: " + error); Console.WriteLine("RECEIVED Exception: " + error);
this.exception(sender, error); this.exceptionHandler(sender, error);
} }
public override void Oneway(Command command) public override void Oneway(Command command)

View File

@ -19,11 +19,12 @@ using ActiveMQ.Transport;
using JMS; using JMS;
using System; using System;
/// <summary>
/// A Transport which gaurds access to the next transport using a mutex.
/// </summary>
namespace ActiveMQ.Transport namespace ActiveMQ.Transport
{ {
/// <summary>
/// A Transport which gaurds access to the next transport using a mutex.
/// </summary>
public class MutexTransport : TransportFilter public class MutexTransport : TransportFilter
{ {

View File

@ -22,11 +22,12 @@ using ActiveMQ.Commands;
using ActiveMQ.Transport; using ActiveMQ.Transport;
using JMS; using JMS;
/// <summary>
/// A Transport which gaurds access to the next transport using a mutex.
/// </summary>
namespace ActiveMQ.Transport namespace ActiveMQ.Transport
{ {
/// <summary>
/// A Transport which gaurds access to the next transport using a mutex.
/// </summary>
public class ResponseCorrelator : TransportFilter public class ResponseCorrelator : TransportFilter
{ {
@ -86,7 +87,7 @@ namespace ActiveMQ.Transport
{ {
ExceptionResponse er = (ExceptionResponse) response; ExceptionResponse er = (ExceptionResponse) response;
BrokerError brokerError = er.Exception; BrokerError brokerError = er.Exception;
this.exception(this, new BrokerException(brokerError)); this.exceptionHandler(this, new BrokerException(brokerError));
} }
future.Response = response; future.Response = response;
} }
@ -95,7 +96,7 @@ namespace ActiveMQ.Transport
Console.WriteLine("ERROR: Unknown response ID: " + response.CommandId + " for response: " + response); Console.WriteLine("ERROR: Unknown response ID: " + response.CommandId + " for response: " + response);
} }
} else { } else {
this.command(sender, command); this.commandHandler(sender, command);
} }
} }

View File

@ -25,14 +25,12 @@ using System.Net;
using System.Net.Sockets; using System.Net.Sockets;
using System.Threading; using System.Threading;
/// <summary>
/// An implementation of ITransport that uses sockets to communicate with the broker
/// </summary>
namespace ActiveMQ.Transport.Tcp namespace ActiveMQ.Transport.Tcp
{ {
/// <summary>
/// An implementation of ITransport that uses sockets to communicate with the broker
/// </summary>
public class TcpTransport : ITransport public class TcpTransport : ITransport
{ {
private Socket socket; private Socket socket;
@ -43,8 +41,8 @@ namespace ActiveMQ.Transport.Tcp
private bool started; private bool started;
volatile private bool closed; volatile private bool closed;
public CommandHandler command; private CommandHandler commandHandlerHandlerHandlerHandlerHandler;
public ExceptionHandler exception; private ExceptionHandler exceptionHandler;
public TcpTransport(Socket socket) public TcpTransport(Socket socket)
{ {
@ -58,9 +56,9 @@ namespace ActiveMQ.Transport.Tcp
{ {
if (!started) if (!started)
{ {
if( command == null ) if( commandHandlerHandlerHandlerHandlerHandler == null )
throw new InvalidOperationException ("command cannot be null when Start is called."); throw new InvalidOperationException ("command cannot be null when Start is called.");
if( exception == null ) if( exceptionHandler == null )
throw new InvalidOperationException ("exception cannot be null when Start is called."); throw new InvalidOperationException ("exception cannot be null when Start is called.");
started = true; started = true;
@ -110,7 +108,7 @@ namespace ActiveMQ.Transport.Tcp
try try
{ {
Command command = (Command) wireformat.Unmarshal(socketReader); Command command = (Command) wireformat.Unmarshal(socketReader);
this.command(this, command); this.commandHandlerHandlerHandlerHandlerHandler(this, command);
} }
catch (ObjectDisposedException) catch (ObjectDisposedException)
{ {
@ -118,7 +116,7 @@ namespace ActiveMQ.Transport.Tcp
} }
catch (Exception e) catch (Exception e)
{ {
this.exception(this,e); this.exceptionHandler(this,e);
} }
} }
} }
@ -129,13 +127,13 @@ namespace ActiveMQ.Transport.Tcp
// Implementation methods // Implementation methods
public CommandHandler Command { public CommandHandler Command {
get { return command; } get { return commandHandlerHandlerHandlerHandlerHandler; }
set { this.command = value; } set { this.commandHandlerHandlerHandlerHandlerHandler = value; }
} }
public ExceptionHandler Exception { public ExceptionHandler Exception {
get { return exception; } get { return exceptionHandler; }
set { this.exception = value; } set { this.exceptionHandler = value; }
} }
} }

View File

@ -19,16 +19,17 @@ using ActiveMQ.Transport;
using JMS; using JMS;
using System; using System;
/// <summary>
/// Used to implement a filter on the transport layer.
/// </summary>
namespace ActiveMQ.Transport namespace ActiveMQ.Transport
{ {
/// <summary>
/// Used to implement a filter on the transport layer.
/// </summary>
public class TransportFilter : ITransport public class TransportFilter : ITransport
{ {
protected readonly ITransport next; protected readonly ITransport next;
protected CommandHandler command; protected CommandHandler commandHandler;
protected ExceptionHandler exception; protected ExceptionHandler exceptionHandler;
public TransportFilter(ITransport next) { public TransportFilter(ITransport next) {
this.next = next; this.next = next;
@ -37,11 +38,11 @@ namespace ActiveMQ.Transport
} }
protected virtual void OnCommand(ITransport sender, Command command) { protected virtual void OnCommand(ITransport sender, Command command) {
this.command(sender, command); this.commandHandler(sender, command);
} }
protected virtual void OnException(ITransport sender, Exception command) { protected virtual void OnException(ITransport sender, Exception command) {
this.exception(sender, command); this.exceptionHandler(sender, command);
} }
@ -79,9 +80,9 @@ namespace ActiveMQ.Transport
/// </summary> /// </summary>
public virtual void Start() public virtual void Start()
{ {
if( command == null ) if( commandHandler == null )
throw new InvalidOperationException ("command cannot be null when Start is called."); throw new InvalidOperationException ("command cannot be null when Start is called.");
if( exception == null ) if( exceptionHandler == null )
throw new InvalidOperationException ("exception cannot be null when Start is called."); throw new InvalidOperationException ("exception cannot be null when Start is called.");
this.next.Start(); this.next.Start();
} }
@ -95,13 +96,13 @@ namespace ActiveMQ.Transport
} }
public CommandHandler Command { public CommandHandler Command {
get { return command; } get { return commandHandler; }
set { this.command = value; } set { this.commandHandler = value; }
} }
public ExceptionHandler Exception { public ExceptionHandler Exception {
get { return exception; } get { return exceptionHandler; }
set { this.exception = value; } set { this.exceptionHandler = value; }
} }
} }

View File

@ -16,12 +16,12 @@
*/ */
using JMS; using JMS;
/// <summary>
/// Represents a binary based message
/// </summary>
namespace JMS namespace JMS
{ {
/// <summary>
/// Represents a binary based message
/// </summary>
public interface IBytesMessage : IMessage public interface IBytesMessage : IMessage
{ {

View File

@ -16,13 +16,12 @@
*/ */
using JMS; using JMS;
/// <summary>
/// A Factory of IConnection objects
/// </summary>
namespace JMS namespace JMS
{ {
/// <summary>
/// A Factory of IConnection objects
/// </summary>
public interface IConnectionFactory public interface IConnectionFactory
{ {

View File

@ -14,14 +14,12 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
/// <summary>
/// Summary description for Destination.
/// </summary>
namespace JMS namespace JMS
{ {
/// <summary>
/// Summary description for Destination.
/// </summary>
public interface IDestination public interface IDestination
{ {
} }

View File

@ -16,13 +16,13 @@
*/ */
using JMS; using JMS;
/// <summary>
/// Represents a Map message which contains key and value pairs which are
/// of primitive types
/// </summary>
namespace JMS namespace JMS
{ {
/// <summary>
/// Represents a Map message which contains key and value pairs which are
/// of primitive types
/// </summary>
public interface IMapMessage : IMessage public interface IMapMessage : IMessage
{ {
IPrimitiveMap Body IPrimitiveMap Body

View File

@ -16,12 +16,12 @@
*/ */
using JMS; using JMS;
/// <summary>
/// Represents a message either to be sent to a message broker or received from a message broker
/// </summary>
namespace JMS namespace JMS
{ {
/// <summary>
/// Represents a message either to be sent to a message broker or received from a message broker
/// </summary>
public interface IMessage public interface IMessage
{ {

View File

@ -17,17 +17,13 @@
using JMS; using JMS;
using System; using System;
namespace JMS namespace JMS
{ {
public delegate void MessageListener(IMessage message); public delegate void MessageListener(IMessage message);
}
/// <summary> /// <summary>
/// A consumer of messages /// A consumer of messages
/// </summary> /// </summary>
namespace JMS
{
public interface IMessageConsumer : IDisposable public interface IMessageConsumer : IDisposable
{ {

View File

@ -17,12 +17,12 @@
using JMS; using JMS;
using System; using System;
/// <summary>
/// An object capable of sending messages to some destination
/// </summary>
namespace JMS namespace JMS
{ {
/// <summary>
/// An object capable of sending messages to some destination
/// </summary>
public interface IMessageProducer : IDisposable public interface IMessageProducer : IDisposable
{ {

View File

@ -16,13 +16,13 @@
*/ */
using System.Collections; using System.Collections;
/// <summary>
/// Represents a Map of primitive types where the keys are all string instances
/// and the values are strings or numbers.
/// </summary>
namespace JMS namespace JMS
{ {
/// <summary>
/// Represents a Map of primitive types where the keys are all string instances
/// and the values are strings or numbers.
/// </summary>
public interface IPrimitiveMap public interface IPrimitiveMap
{ {

View File

@ -17,12 +17,12 @@
using JMS; using JMS;
using System; using System;
/// <summary>
/// Summary description for IQueue.
/// </summary>
namespace JMS namespace JMS
{ {
/// <summary>
/// Summary description for IQueue.
/// </summary>
public interface IQueue : IDestination public interface IQueue : IDestination
{ {

View File

@ -17,13 +17,13 @@
using JMS; using JMS;
using System; using System;
/// <summary>
/// Represents a single unit of work on an IConnection.
/// So the ISession can be used to perform transactional receive and sends
/// </summary>
namespace JMS namespace JMS
{ {
/// <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 : IDisposable public interface ISession : IDisposable
{ {

View File

@ -16,12 +16,12 @@
*/ */
using JMS; using JMS;
/// <summary>
/// Summary description for ITemporaryQueue.
/// </summary>
namespace JMS namespace JMS
{ {
/// <summary>
/// Summary description for ITemporaryQueue.
/// </summary>
public interface ITemporaryQueue : IDestination public interface ITemporaryQueue : IDestination
{ {
} }

View File

@ -16,12 +16,12 @@
*/ */
using JMS; using JMS;
/// <summary>
/// Summary description for TemporaryTopic.
/// </summary>
namespace JMS namespace JMS
{ {
/// <summary>
/// Summary description for TemporaryTopic.
/// </summary>
public interface ITemporaryTopic : IDestination public interface ITemporaryTopic : IDestination
{ {
} }

View File

@ -16,12 +16,12 @@
*/ */
using JMS; using JMS;
/// <summary>
/// Represents a text based message
/// </summary>
namespace JMS namespace JMS
{ {
/// <summary>
/// Represents a text based message
/// </summary>
public interface ITextMessage : IMessage public interface ITextMessage : IMessage
{ {

View File

@ -17,12 +17,12 @@
using JMS; using JMS;
using System; using System;
/// <summary>
/// Summary description for ITopic.
/// </summary>
namespace JMS namespace JMS
{ {
/// <summary>
/// Summary description for ITopic.
/// </summary>
public interface ITopic : IDestination public interface ITopic : IDestination
{ {

View File

@ -16,15 +16,15 @@
*/ */
using System; using System;
/// <summary>
/// Represents a connection failure.
/// </summary>
namespace JMS namespace JMS
{ {
/// <summary>
/// Represents a connection failure.
/// </summary>
public class ConnectionException : JMSException public class ConnectionException : JMSException
{ {
public JMSException(string message) : base(message) public ConnectionException(string message) : base(message)
{ {
} }
} }

View File

@ -16,12 +16,12 @@
*/ */
using System; using System;
/// <summary>
/// Represents a JMS exception
/// </summary>
namespace JMS namespace JMS
{ {
/// <summary>
/// Represents a JMS exception
/// </summary>
public class JMSException : Exception public class JMSException : Exception
{ {
public JMSException(string message) : base(message) public JMSException(string message) : base(message)

View File

@ -120,7 +120,7 @@ namespace ActiveMQ.OpenWire
dis.ReadByte(); dis.ReadByte();
Assert.Fail("Should have reached the end of the stream"); Assert.Fail("Should have reached the end of the stream");
} }
catch (IOException e) catch (IOException)
{ {
} }
} }