diff --git a/openwire-dotnet/src/OpenWire.Core/AbstractCommandMarshaller.cs b/openwire-dotnet/src/OpenWire.Core/AbstractCommandMarshaller.cs index 411b4463a3..30a4064d27 100755 --- a/openwire-dotnet/src/OpenWire.Core/AbstractCommandMarshaller.cs +++ b/openwire-dotnet/src/OpenWire.Core/AbstractCommandMarshaller.cs @@ -1,6 +1,9 @@ using System; using System.IO; +using OpenWire.Core.Commands; +using OpenWire.Core.IO; + namespace OpenWire.Core { /// @@ -11,6 +14,13 @@ namespace OpenWire.Core public abstract Command CreateCommand(); + public virtual Command ReadCommand(BinaryReader dataIn) + { + Command command = CreateCommand(); + BuildCommand(command, dataIn); + return command; + } + public virtual void BuildCommand(Command command, BinaryReader dataIn) { } @@ -19,14 +29,76 @@ namespace OpenWire.Core { } - protected virtual BrokerId ReadBrokerId(BinaryReader dataIn) + protected virtual BrokerId[] ReadBrokerIds(BinaryReader dataIn) { - return brokerIDMarshaller.ReadCommand(); + int size = dataIn.ReadInt32(); + BrokerId[] answer = new BrokerId[size]; + for (int i = 0; i < size; i++) { + answer[i] = (BrokerId) CommandMarshallerRegistry.BrokerIdMarshaller.ReadCommand(dataIn); + } + return answer; + } + + protected virtual void WriteBrokerIds(BrokerId[] commands, BinaryWriter dataOut) + { + int size = commands.Length; + dataOut.Write(size); + for (int i = 0; i < size; i++) { + CommandMarshallerRegistry.BrokerIdMarshaller.WriteCommand(commands[i], dataOut); + } + } + + + protected virtual BrokerInfo[] ReadBrokerInfos(BinaryReader dataIn) + { + int size = dataIn.ReadInt32(); + BrokerInfo[] answer = new BrokerInfo[size]; + for (int i = 0; i < size; i++) { + answer[i] = (BrokerInfo) CommandMarshallerRegistry.BrokerInfoMarshaller.ReadCommand(dataIn); + } + return answer; + } + + protected virtual void WriteBrokerInfos(BrokerInfo[] commands, BinaryWriter dataOut) + { + int size = commands.Length; + dataOut.Write(size); + for (int i = 0; i < size; i++) { + CommandMarshallerRegistry.BrokerInfoMarshaller.WriteCommand(commands[i], dataOut); + } + } + + + protected virtual DataStructure[] ReadDataStructures(BinaryReader dataIn) + { + int size = dataIn.ReadInt32(); + DataStructure[] answer = new DataStructure[size]; + for (int i = 0; i < size; i++) { + answer[i] = (DataStructure) CommandMarshallerRegistry.ReadCommand(dataIn); + } + return answer; + } + + protected virtual void WriteDataStructures(DataStructure[] commands, BinaryWriter dataOut) + { + int size = commands.Length; + dataOut.Write(size); + for (int i = 0; i < size; i++) { + CommandMarshallerRegistry.WriteCommand((Command) commands[i], dataOut); + } + } + + + protected virtual byte[] ReadBytes(BinaryReader dataIn) + { + int size = dataIn.ReadInt32(); + return dataIn.ReadBytes(size); } - protected virtual void WriteBrokerId(BrokerId command, BinaryWriter dataOut) + protected virtual void WriteBytes(byte[] command, BinaryWriter dataOut) { - brokerIDMarshaller.WriteCommand(command, dataOut); + dataOut.Write(command.Length); + dataOut.Write(command); } } diff --git a/openwire-dotnet/src/OpenWire.Core/Commands/ActiveMQBytesMessage.cs b/openwire-dotnet/src/OpenWire.Core/Commands/ActiveMQBytesMessage.cs index a979df281e..76d25d70c1 100644 --- a/openwire-dotnet/src/OpenWire.Core/Commands/ActiveMQBytesMessage.cs +++ b/openwire-dotnet/src/OpenWire.Core/Commands/ActiveMQBytesMessage.cs @@ -16,6 +16,8 @@ namespace OpenWire.Core.Commands { public class ActiveMQBytesMessage : ActiveMQMessage { + public const int ID_ActiveMQBytesMessage = 1; + @@ -25,7 +27,7 @@ namespace OpenWire.Core.Commands public override int GetCommandType() { - return 1; + return ID_ActiveMQBytesMessage; } diff --git a/openwire-dotnet/src/OpenWire.Core/Commands/ActiveMQDestination.cs b/openwire-dotnet/src/OpenWire.Core/Commands/ActiveMQDestination.cs index e799718db4..cbd31a7154 100644 --- a/openwire-dotnet/src/OpenWire.Core/Commands/ActiveMQDestination.cs +++ b/openwire-dotnet/src/OpenWire.Core/Commands/ActiveMQDestination.cs @@ -16,6 +16,8 @@ namespace OpenWire.Core.Commands { public class ActiveMQDestination : AbstractCommand { + public const int ID_ActiveMQDestination = 1; + string physicalName; @@ -26,7 +28,7 @@ namespace OpenWire.Core.Commands public override int GetCommandType() { - return 1; + return ID_ActiveMQDestination; } diff --git a/openwire-dotnet/src/OpenWire.Core/Commands/ActiveMQMapMessage.cs b/openwire-dotnet/src/OpenWire.Core/Commands/ActiveMQMapMessage.cs index e53fa68705..91fcb0a5ff 100644 --- a/openwire-dotnet/src/OpenWire.Core/Commands/ActiveMQMapMessage.cs +++ b/openwire-dotnet/src/OpenWire.Core/Commands/ActiveMQMapMessage.cs @@ -16,6 +16,8 @@ namespace OpenWire.Core.Commands { public class ActiveMQMapMessage : ActiveMQMessage { + public const int ID_ActiveMQMapMessage = 1; + @@ -25,7 +27,7 @@ namespace OpenWire.Core.Commands public override int GetCommandType() { - return 1; + return ID_ActiveMQMapMessage; } diff --git a/openwire-dotnet/src/OpenWire.Core/Commands/ActiveMQMessage.cs b/openwire-dotnet/src/OpenWire.Core/Commands/ActiveMQMessage.cs index ce3ae0db04..72bc9eb4ba 100644 --- a/openwire-dotnet/src/OpenWire.Core/Commands/ActiveMQMessage.cs +++ b/openwire-dotnet/src/OpenWire.Core/Commands/ActiveMQMessage.cs @@ -16,6 +16,8 @@ namespace OpenWire.Core.Commands { public class ActiveMQMessage : AbstractCommand { + public const int ID_ActiveMQMessage = 1; + @@ -25,7 +27,7 @@ namespace OpenWire.Core.Commands public override int GetCommandType() { - return 1; + return ID_ActiveMQMessage; } diff --git a/openwire-dotnet/src/OpenWire.Core/Commands/ActiveMQObjectMessage.cs b/openwire-dotnet/src/OpenWire.Core/Commands/ActiveMQObjectMessage.cs index 4c083e2ef8..173b374f75 100644 --- a/openwire-dotnet/src/OpenWire.Core/Commands/ActiveMQObjectMessage.cs +++ b/openwire-dotnet/src/OpenWire.Core/Commands/ActiveMQObjectMessage.cs @@ -16,6 +16,8 @@ namespace OpenWire.Core.Commands { public class ActiveMQObjectMessage : ActiveMQMessage { + public const int ID_ActiveMQObjectMessage = 1; + @@ -25,7 +27,7 @@ namespace OpenWire.Core.Commands public override int GetCommandType() { - return 1; + return ID_ActiveMQObjectMessage; } diff --git a/openwire-dotnet/src/OpenWire.Core/Commands/ActiveMQQueue.cs b/openwire-dotnet/src/OpenWire.Core/Commands/ActiveMQQueue.cs index ea3247c681..dd0b0943ff 100644 --- a/openwire-dotnet/src/OpenWire.Core/Commands/ActiveMQQueue.cs +++ b/openwire-dotnet/src/OpenWire.Core/Commands/ActiveMQQueue.cs @@ -16,6 +16,8 @@ namespace OpenWire.Core.Commands { public class ActiveMQQueue : AbstractCommand { + public const int ID_ActiveMQQueue = 1; + @@ -25,7 +27,7 @@ namespace OpenWire.Core.Commands public override int GetCommandType() { - return 1; + return ID_ActiveMQQueue; } diff --git a/openwire-dotnet/src/OpenWire.Core/Commands/ActiveMQStreamMessage.cs b/openwire-dotnet/src/OpenWire.Core/Commands/ActiveMQStreamMessage.cs index 4801f81392..0da8d71b4a 100644 --- a/openwire-dotnet/src/OpenWire.Core/Commands/ActiveMQStreamMessage.cs +++ b/openwire-dotnet/src/OpenWire.Core/Commands/ActiveMQStreamMessage.cs @@ -16,6 +16,8 @@ namespace OpenWire.Core.Commands { public class ActiveMQStreamMessage : ActiveMQMessage { + public const int ID_ActiveMQStreamMessage = 1; + @@ -25,7 +27,7 @@ namespace OpenWire.Core.Commands public override int GetCommandType() { - return 1; + return ID_ActiveMQStreamMessage; } diff --git a/openwire-dotnet/src/OpenWire.Core/Commands/ActiveMQTempDestination.cs b/openwire-dotnet/src/OpenWire.Core/Commands/ActiveMQTempDestination.cs index 6d5573164a..20b7396100 100644 --- a/openwire-dotnet/src/OpenWire.Core/Commands/ActiveMQTempDestination.cs +++ b/openwire-dotnet/src/OpenWire.Core/Commands/ActiveMQTempDestination.cs @@ -16,6 +16,8 @@ namespace OpenWire.Core.Commands { public class ActiveMQTempDestination : AbstractCommand { + public const int ID_ActiveMQTempDestination = 1; + @@ -25,7 +27,7 @@ namespace OpenWire.Core.Commands public override int GetCommandType() { - return 1; + return ID_ActiveMQTempDestination; } diff --git a/openwire-dotnet/src/OpenWire.Core/Commands/ActiveMQTempQueue.cs b/openwire-dotnet/src/OpenWire.Core/Commands/ActiveMQTempQueue.cs index faeab16d64..83d2c3f34b 100644 --- a/openwire-dotnet/src/OpenWire.Core/Commands/ActiveMQTempQueue.cs +++ b/openwire-dotnet/src/OpenWire.Core/Commands/ActiveMQTempQueue.cs @@ -16,6 +16,8 @@ namespace OpenWire.Core.Commands { public class ActiveMQTempQueue : AbstractCommand { + public const int ID_ActiveMQTempQueue = 1; + @@ -25,7 +27,7 @@ namespace OpenWire.Core.Commands public override int GetCommandType() { - return 1; + return ID_ActiveMQTempQueue; } diff --git a/openwire-dotnet/src/OpenWire.Core/Commands/ActiveMQTempTopic.cs b/openwire-dotnet/src/OpenWire.Core/Commands/ActiveMQTempTopic.cs index 84f52bd182..7825e41721 100644 --- a/openwire-dotnet/src/OpenWire.Core/Commands/ActiveMQTempTopic.cs +++ b/openwire-dotnet/src/OpenWire.Core/Commands/ActiveMQTempTopic.cs @@ -16,6 +16,8 @@ namespace OpenWire.Core.Commands { public class ActiveMQTempTopic : AbstractCommand { + public const int ID_ActiveMQTempTopic = 1; + @@ -25,7 +27,7 @@ namespace OpenWire.Core.Commands public override int GetCommandType() { - return 1; + return ID_ActiveMQTempTopic; } diff --git a/openwire-dotnet/src/OpenWire.Core/Commands/ActiveMQTextMessage.cs b/openwire-dotnet/src/OpenWire.Core/Commands/ActiveMQTextMessage.cs index e00a994fae..10cf5b2689 100644 --- a/openwire-dotnet/src/OpenWire.Core/Commands/ActiveMQTextMessage.cs +++ b/openwire-dotnet/src/OpenWire.Core/Commands/ActiveMQTextMessage.cs @@ -16,6 +16,8 @@ namespace OpenWire.Core.Commands { public class ActiveMQTextMessage : ActiveMQMessage { + public const int ID_ActiveMQTextMessage = 1; + @@ -25,7 +27,7 @@ namespace OpenWire.Core.Commands public override int GetCommandType() { - return 1; + return ID_ActiveMQTextMessage; } diff --git a/openwire-dotnet/src/OpenWire.Core/Commands/ActiveMQTopic.cs b/openwire-dotnet/src/OpenWire.Core/Commands/ActiveMQTopic.cs index f694234ed1..760003aca8 100644 --- a/openwire-dotnet/src/OpenWire.Core/Commands/ActiveMQTopic.cs +++ b/openwire-dotnet/src/OpenWire.Core/Commands/ActiveMQTopic.cs @@ -16,6 +16,8 @@ namespace OpenWire.Core.Commands { public class ActiveMQTopic : AbstractCommand { + public const int ID_ActiveMQTopic = 1; + @@ -25,7 +27,7 @@ namespace OpenWire.Core.Commands public override int GetCommandType() { - return 1; + return ID_ActiveMQTopic; } diff --git a/openwire-dotnet/src/OpenWire.Core/Commands/BaseCommand.cs b/openwire-dotnet/src/OpenWire.Core/Commands/BaseCommand.cs index 7e631ca1b0..3364a41b06 100644 --- a/openwire-dotnet/src/OpenWire.Core/Commands/BaseCommand.cs +++ b/openwire-dotnet/src/OpenWire.Core/Commands/BaseCommand.cs @@ -16,6 +16,8 @@ namespace OpenWire.Core.Commands { public class BaseCommand : AbstractCommand { + public const int ID_BaseCommand = 1; + short commandId; bool responseRequired; @@ -27,7 +29,7 @@ namespace OpenWire.Core.Commands public override int GetCommandType() { - return 1; + return ID_BaseCommand; } diff --git a/openwire-dotnet/src/OpenWire.Core/Commands/BrokerId.cs b/openwire-dotnet/src/OpenWire.Core/Commands/BrokerId.cs index 0d0fe5039e..f147f0f70f 100644 --- a/openwire-dotnet/src/OpenWire.Core/Commands/BrokerId.cs +++ b/openwire-dotnet/src/OpenWire.Core/Commands/BrokerId.cs @@ -16,6 +16,8 @@ namespace OpenWire.Core.Commands { public class BrokerId : AbstractCommand { + public const int ID_BrokerId = 1; + string brokerId; @@ -26,7 +28,7 @@ namespace OpenWire.Core.Commands public override int GetCommandType() { - return 1; + return ID_BrokerId; } diff --git a/openwire-dotnet/src/OpenWire.Core/Commands/BrokerInfo.cs b/openwire-dotnet/src/OpenWire.Core/Commands/BrokerInfo.cs index c1e743971b..11bf51c156 100644 --- a/openwire-dotnet/src/OpenWire.Core/Commands/BrokerInfo.cs +++ b/openwire-dotnet/src/OpenWire.Core/Commands/BrokerInfo.cs @@ -16,6 +16,8 @@ namespace OpenWire.Core.Commands { public class BrokerInfo : AbstractCommand { + public const int ID_BrokerInfo = 1; + BrokerId brokerId; string brokerURL; BrokerInfo[] peerBrokerInfos; @@ -29,7 +31,7 @@ namespace OpenWire.Core.Commands public override int GetCommandType() { - return 1; + return ID_BrokerInfo; } diff --git a/openwire-dotnet/src/OpenWire.Core/Commands/ConnectionId.cs b/openwire-dotnet/src/OpenWire.Core/Commands/ConnectionId.cs index b8cd4a2ef2..9618ad152d 100644 --- a/openwire-dotnet/src/OpenWire.Core/Commands/ConnectionId.cs +++ b/openwire-dotnet/src/OpenWire.Core/Commands/ConnectionId.cs @@ -16,6 +16,8 @@ namespace OpenWire.Core.Commands { public class ConnectionId : AbstractCommand { + public const int ID_ConnectionId = 1; + string connectionId; @@ -26,7 +28,7 @@ namespace OpenWire.Core.Commands public override int GetCommandType() { - return 1; + return ID_ConnectionId; } diff --git a/openwire-dotnet/src/OpenWire.Core/Commands/ConnectionInfo.cs b/openwire-dotnet/src/OpenWire.Core/Commands/ConnectionInfo.cs index 8c6671d272..9393873faa 100644 --- a/openwire-dotnet/src/OpenWire.Core/Commands/ConnectionInfo.cs +++ b/openwire-dotnet/src/OpenWire.Core/Commands/ConnectionInfo.cs @@ -16,6 +16,8 @@ namespace OpenWire.Core.Commands { public class ConnectionInfo : AbstractCommand { + public const int ID_ConnectionInfo = 1; + ConnectionId connectionId; string clientId; string password; @@ -30,7 +32,7 @@ namespace OpenWire.Core.Commands public override int GetCommandType() { - return 1; + return ID_ConnectionInfo; } diff --git a/openwire-dotnet/src/OpenWire.Core/Commands/ConsumerId.cs b/openwire-dotnet/src/OpenWire.Core/Commands/ConsumerId.cs index beae7594da..fb7140fc96 100644 --- a/openwire-dotnet/src/OpenWire.Core/Commands/ConsumerId.cs +++ b/openwire-dotnet/src/OpenWire.Core/Commands/ConsumerId.cs @@ -16,6 +16,8 @@ namespace OpenWire.Core.Commands { public class ConsumerId : AbstractCommand { + public const int ID_ConsumerId = 1; + string connectionId; long sessionId; long consumerId; @@ -28,7 +30,7 @@ namespace OpenWire.Core.Commands public override int GetCommandType() { - return 1; + return ID_ConsumerId; } diff --git a/openwire-dotnet/src/OpenWire.Core/Commands/ConsumerInfo.cs b/openwire-dotnet/src/OpenWire.Core/Commands/ConsumerInfo.cs index e316c1f401..c8d8857d0f 100644 --- a/openwire-dotnet/src/OpenWire.Core/Commands/ConsumerInfo.cs +++ b/openwire-dotnet/src/OpenWire.Core/Commands/ConsumerInfo.cs @@ -16,6 +16,8 @@ namespace OpenWire.Core.Commands { public class ConsumerInfo : AbstractCommand { + public const int ID_ConsumerInfo = 1; + ConsumerId consumerId; bool browser; ActiveMQDestination destination; @@ -38,7 +40,7 @@ namespace OpenWire.Core.Commands public override int GetCommandType() { - return 1; + return ID_ConsumerInfo; } diff --git a/openwire-dotnet/src/OpenWire.Core/Commands/ControlCommand.cs b/openwire-dotnet/src/OpenWire.Core/Commands/ControlCommand.cs index 3194a58795..687a73ee54 100644 --- a/openwire-dotnet/src/OpenWire.Core/Commands/ControlCommand.cs +++ b/openwire-dotnet/src/OpenWire.Core/Commands/ControlCommand.cs @@ -16,6 +16,8 @@ namespace OpenWire.Core.Commands { public class ControlCommand : AbstractCommand { + public const int ID_ControlCommand = 1; + string command; @@ -26,7 +28,7 @@ namespace OpenWire.Core.Commands public override int GetCommandType() { - return 1; + return ID_ControlCommand; } diff --git a/openwire-dotnet/src/OpenWire.Core/Commands/DataArrayResponse.cs b/openwire-dotnet/src/OpenWire.Core/Commands/DataArrayResponse.cs index fb983097cd..7fa8e4d5d8 100644 --- a/openwire-dotnet/src/OpenWire.Core/Commands/DataArrayResponse.cs +++ b/openwire-dotnet/src/OpenWire.Core/Commands/DataArrayResponse.cs @@ -16,6 +16,8 @@ namespace OpenWire.Core.Commands { public class DataArrayResponse : AbstractCommand { + public const int ID_DataArrayResponse = 1; + Command[] data; @@ -26,7 +28,7 @@ namespace OpenWire.Core.Commands public override int GetCommandType() { - return 1; + return ID_DataArrayResponse; } diff --git a/openwire-dotnet/src/OpenWire.Core/Commands/DataResponse.cs b/openwire-dotnet/src/OpenWire.Core/Commands/DataResponse.cs index 7ce15f230d..187c459b66 100644 --- a/openwire-dotnet/src/OpenWire.Core/Commands/DataResponse.cs +++ b/openwire-dotnet/src/OpenWire.Core/Commands/DataResponse.cs @@ -16,6 +16,8 @@ namespace OpenWire.Core.Commands { public class DataResponse : AbstractCommand { + public const int ID_DataResponse = 1; + Command data; @@ -26,7 +28,7 @@ namespace OpenWire.Core.Commands public override int GetCommandType() { - return 1; + return ID_DataResponse; } diff --git a/openwire-dotnet/src/OpenWire.Core/Commands/DestinationInfo.cs b/openwire-dotnet/src/OpenWire.Core/Commands/DestinationInfo.cs index 85965e207f..403f57a819 100644 --- a/openwire-dotnet/src/OpenWire.Core/Commands/DestinationInfo.cs +++ b/openwire-dotnet/src/OpenWire.Core/Commands/DestinationInfo.cs @@ -16,6 +16,8 @@ namespace OpenWire.Core.Commands { public class DestinationInfo : AbstractCommand { + public const int ID_DestinationInfo = 1; + ConnectionId connectionId; ActiveMQDestination destination; byte operationType; @@ -30,7 +32,7 @@ namespace OpenWire.Core.Commands public override int GetCommandType() { - return 1; + return ID_DestinationInfo; } diff --git a/openwire-dotnet/src/OpenWire.Core/Commands/ExceptionResponse.cs b/openwire-dotnet/src/OpenWire.Core/Commands/ExceptionResponse.cs index 5b6759727a..37f002202d 100644 --- a/openwire-dotnet/src/OpenWire.Core/Commands/ExceptionResponse.cs +++ b/openwire-dotnet/src/OpenWire.Core/Commands/ExceptionResponse.cs @@ -16,6 +16,8 @@ namespace OpenWire.Core.Commands { public class ExceptionResponse : AbstractCommand { + public const int ID_ExceptionResponse = 1; + string exception; @@ -26,7 +28,7 @@ namespace OpenWire.Core.Commands public override int GetCommandType() { - return 1; + return ID_ExceptionResponse; } diff --git a/openwire-dotnet/src/OpenWire.Core/Commands/FlushCommand.cs b/openwire-dotnet/src/OpenWire.Core/Commands/FlushCommand.cs index 8309d6511d..aff440bcce 100644 --- a/openwire-dotnet/src/OpenWire.Core/Commands/FlushCommand.cs +++ b/openwire-dotnet/src/OpenWire.Core/Commands/FlushCommand.cs @@ -16,6 +16,8 @@ namespace OpenWire.Core.Commands { public class FlushCommand : AbstractCommand { + public const int ID_FlushCommand = 1; + @@ -25,7 +27,7 @@ namespace OpenWire.Core.Commands public override int GetCommandType() { - return 1; + return ID_FlushCommand; } diff --git a/openwire-dotnet/src/OpenWire.Core/Commands/IntegerResponse.cs b/openwire-dotnet/src/OpenWire.Core/Commands/IntegerResponse.cs index 2922ee830e..c809627d20 100644 --- a/openwire-dotnet/src/OpenWire.Core/Commands/IntegerResponse.cs +++ b/openwire-dotnet/src/OpenWire.Core/Commands/IntegerResponse.cs @@ -16,6 +16,8 @@ namespace OpenWire.Core.Commands { public class IntegerResponse : AbstractCommand { + public const int ID_IntegerResponse = 1; + int result; @@ -26,7 +28,7 @@ namespace OpenWire.Core.Commands public override int GetCommandType() { - return 1; + return ID_IntegerResponse; } diff --git a/openwire-dotnet/src/OpenWire.Core/Commands/JournalQueueAck.cs b/openwire-dotnet/src/OpenWire.Core/Commands/JournalQueueAck.cs index 4a20b2003b..58c8a4a081 100644 --- a/openwire-dotnet/src/OpenWire.Core/Commands/JournalQueueAck.cs +++ b/openwire-dotnet/src/OpenWire.Core/Commands/JournalQueueAck.cs @@ -16,6 +16,8 @@ namespace OpenWire.Core.Commands { public class JournalQueueAck : AbstractCommand { + public const int ID_JournalQueueAck = 1; + ActiveMQDestination destination; MessageAck messageAck; @@ -27,7 +29,7 @@ namespace OpenWire.Core.Commands public override int GetCommandType() { - return 1; + return ID_JournalQueueAck; } diff --git a/openwire-dotnet/src/OpenWire.Core/Commands/JournalTopicAck.cs b/openwire-dotnet/src/OpenWire.Core/Commands/JournalTopicAck.cs index 8a89d83cfd..489775e08f 100644 --- a/openwire-dotnet/src/OpenWire.Core/Commands/JournalTopicAck.cs +++ b/openwire-dotnet/src/OpenWire.Core/Commands/JournalTopicAck.cs @@ -16,6 +16,8 @@ namespace OpenWire.Core.Commands { public class JournalTopicAck : AbstractCommand { + public const int ID_JournalTopicAck = 1; + ActiveMQDestination destination; MessageId messageId; long messageSequenceId; @@ -31,7 +33,7 @@ namespace OpenWire.Core.Commands public override int GetCommandType() { - return 1; + return ID_JournalTopicAck; } diff --git a/openwire-dotnet/src/OpenWire.Core/Commands/JournalTrace.cs b/openwire-dotnet/src/OpenWire.Core/Commands/JournalTrace.cs index dec55d7db7..51719084d5 100644 --- a/openwire-dotnet/src/OpenWire.Core/Commands/JournalTrace.cs +++ b/openwire-dotnet/src/OpenWire.Core/Commands/JournalTrace.cs @@ -16,6 +16,8 @@ namespace OpenWire.Core.Commands { public class JournalTrace : AbstractCommand { + public const int ID_JournalTrace = 1; + string message; @@ -26,7 +28,7 @@ namespace OpenWire.Core.Commands public override int GetCommandType() { - return 1; + return ID_JournalTrace; } diff --git a/openwire-dotnet/src/OpenWire.Core/Commands/JournalTransaction.cs b/openwire-dotnet/src/OpenWire.Core/Commands/JournalTransaction.cs index da5d44c6ce..b442014e73 100644 --- a/openwire-dotnet/src/OpenWire.Core/Commands/JournalTransaction.cs +++ b/openwire-dotnet/src/OpenWire.Core/Commands/JournalTransaction.cs @@ -16,6 +16,8 @@ namespace OpenWire.Core.Commands { public class JournalTransaction : AbstractCommand { + public const int ID_JournalTransaction = 1; + TransactionId transactionId; byte type; bool wasPrepared; @@ -28,7 +30,7 @@ namespace OpenWire.Core.Commands public override int GetCommandType() { - return 1; + return ID_JournalTransaction; } diff --git a/openwire-dotnet/src/OpenWire.Core/Commands/KeepAliveInfo.cs b/openwire-dotnet/src/OpenWire.Core/Commands/KeepAliveInfo.cs index f067d849cf..927c9627e6 100644 --- a/openwire-dotnet/src/OpenWire.Core/Commands/KeepAliveInfo.cs +++ b/openwire-dotnet/src/OpenWire.Core/Commands/KeepAliveInfo.cs @@ -16,6 +16,8 @@ namespace OpenWire.Core.Commands { public class KeepAliveInfo : AbstractCommand { + public const int ID_KeepAliveInfo = 1; + @@ -25,7 +27,7 @@ namespace OpenWire.Core.Commands public override int GetCommandType() { - return 1; + return ID_KeepAliveInfo; } diff --git a/openwire-dotnet/src/OpenWire.Core/Commands/LocalTransactionId.cs b/openwire-dotnet/src/OpenWire.Core/Commands/LocalTransactionId.cs index 3f374a856f..1b3f7362f3 100644 --- a/openwire-dotnet/src/OpenWire.Core/Commands/LocalTransactionId.cs +++ b/openwire-dotnet/src/OpenWire.Core/Commands/LocalTransactionId.cs @@ -16,6 +16,8 @@ namespace OpenWire.Core.Commands { public class LocalTransactionId : AbstractCommand { + public const int ID_LocalTransactionId = 1; + long transactionId; ConnectionId connectionId; @@ -27,7 +29,7 @@ namespace OpenWire.Core.Commands public override int GetCommandType() { - return 1; + return ID_LocalTransactionId; } diff --git a/openwire-dotnet/src/OpenWire.Core/Commands/Message.cs b/openwire-dotnet/src/OpenWire.Core/Commands/Message.cs index 4c73d25102..50e54b3c14 100644 --- a/openwire-dotnet/src/OpenWire.Core/Commands/Message.cs +++ b/openwire-dotnet/src/OpenWire.Core/Commands/Message.cs @@ -16,6 +16,8 @@ namespace OpenWire.Core.Commands { public class Message : AbstractCommand { + public const int ID_Message = 1; + ProducerId producerId; ActiveMQDestination destination; TransactionId transactionId; @@ -50,7 +52,7 @@ namespace OpenWire.Core.Commands public override int GetCommandType() { - return 1; + return ID_Message; } diff --git a/openwire-dotnet/src/OpenWire.Core/Commands/MessageAck.cs b/openwire-dotnet/src/OpenWire.Core/Commands/MessageAck.cs index 9c1789e0d7..e97c2073cb 100644 --- a/openwire-dotnet/src/OpenWire.Core/Commands/MessageAck.cs +++ b/openwire-dotnet/src/OpenWire.Core/Commands/MessageAck.cs @@ -16,6 +16,8 @@ namespace OpenWire.Core.Commands { public class MessageAck : AbstractCommand { + public const int ID_MessageAck = 1; + ActiveMQDestination destination; TransactionId transactionId; ConsumerId consumerId; @@ -32,7 +34,7 @@ namespace OpenWire.Core.Commands public override int GetCommandType() { - return 1; + return ID_MessageAck; } diff --git a/openwire-dotnet/src/OpenWire.Core/Commands/MessageDispatch.cs b/openwire-dotnet/src/OpenWire.Core/Commands/MessageDispatch.cs index 96e127e6c8..392ecbe827 100644 --- a/openwire-dotnet/src/OpenWire.Core/Commands/MessageDispatch.cs +++ b/openwire-dotnet/src/OpenWire.Core/Commands/MessageDispatch.cs @@ -16,6 +16,8 @@ namespace OpenWire.Core.Commands { public class MessageDispatch : AbstractCommand { + public const int ID_MessageDispatch = 1; + ConsumerId consumerId; ActiveMQDestination destination; Message message; @@ -29,7 +31,7 @@ namespace OpenWire.Core.Commands public override int GetCommandType() { - return 1; + return ID_MessageDispatch; } diff --git a/openwire-dotnet/src/OpenWire.Core/Commands/MessageId.cs b/openwire-dotnet/src/OpenWire.Core/Commands/MessageId.cs index 796d4c6680..114e4262ea 100644 --- a/openwire-dotnet/src/OpenWire.Core/Commands/MessageId.cs +++ b/openwire-dotnet/src/OpenWire.Core/Commands/MessageId.cs @@ -16,6 +16,8 @@ namespace OpenWire.Core.Commands { public class MessageId : AbstractCommand { + public const int ID_MessageId = 1; + ProducerId producerId; long producerSequenceId; long brokerSequenceId; @@ -28,7 +30,7 @@ namespace OpenWire.Core.Commands public override int GetCommandType() { - return 1; + return ID_MessageId; } diff --git a/openwire-dotnet/src/OpenWire.Core/Commands/ProducerId.cs b/openwire-dotnet/src/OpenWire.Core/Commands/ProducerId.cs index 8b886c72aa..a67f145245 100644 --- a/openwire-dotnet/src/OpenWire.Core/Commands/ProducerId.cs +++ b/openwire-dotnet/src/OpenWire.Core/Commands/ProducerId.cs @@ -16,6 +16,8 @@ namespace OpenWire.Core.Commands { public class ProducerId : AbstractCommand { + public const int ID_ProducerId = 1; + string connectionId; long producerId; long sessionId; @@ -28,7 +30,7 @@ namespace OpenWire.Core.Commands public override int GetCommandType() { - return 1; + return ID_ProducerId; } diff --git a/openwire-dotnet/src/OpenWire.Core/Commands/ProducerInfo.cs b/openwire-dotnet/src/OpenWire.Core/Commands/ProducerInfo.cs index 1881df18d4..a26e66d916 100644 --- a/openwire-dotnet/src/OpenWire.Core/Commands/ProducerInfo.cs +++ b/openwire-dotnet/src/OpenWire.Core/Commands/ProducerInfo.cs @@ -16,6 +16,8 @@ namespace OpenWire.Core.Commands { public class ProducerInfo : AbstractCommand { + public const int ID_ProducerInfo = 1; + ProducerId producerId; ActiveMQDestination destination; BrokerId[] brokerPath; @@ -28,7 +30,7 @@ namespace OpenWire.Core.Commands public override int GetCommandType() { - return 1; + return ID_ProducerInfo; } diff --git a/openwire-dotnet/src/OpenWire.Core/Commands/RemoveInfo.cs b/openwire-dotnet/src/OpenWire.Core/Commands/RemoveInfo.cs index f0d3ec07f6..7d6eec7702 100644 --- a/openwire-dotnet/src/OpenWire.Core/Commands/RemoveInfo.cs +++ b/openwire-dotnet/src/OpenWire.Core/Commands/RemoveInfo.cs @@ -16,6 +16,8 @@ namespace OpenWire.Core.Commands { public class RemoveInfo : AbstractCommand { + public const int ID_RemoveInfo = 1; + Command objectId; @@ -26,7 +28,7 @@ namespace OpenWire.Core.Commands public override int GetCommandType() { - return 1; + return ID_RemoveInfo; } diff --git a/openwire-dotnet/src/OpenWire.Core/Commands/RemoveSubscriptionInfo.cs b/openwire-dotnet/src/OpenWire.Core/Commands/RemoveSubscriptionInfo.cs index caa954a7cc..4311a04843 100644 --- a/openwire-dotnet/src/OpenWire.Core/Commands/RemoveSubscriptionInfo.cs +++ b/openwire-dotnet/src/OpenWire.Core/Commands/RemoveSubscriptionInfo.cs @@ -16,6 +16,8 @@ namespace OpenWire.Core.Commands { public class RemoveSubscriptionInfo : AbstractCommand { + public const int ID_RemoveSubscriptionInfo = 1; + ConnectionId connectionId; string subcriptionName; string clientId; @@ -28,7 +30,7 @@ namespace OpenWire.Core.Commands public override int GetCommandType() { - return 1; + return ID_RemoveSubscriptionInfo; } diff --git a/openwire-dotnet/src/OpenWire.Core/Commands/Response.cs b/openwire-dotnet/src/OpenWire.Core/Commands/Response.cs index c909072f94..5db7aeda15 100644 --- a/openwire-dotnet/src/OpenWire.Core/Commands/Response.cs +++ b/openwire-dotnet/src/OpenWire.Core/Commands/Response.cs @@ -16,6 +16,8 @@ namespace OpenWire.Core.Commands { public class Response : AbstractCommand { + public const int ID_Response = 1; + short correlationId; @@ -26,7 +28,7 @@ namespace OpenWire.Core.Commands public override int GetCommandType() { - return 1; + return ID_Response; } diff --git a/openwire-dotnet/src/OpenWire.Core/Commands/SessionId.cs b/openwire-dotnet/src/OpenWire.Core/Commands/SessionId.cs index 19c2340791..db03bfcf53 100644 --- a/openwire-dotnet/src/OpenWire.Core/Commands/SessionId.cs +++ b/openwire-dotnet/src/OpenWire.Core/Commands/SessionId.cs @@ -16,6 +16,8 @@ namespace OpenWire.Core.Commands { public class SessionId : AbstractCommand { + public const int ID_SessionId = 1; + string connectionId; long sessionId; @@ -27,7 +29,7 @@ namespace OpenWire.Core.Commands public override int GetCommandType() { - return 1; + return ID_SessionId; } diff --git a/openwire-dotnet/src/OpenWire.Core/Commands/SessionInfo.cs b/openwire-dotnet/src/OpenWire.Core/Commands/SessionInfo.cs index 6a58136d10..818755e639 100644 --- a/openwire-dotnet/src/OpenWire.Core/Commands/SessionInfo.cs +++ b/openwire-dotnet/src/OpenWire.Core/Commands/SessionInfo.cs @@ -16,6 +16,8 @@ namespace OpenWire.Core.Commands { public class SessionInfo : AbstractCommand { + public const int ID_SessionInfo = 1; + SessionId sessionId; @@ -26,7 +28,7 @@ namespace OpenWire.Core.Commands public override int GetCommandType() { - return 1; + return ID_SessionInfo; } diff --git a/openwire-dotnet/src/OpenWire.Core/Commands/ShutdownInfo.cs b/openwire-dotnet/src/OpenWire.Core/Commands/ShutdownInfo.cs index 219772042a..d2721aa997 100644 --- a/openwire-dotnet/src/OpenWire.Core/Commands/ShutdownInfo.cs +++ b/openwire-dotnet/src/OpenWire.Core/Commands/ShutdownInfo.cs @@ -16,6 +16,8 @@ namespace OpenWire.Core.Commands { public class ShutdownInfo : AbstractCommand { + public const int ID_ShutdownInfo = 1; + @@ -25,7 +27,7 @@ namespace OpenWire.Core.Commands public override int GetCommandType() { - return 1; + return ID_ShutdownInfo; } diff --git a/openwire-dotnet/src/OpenWire.Core/Commands/SubscriptionInfo.cs b/openwire-dotnet/src/OpenWire.Core/Commands/SubscriptionInfo.cs index 395776765b..13383f18af 100644 --- a/openwire-dotnet/src/OpenWire.Core/Commands/SubscriptionInfo.cs +++ b/openwire-dotnet/src/OpenWire.Core/Commands/SubscriptionInfo.cs @@ -16,6 +16,8 @@ namespace OpenWire.Core.Commands { public class SubscriptionInfo : AbstractCommand { + public const int ID_SubscriptionInfo = 1; + string clientId; ActiveMQDestination destination; string selector; @@ -29,7 +31,7 @@ namespace OpenWire.Core.Commands public override int GetCommandType() { - return 1; + return ID_SubscriptionInfo; } diff --git a/openwire-dotnet/src/OpenWire.Core/Commands/TransactionId.cs b/openwire-dotnet/src/OpenWire.Core/Commands/TransactionId.cs index 7d05b808b2..05fbdea588 100644 --- a/openwire-dotnet/src/OpenWire.Core/Commands/TransactionId.cs +++ b/openwire-dotnet/src/OpenWire.Core/Commands/TransactionId.cs @@ -16,6 +16,8 @@ namespace OpenWire.Core.Commands { public class TransactionId : AbstractCommand { + public const int ID_TransactionId = 1; + @@ -25,7 +27,7 @@ namespace OpenWire.Core.Commands public override int GetCommandType() { - return 1; + return ID_TransactionId; } diff --git a/openwire-dotnet/src/OpenWire.Core/Commands/TransactionInfo.cs b/openwire-dotnet/src/OpenWire.Core/Commands/TransactionInfo.cs index 99feab2100..6cc6288657 100644 --- a/openwire-dotnet/src/OpenWire.Core/Commands/TransactionInfo.cs +++ b/openwire-dotnet/src/OpenWire.Core/Commands/TransactionInfo.cs @@ -16,6 +16,8 @@ namespace OpenWire.Core.Commands { public class TransactionInfo : AbstractCommand { + public const int ID_TransactionInfo = 1; + ConnectionId connectionId; TransactionId transactionId; byte type; @@ -28,7 +30,7 @@ namespace OpenWire.Core.Commands public override int GetCommandType() { - return 1; + return ID_TransactionInfo; } diff --git a/openwire-dotnet/src/OpenWire.Core/Commands/WireFormatInfo.cs b/openwire-dotnet/src/OpenWire.Core/Commands/WireFormatInfo.cs index a748087958..064ff33cb7 100644 --- a/openwire-dotnet/src/OpenWire.Core/Commands/WireFormatInfo.cs +++ b/openwire-dotnet/src/OpenWire.Core/Commands/WireFormatInfo.cs @@ -16,6 +16,8 @@ namespace OpenWire.Core.Commands { public class WireFormatInfo : AbstractCommand { + public const int ID_WireFormatInfo = 1; + byte[] magic; int version; int options; @@ -28,7 +30,7 @@ namespace OpenWire.Core.Commands public override int GetCommandType() { - return 1; + return ID_WireFormatInfo; } diff --git a/openwire-dotnet/src/OpenWire.Core/Commands/XATransactionId.cs b/openwire-dotnet/src/OpenWire.Core/Commands/XATransactionId.cs index 1d50da9357..6e4964101d 100644 --- a/openwire-dotnet/src/OpenWire.Core/Commands/XATransactionId.cs +++ b/openwire-dotnet/src/OpenWire.Core/Commands/XATransactionId.cs @@ -16,6 +16,8 @@ namespace OpenWire.Core.Commands { public class XATransactionId : AbstractCommand { + public const int ID_XATransactionId = 1; + int formatId; byte[] globalTransactionId; byte[] branchQualifier; @@ -28,7 +30,7 @@ namespace OpenWire.Core.Commands public override int GetCommandType() { - return 1; + return ID_XATransactionId; } diff --git a/openwire-dotnet/src/OpenWire.Core/DataStructure.cs b/openwire-dotnet/src/OpenWire.Core/DataStructure.cs new file mode 100755 index 0000000000..a9d7c31575 --- /dev/null +++ b/openwire-dotnet/src/OpenWire.Core/DataStructure.cs @@ -0,0 +1,14 @@ +using System; + +namespace OpenWire.Core +{ + /// + /// An OpenWire command + /// + public interface DataStructure { + + int GetCommandType(); + + } +} + diff --git a/openwire-dotnet/src/OpenWire.Core/IO/BrokerInfoMarshaller.cs b/openwire-dotnet/src/OpenWire.Core/IO/BrokerInfoMarshaller.cs index f12b8915fc..920721b9c4 100644 --- a/openwire-dotnet/src/OpenWire.Core/IO/BrokerInfoMarshaller.cs +++ b/openwire-dotnet/src/OpenWire.Core/IO/BrokerInfoMarshaller.cs @@ -29,9 +29,9 @@ namespace OpenWire.Core.IO base.BuildCommand(command, dataIn); BrokerInfo info = (BrokerInfo) command; - info.BrokerId = ReadBrokerId(dataIn); + info.BrokerId = (BrokerId) CommandMarshallerRegistry.BrokerIdMarshaller.ReadCommand(dataIn); info.BrokerURL = dataIn.ReadString(); - info.PeerBrokerInfos = ReadBrokerInfo[](dataIn); + info.PeerBrokerInfos = ReadBrokerInfos(dataIn); info.BrokerName = dataIn.ReadString(); } @@ -40,9 +40,9 @@ namespace OpenWire.Core.IO base.WriteCommand(command, dataOut); BrokerInfo info = (BrokerInfo) command; - WriteBrokerId(info.BrokerId, dataOut); + CommandMarshallerRegistry.BrokerIdMarshaller.WriteCommand(info.BrokerId, dataOut); dataOut.Write(info.BrokerURL); - WriteBrokerInfo[](info.PeerBrokerInfos, dataOut); + WriteBrokerInfos(info.PeerBrokerInfos, dataOut); dataOut.Write(info.BrokerName); } diff --git a/openwire-dotnet/src/OpenWire.Core/IO/CommandMarshallerRegistry.cs b/openwire-dotnet/src/OpenWire.Core/IO/CommandMarshallerRegistry.cs new file mode 100644 index 0000000000..f4b1a3e401 --- /dev/null +++ b/openwire-dotnet/src/OpenWire.Core/IO/CommandMarshallerRegistry.cs @@ -0,0 +1,1011 @@ +// +// Marshalling code for Open Wire Format for ExceptionResponse +// +// +// NOTE!: This file is autogenerated - do not modify! +// if you need to make a change, please see the Groovy scripts in the +// activemq-openwire module +// + +using System; +using System.Collections; +using System.IO; + +using OpenWire.Core; +using OpenWire.Core.Commands; +using OpenWire.Core.IO; + +namespace OpenWire.Core.IO +{ + public class CommandMarshallerRegistry + { + public static Command ReadCommand(BinaryReader dataIn) + { + byte commandID = dataIn.ReadByte(); + switch (commandID) + { + + case MessageId.ID_MessageId: + return messageIdMarshaller.ReadCommand(dataIn); + + + case BrokerInfo.ID_BrokerInfo: + return brokerInfoMarshaller.ReadCommand(dataIn); + + + case ActiveMQTempQueue.ID_ActiveMQTempQueue: + return activeMQTempQueueMarshaller.ReadCommand(dataIn); + + + case LocalTransactionId.ID_LocalTransactionId: + return localTransactionIdMarshaller.ReadCommand(dataIn); + + + case RemoveSubscriptionInfo.ID_RemoveSubscriptionInfo: + return removeSubscriptionInfoMarshaller.ReadCommand(dataIn); + + + case IntegerResponse.ID_IntegerResponse: + return integerResponseMarshaller.ReadCommand(dataIn); + + + case ActiveMQQueue.ID_ActiveMQQueue: + return activeMQQueueMarshaller.ReadCommand(dataIn); + + + case DestinationInfo.ID_DestinationInfo: + return destinationInfoMarshaller.ReadCommand(dataIn); + + + case ActiveMQBytesMessage.ID_ActiveMQBytesMessage: + return activeMQBytesMessageMarshaller.ReadCommand(dataIn); + + + case ShutdownInfo.ID_ShutdownInfo: + return shutdownInfoMarshaller.ReadCommand(dataIn); + + + case DataResponse.ID_DataResponse: + return dataResponseMarshaller.ReadCommand(dataIn); + + + case SessionId.ID_SessionId: + return sessionIdMarshaller.ReadCommand(dataIn); + + + case DataArrayResponse.ID_DataArrayResponse: + return dataArrayResponseMarshaller.ReadCommand(dataIn); + + + case JournalQueueAck.ID_JournalQueueAck: + return journalQueueAckMarshaller.ReadCommand(dataIn); + + + case WireFormatInfo.ID_WireFormatInfo: + return wireFormatInfoMarshaller.ReadCommand(dataIn); + + + case TransactionId.ID_TransactionId: + return transactionIdMarshaller.ReadCommand(dataIn); + + + case Response.ID_Response: + return responseMarshaller.ReadCommand(dataIn); + + + case ActiveMQObjectMessage.ID_ActiveMQObjectMessage: + return activeMQObjectMessageMarshaller.ReadCommand(dataIn); + + + case ConsumerInfo.ID_ConsumerInfo: + return consumerInfoMarshaller.ReadCommand(dataIn); + + + case ConnectionId.ID_ConnectionId: + return connectionIdMarshaller.ReadCommand(dataIn); + + + case ActiveMQTempTopic.ID_ActiveMQTempTopic: + return activeMQTempTopicMarshaller.ReadCommand(dataIn); + + + case ConnectionInfo.ID_ConnectionInfo: + return connectionInfoMarshaller.ReadCommand(dataIn); + + + case KeepAliveInfo.ID_KeepAliveInfo: + return keepAliveInfoMarshaller.ReadCommand(dataIn); + + + case Message.ID_Message: + return messageMarshaller.ReadCommand(dataIn); + + + case BaseCommand.ID_BaseCommand: + return baseCommandMarshaller.ReadCommand(dataIn); + + + case XATransactionId.ID_XATransactionId: + return xATransactionIdMarshaller.ReadCommand(dataIn); + + + case JournalTrace.ID_JournalTrace: + return journalTraceMarshaller.ReadCommand(dataIn); + + + case FlushCommand.ID_FlushCommand: + return flushCommandMarshaller.ReadCommand(dataIn); + + + case ActiveMQTempDestination.ID_ActiveMQTempDestination: + return activeMQTempDestinationMarshaller.ReadCommand(dataIn); + + + case ConsumerId.ID_ConsumerId: + return consumerIdMarshaller.ReadCommand(dataIn); + + + case JournalTopicAck.ID_JournalTopicAck: + return journalTopicAckMarshaller.ReadCommand(dataIn); + + + case ActiveMQTextMessage.ID_ActiveMQTextMessage: + return activeMQTextMessageMarshaller.ReadCommand(dataIn); + + + case BrokerId.ID_BrokerId: + return brokerIdMarshaller.ReadCommand(dataIn); + + + case MessageDispatch.ID_MessageDispatch: + return messageDispatchMarshaller.ReadCommand(dataIn); + + + case ProducerInfo.ID_ProducerInfo: + return producerInfoMarshaller.ReadCommand(dataIn); + + + case SubscriptionInfo.ID_SubscriptionInfo: + return subscriptionInfoMarshaller.ReadCommand(dataIn); + + + case ActiveMQMapMessage.ID_ActiveMQMapMessage: + return activeMQMapMessageMarshaller.ReadCommand(dataIn); + + + case SessionInfo.ID_SessionInfo: + return sessionInfoMarshaller.ReadCommand(dataIn); + + + case ActiveMQMessage.ID_ActiveMQMessage: + return activeMQMessageMarshaller.ReadCommand(dataIn); + + + case TransactionInfo.ID_TransactionInfo: + return transactionInfoMarshaller.ReadCommand(dataIn); + + + case ActiveMQStreamMessage.ID_ActiveMQStreamMessage: + return activeMQStreamMessageMarshaller.ReadCommand(dataIn); + + + case MessageAck.ID_MessageAck: + return messageAckMarshaller.ReadCommand(dataIn); + + + case ProducerId.ID_ProducerId: + return producerIdMarshaller.ReadCommand(dataIn); + + + case ActiveMQTopic.ID_ActiveMQTopic: + return activeMQTopicMarshaller.ReadCommand(dataIn); + + + case JournalTransaction.ID_JournalTransaction: + return journalTransactionMarshaller.ReadCommand(dataIn); + + + case RemoveInfo.ID_RemoveInfo: + return removeInfoMarshaller.ReadCommand(dataIn); + + + case ControlCommand.ID_ControlCommand: + return controlCommandMarshaller.ReadCommand(dataIn); + + + case ExceptionResponse.ID_ExceptionResponse: + return exceptionResponseMarshaller.ReadCommand(dataIn); + + + default: + throw new Exception("Unknown command type: " + commandID); + } + } + + + public static void WriteCommand(Command command, BinaryWriter dataOut) + { + int commandID = command.CommandType; + dataOut.Write(commandID); + switch (commandID) + { + + case MessageId.ID_MessageId: + return messageIdMarshaller.ReadCommand(dataIn); + + + case BrokerInfo.ID_BrokerInfo: + return brokerInfoMarshaller.ReadCommand(dataIn); + + + case ActiveMQTempQueue.ID_ActiveMQTempQueue: + return activeMQTempQueueMarshaller.ReadCommand(dataIn); + + + case LocalTransactionId.ID_LocalTransactionId: + return localTransactionIdMarshaller.ReadCommand(dataIn); + + + case RemoveSubscriptionInfo.ID_RemoveSubscriptionInfo: + return removeSubscriptionInfoMarshaller.ReadCommand(dataIn); + + + case IntegerResponse.ID_IntegerResponse: + return integerResponseMarshaller.ReadCommand(dataIn); + + + case ActiveMQQueue.ID_ActiveMQQueue: + return activeMQQueueMarshaller.ReadCommand(dataIn); + + + case DestinationInfo.ID_DestinationInfo: + return destinationInfoMarshaller.ReadCommand(dataIn); + + + case ActiveMQBytesMessage.ID_ActiveMQBytesMessage: + return activeMQBytesMessageMarshaller.ReadCommand(dataIn); + + + case ShutdownInfo.ID_ShutdownInfo: + return shutdownInfoMarshaller.ReadCommand(dataIn); + + + case DataResponse.ID_DataResponse: + return dataResponseMarshaller.ReadCommand(dataIn); + + + case SessionId.ID_SessionId: + return sessionIdMarshaller.ReadCommand(dataIn); + + + case DataArrayResponse.ID_DataArrayResponse: + return dataArrayResponseMarshaller.ReadCommand(dataIn); + + + case JournalQueueAck.ID_JournalQueueAck: + return journalQueueAckMarshaller.ReadCommand(dataIn); + + + case WireFormatInfo.ID_WireFormatInfo: + return wireFormatInfoMarshaller.ReadCommand(dataIn); + + + case TransactionId.ID_TransactionId: + return transactionIdMarshaller.ReadCommand(dataIn); + + + case Response.ID_Response: + return responseMarshaller.ReadCommand(dataIn); + + + case ActiveMQObjectMessage.ID_ActiveMQObjectMessage: + return activeMQObjectMessageMarshaller.ReadCommand(dataIn); + + + case ConsumerInfo.ID_ConsumerInfo: + return consumerInfoMarshaller.ReadCommand(dataIn); + + + case ConnectionId.ID_ConnectionId: + return connectionIdMarshaller.ReadCommand(dataIn); + + + case ActiveMQTempTopic.ID_ActiveMQTempTopic: + return activeMQTempTopicMarshaller.ReadCommand(dataIn); + + + case ConnectionInfo.ID_ConnectionInfo: + return connectionInfoMarshaller.ReadCommand(dataIn); + + + case KeepAliveInfo.ID_KeepAliveInfo: + return keepAliveInfoMarshaller.ReadCommand(dataIn); + + + case Message.ID_Message: + return messageMarshaller.ReadCommand(dataIn); + + + case BaseCommand.ID_BaseCommand: + return baseCommandMarshaller.ReadCommand(dataIn); + + + case XATransactionId.ID_XATransactionId: + return xATransactionIdMarshaller.ReadCommand(dataIn); + + + case JournalTrace.ID_JournalTrace: + return journalTraceMarshaller.ReadCommand(dataIn); + + + case FlushCommand.ID_FlushCommand: + return flushCommandMarshaller.ReadCommand(dataIn); + + + case ActiveMQTempDestination.ID_ActiveMQTempDestination: + return activeMQTempDestinationMarshaller.ReadCommand(dataIn); + + + case ConsumerId.ID_ConsumerId: + return consumerIdMarshaller.ReadCommand(dataIn); + + + case JournalTopicAck.ID_JournalTopicAck: + return journalTopicAckMarshaller.ReadCommand(dataIn); + + + case ActiveMQTextMessage.ID_ActiveMQTextMessage: + return activeMQTextMessageMarshaller.ReadCommand(dataIn); + + + case BrokerId.ID_BrokerId: + return brokerIdMarshaller.ReadCommand(dataIn); + + + case MessageDispatch.ID_MessageDispatch: + return messageDispatchMarshaller.ReadCommand(dataIn); + + + case ProducerInfo.ID_ProducerInfo: + return producerInfoMarshaller.ReadCommand(dataIn); + + + case SubscriptionInfo.ID_SubscriptionInfo: + return subscriptionInfoMarshaller.ReadCommand(dataIn); + + + case ActiveMQMapMessage.ID_ActiveMQMapMessage: + return activeMQMapMessageMarshaller.ReadCommand(dataIn); + + + case SessionInfo.ID_SessionInfo: + return sessionInfoMarshaller.ReadCommand(dataIn); + + + case ActiveMQMessage.ID_ActiveMQMessage: + return activeMQMessageMarshaller.ReadCommand(dataIn); + + + case TransactionInfo.ID_TransactionInfo: + return transactionInfoMarshaller.ReadCommand(dataIn); + + + case ActiveMQStreamMessage.ID_ActiveMQStreamMessage: + return activeMQStreamMessageMarshaller.ReadCommand(dataIn); + + + case MessageAck.ID_MessageAck: + return messageAckMarshaller.ReadCommand(dataIn); + + + case ProducerId.ID_ProducerId: + return producerIdMarshaller.ReadCommand(dataIn); + + + case ActiveMQTopic.ID_ActiveMQTopic: + return activeMQTopicMarshaller.ReadCommand(dataIn); + + + case JournalTransaction.ID_JournalTransaction: + return journalTransactionMarshaller.ReadCommand(dataIn); + + + case RemoveInfo.ID_RemoveInfo: + return removeInfoMarshaller.ReadCommand(dataIn); + + + case ControlCommand.ID_ControlCommand: + return controlCommandMarshaller.ReadCommand(dataIn); + + + case ExceptionResponse.ID_ExceptionResponse: + return exceptionResponseMarshaller.ReadCommand(dataIn); + + + default: + throw new Exception("Unknown command type: " + commandID); + } + } + + + // Properties + + + private static MessageIdMarshaller messageIdMarshaller = new MessageIdMarshaller(); + + public static MessageIdMarshaller MessageIdMarshaller + { + get + { + return messageIdMarshaller; + } + } + + + + private static BrokerInfoMarshaller brokerInfoMarshaller = new BrokerInfoMarshaller(); + + public static BrokerInfoMarshaller BrokerInfoMarshaller + { + get + { + return brokerInfoMarshaller; + } + } + + + + private static ActiveMQTempQueueMarshaller activeMQTempQueueMarshaller = new ActiveMQTempQueueMarshaller(); + + public static ActiveMQTempQueueMarshaller ActiveMQTempQueueMarshaller + { + get + { + return activeMQTempQueueMarshaller; + } + } + + + + private static LocalTransactionIdMarshaller localTransactionIdMarshaller = new LocalTransactionIdMarshaller(); + + public static LocalTransactionIdMarshaller LocalTransactionIdMarshaller + { + get + { + return localTransactionIdMarshaller; + } + } + + + + private static RemoveSubscriptionInfoMarshaller removeSubscriptionInfoMarshaller = new RemoveSubscriptionInfoMarshaller(); + + public static RemoveSubscriptionInfoMarshaller RemoveSubscriptionInfoMarshaller + { + get + { + return removeSubscriptionInfoMarshaller; + } + } + + + + private static IntegerResponseMarshaller integerResponseMarshaller = new IntegerResponseMarshaller(); + + public static IntegerResponseMarshaller IntegerResponseMarshaller + { + get + { + return integerResponseMarshaller; + } + } + + + + private static ActiveMQQueueMarshaller activeMQQueueMarshaller = new ActiveMQQueueMarshaller(); + + public static ActiveMQQueueMarshaller ActiveMQQueueMarshaller + { + get + { + return activeMQQueueMarshaller; + } + } + + + + private static DestinationInfoMarshaller destinationInfoMarshaller = new DestinationInfoMarshaller(); + + public static DestinationInfoMarshaller DestinationInfoMarshaller + { + get + { + return destinationInfoMarshaller; + } + } + + + + private static ActiveMQBytesMessageMarshaller activeMQBytesMessageMarshaller = new ActiveMQBytesMessageMarshaller(); + + public static ActiveMQBytesMessageMarshaller ActiveMQBytesMessageMarshaller + { + get + { + return activeMQBytesMessageMarshaller; + } + } + + + + private static ShutdownInfoMarshaller shutdownInfoMarshaller = new ShutdownInfoMarshaller(); + + public static ShutdownInfoMarshaller ShutdownInfoMarshaller + { + get + { + return shutdownInfoMarshaller; + } + } + + + + private static DataResponseMarshaller dataResponseMarshaller = new DataResponseMarshaller(); + + public static DataResponseMarshaller DataResponseMarshaller + { + get + { + return dataResponseMarshaller; + } + } + + + + private static SessionIdMarshaller sessionIdMarshaller = new SessionIdMarshaller(); + + public static SessionIdMarshaller SessionIdMarshaller + { + get + { + return sessionIdMarshaller; + } + } + + + + private static DataArrayResponseMarshaller dataArrayResponseMarshaller = new DataArrayResponseMarshaller(); + + public static DataArrayResponseMarshaller DataArrayResponseMarshaller + { + get + { + return dataArrayResponseMarshaller; + } + } + + + + private static JournalQueueAckMarshaller journalQueueAckMarshaller = new JournalQueueAckMarshaller(); + + public static JournalQueueAckMarshaller JournalQueueAckMarshaller + { + get + { + return journalQueueAckMarshaller; + } + } + + + + private static WireFormatInfoMarshaller wireFormatInfoMarshaller = new WireFormatInfoMarshaller(); + + public static WireFormatInfoMarshaller WireFormatInfoMarshaller + { + get + { + return wireFormatInfoMarshaller; + } + } + + + + private static TransactionIdMarshaller transactionIdMarshaller = new TransactionIdMarshaller(); + + public static TransactionIdMarshaller TransactionIdMarshaller + { + get + { + return transactionIdMarshaller; + } + } + + + + private static ResponseMarshaller responseMarshaller = new ResponseMarshaller(); + + public static ResponseMarshaller ResponseMarshaller + { + get + { + return responseMarshaller; + } + } + + + + private static ActiveMQObjectMessageMarshaller activeMQObjectMessageMarshaller = new ActiveMQObjectMessageMarshaller(); + + public static ActiveMQObjectMessageMarshaller ActiveMQObjectMessageMarshaller + { + get + { + return activeMQObjectMessageMarshaller; + } + } + + + + private static ConsumerInfoMarshaller consumerInfoMarshaller = new ConsumerInfoMarshaller(); + + public static ConsumerInfoMarshaller ConsumerInfoMarshaller + { + get + { + return consumerInfoMarshaller; + } + } + + + + private static ConnectionIdMarshaller connectionIdMarshaller = new ConnectionIdMarshaller(); + + public static ConnectionIdMarshaller ConnectionIdMarshaller + { + get + { + return connectionIdMarshaller; + } + } + + + + private static ActiveMQTempTopicMarshaller activeMQTempTopicMarshaller = new ActiveMQTempTopicMarshaller(); + + public static ActiveMQTempTopicMarshaller ActiveMQTempTopicMarshaller + { + get + { + return activeMQTempTopicMarshaller; + } + } + + + + private static ConnectionInfoMarshaller connectionInfoMarshaller = new ConnectionInfoMarshaller(); + + public static ConnectionInfoMarshaller ConnectionInfoMarshaller + { + get + { + return connectionInfoMarshaller; + } + } + + + + private static KeepAliveInfoMarshaller keepAliveInfoMarshaller = new KeepAliveInfoMarshaller(); + + public static KeepAliveInfoMarshaller KeepAliveInfoMarshaller + { + get + { + return keepAliveInfoMarshaller; + } + } + + + + private static MessageMarshaller messageMarshaller = new MessageMarshaller(); + + public static MessageMarshaller MessageMarshaller + { + get + { + return messageMarshaller; + } + } + + + + private static BaseCommandMarshaller baseCommandMarshaller = new BaseCommandMarshaller(); + + public static BaseCommandMarshaller BaseCommandMarshaller + { + get + { + return baseCommandMarshaller; + } + } + + + + private static XATransactionIdMarshaller xATransactionIdMarshaller = new XATransactionIdMarshaller(); + + public static XATransactionIdMarshaller XATransactionIdMarshaller + { + get + { + return xATransactionIdMarshaller; + } + } + + + + private static JournalTraceMarshaller journalTraceMarshaller = new JournalTraceMarshaller(); + + public static JournalTraceMarshaller JournalTraceMarshaller + { + get + { + return journalTraceMarshaller; + } + } + + + + private static FlushCommandMarshaller flushCommandMarshaller = new FlushCommandMarshaller(); + + public static FlushCommandMarshaller FlushCommandMarshaller + { + get + { + return flushCommandMarshaller; + } + } + + + + private static ActiveMQTempDestinationMarshaller activeMQTempDestinationMarshaller = new ActiveMQTempDestinationMarshaller(); + + public static ActiveMQTempDestinationMarshaller ActiveMQTempDestinationMarshaller + { + get + { + return activeMQTempDestinationMarshaller; + } + } + + + + private static ConsumerIdMarshaller consumerIdMarshaller = new ConsumerIdMarshaller(); + + public static ConsumerIdMarshaller ConsumerIdMarshaller + { + get + { + return consumerIdMarshaller; + } + } + + + + private static JournalTopicAckMarshaller journalTopicAckMarshaller = new JournalTopicAckMarshaller(); + + public static JournalTopicAckMarshaller JournalTopicAckMarshaller + { + get + { + return journalTopicAckMarshaller; + } + } + + + + private static ActiveMQTextMessageMarshaller activeMQTextMessageMarshaller = new ActiveMQTextMessageMarshaller(); + + public static ActiveMQTextMessageMarshaller ActiveMQTextMessageMarshaller + { + get + { + return activeMQTextMessageMarshaller; + } + } + + + + private static BrokerIdMarshaller brokerIdMarshaller = new BrokerIdMarshaller(); + + public static BrokerIdMarshaller BrokerIdMarshaller + { + get + { + return brokerIdMarshaller; + } + } + + + + private static MessageDispatchMarshaller messageDispatchMarshaller = new MessageDispatchMarshaller(); + + public static MessageDispatchMarshaller MessageDispatchMarshaller + { + get + { + return messageDispatchMarshaller; + } + } + + + + private static ProducerInfoMarshaller producerInfoMarshaller = new ProducerInfoMarshaller(); + + public static ProducerInfoMarshaller ProducerInfoMarshaller + { + get + { + return producerInfoMarshaller; + } + } + + + + private static SubscriptionInfoMarshaller subscriptionInfoMarshaller = new SubscriptionInfoMarshaller(); + + public static SubscriptionInfoMarshaller SubscriptionInfoMarshaller + { + get + { + return subscriptionInfoMarshaller; + } + } + + + + private static ActiveMQMapMessageMarshaller activeMQMapMessageMarshaller = new ActiveMQMapMessageMarshaller(); + + public static ActiveMQMapMessageMarshaller ActiveMQMapMessageMarshaller + { + get + { + return activeMQMapMessageMarshaller; + } + } + + + + private static SessionInfoMarshaller sessionInfoMarshaller = new SessionInfoMarshaller(); + + public static SessionInfoMarshaller SessionInfoMarshaller + { + get + { + return sessionInfoMarshaller; + } + } + + + + private static ActiveMQMessageMarshaller activeMQMessageMarshaller = new ActiveMQMessageMarshaller(); + + public static ActiveMQMessageMarshaller ActiveMQMessageMarshaller + { + get + { + return activeMQMessageMarshaller; + } + } + + + + private static TransactionInfoMarshaller transactionInfoMarshaller = new TransactionInfoMarshaller(); + + public static TransactionInfoMarshaller TransactionInfoMarshaller + { + get + { + return transactionInfoMarshaller; + } + } + + + + private static ActiveMQStreamMessageMarshaller activeMQStreamMessageMarshaller = new ActiveMQStreamMessageMarshaller(); + + public static ActiveMQStreamMessageMarshaller ActiveMQStreamMessageMarshaller + { + get + { + return activeMQStreamMessageMarshaller; + } + } + + + + private static MessageAckMarshaller messageAckMarshaller = new MessageAckMarshaller(); + + public static MessageAckMarshaller MessageAckMarshaller + { + get + { + return messageAckMarshaller; + } + } + + + + private static ProducerIdMarshaller producerIdMarshaller = new ProducerIdMarshaller(); + + public static ProducerIdMarshaller ProducerIdMarshaller + { + get + { + return producerIdMarshaller; + } + } + + + + private static ActiveMQTopicMarshaller activeMQTopicMarshaller = new ActiveMQTopicMarshaller(); + + public static ActiveMQTopicMarshaller ActiveMQTopicMarshaller + { + get + { + return activeMQTopicMarshaller; + } + } + + + + private static JournalTransactionMarshaller journalTransactionMarshaller = new JournalTransactionMarshaller(); + + public static JournalTransactionMarshaller JournalTransactionMarshaller + { + get + { + return journalTransactionMarshaller; + } + } + + + + private static RemoveInfoMarshaller removeInfoMarshaller = new RemoveInfoMarshaller(); + + public static RemoveInfoMarshaller RemoveInfoMarshaller + { + get + { + return removeInfoMarshaller; + } + } + + + + private static ControlCommandMarshaller controlCommandMarshaller = new ControlCommandMarshaller(); + + public static ControlCommandMarshaller ControlCommandMarshaller + { + get + { + return controlCommandMarshaller; + } + } + + + + private static ExceptionResponseMarshaller exceptionResponseMarshaller = new ExceptionResponseMarshaller(); + + public static ExceptionResponseMarshaller ExceptionResponseMarshaller + { + get + { + return exceptionResponseMarshaller; + } + } + + + + } +} diff --git a/openwire-dotnet/src/OpenWire.Core/IO/ConnectionInfoMarshaller.cs b/openwire-dotnet/src/OpenWire.Core/IO/ConnectionInfoMarshaller.cs index 326f4d4a6f..3f8e4d322c 100644 --- a/openwire-dotnet/src/OpenWire.Core/IO/ConnectionInfoMarshaller.cs +++ b/openwire-dotnet/src/OpenWire.Core/IO/ConnectionInfoMarshaller.cs @@ -29,7 +29,7 @@ namespace OpenWire.Core.IO base.BuildCommand(command, dataIn); ConnectionInfo info = (ConnectionInfo) command; - info.ConnectionId = ReadConnectionId(dataIn); + info.ConnectionId = (ConnectionId) CommandMarshallerRegistry.ConnectionIdMarshaller.ReadCommand(dataIn); info.ClientId = dataIn.ReadString(); info.Password = dataIn.ReadString(); info.UserName = dataIn.ReadString(); @@ -41,11 +41,11 @@ namespace OpenWire.Core.IO base.WriteCommand(command, dataOut); ConnectionInfo info = (ConnectionInfo) command; - WriteConnectionId(info.ConnectionId, dataOut); + CommandMarshallerRegistry.ConnectionIdMarshaller.WriteCommand(info.ConnectionId, dataOut); dataOut.Write(info.ClientId); dataOut.Write(info.Password); dataOut.Write(info.UserName); - dataOut.WriteBrokerIds(info.BrokerPath); + WriteBrokerIds(info.BrokerPath, dataOut); } } diff --git a/openwire-dotnet/src/OpenWire.Core/IO/ConsumerInfoMarshaller.cs b/openwire-dotnet/src/OpenWire.Core/IO/ConsumerInfoMarshaller.cs index 11e1c605ba..082c3834b8 100644 --- a/openwire-dotnet/src/OpenWire.Core/IO/ConsumerInfoMarshaller.cs +++ b/openwire-dotnet/src/OpenWire.Core/IO/ConsumerInfoMarshaller.cs @@ -29,7 +29,7 @@ namespace OpenWire.Core.IO base.BuildCommand(command, dataIn); ConsumerInfo info = (ConsumerInfo) command; - info.ConsumerId = ReadConsumerId(dataIn); + info.ConsumerId = (ConsumerId) CommandMarshallerRegistry.ConsumerIdMarshaller.ReadCommand(dataIn); info.Browser = dataIn.ReadBoolean(); info.Destination = ReadDestination(dataIn); info.PrefetchSize = dataIn.ReadInt32(); @@ -49,7 +49,7 @@ namespace OpenWire.Core.IO base.WriteCommand(command, dataOut); ConsumerInfo info = (ConsumerInfo) command; - WriteConsumerId(info.ConsumerId, dataOut); + CommandMarshallerRegistry.ConsumerIdMarshaller.WriteCommand(info.ConsumerId, dataOut); dataOut.Write(info.Browser); WriteDestination(info.Destination, dataOut); dataOut.Write(info.PrefetchSize); @@ -60,7 +60,7 @@ namespace OpenWire.Core.IO dataOut.Write(info.Exclusive); dataOut.Write(info.Retroactive); dataOut.Write(info.Priority); - dataOut.WriteBrokerIds(info.BrokerPath); + WriteBrokerIds(info.BrokerPath, dataOut); dataOut.Write(info.NetworkSubscription); } diff --git a/openwire-dotnet/src/OpenWire.Core/IO/DataArrayResponseMarshaller.cs b/openwire-dotnet/src/OpenWire.Core/IO/DataArrayResponseMarshaller.cs index 40e6663a4b..e9ea1fdac5 100644 --- a/openwire-dotnet/src/OpenWire.Core/IO/DataArrayResponseMarshaller.cs +++ b/openwire-dotnet/src/OpenWire.Core/IO/DataArrayResponseMarshaller.cs @@ -29,7 +29,7 @@ namespace OpenWire.Core.IO base.BuildCommand(command, dataIn); DataArrayResponse info = (DataArrayResponse) command; - info.Data = ReadDataStructure[](dataIn); + info.Data = ReadDataStructures(dataIn); } @@ -37,7 +37,7 @@ namespace OpenWire.Core.IO base.WriteCommand(command, dataOut); DataArrayResponse info = (DataArrayResponse) command; - WriteDataStructure[](info.Data, dataOut); + WriteDataStructures(info.Data, dataOut); } } diff --git a/openwire-dotnet/src/OpenWire.Core/IO/DataResponseMarshaller.cs b/openwire-dotnet/src/OpenWire.Core/IO/DataResponseMarshaller.cs index 0c04fbc499..8d53f85556 100644 --- a/openwire-dotnet/src/OpenWire.Core/IO/DataResponseMarshaller.cs +++ b/openwire-dotnet/src/OpenWire.Core/IO/DataResponseMarshaller.cs @@ -29,7 +29,7 @@ namespace OpenWire.Core.IO base.BuildCommand(command, dataIn); DataResponse info = (DataResponse) command; - info.Data = ReadDataStructure(dataIn); + info.Data = (DataStructure) CommandMarshallerRegistry.DataStructureMarshaller.ReadCommand(dataIn); } @@ -37,7 +37,7 @@ namespace OpenWire.Core.IO base.WriteCommand(command, dataOut); DataResponse info = (DataResponse) command; - WriteDataStructure(info.Data, dataOut); + CommandMarshallerRegistry.DataStructureMarshaller.WriteCommand(info.Data, dataOut); } } diff --git a/openwire-dotnet/src/OpenWire.Core/IO/DestinationInfoMarshaller.cs b/openwire-dotnet/src/OpenWire.Core/IO/DestinationInfoMarshaller.cs index 5689d28d3d..2ae0830a64 100644 --- a/openwire-dotnet/src/OpenWire.Core/IO/DestinationInfoMarshaller.cs +++ b/openwire-dotnet/src/OpenWire.Core/IO/DestinationInfoMarshaller.cs @@ -29,7 +29,7 @@ namespace OpenWire.Core.IO base.BuildCommand(command, dataIn); DestinationInfo info = (DestinationInfo) command; - info.ConnectionId = ReadConnectionId(dataIn); + info.ConnectionId = (ConnectionId) CommandMarshallerRegistry.ConnectionIdMarshaller.ReadCommand(dataIn); info.Destination = ReadDestination(dataIn); info.OperationType = dataIn.ReadByte(); info.Timeout = dataIn.ReadInt64(); @@ -41,11 +41,11 @@ namespace OpenWire.Core.IO base.WriteCommand(command, dataOut); DestinationInfo info = (DestinationInfo) command; - WriteConnectionId(info.ConnectionId, dataOut); + CommandMarshallerRegistry.ConnectionIdMarshaller.WriteCommand(info.ConnectionId, dataOut); WriteDestination(info.Destination, dataOut); dataOut.Write(info.OperationType); dataOut.Write(info.Timeout); - dataOut.WriteBrokerIds(info.BrokerPath); + WriteBrokerIds(info.BrokerPath, dataOut); } } diff --git a/openwire-dotnet/src/OpenWire.Core/IO/ExceptionResponseMarshaller.cs b/openwire-dotnet/src/OpenWire.Core/IO/ExceptionResponseMarshaller.cs index cb6e7efc8d..fcd2ee5e9a 100644 --- a/openwire-dotnet/src/OpenWire.Core/IO/ExceptionResponseMarshaller.cs +++ b/openwire-dotnet/src/OpenWire.Core/IO/ExceptionResponseMarshaller.cs @@ -29,7 +29,7 @@ namespace OpenWire.Core.IO base.BuildCommand(command, dataIn); ExceptionResponse info = (ExceptionResponse) command; - info.Exception = ReadThrowable(dataIn); + info.Exception = (Throwable) CommandMarshallerRegistry.ThrowableMarshaller.ReadCommand(dataIn); } @@ -37,7 +37,7 @@ namespace OpenWire.Core.IO base.WriteCommand(command, dataOut); ExceptionResponse info = (ExceptionResponse) command; - WriteThrowable(info.Exception, dataOut); + CommandMarshallerRegistry.ThrowableMarshaller.WriteCommand(info.Exception, dataOut); } } diff --git a/openwire-dotnet/src/OpenWire.Core/IO/JournalQueueAckMarshaller.cs b/openwire-dotnet/src/OpenWire.Core/IO/JournalQueueAckMarshaller.cs index 077b469454..1fa1d41f28 100644 --- a/openwire-dotnet/src/OpenWire.Core/IO/JournalQueueAckMarshaller.cs +++ b/openwire-dotnet/src/OpenWire.Core/IO/JournalQueueAckMarshaller.cs @@ -30,7 +30,7 @@ namespace OpenWire.Core.IO JournalQueueAck info = (JournalQueueAck) command; info.Destination = ReadDestination(dataIn); - info.MessageAck = ReadMessageAck(dataIn); + info.MessageAck = (MessageAck) CommandMarshallerRegistry.MessageAckMarshaller.ReadCommand(dataIn); } @@ -39,7 +39,7 @@ namespace OpenWire.Core.IO JournalQueueAck info = (JournalQueueAck) command; WriteDestination(info.Destination, dataOut); - WriteMessageAck(info.MessageAck, dataOut); + CommandMarshallerRegistry.MessageAckMarshaller.WriteCommand(info.MessageAck, dataOut); } } diff --git a/openwire-dotnet/src/OpenWire.Core/IO/JournalTopicAckMarshaller.cs b/openwire-dotnet/src/OpenWire.Core/IO/JournalTopicAckMarshaller.cs index b21e647b33..f17f4f094c 100644 --- a/openwire-dotnet/src/OpenWire.Core/IO/JournalTopicAckMarshaller.cs +++ b/openwire-dotnet/src/OpenWire.Core/IO/JournalTopicAckMarshaller.cs @@ -30,11 +30,11 @@ namespace OpenWire.Core.IO JournalTopicAck info = (JournalTopicAck) command; info.Destination = ReadDestination(dataIn); - info.MessageId = ReadMessageId(dataIn); + info.MessageId = (MessageId) CommandMarshallerRegistry.MessageIdMarshaller.ReadCommand(dataIn); info.MessageSequenceId = dataIn.ReadInt64(); info.SubscritionName = dataIn.ReadString(); info.ClientId = dataIn.ReadString(); - info.TransactionId = ReadTransactionId(dataIn); + info.TransactionId = (TransactionId) CommandMarshallerRegistry.TransactionIdMarshaller.ReadCommand(dataIn); } @@ -43,11 +43,11 @@ namespace OpenWire.Core.IO JournalTopicAck info = (JournalTopicAck) command; WriteDestination(info.Destination, dataOut); - WriteMessageId(info.MessageId, dataOut); + CommandMarshallerRegistry.MessageIdMarshaller.WriteCommand(info.MessageId, dataOut); dataOut.Write(info.MessageSequenceId); dataOut.Write(info.SubscritionName); dataOut.Write(info.ClientId); - WriteTransactionId(info.TransactionId, dataOut); + CommandMarshallerRegistry.TransactionIdMarshaller.WriteCommand(info.TransactionId, dataOut); } } diff --git a/openwire-dotnet/src/OpenWire.Core/IO/JournalTransactionMarshaller.cs b/openwire-dotnet/src/OpenWire.Core/IO/JournalTransactionMarshaller.cs index 278961c09a..20bd2e5100 100644 --- a/openwire-dotnet/src/OpenWire.Core/IO/JournalTransactionMarshaller.cs +++ b/openwire-dotnet/src/OpenWire.Core/IO/JournalTransactionMarshaller.cs @@ -29,7 +29,7 @@ namespace OpenWire.Core.IO base.BuildCommand(command, dataIn); JournalTransaction info = (JournalTransaction) command; - info.TransactionId = ReadTransactionId(dataIn); + info.TransactionId = (TransactionId) CommandMarshallerRegistry.TransactionIdMarshaller.ReadCommand(dataIn); info.Type = dataIn.ReadByte(); info.WasPrepared = dataIn.ReadBoolean(); @@ -39,7 +39,7 @@ namespace OpenWire.Core.IO base.WriteCommand(command, dataOut); JournalTransaction info = (JournalTransaction) command; - WriteTransactionId(info.TransactionId, dataOut); + CommandMarshallerRegistry.TransactionIdMarshaller.WriteCommand(info.TransactionId, dataOut); dataOut.Write(info.Type); dataOut.Write(info.WasPrepared); diff --git a/openwire-dotnet/src/OpenWire.Core/IO/LocalTransactionIdMarshaller.cs b/openwire-dotnet/src/OpenWire.Core/IO/LocalTransactionIdMarshaller.cs index bcfbe98eb1..25ad7dee9c 100644 --- a/openwire-dotnet/src/OpenWire.Core/IO/LocalTransactionIdMarshaller.cs +++ b/openwire-dotnet/src/OpenWire.Core/IO/LocalTransactionIdMarshaller.cs @@ -30,7 +30,7 @@ namespace OpenWire.Core.IO LocalTransactionId info = (LocalTransactionId) command; info.TransactionId = dataIn.ReadInt64(); - info.ConnectionId = ReadConnectionId(dataIn); + info.ConnectionId = (ConnectionId) CommandMarshallerRegistry.ConnectionIdMarshaller.ReadCommand(dataIn); } @@ -39,7 +39,7 @@ namespace OpenWire.Core.IO LocalTransactionId info = (LocalTransactionId) command; dataOut.Write(info.TransactionId); - WriteConnectionId(info.ConnectionId, dataOut); + CommandMarshallerRegistry.ConnectionIdMarshaller.WriteCommand(info.ConnectionId, dataOut); } } diff --git a/openwire-dotnet/src/OpenWire.Core/IO/MessageAckMarshaller.cs b/openwire-dotnet/src/OpenWire.Core/IO/MessageAckMarshaller.cs index 009f2ec744..1d423c0e8f 100644 --- a/openwire-dotnet/src/OpenWire.Core/IO/MessageAckMarshaller.cs +++ b/openwire-dotnet/src/OpenWire.Core/IO/MessageAckMarshaller.cs @@ -30,11 +30,11 @@ namespace OpenWire.Core.IO MessageAck info = (MessageAck) command; info.Destination = ReadDestination(dataIn); - info.TransactionId = ReadTransactionId(dataIn); - info.ConsumerId = ReadConsumerId(dataIn); + info.TransactionId = (TransactionId) CommandMarshallerRegistry.TransactionIdMarshaller.ReadCommand(dataIn); + info.ConsumerId = (ConsumerId) CommandMarshallerRegistry.ConsumerIdMarshaller.ReadCommand(dataIn); info.AckType = dataIn.ReadByte(); - info.FirstMessageId = ReadMessageId(dataIn); - info.LastMessageId = ReadMessageId(dataIn); + info.FirstMessageId = (MessageId) CommandMarshallerRegistry.MessageIdMarshaller.ReadCommand(dataIn); + info.LastMessageId = (MessageId) CommandMarshallerRegistry.MessageIdMarshaller.ReadCommand(dataIn); info.MessageCount = dataIn.ReadInt32(); } @@ -44,11 +44,11 @@ namespace OpenWire.Core.IO MessageAck info = (MessageAck) command; WriteDestination(info.Destination, dataOut); - WriteTransactionId(info.TransactionId, dataOut); - WriteConsumerId(info.ConsumerId, dataOut); + CommandMarshallerRegistry.TransactionIdMarshaller.WriteCommand(info.TransactionId, dataOut); + CommandMarshallerRegistry.ConsumerIdMarshaller.WriteCommand(info.ConsumerId, dataOut); dataOut.Write(info.AckType); - WriteMessageId(info.FirstMessageId, dataOut); - WriteMessageId(info.LastMessageId, dataOut); + CommandMarshallerRegistry.MessageIdMarshaller.WriteCommand(info.FirstMessageId, dataOut); + CommandMarshallerRegistry.MessageIdMarshaller.WriteCommand(info.LastMessageId, dataOut); dataOut.Write(info.MessageCount); } diff --git a/openwire-dotnet/src/OpenWire.Core/IO/MessageDispatchMarshaller.cs b/openwire-dotnet/src/OpenWire.Core/IO/MessageDispatchMarshaller.cs index 2d00dcc212..9e02c7170b 100644 --- a/openwire-dotnet/src/OpenWire.Core/IO/MessageDispatchMarshaller.cs +++ b/openwire-dotnet/src/OpenWire.Core/IO/MessageDispatchMarshaller.cs @@ -29,9 +29,9 @@ namespace OpenWire.Core.IO base.BuildCommand(command, dataIn); MessageDispatch info = (MessageDispatch) command; - info.ConsumerId = ReadConsumerId(dataIn); + info.ConsumerId = (ConsumerId) CommandMarshallerRegistry.ConsumerIdMarshaller.ReadCommand(dataIn); info.Destination = ReadDestination(dataIn); - info.Message = ReadMessage(dataIn); + info.Message = (Message) CommandMarshallerRegistry.MessageMarshaller.ReadCommand(dataIn); info.RedeliveryCounter = dataIn.ReadInt32(); } @@ -40,9 +40,9 @@ namespace OpenWire.Core.IO base.WriteCommand(command, dataOut); MessageDispatch info = (MessageDispatch) command; - WriteConsumerId(info.ConsumerId, dataOut); + CommandMarshallerRegistry.ConsumerIdMarshaller.WriteCommand(info.ConsumerId, dataOut); WriteDestination(info.Destination, dataOut); - WriteMessage(info.Message, dataOut); + CommandMarshallerRegistry.MessageMarshaller.WriteCommand(info.Message, dataOut); dataOut.Write(info.RedeliveryCounter); } diff --git a/openwire-dotnet/src/OpenWire.Core/IO/MessageIdMarshaller.cs b/openwire-dotnet/src/OpenWire.Core/IO/MessageIdMarshaller.cs index b0647350ed..3ecdd4b572 100644 --- a/openwire-dotnet/src/OpenWire.Core/IO/MessageIdMarshaller.cs +++ b/openwire-dotnet/src/OpenWire.Core/IO/MessageIdMarshaller.cs @@ -29,7 +29,7 @@ namespace OpenWire.Core.IO base.BuildCommand(command, dataIn); MessageId info = (MessageId) command; - info.ProducerId = ReadProducerId(dataIn); + info.ProducerId = (ProducerId) CommandMarshallerRegistry.ProducerIdMarshaller.ReadCommand(dataIn); info.ProducerSequenceId = dataIn.ReadInt64(); info.BrokerSequenceId = dataIn.ReadInt64(); @@ -39,7 +39,7 @@ namespace OpenWire.Core.IO base.WriteCommand(command, dataOut); MessageId info = (MessageId) command; - WriteProducerId(info.ProducerId, dataOut); + CommandMarshallerRegistry.ProducerIdMarshaller.WriteCommand(info.ProducerId, dataOut); dataOut.Write(info.ProducerSequenceId); dataOut.Write(info.BrokerSequenceId); diff --git a/openwire-dotnet/src/OpenWire.Core/IO/MessageMarshaller.cs b/openwire-dotnet/src/OpenWire.Core/IO/MessageMarshaller.cs index e8e98b6a39..790bbcf050 100644 --- a/openwire-dotnet/src/OpenWire.Core/IO/MessageMarshaller.cs +++ b/openwire-dotnet/src/OpenWire.Core/IO/MessageMarshaller.cs @@ -29,12 +29,12 @@ namespace OpenWire.Core.IO base.BuildCommand(command, dataIn); Message info = (Message) command; - info.ProducerId = ReadProducerId(dataIn); + info.ProducerId = (ProducerId) CommandMarshallerRegistry.ProducerIdMarshaller.ReadCommand(dataIn); info.Destination = ReadDestination(dataIn); - info.TransactionId = ReadTransactionId(dataIn); + info.TransactionId = (TransactionId) CommandMarshallerRegistry.TransactionIdMarshaller.ReadCommand(dataIn); info.OriginalDestination = ReadDestination(dataIn); - info.MessageId = ReadMessageId(dataIn); - info.OriginalTransactionId = ReadTransactionId(dataIn); + info.MessageId = (MessageId) CommandMarshallerRegistry.MessageIdMarshaller.ReadCommand(dataIn); + info.OriginalTransactionId = (TransactionId) CommandMarshallerRegistry.TransactionIdMarshaller.ReadCommand(dataIn); info.GroupID = dataIn.ReadString(); info.GroupSequence = dataIn.ReadInt32(); info.CorrelationId = dataIn.ReadString(); @@ -44,10 +44,10 @@ namespace OpenWire.Core.IO info.ReplyTo = ReadDestination(dataIn); info.Timestamp = dataIn.ReadInt64(); info.Type = dataIn.ReadString(); - info.Content = ReadByteSequence(dataIn); - info.MarshalledProperties = ReadByteSequence(dataIn); - info.DataStructure = ReadDataStructure(dataIn); - info.TargetConsumerId = ReadConsumerId(dataIn); + info.Content = (ByteSequence) CommandMarshallerRegistry.ByteSequenceMarshaller.ReadCommand(dataIn); + info.MarshalledProperties = (ByteSequence) CommandMarshallerRegistry.ByteSequenceMarshaller.ReadCommand(dataIn); + info.DataStructure = (DataStructure) CommandMarshallerRegistry.DataStructureMarshaller.ReadCommand(dataIn); + info.TargetConsumerId = (ConsumerId) CommandMarshallerRegistry.ConsumerIdMarshaller.ReadCommand(dataIn); info.Compressed = dataIn.ReadBoolean(); info.RedeliveryCounter = dataIn.ReadInt32(); info.BrokerPath = ReadBrokerIds(dataIn); @@ -61,12 +61,12 @@ namespace OpenWire.Core.IO base.WriteCommand(command, dataOut); Message info = (Message) command; - WriteProducerId(info.ProducerId, dataOut); + CommandMarshallerRegistry.ProducerIdMarshaller.WriteCommand(info.ProducerId, dataOut); WriteDestination(info.Destination, dataOut); - WriteTransactionId(info.TransactionId, dataOut); + CommandMarshallerRegistry.TransactionIdMarshaller.WriteCommand(info.TransactionId, dataOut); WriteDestination(info.OriginalDestination, dataOut); - WriteMessageId(info.MessageId, dataOut); - WriteTransactionId(info.OriginalTransactionId, dataOut); + CommandMarshallerRegistry.MessageIdMarshaller.WriteCommand(info.MessageId, dataOut); + CommandMarshallerRegistry.TransactionIdMarshaller.WriteCommand(info.OriginalTransactionId, dataOut); dataOut.Write(info.GroupID); dataOut.Write(info.GroupSequence); dataOut.Write(info.CorrelationId); @@ -76,13 +76,13 @@ namespace OpenWire.Core.IO WriteDestination(info.ReplyTo, dataOut); dataOut.Write(info.Timestamp); dataOut.Write(info.Type); - WriteByteSequence(info.Content, dataOut); - WriteByteSequence(info.MarshalledProperties, dataOut); - WriteDataStructure(info.DataStructure, dataOut); - WriteConsumerId(info.TargetConsumerId, dataOut); + CommandMarshallerRegistry.ByteSequenceMarshaller.WriteCommand(info.Content, dataOut); + CommandMarshallerRegistry.ByteSequenceMarshaller.WriteCommand(info.MarshalledProperties, dataOut); + CommandMarshallerRegistry.DataStructureMarshaller.WriteCommand(info.DataStructure, dataOut); + CommandMarshallerRegistry.ConsumerIdMarshaller.WriteCommand(info.TargetConsumerId, dataOut); dataOut.Write(info.Compressed); dataOut.Write(info.RedeliveryCounter); - dataOut.WriteBrokerIds(info.BrokerPath); + WriteBrokerIds(info.BrokerPath, dataOut); dataOut.Write(info.Arrival); dataOut.Write(info.UserID); dataOut.Write(info.RecievedByDFBridge); diff --git a/openwire-dotnet/src/OpenWire.Core/IO/ProducerInfoMarshaller.cs b/openwire-dotnet/src/OpenWire.Core/IO/ProducerInfoMarshaller.cs index b2c2e9882e..e03ddf4003 100644 --- a/openwire-dotnet/src/OpenWire.Core/IO/ProducerInfoMarshaller.cs +++ b/openwire-dotnet/src/OpenWire.Core/IO/ProducerInfoMarshaller.cs @@ -29,7 +29,7 @@ namespace OpenWire.Core.IO base.BuildCommand(command, dataIn); ProducerInfo info = (ProducerInfo) command; - info.ProducerId = ReadProducerId(dataIn); + info.ProducerId = (ProducerId) CommandMarshallerRegistry.ProducerIdMarshaller.ReadCommand(dataIn); info.Destination = ReadDestination(dataIn); info.BrokerPath = ReadBrokerIds(dataIn); @@ -39,9 +39,9 @@ namespace OpenWire.Core.IO base.WriteCommand(command, dataOut); ProducerInfo info = (ProducerInfo) command; - WriteProducerId(info.ProducerId, dataOut); + CommandMarshallerRegistry.ProducerIdMarshaller.WriteCommand(info.ProducerId, dataOut); WriteDestination(info.Destination, dataOut); - dataOut.WriteBrokerIds(info.BrokerPath); + WriteBrokerIds(info.BrokerPath, dataOut); } } diff --git a/openwire-dotnet/src/OpenWire.Core/IO/RemoveInfoMarshaller.cs b/openwire-dotnet/src/OpenWire.Core/IO/RemoveInfoMarshaller.cs index 9c892a06d0..4f18a6b8d2 100644 --- a/openwire-dotnet/src/OpenWire.Core/IO/RemoveInfoMarshaller.cs +++ b/openwire-dotnet/src/OpenWire.Core/IO/RemoveInfoMarshaller.cs @@ -29,7 +29,7 @@ namespace OpenWire.Core.IO base.BuildCommand(command, dataIn); RemoveInfo info = (RemoveInfo) command; - info.ObjectId = ReadDataStructure(dataIn); + info.ObjectId = (DataStructure) CommandMarshallerRegistry.DataStructureMarshaller.ReadCommand(dataIn); } @@ -37,7 +37,7 @@ namespace OpenWire.Core.IO base.WriteCommand(command, dataOut); RemoveInfo info = (RemoveInfo) command; - WriteDataStructure(info.ObjectId, dataOut); + CommandMarshallerRegistry.DataStructureMarshaller.WriteCommand(info.ObjectId, dataOut); } } diff --git a/openwire-dotnet/src/OpenWire.Core/IO/RemoveSubscriptionInfoMarshaller.cs b/openwire-dotnet/src/OpenWire.Core/IO/RemoveSubscriptionInfoMarshaller.cs index a4dbcc6055..430236d847 100644 --- a/openwire-dotnet/src/OpenWire.Core/IO/RemoveSubscriptionInfoMarshaller.cs +++ b/openwire-dotnet/src/OpenWire.Core/IO/RemoveSubscriptionInfoMarshaller.cs @@ -29,7 +29,7 @@ namespace OpenWire.Core.IO base.BuildCommand(command, dataIn); RemoveSubscriptionInfo info = (RemoveSubscriptionInfo) command; - info.ConnectionId = ReadConnectionId(dataIn); + info.ConnectionId = (ConnectionId) CommandMarshallerRegistry.ConnectionIdMarshaller.ReadCommand(dataIn); info.SubcriptionName = dataIn.ReadString(); info.ClientId = dataIn.ReadString(); @@ -39,7 +39,7 @@ namespace OpenWire.Core.IO base.WriteCommand(command, dataOut); RemoveSubscriptionInfo info = (RemoveSubscriptionInfo) command; - WriteConnectionId(info.ConnectionId, dataOut); + CommandMarshallerRegistry.ConnectionIdMarshaller.WriteCommand(info.ConnectionId, dataOut); dataOut.Write(info.SubcriptionName); dataOut.Write(info.ClientId); diff --git a/openwire-dotnet/src/OpenWire.Core/IO/SessionInfoMarshaller.cs b/openwire-dotnet/src/OpenWire.Core/IO/SessionInfoMarshaller.cs index fd62f9d78a..835fb7a8cb 100644 --- a/openwire-dotnet/src/OpenWire.Core/IO/SessionInfoMarshaller.cs +++ b/openwire-dotnet/src/OpenWire.Core/IO/SessionInfoMarshaller.cs @@ -29,7 +29,7 @@ namespace OpenWire.Core.IO base.BuildCommand(command, dataIn); SessionInfo info = (SessionInfo) command; - info.SessionId = ReadSessionId(dataIn); + info.SessionId = (SessionId) CommandMarshallerRegistry.SessionIdMarshaller.ReadCommand(dataIn); } @@ -37,7 +37,7 @@ namespace OpenWire.Core.IO base.WriteCommand(command, dataOut); SessionInfo info = (SessionInfo) command; - WriteSessionId(info.SessionId, dataOut); + CommandMarshallerRegistry.SessionIdMarshaller.WriteCommand(info.SessionId, dataOut); } } diff --git a/openwire-dotnet/src/OpenWire.Core/IO/TransactionInfoMarshaller.cs b/openwire-dotnet/src/OpenWire.Core/IO/TransactionInfoMarshaller.cs index b79c7ada33..8f8e656521 100644 --- a/openwire-dotnet/src/OpenWire.Core/IO/TransactionInfoMarshaller.cs +++ b/openwire-dotnet/src/OpenWire.Core/IO/TransactionInfoMarshaller.cs @@ -29,8 +29,8 @@ namespace OpenWire.Core.IO base.BuildCommand(command, dataIn); TransactionInfo info = (TransactionInfo) command; - info.ConnectionId = ReadConnectionId(dataIn); - info.TransactionId = ReadTransactionId(dataIn); + info.ConnectionId = (ConnectionId) CommandMarshallerRegistry.ConnectionIdMarshaller.ReadCommand(dataIn); + info.TransactionId = (TransactionId) CommandMarshallerRegistry.TransactionIdMarshaller.ReadCommand(dataIn); info.Type = dataIn.ReadByte(); } @@ -39,8 +39,8 @@ namespace OpenWire.Core.IO base.WriteCommand(command, dataOut); TransactionInfo info = (TransactionInfo) command; - WriteConnectionId(info.ConnectionId, dataOut); - WriteTransactionId(info.TransactionId, dataOut); + CommandMarshallerRegistry.ConnectionIdMarshaller.WriteCommand(info.ConnectionId, dataOut); + CommandMarshallerRegistry.TransactionIdMarshaller.WriteCommand(info.TransactionId, dataOut); dataOut.Write(info.Type); } diff --git a/openwire-dotnet/src/OpenWire.Core/IO/WireFormatInfoMarshaller.cs b/openwire-dotnet/src/OpenWire.Core/IO/WireFormatInfoMarshaller.cs index 1e07c9ea29..feb916b610 100644 --- a/openwire-dotnet/src/OpenWire.Core/IO/WireFormatInfoMarshaller.cs +++ b/openwire-dotnet/src/OpenWire.Core/IO/WireFormatInfoMarshaller.cs @@ -29,7 +29,7 @@ namespace OpenWire.Core.IO base.BuildCommand(command, dataIn); WireFormatInfo info = (WireFormatInfo) command; - info.Magic = Readbyte[](dataIn); + info.Magic = ReadBytes(dataIn); info.Version = dataIn.ReadInt32(); info.Options = dataIn.ReadInt32(); @@ -39,7 +39,7 @@ namespace OpenWire.Core.IO base.WriteCommand(command, dataOut); WireFormatInfo info = (WireFormatInfo) command; - Writebyte[](info.Magic, dataOut); + WriteBytes(info.Magic, dataOut); dataOut.Write(info.Version); dataOut.Write(info.Options); diff --git a/openwire-dotnet/src/OpenWire.Core/IO/XATransactionIdMarshaller.cs b/openwire-dotnet/src/OpenWire.Core/IO/XATransactionIdMarshaller.cs index bda7e9fd52..301a83b47a 100644 --- a/openwire-dotnet/src/OpenWire.Core/IO/XATransactionIdMarshaller.cs +++ b/openwire-dotnet/src/OpenWire.Core/IO/XATransactionIdMarshaller.cs @@ -30,8 +30,8 @@ namespace OpenWire.Core.IO XATransactionId info = (XATransactionId) command; info.FormatId = dataIn.ReadInt32(); - info.GlobalTransactionId = Readbyte[](dataIn); - info.BranchQualifier = Readbyte[](dataIn); + info.GlobalTransactionId = ReadBytes(dataIn); + info.BranchQualifier = ReadBytes(dataIn); } @@ -40,8 +40,8 @@ namespace OpenWire.Core.IO XATransactionId info = (XATransactionId) command; dataOut.Write(info.FormatId); - Writebyte[](info.GlobalTransactionId, dataOut); - Writebyte[](info.BranchQualifier, dataOut); + WriteBytes(info.GlobalTransactionId, dataOut); + WriteBytes(info.BranchQualifier, dataOut); } }