qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rgodf...@apache.org
Subject svn commit: r1157566 [19/23] - in /qpid: branches/rg-amqp-1-0-sandbox/qpid/java/ branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-client/ branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-client/src/ branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-client/...
Date Sun, 14 Aug 2011 17:15:08 GMT
Added: qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/codec/DetachConstructor.java
URL: http://svn.apache.org/viewvc/qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/codec/DetachConstructor.java?rev=1157566&view=auto
==============================================================================
--- qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/codec/DetachConstructor.java (added)
+++ qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/codec/DetachConstructor.java Sun Aug 14 17:14:51 2011
@@ -0,0 +1,153 @@
+
+/*
+*
+* 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.
+*
+*/
+
+
+package org.apache.qpid.amqp_1_0.type.transport.codec;
+
+import org.apache.qpid.amqp_1_0.codec.DescribedTypeConstructor;
+import org.apache.qpid.amqp_1_0.codec.DescribedTypeConstructorRegistry;
+import org.apache.qpid.amqp_1_0.type.*;
+import org.apache.qpid.amqp_1_0.type.transport.*;
+import org.apache.qpid.amqp_1_0.type.transport.Detach;
+
+
+import java.util.List;
+
+public class DetachConstructor extends DescribedTypeConstructor<Detach>
+{
+    private static final Object[] DESCRIPTORS =
+    {
+            Symbol.valueOf("apache.qpid.amqp_1_0:detach:list"),UnsignedLong.valueOf(0x0000000000000016L),
+    };
+
+    private static final DetachConstructor INSTANCE = new DetachConstructor();
+
+    public static void register(DescribedTypeConstructorRegistry registry)
+    {
+        for(Object descriptor : DESCRIPTORS)
+        {
+            registry.register(descriptor, INSTANCE);
+        }
+    }
+
+    public Detach construct(Object underlying)
+    {
+        if(underlying instanceof List)
+        {
+            List list = (List) underlying;
+            Detach obj = new Detach();
+            int position = 0;
+            final int size = list.size();
+
+            if(position < size)
+            {
+                Object val = list.get(position);
+                position++;
+
+                if(val != null)
+                {
+
+                    try
+                    {
+                        obj.setHandle( (UnsignedInteger) val );
+                    }
+                    catch(ClassCastException e)
+                    {
+
+                        // TODO Error
+                    }
+
+                }
+
+
+            }
+            else
+            {
+                return obj;
+            }
+
+            if(position < size)
+            {
+                Object val = list.get(position);
+                position++;
+
+                if(val != null)
+                {
+
+                    try
+                    {
+                        obj.setClosed( (Boolean) val );
+                    }
+                    catch(ClassCastException e)
+                    {
+
+                        // TODO Error
+                    }
+
+                }
+
+
+            }
+            else
+            {
+                return obj;
+            }
+
+            if(position < size)
+            {
+                Object val = list.get(position);
+                position++;
+
+                if(val != null)
+                {
+
+                    try
+                    {
+                        obj.setError( (org.apache.qpid.amqp_1_0.type.transport.Error) val );
+                    }
+                    catch(ClassCastException e)
+                    {
+
+                        // TODO Error
+                    }
+
+                }
+
+
+            }
+            else
+            {
+                return obj;
+            }
+
+
+            return obj;
+        }
+        else
+        {
+            // TODO - error
+            return null;
+        }
+    }
+
+
+}

Added: qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/codec/DetachWriter.java
URL: http://svn.apache.org/viewvc/qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/codec/DetachWriter.java?rev=1157566&view=auto
==============================================================================
--- qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/codec/DetachWriter.java (added)
+++ qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/codec/DetachWriter.java Sun Aug 14 17:14:51 2011
@@ -0,0 +1,166 @@
+
+/*
+*
+* 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.
+*
+*/
+
+
+package org.apache.qpid.amqp_1_0.type.transport.codec;
+
+import org.apache.qpid.amqp_1_0.codec.AbstractDescribedTypeWriter;
+import org.apache.qpid.amqp_1_0.codec.AbstractListWriter;
+import org.apache.qpid.amqp_1_0.codec.ValueWriter;
+
+import org.apache.qpid.amqp_1_0.type.UnsignedLong;
+import org.apache.qpid.amqp_1_0.type.transport.Detach;
+
+public class DetachWriter extends AbstractDescribedTypeWriter<Detach>
+{
+    private Detach _value;
+    private int _count = -1;
+
+    public DetachWriter(final Registry registry)
+    {
+        super(registry);
+    }
+
+    @Override
+    protected void onSetValue(final Detach value)
+    {
+        _value = value;
+        _count = calculateCount();
+    }
+
+    private int calculateCount()
+    {
+
+
+        if( _value.getError() != null)
+        {
+            return 3;
+        }
+
+        if( _value.getClosed() != null)
+        {
+            return 2;
+        }
+
+        if( _value.getHandle() != null)
+        {
+            return 1;
+        }
+
+        return 0;
+    }
+
+    @Override
+    protected void clear()
+    {
+        _value = null;
+        _count = -1;
+    }
+
+
+    protected Object getDescriptor()
+    {
+        return UnsignedLong.valueOf(0x0000000000000016L);
+    }
+
+    @Override
+    protected ValueWriter createDescribedWriter()
+    {
+        final Writer writer = new Writer(getRegistry());
+        writer.setValue(_value);
+        return writer;
+    }
+
+    private class Writer extends AbstractListWriter<Detach>
+    {
+        private int _field;
+
+        public Writer(final Registry registry)
+        {
+            super(registry);
+        }
+
+        @Override
+        protected void onSetValue(final Detach value)
+        {
+            reset();
+        }
+
+        @Override
+        protected int getCount()
+        {
+            return _count;
+        }
+
+        @Override
+        protected boolean hasNext()
+        {
+            return _field < _count;
+        }
+
+        @Override
+        protected Object next()
+        {
+            switch(_field++)
+            {
+
+                case 0:
+                    return _value.getHandle();
+
+                case 1:
+                    return _value.getClosed();
+
+                case 2:
+                    return _value.getError();
+
+                default:
+                    return null;
+            }
+        }
+
+        @Override
+        protected void clear()
+        {
+        }
+
+        @Override
+        protected void reset()
+        {
+            _field = 0;
+        }
+    }
+
+    private static Factory<Detach> FACTORY = new Factory<Detach>()
+    {
+
+        public ValueWriter<Detach> newInstance(Registry registry)
+        {
+            return new DetachWriter(registry);
+        }
+    };
+
+    public static void register(ValueWriter.Registry registry)
+    {
+        registry.register(Detach.class, FACTORY);
+    }
+
+}

Added: qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/codec/DispositionConstructor.java
URL: http://svn.apache.org/viewvc/qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/codec/DispositionConstructor.java?rev=1157566&view=auto
==============================================================================
--- qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/codec/DispositionConstructor.java (added)
+++ qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/codec/DispositionConstructor.java Sun Aug 14 17:14:51 2011
@@ -0,0 +1,234 @@
+
+/*
+*
+* 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.
+*
+*/
+
+
+package org.apache.qpid.amqp_1_0.type.transport.codec;
+
+import org.apache.qpid.amqp_1_0.codec.DescribedTypeConstructor;
+import org.apache.qpid.amqp_1_0.codec.DescribedTypeConstructorRegistry;
+import org.apache.qpid.amqp_1_0.type.*;
+import org.apache.qpid.amqp_1_0.type.transport.*;
+import org.apache.qpid.amqp_1_0.type.transport.Disposition;
+
+
+import java.util.List;
+
+public class DispositionConstructor extends DescribedTypeConstructor<Disposition>
+{
+    private static final Object[] DESCRIPTORS =
+    {
+            Symbol.valueOf("apache.qpid.amqp_1_0:disposition:list"),UnsignedLong.valueOf(0x0000000000000015L),
+    };
+
+    private static final DispositionConstructor INSTANCE = new DispositionConstructor();
+
+    public static void register(DescribedTypeConstructorRegistry registry)
+    {
+        for(Object descriptor : DESCRIPTORS)
+        {
+            registry.register(descriptor, INSTANCE);
+        }
+    }
+
+    public Disposition construct(Object underlying)
+    {
+        if(underlying instanceof List)
+        {
+            List list = (List) underlying;
+            Disposition obj = new Disposition();
+            int position = 0;
+            final int size = list.size();
+
+            if(position < size)
+            {
+                Object val = list.get(position);
+                position++;
+
+                if(val != null)
+                {
+
+                    try
+                    {
+                        obj.setRole( Role.valueOf( val ) );
+                    }
+                    catch(ClassCastException e)
+                    {
+
+                        // TODO Error
+                    }
+
+                }
+
+
+            }
+            else
+            {
+                return obj;
+            }
+
+            if(position < size)
+            {
+                Object val = list.get(position);
+                position++;
+
+                if(val != null)
+                {
+
+                    try
+                    {
+                        obj.setFirst( (UnsignedInteger) val );
+                    }
+                    catch(ClassCastException e)
+                    {
+
+                        // TODO Error
+                    }
+
+                }
+
+
+            }
+            else
+            {
+                return obj;
+            }
+
+            if(position < size)
+            {
+                Object val = list.get(position);
+                position++;
+
+                if(val != null)
+                {
+
+                    try
+                    {
+                        obj.setLast( (UnsignedInteger) val );
+                    }
+                    catch(ClassCastException e)
+                    {
+
+                        // TODO Error
+                    }
+
+                }
+
+
+            }
+            else
+            {
+                return obj;
+            }
+
+            if(position < size)
+            {
+                Object val = list.get(position);
+                position++;
+
+                if(val != null)
+                {
+
+                    try
+                    {
+                        obj.setSettled( (Boolean) val );
+                    }
+                    catch(ClassCastException e)
+                    {
+
+                        // TODO Error
+                    }
+
+                }
+
+
+            }
+            else
+            {
+                return obj;
+            }
+
+            if(position < size)
+            {
+                Object val = list.get(position);
+                position++;
+
+                if(val != null)
+                {
+
+                    try
+                    {
+                        obj.setState( (DeliveryState) val );
+                    }
+                    catch(ClassCastException e)
+                    {
+
+                        // TODO Error
+                    }
+
+                }
+
+
+            }
+            else
+            {
+                return obj;
+            }
+
+            if(position < size)
+            {
+                Object val = list.get(position);
+                position++;
+
+                if(val != null)
+                {
+
+                    try
+                    {
+                        obj.setBatchable( (Boolean) val );
+                    }
+                    catch(ClassCastException e)
+                    {
+
+                        // TODO Error
+                    }
+
+                }
+
+
+            }
+            else
+            {
+                return obj;
+            }
+
+
+            return obj;
+        }
+        else
+        {
+            // TODO - error
+            return null;
+        }
+    }
+
+
+}

Added: qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/codec/DispositionWriter.java
URL: http://svn.apache.org/viewvc/qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/codec/DispositionWriter.java?rev=1157566&view=auto
==============================================================================
--- qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/codec/DispositionWriter.java (added)
+++ qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/codec/DispositionWriter.java Sun Aug 14 17:14:51 2011
@@ -0,0 +1,190 @@
+
+/*
+*
+* 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.
+*
+*/
+
+
+package org.apache.qpid.amqp_1_0.type.transport.codec;
+
+import org.apache.qpid.amqp_1_0.codec.AbstractDescribedTypeWriter;
+import org.apache.qpid.amqp_1_0.codec.AbstractListWriter;
+import org.apache.qpid.amqp_1_0.codec.ValueWriter;
+
+import org.apache.qpid.amqp_1_0.type.UnsignedLong;
+import org.apache.qpid.amqp_1_0.type.transport.Disposition;
+
+public class DispositionWriter extends AbstractDescribedTypeWriter<Disposition>
+{
+    private Disposition _value;
+    private int _count = -1;
+
+    public DispositionWriter(final Registry registry)
+    {
+        super(registry);
+    }
+
+    @Override
+    protected void onSetValue(final Disposition value)
+    {
+        _value = value;
+        _count = calculateCount();
+    }
+
+    private int calculateCount()
+    {
+
+
+        if( _value.getBatchable() != null)
+        {
+            return 6;
+        }
+
+        if( _value.getState() != null)
+        {
+            return 5;
+        }
+
+        if( _value.getSettled() != null)
+        {
+            return 4;
+        }
+
+        if( _value.getLast() != null)
+        {
+            return 3;
+        }
+
+        if( _value.getFirst() != null)
+        {
+            return 2;
+        }
+
+        if( _value.getRole() != null)
+        {
+            return 1;
+        }
+
+        return 0;
+    }
+
+    @Override
+    protected void clear()
+    {
+        _value = null;
+        _count = -1;
+    }
+
+
+    protected Object getDescriptor()
+    {
+        return UnsignedLong.valueOf(0x0000000000000015L);
+    }
+
+    @Override
+    protected ValueWriter createDescribedWriter()
+    {
+        final Writer writer = new Writer(getRegistry());
+        writer.setValue(_value);
+        return writer;
+    }
+
+    private class Writer extends AbstractListWriter<Disposition>
+    {
+        private int _field;
+
+        public Writer(final Registry registry)
+        {
+            super(registry);
+        }
+
+        @Override
+        protected void onSetValue(final Disposition value)
+        {
+            reset();
+        }
+
+        @Override
+        protected int getCount()
+        {
+            return _count;
+        }
+
+        @Override
+        protected boolean hasNext()
+        {
+            return _field < _count;
+        }
+
+        @Override
+        protected Object next()
+        {
+            switch(_field++)
+            {
+
+                case 0:
+                    return _value.getRole();
+
+                case 1:
+                    return _value.getFirst();
+
+                case 2:
+                    return _value.getLast();
+
+                case 3:
+                    return _value.getSettled();
+
+                case 4:
+                    return _value.getState();
+
+                case 5:
+                    return _value.getBatchable();
+
+                default:
+                    return null;
+            }
+        }
+
+        @Override
+        protected void clear()
+        {
+        }
+
+        @Override
+        protected void reset()
+        {
+            _field = 0;
+        }
+    }
+
+    private static Factory<Disposition> FACTORY = new Factory<Disposition>()
+    {
+
+        public ValueWriter<Disposition> newInstance(Registry registry)
+        {
+            return new DispositionWriter(registry);
+        }
+    };
+
+    public static void register(ValueWriter.Registry registry)
+    {
+        registry.register(Disposition.class, FACTORY);
+    }
+
+}

Added: qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/codec/EndConstructor.java
URL: http://svn.apache.org/viewvc/qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/codec/EndConstructor.java?rev=1157566&view=auto
==============================================================================
--- qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/codec/EndConstructor.java (added)
+++ qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/codec/EndConstructor.java Sun Aug 14 17:14:51 2011
@@ -0,0 +1,99 @@
+
+/*
+*
+* 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.
+*
+*/
+
+
+package org.apache.qpid.amqp_1_0.type.transport.codec;
+
+import org.apache.qpid.amqp_1_0.codec.DescribedTypeConstructor;
+import org.apache.qpid.amqp_1_0.codec.DescribedTypeConstructorRegistry;
+import org.apache.qpid.amqp_1_0.type.*;
+import org.apache.qpid.amqp_1_0.type.transport.*;
+import org.apache.qpid.amqp_1_0.type.transport.End;
+
+
+import java.util.List;
+
+public class EndConstructor extends DescribedTypeConstructor<End>
+{
+    private static final Object[] DESCRIPTORS =
+    {
+            Symbol.valueOf("apache.qpid.amqp_1_0:end:list"),UnsignedLong.valueOf(0x0000000000000017L),
+    };
+
+    private static final EndConstructor INSTANCE = new EndConstructor();
+
+    public static void register(DescribedTypeConstructorRegistry registry)
+    {
+        for(Object descriptor : DESCRIPTORS)
+        {
+            registry.register(descriptor, INSTANCE);
+        }
+    }
+
+    public End construct(Object underlying)
+    {
+        if(underlying instanceof List)
+        {
+            List list = (List) underlying;
+            End obj = new End();
+            int position = 0;
+            final int size = list.size();
+
+            if(position < size)
+            {
+                Object val = list.get(position);
+                position++;
+
+                if(val != null)
+                {
+
+                    try
+                    {
+                        obj.setError( (org.apache.qpid.amqp_1_0.type.transport.Error) val );
+                    }
+                    catch(ClassCastException e)
+                    {
+
+                        // TODO Error
+                    }
+
+                }
+
+
+            }
+            else
+            {
+                return obj;
+            }
+
+
+            return obj;
+        }
+        else
+        {
+            // TODO - error
+            return null;
+        }
+    }
+
+
+}

Added: qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/codec/EndWriter.java
URL: http://svn.apache.org/viewvc/qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/codec/EndWriter.java?rev=1157566&view=auto
==============================================================================
--- qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/codec/EndWriter.java (added)
+++ qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/codec/EndWriter.java Sun Aug 14 17:14:51 2011
@@ -0,0 +1,150 @@
+
+/*
+*
+* 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.
+*
+*/
+
+
+package org.apache.qpid.amqp_1_0.type.transport.codec;
+
+import org.apache.qpid.amqp_1_0.codec.AbstractDescribedTypeWriter;
+import org.apache.qpid.amqp_1_0.codec.AbstractListWriter;
+import org.apache.qpid.amqp_1_0.codec.ValueWriter;
+
+import org.apache.qpid.amqp_1_0.type.UnsignedLong;
+import org.apache.qpid.amqp_1_0.type.transport.End;
+
+public class EndWriter extends AbstractDescribedTypeWriter<End>
+{
+    private End _value;
+    private int _count = -1;
+
+    public EndWriter(final Registry registry)
+    {
+        super(registry);
+    }
+
+    @Override
+    protected void onSetValue(final End value)
+    {
+        _value = value;
+        _count = calculateCount();
+    }
+
+    private int calculateCount()
+    {
+
+
+        if( _value.getError() != null)
+        {
+            return 1;
+        }
+
+        return 0;
+    }
+
+    @Override
+    protected void clear()
+    {
+        _value = null;
+        _count = -1;
+    }
+
+
+    protected Object getDescriptor()
+    {
+        return UnsignedLong.valueOf(0x0000000000000017L);
+    }
+
+    @Override
+    protected ValueWriter createDescribedWriter()
+    {
+        final Writer writer = new Writer(getRegistry());
+        writer.setValue(_value);
+        return writer;
+    }
+
+    private class Writer extends AbstractListWriter<End>
+    {
+        private int _field;
+
+        public Writer(final Registry registry)
+        {
+            super(registry);
+        }
+
+        @Override
+        protected void onSetValue(final End value)
+        {
+            reset();
+        }
+
+        @Override
+        protected int getCount()
+        {
+            return _count;
+        }
+
+        @Override
+        protected boolean hasNext()
+        {
+            return _field < _count;
+        }
+
+        @Override
+        protected Object next()
+        {
+            switch(_field++)
+            {
+
+                case 0:
+                    return _value.getError();
+
+                default:
+                    return null;
+            }
+        }
+
+        @Override
+        protected void clear()
+        {
+        }
+
+        @Override
+        protected void reset()
+        {
+            _field = 0;
+        }
+    }
+
+    private static Factory<End> FACTORY = new Factory<End>()
+    {
+
+        public ValueWriter<End> newInstance(Registry registry)
+        {
+            return new EndWriter(registry);
+        }
+    };
+
+    public static void register(ValueWriter.Registry registry)
+    {
+        registry.register(End.class, FACTORY);
+    }
+
+}

Added: qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/codec/ErrorConstructor.java
URL: http://svn.apache.org/viewvc/qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/codec/ErrorConstructor.java?rev=1157566&view=auto
==============================================================================
--- qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/codec/ErrorConstructor.java (added)
+++ qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/codec/ErrorConstructor.java Sun Aug 14 17:14:51 2011
@@ -0,0 +1,153 @@
+
+/*
+*
+* 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.
+*
+*/
+
+
+package org.apache.qpid.amqp_1_0.type.transport.codec;
+
+import org.apache.qpid.amqp_1_0.codec.DescribedTypeConstructor;
+import org.apache.qpid.amqp_1_0.codec.DescribedTypeConstructorRegistry;
+import org.apache.qpid.amqp_1_0.type.*;
+import org.apache.qpid.amqp_1_0.type.transport.*;
+
+
+import java.util.List;
+import java.util.Map;
+
+public class ErrorConstructor extends DescribedTypeConstructor<org.apache.qpid.amqp_1_0.type.transport.Error>
+{
+    private static final Object[] DESCRIPTORS =
+    {
+            Symbol.valueOf("apache.qpid.amqp_1_0:error:list"),UnsignedLong.valueOf(0x000000000000001dL),
+    };
+
+    private static final ErrorConstructor INSTANCE = new ErrorConstructor();
+
+    public static void register(DescribedTypeConstructorRegistry registry)
+    {
+        for(Object descriptor : DESCRIPTORS)
+        {
+            registry.register(descriptor, INSTANCE);
+        }
+    }
+
+    public org.apache.qpid.amqp_1_0.type.transport.Error construct(Object underlying)
+    {
+        if(underlying instanceof List)
+        {
+            List list = (List) underlying;
+            org.apache.qpid.amqp_1_0.type.transport.Error obj = new org.apache.qpid.amqp_1_0.type.transport.Error();
+            int position = 0;
+            final int size = list.size();
+
+            if(position < size)
+            {
+                Object val = list.get(position);
+                position++;
+
+                if(val != null)
+                {
+
+                    try
+                    {
+                        obj.setCondition( (ErrorCondition) val );
+                    }
+                    catch(ClassCastException e)
+                    {
+
+                        // TODO Error
+                    }
+
+                }
+
+
+            }
+            else
+            {
+                return obj;
+            }
+
+            if(position < size)
+            {
+                Object val = list.get(position);
+                position++;
+
+                if(val != null)
+                {
+
+                    try
+                    {
+                        obj.setDescription( (String) val );
+                    }
+                    catch(ClassCastException e)
+                    {
+
+                        // TODO Error
+                    }
+
+                }
+
+
+            }
+            else
+            {
+                return obj;
+            }
+
+            if(position < size)
+            {
+                Object val = list.get(position);
+                position++;
+
+                if(val != null)
+                {
+
+                    try
+                    {
+                        obj.setInfo( (Map) val );
+                    }
+                    catch(ClassCastException e)
+                    {
+
+                        // TODO Error
+                    }
+
+                }
+
+
+            }
+            else
+            {
+                return obj;
+            }
+
+
+            return obj;
+        }
+        else
+        {
+            // TODO - error
+            return null;
+        }
+    }
+
+
+}

Added: qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/codec/ErrorWriter.java
URL: http://svn.apache.org/viewvc/qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/codec/ErrorWriter.java?rev=1157566&view=auto
==============================================================================
--- qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/codec/ErrorWriter.java (added)
+++ qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/codec/ErrorWriter.java Sun Aug 14 17:14:51 2011
@@ -0,0 +1,166 @@
+
+/*
+*
+* 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.
+*
+*/
+
+
+package org.apache.qpid.amqp_1_0.type.transport.codec;
+
+import org.apache.qpid.amqp_1_0.codec.AbstractDescribedTypeWriter;
+import org.apache.qpid.amqp_1_0.codec.AbstractListWriter;
+import org.apache.qpid.amqp_1_0.codec.ValueWriter;
+
+import org.apache.qpid.amqp_1_0.type.UnsignedLong;
+import org.apache.qpid.amqp_1_0.type.transport.Error;
+
+public class ErrorWriter extends AbstractDescribedTypeWriter<Error>
+{
+    private Error _value;
+    private int _count = -1;
+
+    public ErrorWriter(final Registry registry)
+    {
+        super(registry);
+    }
+
+    @Override
+    protected void onSetValue(final Error value)
+    {
+        _value = value;
+        _count = calculateCount();
+    }
+
+    private int calculateCount()
+    {
+
+
+        if( _value.getInfo() != null)
+        {
+            return 3;
+        }
+
+        if( _value.getDescription() != null)
+        {
+            return 2;
+        }
+
+        if( _value.getCondition() != null)
+        {
+            return 1;
+        }
+
+        return 0;
+    }
+
+    @Override
+    protected void clear()
+    {
+        _value = null;
+        _count = -1;
+    }
+
+
+    protected Object getDescriptor()
+    {
+        return UnsignedLong.valueOf(0x000000000000001dL);
+    }
+
+    @Override
+    protected ValueWriter createDescribedWriter()
+    {
+        final Writer writer = new Writer(getRegistry());
+        writer.setValue(_value);
+        return writer;
+    }
+
+    private class Writer extends AbstractListWriter<Error>
+    {
+        private int _field;
+
+        public Writer(final Registry registry)
+        {
+            super(registry);
+        }
+
+        @Override
+        protected void onSetValue(final Error value)
+        {
+            reset();
+        }
+
+        @Override
+        protected int getCount()
+        {
+            return _count;
+        }
+
+        @Override
+        protected boolean hasNext()
+        {
+            return _field < _count;
+        }
+
+        @Override
+        protected Object next()
+        {
+            switch(_field++)
+            {
+
+                case 0:
+                    return _value.getCondition();
+
+                case 1:
+                    return _value.getDescription();
+
+                case 2:
+                    return _value.getInfo();
+
+                default:
+                    return null;
+            }
+        }
+
+        @Override
+        protected void clear()
+        {
+        }
+
+        @Override
+        protected void reset()
+        {
+            _field = 0;
+        }
+    }
+
+    private static Factory<Error> FACTORY = new Factory<Error>()
+    {
+
+        public ValueWriter<Error> newInstance(Registry registry)
+        {
+            return new ErrorWriter(registry);
+        }
+    };
+
+    public static void register(ValueWriter.Registry registry)
+    {
+        registry.register(Error.class, FACTORY);
+    }
+
+}

Added: qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/codec/FlowConstructor.java
URL: http://svn.apache.org/viewvc/qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/codec/FlowConstructor.java?rev=1157566&view=auto
==============================================================================
--- qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/codec/FlowConstructor.java (added)
+++ qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/codec/FlowConstructor.java Sun Aug 14 17:14:51 2011
@@ -0,0 +1,370 @@
+
+/*
+*
+* 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.
+*
+*/
+
+
+package org.apache.qpid.amqp_1_0.type.transport.codec;
+
+import org.apache.qpid.amqp_1_0.codec.DescribedTypeConstructor;
+import org.apache.qpid.amqp_1_0.codec.DescribedTypeConstructorRegistry;
+import org.apache.qpid.amqp_1_0.type.*;
+import org.apache.qpid.amqp_1_0.type.transport.*;
+import org.apache.qpid.amqp_1_0.type.transport.Flow;
+
+
+import java.util.List;
+import java.util.Map;
+
+public class FlowConstructor extends DescribedTypeConstructor<Flow>
+{
+    private static final Object[] DESCRIPTORS =
+    {
+            Symbol.valueOf("apache.qpid.amqp_1_0:flow:list"),UnsignedLong.valueOf(0x0000000000000013L),
+    };
+
+    private static final FlowConstructor INSTANCE = new FlowConstructor();
+
+    public static void register(DescribedTypeConstructorRegistry registry)
+    {
+        for(Object descriptor : DESCRIPTORS)
+        {
+            registry.register(descriptor, INSTANCE);
+        }
+    }
+
+    public Flow construct(Object underlying)
+    {
+        if(underlying instanceof List)
+        {
+            List list = (List) underlying;
+            Flow obj = new Flow();
+            int position = 0;
+            final int size = list.size();
+
+            if(position < size)
+            {
+                Object val = list.get(position);
+                position++;
+
+                if(val != null)
+                {
+
+                    try
+                    {
+                        obj.setNextIncomingId( (UnsignedInteger) val );
+                    }
+                    catch(ClassCastException e)
+                    {
+
+                        // TODO Error
+                    }
+
+                }
+
+
+            }
+            else
+            {
+                return obj;
+            }
+
+            if(position < size)
+            {
+                Object val = list.get(position);
+                position++;
+
+                if(val != null)
+                {
+
+                    try
+                    {
+                        obj.setIncomingWindow( (UnsignedInteger) val );
+                    }
+                    catch(ClassCastException e)
+                    {
+
+                        // TODO Error
+                    }
+
+                }
+
+
+            }
+            else
+            {
+                return obj;
+            }
+
+            if(position < size)
+            {
+                Object val = list.get(position);
+                position++;
+
+                if(val != null)
+                {
+
+                    try
+                    {
+                        obj.setNextOutgoingId( (UnsignedInteger) val );
+                    }
+                    catch(ClassCastException e)
+                    {
+
+                        // TODO Error
+                    }
+
+                }
+
+
+            }
+            else
+            {
+                return obj;
+            }
+
+            if(position < size)
+            {
+                Object val = list.get(position);
+                position++;
+
+                if(val != null)
+                {
+
+                    try
+                    {
+                        obj.setOutgoingWindow( (UnsignedInteger) val );
+                    }
+                    catch(ClassCastException e)
+                    {
+
+                        // TODO Error
+                    }
+
+                }
+
+
+            }
+            else
+            {
+                return obj;
+            }
+
+            if(position < size)
+            {
+                Object val = list.get(position);
+                position++;
+
+                if(val != null)
+                {
+
+                    try
+                    {
+                        obj.setHandle( (UnsignedInteger) val );
+                    }
+                    catch(ClassCastException e)
+                    {
+
+                        // TODO Error
+                    }
+
+                }
+
+
+            }
+            else
+            {
+                return obj;
+            }
+
+            if(position < size)
+            {
+                Object val = list.get(position);
+                position++;
+
+                if(val != null)
+                {
+
+                    try
+                    {
+                        obj.setDeliveryCount( (UnsignedInteger) val );
+                    }
+                    catch(ClassCastException e)
+                    {
+
+                        // TODO Error
+                    }
+
+                }
+
+
+            }
+            else
+            {
+                return obj;
+            }
+
+            if(position < size)
+            {
+                Object val = list.get(position);
+                position++;
+
+                if(val != null)
+                {
+
+                    try
+                    {
+                        obj.setLinkCredit( (UnsignedInteger) val );
+                    }
+                    catch(ClassCastException e)
+                    {
+
+                        // TODO Error
+                    }
+
+                }
+
+
+            }
+            else
+            {
+                return obj;
+            }
+
+            if(position < size)
+            {
+                Object val = list.get(position);
+                position++;
+
+                if(val != null)
+                {
+
+                    try
+                    {
+                        obj.setAvailable( (UnsignedInteger) val );
+                    }
+                    catch(ClassCastException e)
+                    {
+
+                        // TODO Error
+                    }
+
+                }
+
+
+            }
+            else
+            {
+                return obj;
+            }
+
+            if(position < size)
+            {
+                Object val = list.get(position);
+                position++;
+
+                if(val != null)
+                {
+
+                    try
+                    {
+                        obj.setDrain( (Boolean) val );
+                    }
+                    catch(ClassCastException e)
+                    {
+
+                        // TODO Error
+                    }
+
+                }
+
+
+            }
+            else
+            {
+                return obj;
+            }
+
+            if(position < size)
+            {
+                Object val = list.get(position);
+                position++;
+
+                if(val != null)
+                {
+
+                    try
+                    {
+                        obj.setEcho( (Boolean) val );
+                    }
+                    catch(ClassCastException e)
+                    {
+
+                        // TODO Error
+                    }
+
+                }
+
+
+            }
+            else
+            {
+                return obj;
+            }
+
+            if(position < size)
+            {
+                Object val = list.get(position);
+                position++;
+
+                if(val != null)
+                {
+
+                    try
+                    {
+                        obj.setProperties( (Map) val );
+                    }
+                    catch(ClassCastException e)
+                    {
+
+                        // TODO Error
+                    }
+
+                }
+
+
+            }
+            else
+            {
+                return obj;
+            }
+
+
+            return obj;
+        }
+        else
+        {
+            // TODO - error
+            return null;
+        }
+    }
+
+
+}

Added: qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/codec/FlowWriter.java
URL: http://svn.apache.org/viewvc/qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/codec/FlowWriter.java?rev=1157566&view=auto
==============================================================================
--- qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/codec/FlowWriter.java (added)
+++ qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/codec/FlowWriter.java Sun Aug 14 17:14:51 2011
@@ -0,0 +1,230 @@
+
+/*
+*
+* 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.
+*
+*/
+
+
+package org.apache.qpid.amqp_1_0.type.transport.codec;
+
+import org.apache.qpid.amqp_1_0.codec.AbstractDescribedTypeWriter;
+import org.apache.qpid.amqp_1_0.codec.AbstractListWriter;
+import org.apache.qpid.amqp_1_0.codec.ValueWriter;
+
+import org.apache.qpid.amqp_1_0.type.UnsignedLong;
+import org.apache.qpid.amqp_1_0.type.transport.Flow;
+
+public class FlowWriter extends AbstractDescribedTypeWriter<Flow>
+{
+    private Flow _value;
+    private int _count = -1;
+
+    public FlowWriter(final Registry registry)
+    {
+        super(registry);
+    }
+
+    @Override
+    protected void onSetValue(final Flow value)
+    {
+        _value = value;
+        _count = calculateCount();
+    }
+
+    private int calculateCount()
+    {
+
+
+        if( _value.getProperties() != null)
+        {
+            return 11;
+        }
+
+        if( _value.getEcho() != null)
+        {
+            return 10;
+        }
+
+        if( _value.getDrain() != null)
+        {
+            return 9;
+        }
+
+        if( _value.getAvailable() != null)
+        {
+            return 8;
+        }
+
+        if( _value.getLinkCredit() != null)
+        {
+            return 7;
+        }
+
+        if( _value.getDeliveryCount() != null)
+        {
+            return 6;
+        }
+
+        if( _value.getHandle() != null)
+        {
+            return 5;
+        }
+
+        if( _value.getOutgoingWindow() != null)
+        {
+            return 4;
+        }
+
+        if( _value.getNextOutgoingId() != null)
+        {
+            return 3;
+        }
+
+        if( _value.getIncomingWindow() != null)
+        {
+            return 2;
+        }
+
+        if( _value.getNextIncomingId() != null)
+        {
+            return 1;
+        }
+
+        return 0;
+    }
+
+    @Override
+    protected void clear()
+    {
+        _value = null;
+        _count = -1;
+    }
+
+
+    protected Object getDescriptor()
+    {
+        return UnsignedLong.valueOf(0x0000000000000013L);
+    }
+
+    @Override
+    protected ValueWriter createDescribedWriter()
+    {
+        final Writer writer = new Writer(getRegistry());
+        writer.setValue(_value);
+        return writer;
+    }
+
+    private class Writer extends AbstractListWriter<Flow>
+    {
+        private int _field;
+
+        public Writer(final Registry registry)
+        {
+            super(registry);
+        }
+
+        @Override
+        protected void onSetValue(final Flow value)
+        {
+            reset();
+        }
+
+        @Override
+        protected int getCount()
+        {
+            return _count;
+        }
+
+        @Override
+        protected boolean hasNext()
+        {
+            return _field < _count;
+        }
+
+        @Override
+        protected Object next()
+        {
+            switch(_field++)
+            {
+
+                case 0:
+                    return _value.getNextIncomingId();
+
+                case 1:
+                    return _value.getIncomingWindow();
+
+                case 2:
+                    return _value.getNextOutgoingId();
+
+                case 3:
+                    return _value.getOutgoingWindow();
+
+                case 4:
+                    return _value.getHandle();
+
+                case 5:
+                    return _value.getDeliveryCount();
+
+                case 6:
+                    return _value.getLinkCredit();
+
+                case 7:
+                    return _value.getAvailable();
+
+                case 8:
+                    return _value.getDrain();
+
+                case 9:
+                    return _value.getEcho();
+
+                case 10:
+                    return _value.getProperties();
+
+                default:
+                    return null;
+            }
+        }
+
+        @Override
+        protected void clear()
+        {
+        }
+
+        @Override
+        protected void reset()
+        {
+            _field = 0;
+        }
+    }
+
+    private static Factory<Flow> FACTORY = new Factory<Flow>()
+    {
+
+        public ValueWriter<Flow> newInstance(Registry registry)
+        {
+            return new FlowWriter(registry);
+        }
+    };
+
+    public static void register(ValueWriter.Registry registry)
+    {
+        registry.register(Flow.class, FACTORY);
+    }
+
+}

Added: qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/codec/OpenConstructor.java
URL: http://svn.apache.org/viewvc/qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/codec/OpenConstructor.java?rev=1157566&view=auto
==============================================================================
--- qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/codec/OpenConstructor.java (added)
+++ qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/codec/OpenConstructor.java Sun Aug 14 17:14:51 2011
@@ -0,0 +1,371 @@
+
+/*
+*
+* 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.
+*
+*/
+
+
+package org.apache.qpid.amqp_1_0.type.transport.codec;
+
+import org.apache.qpid.amqp_1_0.codec.DescribedTypeConstructor;
+import org.apache.qpid.amqp_1_0.codec.DescribedTypeConstructorRegistry;
+import org.apache.qpid.amqp_1_0.type.*;
+import org.apache.qpid.amqp_1_0.type.transport.*;
+import org.apache.qpid.amqp_1_0.type.transport.Open;
+
+
+import java.util.List;
+import java.util.Map;
+
+public class OpenConstructor extends DescribedTypeConstructor<Open>
+{
+    private static final Object[] DESCRIPTORS =
+    {
+            Symbol.valueOf("apache.qpid.amqp_1_0:open:list"),UnsignedLong.valueOf(0x0000000000000010L),
+    };
+
+    private static final OpenConstructor INSTANCE = new OpenConstructor();
+
+    public static void register(DescribedTypeConstructorRegistry registry)
+    {
+        for(Object descriptor : DESCRIPTORS)
+        {
+            registry.register(descriptor, INSTANCE);
+        }
+    }
+
+    public Open construct(Object underlying)
+    {
+        if(underlying instanceof List)
+        {
+            List list = (List) underlying;
+            Open obj = new Open();
+            int position = 0;
+            final int size = list.size();
+
+            if(position < size)
+            {
+                Object val = list.get(position);
+                position++;
+
+                if(val != null)
+                {
+
+                    try
+                    {
+                        obj.setContainerId( (String) val );
+                    }
+                    catch(ClassCastException e)
+                    {
+
+                        // TODO Error
+                    }
+
+                }
+
+
+            }
+            else
+            {
+                return obj;
+            }
+
+            if(position < size)
+            {
+                Object val = list.get(position);
+                position++;
+
+                if(val != null)
+                {
+
+                    try
+                    {
+                        obj.setHostname( (String) val );
+                    }
+                    catch(ClassCastException e)
+                    {
+
+                        // TODO Error
+                    }
+
+                }
+
+
+            }
+            else
+            {
+                return obj;
+            }
+
+            if(position < size)
+            {
+                Object val = list.get(position);
+                position++;
+
+                if(val != null)
+                {
+
+                    try
+                    {
+                        obj.setMaxFrameSize( (UnsignedInteger) val );
+                    }
+                    catch(ClassCastException e)
+                    {
+
+                        // TODO Error
+                    }
+
+                }
+
+
+            }
+            else
+            {
+                return obj;
+            }
+
+            if(position < size)
+            {
+                Object val = list.get(position);
+                position++;
+
+                if(val != null)
+                {
+
+                    try
+                    {
+                        obj.setChannelMax( (UnsignedShort) val );
+                    }
+                    catch(ClassCastException e)
+                    {
+
+                        // TODO Error
+                    }
+
+                }
+
+
+            }
+            else
+            {
+                return obj;
+            }
+
+            if(position < size)
+            {
+                Object val = list.get(position);
+                position++;
+
+                if(val != null)
+                {
+
+                    try
+                    {
+                        obj.setIdleTimeOut( (UnsignedInteger) val );
+                    }
+                    catch(ClassCastException e)
+                    {
+
+                        // TODO Error
+                    }
+
+                }
+
+
+            }
+            else
+            {
+                return obj;
+            }
+
+            if(position < size)
+            {
+                Object val = list.get(position);
+                position++;
+
+                if(val != null)
+                {
+
+
+                    if (val instanceof Symbol[] )
+                    {
+                        obj.setOutgoingLocales( (Symbol[]) val );
+                    }
+                    else
+		            {
+                        try
+                        {
+                            obj.setOutgoingLocales( new Symbol[] { (Symbol) val } );
+                        }
+                        catch(ClassCastException e)
+                        {
+                            // TODO Error
+                        }
+                    }
+                    
+                }
+
+
+            }
+            else
+            {
+                return obj;
+            }
+
+            if(position < size)
+            {
+                Object val = list.get(position);
+                position++;
+
+                if(val != null)
+                {
+
+
+                    if (val instanceof Symbol[] )
+                    {
+                        obj.setIncomingLocales( (Symbol[]) val );
+                    }
+                    else
+		            {
+                        try
+                        {
+                            obj.setIncomingLocales( new Symbol[] { (Symbol) val } );
+                        }
+                        catch(ClassCastException e)
+                        {
+                            // TODO Error
+                        }
+                    }
+                    
+                }
+
+
+            }
+            else
+            {
+                return obj;
+            }
+
+            if(position < size)
+            {
+                Object val = list.get(position);
+                position++;
+
+                if(val != null)
+                {
+
+
+                    if (val instanceof Symbol[] )
+                    {
+                        obj.setOfferedCapabilities( (Symbol[]) val );
+                    }
+                    else
+		            {
+                        try
+                        {
+                            obj.setOfferedCapabilities( new Symbol[] { (Symbol) val } );
+                        }
+                        catch(ClassCastException e)
+                        {
+                            // TODO Error
+                        }
+                    }
+                    
+                }
+
+
+            }
+            else
+            {
+                return obj;
+            }
+
+            if(position < size)
+            {
+                Object val = list.get(position);
+                position++;
+
+                if(val != null)
+                {
+
+
+                    if (val instanceof Symbol[] )
+                    {
+                        obj.setDesiredCapabilities( (Symbol[]) val );
+                    }
+                    else
+		            {
+                        try
+                        {
+                            obj.setDesiredCapabilities( new Symbol[] { (Symbol) val } );
+                        }
+                        catch(ClassCastException e)
+                        {
+                            // TODO Error
+                        }
+                    }
+                    
+                }
+
+
+            }
+            else
+            {
+                return obj;
+            }
+
+            if(position < size)
+            {
+                Object val = list.get(position);
+                position++;
+
+                if(val != null)
+                {
+
+                    try
+                    {
+                        obj.setProperties( (Map) val );
+                    }
+                    catch(ClassCastException e)
+                    {
+
+                        // TODO Error
+                    }
+
+                }
+
+
+            }
+            else
+            {
+                return obj;
+            }
+
+
+            return obj;
+        }
+        else
+        {
+            // TODO - error
+            return null;
+        }
+    }
+
+
+}

Added: qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/codec/OpenWriter.java
URL: http://svn.apache.org/viewvc/qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/codec/OpenWriter.java?rev=1157566&view=auto
==============================================================================
--- qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/codec/OpenWriter.java (added)
+++ qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/codec/OpenWriter.java Sun Aug 14 17:14:51 2011
@@ -0,0 +1,222 @@
+
+/*
+*
+* 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.
+*
+*/
+
+
+package org.apache.qpid.amqp_1_0.type.transport.codec;
+
+import org.apache.qpid.amqp_1_0.codec.AbstractDescribedTypeWriter;
+import org.apache.qpid.amqp_1_0.codec.AbstractListWriter;
+import org.apache.qpid.amqp_1_0.codec.ValueWriter;
+
+import org.apache.qpid.amqp_1_0.type.UnsignedLong;
+import org.apache.qpid.amqp_1_0.type.transport.Open;
+
+public class OpenWriter extends AbstractDescribedTypeWriter<Open>
+{
+    private Open _value;
+    private int _count = -1;
+
+    public OpenWriter(final Registry registry)
+    {
+        super(registry);
+    }
+
+    @Override
+    protected void onSetValue(final Open value)
+    {
+        _value = value;
+        _count = calculateCount();
+    }
+
+    private int calculateCount()
+    {
+
+
+        if( _value.getProperties() != null)
+        {
+            return 10;
+        }
+
+        if( _value.getDesiredCapabilities() != null)
+        {
+            return 9;
+        }
+
+        if( _value.getOfferedCapabilities() != null)
+        {
+            return 8;
+        }
+
+        if( _value.getIncomingLocales() != null)
+        {
+            return 7;
+        }
+
+        if( _value.getOutgoingLocales() != null)
+        {
+            return 6;
+        }
+
+        if( _value.getIdleTimeOut() != null)
+        {
+            return 5;
+        }
+
+        if( _value.getChannelMax() != null)
+        {
+            return 4;
+        }
+
+        if( _value.getMaxFrameSize() != null)
+        {
+            return 3;
+        }
+
+        if( _value.getHostname() != null)
+        {
+            return 2;
+        }
+
+        if( _value.getContainerId() != null)
+        {
+            return 1;
+        }
+
+        return 0;
+    }
+
+    @Override
+    protected void clear()
+    {
+        _value = null;
+        _count = -1;
+    }
+
+
+    protected Object getDescriptor()
+    {
+        return UnsignedLong.valueOf(0x0000000000000010L);
+    }
+
+    @Override
+    protected ValueWriter createDescribedWriter()
+    {
+        final Writer writer = new Writer(getRegistry());
+        writer.setValue(_value);
+        return writer;
+    }
+
+    private class Writer extends AbstractListWriter<Open>
+    {
+        private int _field;
+
+        public Writer(final Registry registry)
+        {
+            super(registry);
+        }
+
+        @Override
+        protected void onSetValue(final Open value)
+        {
+            reset();
+        }
+
+        @Override
+        protected int getCount()
+        {
+            return _count;
+        }
+
+        @Override
+        protected boolean hasNext()
+        {
+            return _field < _count;
+        }
+
+        @Override
+        protected Object next()
+        {
+            switch(_field++)
+            {
+
+                case 0:
+                    return _value.getContainerId();
+
+                case 1:
+                    return _value.getHostname();
+
+                case 2:
+                    return _value.getMaxFrameSize();
+
+                case 3:
+                    return _value.getChannelMax();
+
+                case 4:
+                    return _value.getIdleTimeOut();
+
+                case 5:
+                    return _value.getOutgoingLocales();
+
+                case 6:
+                    return _value.getIncomingLocales();
+
+                case 7:
+                    return _value.getOfferedCapabilities();
+
+                case 8:
+                    return _value.getDesiredCapabilities();
+
+                case 9:
+                    return _value.getProperties();
+
+                default:
+                    return null;
+            }
+        }
+
+        @Override
+        protected void clear()
+        {
+        }
+
+        @Override
+        protected void reset()
+        {
+            _field = 0;
+        }
+    }
+
+    private static Factory<Open> FACTORY = new Factory<Open>()
+    {
+
+        public ValueWriter<Open> newInstance(Registry registry)
+        {
+            return new OpenWriter(registry);
+        }
+    };
+
+    public static void register(ValueWriter.Registry registry)
+    {
+        registry.register(Open.class, FACTORY);
+    }
+
+}

Added: qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/codec/TransferConstructor.java
URL: http://svn.apache.org/viewvc/qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/codec/TransferConstructor.java?rev=1157566&view=auto
==============================================================================
--- qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/codec/TransferConstructor.java (added)
+++ qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/codec/TransferConstructor.java Sun Aug 14 17:14:51 2011
@@ -0,0 +1,369 @@
+
+/*
+*
+* 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.
+*
+*/
+
+
+package org.apache.qpid.amqp_1_0.type.transport.codec;
+
+import org.apache.qpid.amqp_1_0.codec.DescribedTypeConstructor;
+import org.apache.qpid.amqp_1_0.codec.DescribedTypeConstructorRegistry;
+import org.apache.qpid.amqp_1_0.type.*;
+import org.apache.qpid.amqp_1_0.type.transport.*;
+import org.apache.qpid.amqp_1_0.type.transport.Transfer;
+
+
+import java.util.List;
+
+public class TransferConstructor extends DescribedTypeConstructor<Transfer>
+{
+    private static final Object[] DESCRIPTORS =
+    {
+            Symbol.valueOf("apache.qpid.amqp_1_0:transfer:list"),UnsignedLong.valueOf(0x0000000000000014L),
+    };
+
+    private static final TransferConstructor INSTANCE = new TransferConstructor();
+
+    public static void register(DescribedTypeConstructorRegistry registry)
+    {
+        for(Object descriptor : DESCRIPTORS)
+        {
+            registry.register(descriptor, INSTANCE);
+        }
+    }
+
+    public Transfer construct(Object underlying)
+    {
+        if(underlying instanceof List)
+        {
+            List list = (List) underlying;
+            Transfer obj = new Transfer();
+            int position = 0;
+            final int size = list.size();
+
+            if(position < size)
+            {
+                Object val = list.get(position);
+                position++;
+
+                if(val != null)
+                {
+
+                    try
+                    {
+                        obj.setHandle( (UnsignedInteger) val );
+                    }
+                    catch(ClassCastException e)
+                    {
+
+                        // TODO Error
+                    }
+
+                }
+
+
+            }
+            else
+            {
+                return obj;
+            }
+
+            if(position < size)
+            {
+                Object val = list.get(position);
+                position++;
+
+                if(val != null)
+                {
+
+                    try
+                    {
+                        obj.setDeliveryId( (UnsignedInteger) val );
+                    }
+                    catch(ClassCastException e)
+                    {
+
+                        // TODO Error
+                    }
+
+                }
+
+
+            }
+            else
+            {
+                return obj;
+            }
+
+            if(position < size)
+            {
+                Object val = list.get(position);
+                position++;
+
+                if(val != null)
+                {
+
+                    try
+                    {
+                        obj.setDeliveryTag( (Binary) val );
+                    }
+                    catch(ClassCastException e)
+                    {
+
+                        // TODO Error
+                    }
+
+                }
+
+
+            }
+            else
+            {
+                return obj;
+            }
+
+            if(position < size)
+            {
+                Object val = list.get(position);
+                position++;
+
+                if(val != null)
+                {
+
+                    try
+                    {
+                        obj.setMessageFormat( (UnsignedInteger) val );
+                    }
+                    catch(ClassCastException e)
+                    {
+
+                        // TODO Error
+                    }
+
+                }
+
+
+            }
+            else
+            {
+                return obj;
+            }
+
+            if(position < size)
+            {
+                Object val = list.get(position);
+                position++;
+
+                if(val != null)
+                {
+
+                    try
+                    {
+                        obj.setSettled( (Boolean) val );
+                    }
+                    catch(ClassCastException e)
+                    {
+
+                        // TODO Error
+                    }
+
+                }
+
+
+            }
+            else
+            {
+                return obj;
+            }
+
+            if(position < size)
+            {
+                Object val = list.get(position);
+                position++;
+
+                if(val != null)
+                {
+
+                    try
+                    {
+                        obj.setMore( (Boolean) val );
+                    }
+                    catch(ClassCastException e)
+                    {
+
+                        // TODO Error
+                    }
+
+                }
+
+
+            }
+            else
+            {
+                return obj;
+            }
+
+            if(position < size)
+            {
+                Object val = list.get(position);
+                position++;
+
+                if(val != null)
+                {
+
+                    try
+                    {
+                        obj.setRcvSettleMode( ReceiverSettleMode.valueOf( val ) );
+                    }
+                    catch(ClassCastException e)
+                    {
+
+                        // TODO Error
+                    }
+
+                }
+
+
+            }
+            else
+            {
+                return obj;
+            }
+
+            if(position < size)
+            {
+                Object val = list.get(position);
+                position++;
+
+                if(val != null)
+                {
+
+                    try
+                    {
+                        obj.setState( (DeliveryState) val );
+                    }
+                    catch(ClassCastException e)
+                    {
+
+                        // TODO Error
+                    }
+
+                }
+
+
+            }
+            else
+            {
+                return obj;
+            }
+
+            if(position < size)
+            {
+                Object val = list.get(position);
+                position++;
+
+                if(val != null)
+                {
+
+                    try
+                    {
+                        obj.setResume( (Boolean) val );
+                    }
+                    catch(ClassCastException e)
+                    {
+
+                        // TODO Error
+                    }
+
+                }
+
+
+            }
+            else
+            {
+                return obj;
+            }
+
+            if(position < size)
+            {
+                Object val = list.get(position);
+                position++;
+
+                if(val != null)
+                {
+
+                    try
+                    {
+                        obj.setAborted( (Boolean) val );
+                    }
+                    catch(ClassCastException e)
+                    {
+
+                        // TODO Error
+                    }
+
+                }
+
+
+            }
+            else
+            {
+                return obj;
+            }
+
+            if(position < size)
+            {
+                Object val = list.get(position);
+                position++;
+
+                if(val != null)
+                {
+
+                    try
+                    {
+                        obj.setBatchable( (Boolean) val );
+                    }
+                    catch(ClassCastException e)
+                    {
+
+                        // TODO Error
+                    }
+
+                }
+
+
+            }
+            else
+            {
+                return obj;
+            }
+
+
+            return obj;
+        }
+        else
+        {
+            // TODO - error
+            return null;
+        }
+    }
+
+
+}

Added: qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/codec/TransferWriter.java
URL: http://svn.apache.org/viewvc/qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/codec/TransferWriter.java?rev=1157566&view=auto
==============================================================================
--- qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/codec/TransferWriter.java (added)
+++ qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/codec/TransferWriter.java Sun Aug 14 17:14:51 2011
@@ -0,0 +1,230 @@
+
+/*
+*
+* 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.
+*
+*/
+
+
+package org.apache.qpid.amqp_1_0.type.transport.codec;
+
+import org.apache.qpid.amqp_1_0.codec.AbstractDescribedTypeWriter;
+import org.apache.qpid.amqp_1_0.codec.AbstractListWriter;
+import org.apache.qpid.amqp_1_0.codec.ValueWriter;
+
+import org.apache.qpid.amqp_1_0.type.UnsignedLong;
+import org.apache.qpid.amqp_1_0.type.transport.Transfer;
+
+public class TransferWriter extends AbstractDescribedTypeWriter<Transfer>
+{
+    private Transfer _value;
+    private int _count = -1;
+
+    public TransferWriter(final Registry registry)
+    {
+        super(registry);
+    }
+
+    @Override
+    protected void onSetValue(final Transfer value)
+    {
+        _value = value;
+        _count = calculateCount();
+    }
+
+    private int calculateCount()
+    {
+
+
+        if( _value.getBatchable() != null)
+        {
+            return 11;
+        }
+
+        if( _value.getAborted() != null)
+        {
+            return 10;
+        }
+
+        if( _value.getResume() != null)
+        {
+            return 9;
+        }
+
+        if( _value.getState() != null)
+        {
+            return 8;
+        }
+
+        if( _value.getRcvSettleMode() != null)
+        {
+            return 7;
+        }
+
+        if( _value.getMore() != null)
+        {
+            return 6;
+        }
+
+        if( _value.getSettled() != null)
+        {
+            return 5;
+        }
+
+        if( _value.getMessageFormat() != null)
+        {
+            return 4;
+        }
+
+        if( _value.getDeliveryTag() != null)
+        {
+            return 3;
+        }
+
+        if( _value.getDeliveryId() != null)
+        {
+            return 2;
+        }
+
+        if( _value.getHandle() != null)
+        {
+            return 1;
+        }
+
+        return 0;
+    }
+
+    @Override
+    protected void clear()
+    {
+        _value = null;
+        _count = -1;
+    }
+
+
+    protected Object getDescriptor()
+    {
+        return UnsignedLong.valueOf(0x0000000000000014L);
+    }
+
+    @Override
+    protected ValueWriter createDescribedWriter()
+    {
+        final Writer writer = new Writer(getRegistry());
+        writer.setValue(_value);
+        return writer;
+    }
+
+    private class Writer extends AbstractListWriter<Transfer>
+    {
+        private int _field;
+
+        public Writer(final Registry registry)
+        {
+            super(registry);
+        }
+
+        @Override
+        protected void onSetValue(final Transfer value)
+        {
+            reset();
+        }
+
+        @Override
+        protected int getCount()
+        {
+            return _count;
+        }
+
+        @Override
+        protected boolean hasNext()
+        {
+            return _field < _count;
+        }
+
+        @Override
+        protected Object next()
+        {
+            switch(_field++)
+            {
+
+                case 0:
+                    return _value.getHandle();
+
+                case 1:
+                    return _value.getDeliveryId();
+
+                case 2:
+                    return _value.getDeliveryTag();
+
+                case 3:
+                    return _value.getMessageFormat();
+
+                case 4:
+                    return _value.getSettled();
+
+                case 5:
+                    return _value.getMore();
+
+                case 6:
+                    return _value.getRcvSettleMode();
+
+                case 7:
+                    return _value.getState();
+
+                case 8:
+                    return _value.getResume();
+
+                case 9:
+                    return _value.getAborted();
+
+                case 10:
+                    return _value.getBatchable();
+
+                default:
+                    return null;
+            }
+        }
+
+        @Override
+        protected void clear()
+        {
+        }
+
+        @Override
+        protected void reset()
+        {
+            _field = 0;
+        }
+    }
+
+    private static Factory<Transfer> FACTORY = new Factory<Transfer>()
+    {
+
+        public ValueWriter<Transfer> newInstance(Registry registry)
+        {
+            return new TransferWriter(registry);
+        }
+    };
+
+    public static void register(ValueWriter.Registry registry)
+    {
+        registry.register(Transfer.class, FACTORY);
+    }
+
+}

Modified: qpid/branches/rg-amqp-1-0-sandbox/qpid/java/broker/build.xml
URL: http://svn.apache.org/viewvc/qpid/branches/rg-amqp-1-0-sandbox/qpid/java/broker/build.xml?rev=1157566&r1=1157565&r2=1157566&view=diff
==============================================================================
--- qpid/branches/rg-amqp-1-0-sandbox/qpid/java/broker/build.xml (original)
+++ qpid/branches/rg-amqp-1-0-sandbox/qpid/java/broker/build.xml Sun Aug 14 17:14:51 2011
@@ -20,7 +20,7 @@
  -->
 <project name="AMQ Broker" default="build">
 
-    <property name="module.depends" value="management/common common"/>
+    <property name="module.depends" value="management/common common amqp-1-0-common"/>
     <property name="module.test.depends" value="common/test" />
     <property name="module.main" value="org.apache.qpid.server.Main"/>
 

Modified: qpid/branches/rg-amqp-1-0-sandbox/qpid/java/broker/src/main/java/org/apache/qpid/qmf/QMFMessage.java
URL: http://svn.apache.org/viewvc/qpid/branches/rg-amqp-1-0-sandbox/qpid/java/broker/src/main/java/org/apache/qpid/qmf/QMFMessage.java?rev=1157566&r1=1157565&r2=1157566&view=diff
==============================================================================
--- qpid/branches/rg-amqp-1-0-sandbox/qpid/java/broker/src/main/java/org/apache/qpid/qmf/QMFMessage.java (original)
+++ qpid/branches/rg-amqp-1-0-sandbox/qpid/java/broker/src/main/java/org/apache/qpid/qmf/QMFMessage.java Sun Aug 14 17:14:51 2011
@@ -28,7 +28,7 @@ import org.apache.qpid.transport.codec.B
 import java.nio.ByteBuffer;
 import java.util.Set;
 
-public class QMFMessage implements ServerMessage, InboundMessage, AMQMessageHeader
+public class QMFMessage implements ServerMessage<QMFMessage>, InboundMessage, AMQMessageHeader
 {
 
     private ByteBuffer _content;
@@ -154,7 +154,7 @@ public class QMFMessage implements Serve
         return false;
     }
 
-    public MessageReference newReference()
+    public MessageReference<QMFMessage> newReference()
     {
         return new QMFMessageReference(this);
     }

Modified: qpid/branches/rg-amqp-1-0-sandbox/qpid/java/broker/src/main/java/org/apache/qpid/server/AMQChannel.java
URL: http://svn.apache.org/viewvc/qpid/branches/rg-amqp-1-0-sandbox/qpid/java/broker/src/main/java/org/apache/qpid/server/AMQChannel.java?rev=1157566&r1=1157565&r2=1157566&view=diff
==============================================================================
--- qpid/branches/rg-amqp-1-0-sandbox/qpid/java/broker/src/main/java/org/apache/qpid/server/AMQChannel.java (original)
+++ qpid/branches/rg-amqp-1-0-sandbox/qpid/java/broker/src/main/java/org/apache/qpid/server/AMQChannel.java Sun Aug 14 17:14:51 2011
@@ -70,6 +70,7 @@ import org.apache.qpid.server.subscripti
 import org.apache.qpid.server.subscription.RecordDeliveryMethod;
 import org.apache.qpid.server.subscription.Subscription;
 import org.apache.qpid.server.subscription.SubscriptionFactoryImpl;
+import org.apache.qpid.server.subscription.SubscriptionImpl;
 import org.apache.qpid.server.txn.AutoCommitTransaction;
 import org.apache.qpid.server.txn.LocalTransaction;
 import org.apache.qpid.server.txn.ServerTransaction;
@@ -136,7 +137,7 @@ public class AMQChannel implements Sessi
     private final AtomicBoolean _suspended = new AtomicBoolean(false);
 
     private ServerTransaction _transaction;
-    
+
     private final AtomicLong _txnStarts = new AtomicLong(0);
     private final AtomicLong _txnCommits = new AtomicLong(0);
     private final AtomicLong _txnRejects = new AtomicLong(0);
@@ -199,7 +200,7 @@ public class AMQChannel implements Sessi
         // theory
         return !(_transaction instanceof AutoCommitTransaction);
     }
-    
+
     private void incrementOutstandingTxnsIfNecessary()
     {
         if(isTransactional())
@@ -209,7 +210,7 @@ public class AMQChannel implements Sessi
             _txnCount.compareAndSet(0,1);
         }
     }
-    
+
     private void decrementOutstandingTxnsIfNecessary()
     {
         if(isTransactional())
@@ -308,7 +309,7 @@ public class AMQChannel implements Sessi
             try
             {
                 _currentMessage.getStoredMessage().flushToStore();
-                
+
                 final ArrayList<? extends BaseQueue> destinationQueues = _currentMessage.getDestinationQueues();
 
                 if(!checkMessageUserId(_currentMessage.getContentHeader()))
@@ -425,7 +426,7 @@ public class AMQChannel implements Sessi
         {
             throw new AMQException("Consumer already exists with same tag: " + tag);
         }
-        
+
          Subscription subscription =
                 SubscriptionFactoryImpl.INSTANCE.createSubscription(_channelId, _session, tag, acks, filters, noLocal, _creditManager);
 
@@ -933,7 +934,7 @@ public class AMQChannel implements Sessi
         finally
         {
             _rollingBack = false;
-            
+
             _txnRejects.incrementAndGet();
             _txnStarts.incrementAndGet();
             decrementOutstandingTxnsIfNecessary();
@@ -1017,7 +1018,8 @@ public class AMQChannel implements Sessi
                     throws AMQException
             {
                 getProtocolSession().getProtocolOutputConverter().writeDeliver(entry, getChannelId(),
-                                                                               deliveryTag, sub.getConsumerTag());
+                                                                               deliveryTag,
+                                                                               ((SubscriptionImpl)sub).getConsumerTag());
             }
 
         };
@@ -1402,7 +1404,7 @@ public class AMQChannel implements Sessi
     {
         return _createTime;
     }
-    
+
     public void mgmtClose() throws AMQException
     {
         _session.mgmtCloseChannel(_channelId);



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:commits-subscribe@qpid.apache.org


Mime
View raw message