Examples of BBDecoder


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

        {
            throw new BindingException(
                    "Could not create a List implementation for "
                            + javaClass.getName(), e);
        }
        BBDecoder newDecoder = new BBDecoder();
        newDecoder.init(ByteBuffer.wrap(dec.readVbin32()));
        long count = newDecoder.readUint32();
        while (count > 0)
        {
            short typeCode = newDecoder.readUint8();
            TypeBinding type = QMFTypeBinding.getType(typeCode);
            if (type == null)
            {
                type = bctx.getTypeBinding(Object.class);
            }
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 AgentException(e);
        }
        dec.init(ByteBuffer.wrap(body, 0, size));
        return dec;
    }
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(QManManagedObject 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(QManManagedObject 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

    }

    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
            int hdr = dec.readUint16();
            command = Method.create(commandType);
            command.setSync((0x0001 & hdr) != 0);
            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

     * @param instance the managed object instance.
     * @param rawData the incoming configuration data which contains new values for instance properties.
     */
    void updateEventInstanceWithData(QManManagedEvent instance)
    {
        BBDecoder decoder = new BBDecoder();
        decoder.init(ByteBuffer.wrap(instance._rawEventData));

        for (QpidProperty property : _schemaOrderedArguments)
        {                 
            try {
                Object value = property.decodeValue(decoder);
View Full Code Here

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

    protected void populateMapFromData() throws JMSException
    {
        if (_data != null)
        {
            _data.rewind();
            BBDecoder decoder = new BBDecoder();
            decoder.init(_data.buf());
            _map = decoder.readMap();
        }
        else
        {
            _map.clear();
        }
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);
            setMap(decoder.readMap());
        }
        else
        {
            getMap().clear();
        }
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.