Java Code Examples for com.sun.corba.se.impl.orbutil.ORBUtility.createValueHandler()

The following are Jave code examples for showing how to use createValueHandler() of the com.sun.corba.se.impl.orbutil.ORBUtility class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: OpenJSharp   File: CDROutputStream_1_0.java   Source Code and License Vote up 5 votes
private void writeArray(Serializable array, Class clazz) {

        if (valueHandler == null)
            valueHandler = ORBUtility.createValueHandler(); //d11638

        // Write value_tag
        int indirection = writeValueTag(mustChunk, true,
                                        Util.getCodebase(clazz));

        // Write repository ID
        write_repositoryId(repIdStrs.createSequenceRepID(clazz));

        // Add indirection for object to indirection table
        updateIndirectionTable(indirection, array, array);

        // Write Value chunk
        if (mustChunk) {
            start_block();
            end_flag--;
            chunkedValueNestingLevel--;
        } else
            end_flag--;

        if (valueHandler instanceof ValueHandlerMultiFormat) {
            ValueHandlerMultiFormat vh = (ValueHandlerMultiFormat)valueHandler;
            vh.writeValue(parent, array, streamFormatVersion);
        } else
            valueHandler.writeValue(parent, array);

        if (mustChunk)
            end_block();

        // Write end tag
        writeEndTag(mustChunk);
    }
 
Example 2
Project: openjdk-jdk10   File: CDROutputStream_1_0.java   Source Code and License Vote up 5 votes
private void writeArray(Serializable array, Class clazz) {

        if (valueHandler == null)
            valueHandler = ORBUtility.createValueHandler(); //d11638

        // Write value_tag
        int indirection = writeValueTag(mustChunk, true,
                                        Util.getCodebase(clazz));

        // Write repository ID
        write_repositoryId(repIdStrs.createSequenceRepID(clazz));

        // Add indirection for object to indirection table
        updateIndirectionTable(indirection, array, array);

        // Write Value chunk
        if (mustChunk) {
            start_block();
            end_flag--;
            chunkedValueNestingLevel--;
        } else
            end_flag--;

        if (valueHandler instanceof ValueHandlerMultiFormat) {
            ValueHandlerMultiFormat vh = (ValueHandlerMultiFormat)valueHandler;
            vh.writeValue(parent, array, streamFormatVersion);
        } else
            valueHandler.writeValue(parent, array);

        if (mustChunk)
            end_block();

        // Write end tag
        writeEndTag(mustChunk);
    }
 
Example 3
Project: OpenJSharp   File: CDROutputStream_1_0.java   Source Code and License Vote up 4 votes
private void writeRMIIIOPValueType(Serializable object, Class clazz) {
    if (valueHandler == null)
        valueHandler = ORBUtility.createValueHandler(); //d11638

    Serializable key = object;

    // Allow the ValueHandler to call writeReplace on
    // the Serializable (if the method is present)
    object = valueHandler.writeReplace(key);

    if (object == null) {
        // Write null tag and return
        write_long(0);
        return;
    }

    if (object != key) {
        if (valueCache != null && valueCache.containsKey(object)) {
            writeIndirection(INDIRECTION_TAG, valueCache.getVal(object));
            return;
        }

        clazz = object.getClass();
    }

    if (mustChunk || valueHandler.isCustomMarshaled(clazz)) {
        mustChunk = true;
    }

    // Write value_tag
    int indirection = writeValueTag(mustChunk, true, Util.getCodebase(clazz));

    // Write rep. id
    write_repositoryId(repIdStrs.createForJavaType(clazz));

    // Add indirection for object to indirection table
    updateIndirectionTable(indirection, object, key);

    if (mustChunk) {
        // Write Value chunk
        end_flag--;
        chunkedValueNestingLevel--;
        start_block();
    } else
        end_flag--;

    if (valueHandler instanceof ValueHandlerMultiFormat) {
        ValueHandlerMultiFormat vh = (ValueHandlerMultiFormat)valueHandler;
        vh.writeValue(parent, object, streamFormatVersion);
    } else
        valueHandler.writeValue(parent, object);

    if (mustChunk)
        end_block();

    // Write end tag
    writeEndTag(mustChunk);
}
 
Example 4
Project: openjdk-jdk10   File: CDROutputStream_1_0.java   Source Code and License Vote up 4 votes
private void writeRMIIIOPValueType(Serializable object, Class clazz) {
    if (valueHandler == null)
        valueHandler = ORBUtility.createValueHandler(); //d11638

    Serializable key = object;

    // Allow the ValueHandler to call writeReplace on
    // the Serializable (if the method is present)
    object = valueHandler.writeReplace(key);

    if (object == null) {
        // Write null tag and return
        write_long(0);
        return;
    }

    if (object != key) {
        if (valueCache != null && valueCache.containsKey(object)) {
            writeIndirection(INDIRECTION_TAG, valueCache.getVal(object));
            return;
        }

        clazz = object.getClass();
    }

    if (mustChunk || valueHandler.isCustomMarshaled(clazz)) {
        mustChunk = true;
    }

    // Write value_tag
    int indirection = writeValueTag(mustChunk, true, Util.getCodebase(clazz));

    // Write rep. id
    write_repositoryId(repIdStrs.createForJavaType(clazz));

    // Add indirection for object to indirection table
    updateIndirectionTable(indirection, object, key);

    if (mustChunk) {
        // Write Value chunk
        end_flag--;
        chunkedValueNestingLevel--;
        start_block();
    } else
        end_flag--;

    if (valueHandler instanceof ValueHandlerMultiFormat) {
        ValueHandlerMultiFormat vh = (ValueHandlerMultiFormat)valueHandler;
        vh.writeValue(parent, object, streamFormatVersion);
    } else
        valueHandler.writeValue(parent, object);

    if (mustChunk)
        end_block();

    // Write end tag
    writeEndTag(mustChunk);
}