From d947dab3de62830cbfb41dc989ec7a5ff6af8f55 Mon Sep 17 00:00:00 2001 From: Aidan Skinner Date: Wed, 23 Apr 2008 23:50:34 +0000 Subject: Delete stuff that's just going to get synced from M2.x git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@651111 13f79535-47bb-0310-9956-ffa450edef68 --- dotnet/Qpid.Codec/CumulativeProtocolDecoder.cs | 152 -------- .../Demux/DemuxingProtocolCodecFactory.cs | 387 --------------------- dotnet/Qpid.Codec/Demux/IMessageDecoder.cs | 56 --- dotnet/Qpid.Codec/Demux/IMessageDecoderFactory.cs | 32 -- dotnet/Qpid.Codec/Demux/IMessageEncoder.cs | 48 --- dotnet/Qpid.Codec/Demux/IMessageEncoderFactory.cs | 32 -- dotnet/Qpid.Codec/Demux/MessageDecoderResult.cs | 29 -- dotnet/Qpid.Codec/IProtocolCodecFactory.cs | 37 -- dotnet/Qpid.Codec/IProtocolDecoder.cs | 41 --- dotnet/Qpid.Codec/IProtocolDecoderOutput.cs | 35 -- dotnet/Qpid.Codec/IProtocolEncoder.cs | 41 --- dotnet/Qpid.Codec/IProtocolEncoderOutput.cs | 37 -- dotnet/Qpid.Codec/Properties/AssemblyInfo.cs | 53 --- dotnet/Qpid.Codec/ProtocolCodecException.cs | 49 --- dotnet/Qpid.Codec/ProtocolDecoderException.cs | 70 ---- dotnet/Qpid.Codec/ProtocolEncoderException.cs | 49 --- dotnet/Qpid.Codec/Qpid.Codec.csproj | 73 ---- .../Support/SimpleProtocolDecoderOutput.cs | 44 --- .../Support/SimpleProtocolEncoderOutput.cs | 43 --- dotnet/Qpid.Codec/default.build | 26 -- 20 files changed, 1334 deletions(-) delete mode 100644 dotnet/Qpid.Codec/CumulativeProtocolDecoder.cs delete mode 100644 dotnet/Qpid.Codec/Demux/DemuxingProtocolCodecFactory.cs delete mode 100644 dotnet/Qpid.Codec/Demux/IMessageDecoder.cs delete mode 100644 dotnet/Qpid.Codec/Demux/IMessageDecoderFactory.cs delete mode 100644 dotnet/Qpid.Codec/Demux/IMessageEncoder.cs delete mode 100644 dotnet/Qpid.Codec/Demux/IMessageEncoderFactory.cs delete mode 100644 dotnet/Qpid.Codec/Demux/MessageDecoderResult.cs delete mode 100644 dotnet/Qpid.Codec/IProtocolCodecFactory.cs delete mode 100644 dotnet/Qpid.Codec/IProtocolDecoder.cs delete mode 100644 dotnet/Qpid.Codec/IProtocolDecoderOutput.cs delete mode 100644 dotnet/Qpid.Codec/IProtocolEncoder.cs delete mode 100644 dotnet/Qpid.Codec/IProtocolEncoderOutput.cs delete mode 100644 dotnet/Qpid.Codec/Properties/AssemblyInfo.cs delete mode 100644 dotnet/Qpid.Codec/ProtocolCodecException.cs delete mode 100644 dotnet/Qpid.Codec/ProtocolDecoderException.cs delete mode 100644 dotnet/Qpid.Codec/ProtocolEncoderException.cs delete mode 100644 dotnet/Qpid.Codec/Qpid.Codec.csproj delete mode 100644 dotnet/Qpid.Codec/Support/SimpleProtocolDecoderOutput.cs delete mode 100644 dotnet/Qpid.Codec/Support/SimpleProtocolEncoderOutput.cs delete mode 100644 dotnet/Qpid.Codec/default.build (limited to 'dotnet/Qpid.Codec') diff --git a/dotnet/Qpid.Codec/CumulativeProtocolDecoder.cs b/dotnet/Qpid.Codec/CumulativeProtocolDecoder.cs deleted file mode 100644 index 6cfd75c851..0000000000 --- a/dotnet/Qpid.Codec/CumulativeProtocolDecoder.cs +++ /dev/null @@ -1,152 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ -using System; -using log4net; -using Apache.Qpid.Buffer; - -namespace Apache.Qpid.Codec -{ - public abstract class CumulativeProtocolDecoder : IProtocolDecoder - { - static ILog _logger = LogManager.GetLogger(typeof(CumulativeProtocolDecoder)); - - ByteBuffer _remaining; - - /// - /// Creates a new instance with the 4096 bytes initial capacity of - /// cumulative buffer. - /// - protected CumulativeProtocolDecoder() - { - _remaining = AllocateBuffer(); - } - - /// - /// Cumulates content of in into internal buffer and forwards - /// decoding request to {@link #doDecode(IoSession, ByteBuffer, ProtocolDecoderOutput)}. - /// doDecode() is invoked repeatedly until it returns false - /// and the cumulative buffer is compacted after decoding ends. - /// - /// - /// if your doDecode() returned true not consuming the cumulative buffer. - /// - public void Decode(ByteBuffer input, IProtocolDecoderOutput output) - { - if ( _remaining.Position != 0 ) // If there were remaining undecoded bytes - { - DecodeRemainingAndInput(input, output); - } else - { - DecodeInput(input, output); - } - } - - private void DecodeInput(ByteBuffer input, IProtocolDecoderOutput output) - { - _logger.Debug(string.Format("DecodeInput: input {0}", input.Remaining)); - // Just decode the input buffer and remember any remaining undecoded bytes. - try - { - DecodeAll(input, output); - } finally - { - if ( input.HasRemaining ) - { - _remaining.Put(input); - } - } - } - - private void DecodeRemainingAndInput(ByteBuffer input, IProtocolDecoderOutput output) - { - _logger.Debug(string.Format("DecodeRemainingAndInput: input {0}, remaining {1}", input.Remaining, _remaining.Position)); - // replace the _remainder buffer, so that we can leave the - // original one alone. Necessary because some consumer splice - // the buffer and only consume it until later, causing - // a race condition if we compact it too soon. - ByteBuffer newRemainding = AllocateBuffer(); - ByteBuffer temp = _remaining; - _remaining = newRemainding; - temp.Put(input); - temp.Flip(); - try - { - DecodeAll(temp, output); - } finally - { - if ( temp.Remaining > 0 ) - _remaining.Put(temp); - } - } - - private void DecodeAll(ByteBuffer buf, IProtocolDecoderOutput output) - { - for ( ; ; ) - { - int oldPos = buf.Position; - bool decoded = DoDecode(buf, output); - if ( decoded ) - { - if ( buf.Position == oldPos ) - { - throw new Exception( - "doDecode() can't return true when buffer is not consumed."); - } - - if ( !buf.HasRemaining ) - { - break; - } - } else - { - break; - } - } - } - - /// - /// Implement this method to consume the specified cumulative buffer and - /// decode its content into message(s). - /// - /// the cumulative buffer - /// decoder output - /// - /// true if and only if there's more to decode in the buffer - /// and you want to have doDecode method invoked again. - /// Return false if remaining data is not enough to decode, - /// then this method will be invoked again when more data is cumulated. - /// - /// If cannot decode - protected abstract bool DoDecode(ByteBuffer input, IProtocolDecoderOutput output); - - public void Dispose() - { - _remaining = null; - } - - private ByteBuffer AllocateBuffer() - { - ByteBuffer buffer = ByteBuffer.Allocate(4096); - buffer.IsAutoExpand = true; - return buffer; - } - } -} diff --git a/dotnet/Qpid.Codec/Demux/DemuxingProtocolCodecFactory.cs b/dotnet/Qpid.Codec/Demux/DemuxingProtocolCodecFactory.cs deleted file mode 100644 index 78276202d6..0000000000 --- a/dotnet/Qpid.Codec/Demux/DemuxingProtocolCodecFactory.cs +++ /dev/null @@ -1,387 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ -using System; -using System.Collections; -using Apache.Qpid.Buffer; - -namespace Apache.Qpid.Codec.Demux -{ - public class DemuxingProtocolCodecFactory : IProtocolCodecFactory - { - private ArrayList _decoderFactories = new ArrayList(); - private ArrayList _encoderFactories = new ArrayList(); - - public void Register(Type encoderOrDecoderClass) - { - if (encoderOrDecoderClass == null) - { - throw new ArgumentNullException("encoderOrDecoderClass"); - } - - bool registered = false; - if (typeof(IMessageEncoder).IsAssignableFrom(encoderOrDecoderClass)) - { - Register(new DefaultConstructorMessageEncoderFactory(encoderOrDecoderClass)); - registered = true; - } - - if (typeof(IMessageDecoder).IsAssignableFrom(encoderOrDecoderClass)) - { - Register(new DefaultConstructorMessageDecoderFactory(encoderOrDecoderClass)); - registered = true; - } - - if (!registered) - { - throw new ArgumentException("Unregisterable type: " + encoderOrDecoderClass); - } - } - - public void Register(IMessageEncoder encoder) - { - Register(new SingletonMessageEncoderFactory(encoder)); - } - - public void Register(IMessageEncoderFactory factory) - { - if (factory == null) - { - throw new ArgumentNullException("factory"); - } - - _encoderFactories.Add(factory); - } - - public void Register(IMessageDecoder decoder) - { - Register(new SingletonMessageDecoderFactory(decoder)); - } - - public void Register(IMessageDecoderFactory factory) - { - if (factory == null) - { - throw new ArgumentNullException("factory"); - } - _decoderFactories.Add(factory); - } - - public IProtocolEncoder Encoder - { - get - { - return new ProtocolEncoderImpl(this); - } - } - - public IProtocolDecoder Decoder - { - get - { - return new ProtocolDecoderImpl(this); - } - } - - protected void DisposeCodecResources() - { - // Do nothing by default - } - - private class ProtocolEncoderImpl : IProtocolEncoder - { - private readonly Hashtable _encoders = new Hashtable(); - - private DemuxingProtocolCodecFactory _enclosing; - - public ProtocolEncoderImpl(DemuxingProtocolCodecFactory enclosing) - { - _enclosing = enclosing; - ArrayList encoderFactories = enclosing._encoderFactories; - for (int i = encoderFactories.Count - 1; i >= 0; i--) - { - IMessageEncoder encoder = ((IMessageEncoderFactory)encoderFactories[i]).NewEncoder(); - foreach (Type type in encoder.MessageTypes.Keys) - { - _encoders[type] = encoder; - } - } - } - - public void Encode(object message, IProtocolEncoderOutput output) - { - Type type = message.GetType(); - IMessageEncoder encoder = FindEncoder(type); - if (encoder == null) - { - throw new ProtocolEncoderException("Unexpected message type: " + type); - } - - encoder.Encode(message, output); - } - - private IMessageEncoder FindEncoder(Type type) - { - IMessageEncoder encoder = (IMessageEncoder)_encoders[type]; - if (encoder == null) - { - encoder = FindEncoder(type, new Hashtable()); - } - - return encoder; - } - - private IMessageEncoder FindEncoder(Type type, Hashtable triedClasses) - { - IMessageEncoder encoder; - - if (triedClasses.Contains(type)) - { - return null; - } - triedClasses[type] = 1; - - encoder = (IMessageEncoder)_encoders[type]; - if (encoder == null) - { - encoder = FindEncoder(type, triedClasses); - if (encoder != null) - { - return encoder; - } - - Type[] interfaces = type.GetInterfaces(); - for (int i = 0; i < interfaces.Length; i++) - { - encoder = FindEncoder(interfaces[i], triedClasses); - if (encoder != null) - { - return encoder; - } - } - - return null; - } - else - return encoder; - } - - public void Dispose() - { - _enclosing.DisposeCodecResources(); - } - } - - private class ProtocolDecoderImpl : CumulativeProtocolDecoder - { - private readonly IMessageDecoder[] _decoders; - private IMessageDecoder _currentDecoder; - private DemuxingProtocolCodecFactory _enclosing; - - public ProtocolDecoderImpl(DemuxingProtocolCodecFactory enclosing) - { - _enclosing = enclosing; - ArrayList decoderFactories = _enclosing._decoderFactories; - _decoders = new IMessageDecoder[decoderFactories.Count]; - for (int i = decoderFactories.Count - 1; i >= 0; i--) - { - _decoders[i] = ((IMessageDecoderFactory) decoderFactories[i]).NewDecoder(); - } - } - - protected override bool DoDecode(ByteBuffer input, IProtocolDecoderOutput output) - { - MessageDecoderResult result; - if (_currentDecoder == null) - { - IMessageDecoder[] decoders = _decoders; - int undecodables = 0; - - for (int i = decoders.Length - 1; i >= 0; i --) - { - IMessageDecoder decoder = decoders[i]; - int limit = input.Limit; - int pos = input.Position; - - try - { - result = decoder.Decodable(input); - } - finally - { - input.Position = pos; - input.Limit = limit; - } - - if (result == MessageDecoderResult.OK) - { - _currentDecoder = decoder; - break; - } - else if(result == MessageDecoderResult.NOT_OK) - { - undecodables ++; - } - else if (result != MessageDecoderResult.NEED_DATA) - { - throw new Exception("Unexpected decode result (see your decodable()): " + result); - } - } - - if (undecodables == _decoders.Length) - { - // Throw an exception if all decoders cannot decode data. - input.Position = input.Limit; // Skip data - throw new ProtocolDecoderException( - "No appropriate message decoder: " + input.GetHexDump()); - } - - if (_currentDecoder == null) - { - // Decoder is not determined yet (i.e. we need more data) - return false; - } - } - - result = _currentDecoder.Decode(input, output); - if (result == MessageDecoderResult.OK) - { - _currentDecoder = null; - return true; - } - else if (result == MessageDecoderResult.NEED_DATA) - { - return false; - } - else if (result == MessageDecoderResult.NOT_OK) - { - throw new ProtocolDecoderException("Message decoder returned NOT_OK."); - } - else - { - throw new Exception("Unexpected decode result (see your decode()): " + result); - } - } - } - - private class SingletonMessageEncoderFactory : IMessageEncoderFactory - { - private readonly IMessageEncoder _encoder; - - public SingletonMessageEncoderFactory(IMessageEncoder encoder) - { - if (encoder == null) - { - throw new ArgumentNullException("encoder"); - } - _encoder = encoder; - } - - public IMessageEncoder NewEncoder() - { - return _encoder; - } - } - - private class SingletonMessageDecoderFactory : IMessageDecoderFactory - { - private readonly IMessageDecoder _decoder; - - public SingletonMessageDecoderFactory(IMessageDecoder decoder) - { - if (decoder == null) - { - throw new ArgumentNullException("decoder"); - } - _decoder = decoder; - } - - public IMessageDecoder NewDecoder() - { - return _decoder; - } - } - - private class DefaultConstructorMessageEncoderFactory : IMessageEncoderFactory - { - private readonly Type _encoderClass; - - public DefaultConstructorMessageEncoderFactory(Type encoderClass) - { - if (encoderClass == null) - { - throw new ArgumentNullException("encoderClass"); - } - - if(!typeof(IMessageEncoder).IsAssignableFrom(encoderClass)) - { - throw new ArgumentException("encoderClass is not assignable to MessageEncoder"); - } - _encoderClass = encoderClass; - } - - public IMessageEncoder NewEncoder() - { - try - { - return (IMessageEncoder) Activator.CreateInstance(_encoderClass); - } - catch (Exception e) - { - throw new Exception( "Failed to create a new instance of " + _encoderClass, e); - } - } - } - - private class DefaultConstructorMessageDecoderFactory : IMessageDecoderFactory - { - private readonly Type _decoderClass; - - public DefaultConstructorMessageDecoderFactory(Type decoderClass) - { - if (decoderClass == null) - { - throw new ArgumentNullException("decoderClass"); - } - - if(!typeof(IMessageDecoder).IsAssignableFrom(decoderClass)) - { - throw new ArgumentException("decoderClass is not assignable to MessageDecoder"); - } - _decoderClass = decoderClass; - } - - public IMessageDecoder NewDecoder() - { - try - { - return (IMessageDecoder) Activator.CreateInstance(_decoderClass); - } - catch (Exception e) - { - throw new Exception("Failed to create a new instance of " + _decoderClass, e); - } - } - } - } -} - - - diff --git a/dotnet/Qpid.Codec/Demux/IMessageDecoder.cs b/dotnet/Qpid.Codec/Demux/IMessageDecoder.cs deleted file mode 100644 index 5892673440..0000000000 --- a/dotnet/Qpid.Codec/Demux/IMessageDecoder.cs +++ /dev/null @@ -1,56 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ -using System; -using Apache.Qpid.Buffer; - -namespace Apache.Qpid.Codec.Demux -{ - public interface IMessageDecoder - { - /// - /// Checks the specified buffer is decodable by this decoder. - /// - /// The buffer to read data from. - /// - /// OK if this decoder can decode the specified buffer. - /// NOT_OK if this decoder cannot decode the specified buffer. - /// if more data is required to determine if the - /// specified buffer is decodable ({@link #OK}) or not decodable - /// {@link #NOT_OK}. - MessageDecoderResult Decodable(ByteBuffer buffer); - - /// - /// Decodes binary or protocol-specific content into higher-level message objects. - /// MINA invokes {@link #decode(IoSession, ByteBuffer, ProtocolDecoderOutput)} - /// method with read data, and then the decoder implementation puts decoded - /// messages into {@link ProtocolDecoderOutput}. - /// - /// - /// {@link #OK} if you finished decoding messages successfully. - /// {@link #NEED_DATA} if you need more data to finish decoding current message. - /// {@link #NOT_OK} if you cannot decode current message due to protocol specification violation. - /// - /// if the read data violated protocol specification - MessageDecoderResult Decode(ByteBuffer buffer, IProtocolDecoderOutput output); - } -} - - diff --git a/dotnet/Qpid.Codec/Demux/IMessageDecoderFactory.cs b/dotnet/Qpid.Codec/Demux/IMessageDecoderFactory.cs deleted file mode 100644 index 9e333d670f..0000000000 --- a/dotnet/Qpid.Codec/Demux/IMessageDecoderFactory.cs +++ /dev/null @@ -1,32 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ -namespace Apache.Qpid.Codec.Demux -{ - public interface IMessageDecoderFactory - { - /// - /// Creates a new message decoder. - /// - IMessageDecoder NewDecoder(); - } -} - - diff --git a/dotnet/Qpid.Codec/Demux/IMessageEncoder.cs b/dotnet/Qpid.Codec/Demux/IMessageEncoder.cs deleted file mode 100644 index 75ae23592b..0000000000 --- a/dotnet/Qpid.Codec/Demux/IMessageEncoder.cs +++ /dev/null @@ -1,48 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ -using System; -using System.Collections; - -namespace Apache.Qpid.Codec.Demux -{ - public interface IMessageEncoder - { - /// - /// Returns the set of message classes this encoder can encode. - /// - Hashtable MessageTypes - { - get; - } - - /// - /// Encodes higher-level message objects into binary or protocol-specific data. - /// MINA invokes {@link #encode(IoSession, Object, ProtocolEncoderOutput)} - /// method with message which is popped from the session write queue, and then - /// the encoder implementation puts encoded {@link ByteBuffer}s into - /// {@link ProtocolEncoderOutput}. - /// - /// if the message violated protocol specification - void Encode(Object message, IProtocolEncoderOutput output); - } -} - - diff --git a/dotnet/Qpid.Codec/Demux/IMessageEncoderFactory.cs b/dotnet/Qpid.Codec/Demux/IMessageEncoderFactory.cs deleted file mode 100644 index 3001d1a963..0000000000 --- a/dotnet/Qpid.Codec/Demux/IMessageEncoderFactory.cs +++ /dev/null @@ -1,32 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ -namespace Apache.Qpid.Codec.Demux -{ - public interface IMessageEncoderFactory - { - /// - /// Creates a new message encoder. - /// - IMessageEncoder NewEncoder(); - } -} - - diff --git a/dotnet/Qpid.Codec/Demux/MessageDecoderResult.cs b/dotnet/Qpid.Codec/Demux/MessageDecoderResult.cs deleted file mode 100644 index ab01864bc0..0000000000 --- a/dotnet/Qpid.Codec/Demux/MessageDecoderResult.cs +++ /dev/null @@ -1,29 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ -namespace Apache.Qpid.Codec.Demux -{ - public enum MessageDecoderResult - { - OK, NOT_OK, NEED_DATA - } -} - - diff --git a/dotnet/Qpid.Codec/IProtocolCodecFactory.cs b/dotnet/Qpid.Codec/IProtocolCodecFactory.cs deleted file mode 100644 index a26b91b16c..0000000000 --- a/dotnet/Qpid.Codec/IProtocolCodecFactory.cs +++ /dev/null @@ -1,37 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ -namespace Apache.Qpid.Codec -{ - public interface IProtocolCodecFactory - { - IProtocolEncoder Encoder - { - get; - } - - IProtocolDecoder Decoder - { - get; - } - } -} - - diff --git a/dotnet/Qpid.Codec/IProtocolDecoder.cs b/dotnet/Qpid.Codec/IProtocolDecoder.cs deleted file mode 100644 index 3cccb0f7da..0000000000 --- a/dotnet/Qpid.Codec/IProtocolDecoder.cs +++ /dev/null @@ -1,41 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ -using System; -using Apache.Qpid.Buffer; - -namespace Apache.Qpid.Codec -{ - public interface IProtocolDecoder : IDisposable - { - /// - /// Decodes binary or protocol-specific content into higher-level message objects. - /// MINA invokes {@link #decode(IoSession, ByteBuffer, ProtocolDecoderOutput)} - /// method with read data, and then the decoder implementation puts decoded - /// messages into {@link ProtocolDecoderOutput}. - /// - /// - /// - /// if the read data violated protocol specification - void Decode(ByteBuffer input, IProtocolDecoderOutput output); - } -} - - diff --git a/dotnet/Qpid.Codec/IProtocolDecoderOutput.cs b/dotnet/Qpid.Codec/IProtocolDecoderOutput.cs deleted file mode 100644 index 77a1aea9db..0000000000 --- a/dotnet/Qpid.Codec/IProtocolDecoderOutput.cs +++ /dev/null @@ -1,35 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ -namespace Apache.Qpid.Codec -{ - public interface IProtocolDecoderOutput - { - /// - /// Callback for {@link ProtocolDecoder} to generate decoded messages. - /// {@link ProtocolDecoder} must call {@link #write(Object)} for each - /// decoded messages. - /// - /// the decoded message - void Write(object message); - } -} - - diff --git a/dotnet/Qpid.Codec/IProtocolEncoder.cs b/dotnet/Qpid.Codec/IProtocolEncoder.cs deleted file mode 100644 index a16f2ad9d6..0000000000 --- a/dotnet/Qpid.Codec/IProtocolEncoder.cs +++ /dev/null @@ -1,41 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ -using System; - -namespace Apache.Qpid.Codec -{ - public interface IProtocolEncoder : IDisposable - { - /// - /// Encodes higher-level message objects into binary or protocol-specific data. - /// MINA invokes {@link #encode(IoSession, Object, ProtocolEncoderOutput)} - /// method with message which is popped from the session write queue, and then - /// the encoder implementation puts encoded {@link ByteBuffer}s into - /// {@link ProtocolEncoderOutput}. - /// - /// - /// - /// if the message violated protocol specification - void Encode(Object message, IProtocolEncoderOutput output); - } -} - - diff --git a/dotnet/Qpid.Codec/IProtocolEncoderOutput.cs b/dotnet/Qpid.Codec/IProtocolEncoderOutput.cs deleted file mode 100644 index 70f9be38dc..0000000000 --- a/dotnet/Qpid.Codec/IProtocolEncoderOutput.cs +++ /dev/null @@ -1,37 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ -using Apache.Qpid.Buffer; - -namespace Apache.Qpid.Codec -{ - public interface IProtocolEncoderOutput - { - /// - /// Callback for {@link ProtocolEncoder} to generate encoded - /// {@link ByteBuffer}s. {@link ProtocolEncoder} must call - /// {@link #write(ByteBuffer)} for each decoded messages. - /// - /// the buffer which contains encoded data - void Write(ByteBuffer buf); - } -} - - diff --git a/dotnet/Qpid.Codec/Properties/AssemblyInfo.cs b/dotnet/Qpid.Codec/Properties/AssemblyInfo.cs deleted file mode 100644 index aa1d6a662e..0000000000 --- a/dotnet/Qpid.Codec/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,53 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ -using System.Reflection; -using System.Runtime.InteropServices; -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("Apache.Qpid.Codec")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("Apache Qpid")] -[assembly: AssemblyProduct("Apache.Qpid.Codec")] -[assembly: AssemblyCopyright("Copyright (c) 2006 The Apache Software Foundation")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("8bfe84f8-cd88-48f7-b0d2-0010411a14e5")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Revision and Build Numbers -// by using the '*' as shown below: -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/dotnet/Qpid.Codec/ProtocolCodecException.cs b/dotnet/Qpid.Codec/ProtocolCodecException.cs deleted file mode 100644 index 49678d2c11..0000000000 --- a/dotnet/Qpid.Codec/ProtocolCodecException.cs +++ /dev/null @@ -1,49 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ -using System; -using System.Runtime.Serialization; - -namespace Apache.Qpid.Codec -{ - [Serializable] - public class ProtocolCodecException : Exception - { - public ProtocolCodecException() : base() - { - } - - public ProtocolCodecException(string message) : base(message) - { - } - - public ProtocolCodecException(Exception cause) : base("Codec Exception", cause) - { - } - - protected ProtocolCodecException(SerializationInfo info, StreamingContext ctxt) - : base(info, ctxt) - { - } - } -} - - - diff --git a/dotnet/Qpid.Codec/ProtocolDecoderException.cs b/dotnet/Qpid.Codec/ProtocolDecoderException.cs deleted file mode 100644 index 8e7e6da145..0000000000 --- a/dotnet/Qpid.Codec/ProtocolDecoderException.cs +++ /dev/null @@ -1,70 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ -using System; -using System.Runtime.Serialization; - -namespace Apache.Qpid.Codec -{ - [Serializable] - public class ProtocolDecoderException : ProtocolCodecException - { - private string _hexdump; - - public ProtocolDecoderException() : base() - { - } - - public ProtocolDecoderException(string message) : base(message) - { - } - - public ProtocolDecoderException(Exception cause) : base(cause) - { - } - - protected ProtocolDecoderException(SerializationInfo info, StreamingContext ctxt) - : base(info, ctxt) - { - _hexdump = info.GetString("HexDump"); - } - - public string HexDump - { - get - { - return _hexdump; - } - set - { - _hexdump = value; - } - } - - public override void GetObjectData(SerializationInfo info, StreamingContext context) - { - base.GetObjectData(info, context); - info.AddValue("HexDump", _hexdump); - } - } -} - - - diff --git a/dotnet/Qpid.Codec/ProtocolEncoderException.cs b/dotnet/Qpid.Codec/ProtocolEncoderException.cs deleted file mode 100644 index ac565a308b..0000000000 --- a/dotnet/Qpid.Codec/ProtocolEncoderException.cs +++ /dev/null @@ -1,49 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ -using System; -using System.Runtime.Serialization; - -namespace Apache.Qpid.Codec -{ - [Serializable] - public class ProtocolEncoderException : ProtocolCodecException - { - public ProtocolEncoderException() : base() - { - } - - public ProtocolEncoderException(string message) : base(message) - { - } - - public ProtocolEncoderException(Exception cause) : base(cause) - { - } - - protected ProtocolEncoderException(SerializationInfo info, StreamingContext ctxt) - : base(info, ctxt) - { - } - } -} - - - diff --git a/dotnet/Qpid.Codec/Qpid.Codec.csproj b/dotnet/Qpid.Codec/Qpid.Codec.csproj deleted file mode 100644 index ebe4681397..0000000000 --- a/dotnet/Qpid.Codec/Qpid.Codec.csproj +++ /dev/null @@ -1,73 +0,0 @@ - - - Debug - AnyCPU - 8.0.50727 - 2.0 - {22D0D0C2-77AF-4DE3-B456-7FF3893F9F88} - Library - Properties - Apache.Qpid.Codec - Apache.Qpid.Codec - - - true - full - false - ..\bin\net-2.0\debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - ..\bin\net-2.0\release\ - TRACE - prompt - 4 - - - - False - ..\Qpid.Common\lib\log4net\log4net.dll - - - - - - - - - - - - - - - - - - - - - - - - - - - - {44384DF2-B0A4-4580-BDBC-EE4BAA87D995} - Qpid.Buffer - - - - - diff --git a/dotnet/Qpid.Codec/Support/SimpleProtocolDecoderOutput.cs b/dotnet/Qpid.Codec/Support/SimpleProtocolDecoderOutput.cs deleted file mode 100644 index 0a4ff10ff0..0000000000 --- a/dotnet/Qpid.Codec/Support/SimpleProtocolDecoderOutput.cs +++ /dev/null @@ -1,44 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ -using System.Collections; - -namespace Apache.Qpid.Codec.Support -{ - public class SimpleProtocolDecoderOutput : IProtocolDecoderOutput - { - private readonly Queue _messageQueue = new Queue(); - - public Queue MessageQueue - { - get - { - return _messageQueue; - } - } - - public void Write(object message) - { - _messageQueue.Enqueue(message); - } - } -} - - diff --git a/dotnet/Qpid.Codec/Support/SimpleProtocolEncoderOutput.cs b/dotnet/Qpid.Codec/Support/SimpleProtocolEncoderOutput.cs deleted file mode 100644 index 2e4224ef98..0000000000 --- a/dotnet/Qpid.Codec/Support/SimpleProtocolEncoderOutput.cs +++ /dev/null @@ -1,43 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ -using System.Collections; -using Apache.Qpid.Buffer; - -namespace Apache.Qpid.Codec.Support -{ - public abstract class SimpleProtocolEncoderOutput : IProtocolEncoderOutput - { - private readonly Queue _bufferQueue = new Queue(); - - public Queue BufferQueue - { - get - { - return _bufferQueue; - } - } - - public void Write(ByteBuffer buf) - { - _bufferQueue.Enqueue(buf); - } - } -} diff --git a/dotnet/Qpid.Codec/default.build b/dotnet/Qpid.Codec/default.build deleted file mode 100644 index db9e8d1166..0000000000 --- a/dotnet/Qpid.Codec/default.build +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - - - -- cgit v1.2.1