Examples of BBDecoder


Examples of org.apache.qpid.transport.codec.BBDecoder

  private void build(Message compoundMessage) throws IOException
  {     
    int startIndex = 0;
    int indexOfMagicNumber = 0;
   
    BBDecoder decoder = new BBDecoder();
    decoder.init(compoundMessage.readData());
    byte [] source = decoder.readReaminingBytes();     
   
    int howManyTokens = 1;
   
    while ((indexOfMagicNumber = indexOf(source, startIndex+1)) != -1)
    {
View Full Code Here

Examples of org.apache.qpid.transport.codec.BBDecoder

     * @param instance the managed object instance.
     * @param rawData the incoming configuration data which contains new values for instance properties.
     */
    void updateInstanceWithConfigurationData(QpidManagedObject instance,byte [] rawData)
    {
        BBDecoder decoder = new BBDecoder();
        decoder.init(ByteBuffer.wrap(rawData));

        byte [] presenceBitMasks = decoder.readBytes(_howManyPresenceBitMasks);
        for (QpidProperty property : _schemaOrderedProperties)
        {                 
            try {
                Object value = property.decodeValue(decoder,presenceBitMasks);
                instance.createOrReplaceAttributeValue(property.getName(),value);            
View Full Code Here

Examples of org.apache.qpid.transport.codec.BBDecoder

     * @param instance the managed object instance.
     * @param rawData the incoming instrumentation data which contains new values for instance properties.
     */
    void updateInstanceWithInstrumentationData(QpidManagedObject instance,byte [] rawData)
    {
        BBDecoder decoder = new BBDecoder();
        decoder.init(ByteBuffer.wrap(rawData));

        for (QpidStatistic statistic : _schemaOrderedStatistics)
        {                 
            try {
                Object value = statistic.decodeValue(decoder);
View Full Code Here

Examples of org.apache.qpid.transport.codec.BBDecoder

         char opcode = (char)buffer.get();
        
         IMessageHandler handler = _handlers.get(opcode);
         if (handler != null)
         {
             BBDecoder decoder = new BBDecoder();
             decoder.init(buffer);
            
             LOGGER.debug(Messages.QMAN_200003_MESSAGE_FORWARDING,opcode,handler);
            
             handler.process(decoder,decoder.readSequenceNo());
         } else
         {
             LOGGER.warn(Messages.QMAN_300001_MESSAGE_DISCARDED,opcode);
             Log.debugConfiguredHandlers(_handlers);
         }
View Full Code Here

Examples of org.apache.qpid.transport.codec.BBDecoder

    }

    private void assemble(Frame frame, ByteBuffer segment)
    {
        BBDecoder dec = decoder.get();
        dec.init(segment);

        int channel = frame.getChannel();
        Method command;

        switch (frame.getType())
        {
        case CONTROL:
            int controlType = dec.readUint16();
            Method control = Method.create(controlType);
            control.read(dec);
            emit(channel, control);
            break;
        case COMMAND:
            int commandType = dec.readUint16();
            // read in the session header, right now we don't use it
            dec.readUint16();
            command = Method.create(commandType);
            command.read(dec);
            if (command.hasPayload())
            {
                incomplete[channel] = command;
            }
            else
            {
                emit(channel, command);
            }
            break;
        case HEADER:
            command = incomplete[channel];
            List<Struct> structs = new ArrayList(2);
            while (dec.hasRemaining())
            {
                structs.add(dec.readStruct32());
            }
            command.setHeader(new Header(structs));
            if (frame.isLastSegment())
            {
                incomplete[channel] = null;
View Full Code Here

Examples of org.apache.qpid.transport.codec.BBDecoder

    protected void populateMapFromData(ByteBuffer data) throws JMSException
    {
        if (data != null)
        {
            data.rewind();
            BBDecoder decoder = new BBDecoder();
            decoder.init(data);
            _map = decoder.readMap();
        }
        else
        {
            _map.clear();
        }
View Full Code Here

Examples of org.apache.qpid.transport.codec.BBDecoder

    private static class MetaDataFactory implements MessageMetaDataType.Factory<MessageMetaData_0_10>
    {
        public MessageMetaData_0_10 createMetaData(ByteBuffer buf)
        {
            BBDecoder decoder = new BBDecoder();
            decoder.init(buf);

            long arrivalTime = decoder.readInt64();
            int bodySize = decoder.readInt32();
            int headerCount = decoder.readInt32();

            DeliveryProperties deliveryProperties = null;
            MessageProperties messageProperties = null;
            List<Struct> otherProps = null;

            for(int i = 0 ; i < headerCount; i++)
            {
                Struct struct = decoder.readStruct32();
                if(struct instanceof DeliveryProperties && deliveryProperties == null)
                {
                    deliveryProperties = (DeliveryProperties) struct;
                }
                else if(struct instanceof MessageProperties && messageProperties == null)
View Full Code Here

Examples of org.apache.qpid.transport.codec.BBDecoder

    }

    private Decoder readBody(Message message)
    {
        BytesMessage msg = (BytesMessage) message;
        BBDecoder dec = new BBDecoder();
        byte[] buf = new byte[1024];
        byte[] body = new byte[1024];
        int size = 0;
        int n;
        try
        {
            while ((n = msg.readBytes(buf)) > 0)
            {
                body = ensure(size + n, body, size);
                System.arraycopy(buf, 0, body, size, n);
                size += n;
            }
        } catch (JMSException e)
        {
            throw new ConsoleException(e);
        }
        dec.init(ByteBuffer.wrap(body, 0, size));
        return dec;
    }
View Full Code Here

Examples of org.apache.qpid.transport.codec.BBDecoder

                    }
                }
            }
            return returnValue;
        case 21: // List
            BBDecoder lDec = new BBDecoder();
            lDec.init(ByteBuffer.wrap(dec.readVbin32()));
            long count = lDec.readUint32();
            ArrayList<Object> newList = new ArrayList<Object>();
            while (count > 0)
            {
                short innerType = lDec.readUint8();
                newList.add(this.decodeValue(lDec, innerType));
                count -= 1;
            }
            return newList;
        case 22: // Array
            BBDecoder aDec = new BBDecoder();
            aDec.init(ByteBuffer.wrap(dec.readVbin32()));
            long cnt = aDec.readUint32();
            short innerType = aDec.readUint8();
            ArrayList<Object> aList = new ArrayList<Object>();
            while (cnt > 0)
            {
                aList.add(this.decodeValue(aDec, innerType));
                cnt -= 1;
View Full Code Here

Examples of org.apache.qpid.transport.codec.BBDecoder

    private static class MetaDataFactory implements MessageMetaDataType.Factory<MessageMetaData_0_10>
    {
        public MessageMetaData_0_10 createMetaData(ByteBuffer buf)
        {
            BBDecoder decoder = new BBDecoder();
            decoder.init(buf);

            long arrivalTime = decoder.readInt64();
            int bodySize = decoder.readInt32();
            int headerCount = decoder.readInt32();

            DeliveryProperties deliveryProperties = null;
            MessageProperties messageProperties = null;
            List<Struct> otherProps = null;

            for(int i = 0 ; i < headerCount; i++)
            {
                Struct struct = decoder.readStruct32();
                if(struct instanceof DeliveryProperties && deliveryProperties == null)
                {
                    deliveryProperties = (DeliveryProperties) struct;
                }
                else if(struct instanceof MessageProperties && messageProperties == null)
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.