Package com.custardsource.parfait.dxm.types

Examples of com.custardsource.parfait.dxm.types.TypeHandler


     *            the PcpValueInfo to be written to the file
     */
    @SuppressWarnings("unchecked")
    private void writeValueSection(ByteBuffer dataFileBuffer, PcpValueInfo info) {
        int originalPosition = dataFileBuffer.position();
        TypeHandler rawHandler = info.getTypeHandler();
        if (rawHandler.requiresLargeStorage()) {
            // API requires the length here but it's currently unused -- write out the maximum
            // possible length
            dataFileBuffer.putLong(STRING_BLOCK_LENGTH - 1);
            dataFileBuffer.putLong(info.getLargeValue().getOffset());
            dataFileBuffer.position(info.getLargeValue().getOffset());
        }
        rawHandler.putBytes(dataFileBuffer, info.getInitialValue());
        dataFileBuffer.position(originalPosition + DATA_VALUE_LENGTH);
        dataFileBuffer.putLong(info.getDescriptorOffset());
        dataFileBuffer.putLong(info.getInstanceOffset());
    }
View Full Code Here


        }
    }

    @SuppressWarnings("unchecked")
    protected final void updateValue(PcpValueInfo info, Object value) {
        TypeHandler rawHandler = info.getTypeHandler();
        synchronized (dataFileBuffer) {
            dataFileBuffer.position(rawHandler.requiresLargeStorage() ? info.getLargeValue()
                    .getOffset() : info.getOffset());
            rawHandler.putBytes(dataFileBuffer, value);
        }
    }
View Full Code Here

     *            the PcpValueInfo to be written to the file
     */
    @SuppressWarnings({ "unchecked", "rawtypes" })
    private void writeValueSection(ByteBuffer dataFileBuffer, PcpValueInfo info) {
        int originalPosition = dataFileBuffer.position();
        TypeHandler rawHandler = info.getTypeHandler();
        if (rawHandler.requiresLargeStorage()) {
            // API requires the length here but it's currently unused -- write out the maximum
            // possible length
            dataFileBuffer.putLong(STRING_BLOCK_LENGTH - 1);
            dataFileBuffer.putLong(info.getLargeValue().getOffset());
            dataFileBuffer.position(info.getLargeValue().getOffset());
        }
        rawHandler.putBytes(dataFileBuffer, info.getInitialValue());
        dataFileBuffer.position(originalPosition + DATA_VALUE_LENGTH);
        dataFileBuffer.putLong(info.getDescriptorOffset());
        dataFileBuffer.putLong(info.getInstanceOffset());
    }
View Full Code Here

        }
    }

    @SuppressWarnings("unchecked")
    protected final void updateValue(PcpValueInfo info, Object value) {
        @SuppressWarnings("rawtypes")
        TypeHandler rawHandler = info.getTypeHandler();

        if (usePerMetricLock) {
            writeValueWithLockPerMetric(info, value, rawHandler);
        } else {
View Full Code Here

        }
    }

    @SuppressWarnings("unchecked")
    protected final void updateValue(PcpValueInfo info, Object value) {
        TypeHandler rawHandler = info.getTypeHandler();
        dataFileBuffer.position(rawHandler.requiresLargeStorage() ? info.getLargeValue()
                .getOffset() : info.getOffset());
        rawHandler.putBytes(dataFileBuffer, value);
    }
View Full Code Here

TOP

Related Classes of com.custardsource.parfait.dxm.types.TypeHandler

Copyright © 2018 www.massapicom. 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.