Package com.netflix.server.context

Examples of com.netflix.server.context.DirectionAwareContextSerializer


            throws ContextSerializationException {
        if(contextHolder.hasRawSerializedForm()) {
            return contextHolder.getRawSerializedForm();
        }

        DirectionAwareContextSerializer serializer = contextHolder.getSerializer();

        String data = contextHolder.hasSerialized()
                      ? contextHolder.getSerialized()
                      : serializer.serialize(contextHolder.getContext(), direction);

        if (null == data) {
            throw new ContextSerializationException("Serializer returned null for context name: " + contextHolder.getContextName());
        }

        if (data.isEmpty()) {
            data = maskEmptyString();
        }

        StringBuilder builder = new StringBuilder();
        builder.append(SERIALIZATION_FORMAT_VER);
        builder.append(CONTEXT_SERIALIZATION_PROPS_SEPARATOR);
        builder.append(contextHolder.getSerializerClassName());
        builder.append(CONTEXT_SERIALIZATION_PROPS_SEPARATOR);
        builder.append(serializer.getVersion());
        builder.append(CONTEXT_SERIALIZATION_PROPS_SEPARATOR);
        builder.append(data);
        return builder.toString();
    }
View Full Code Here

TOP

Related Classes of com.netflix.server.context.DirectionAwareContextSerializer

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.