/** * Returns the maximum stream format version supported by our ValueHandler. */ public static byte getMaxStreamFormatVersion() { ValueHandler vh = Util.createValueHandler(); if (!(vh instanceof javax.rmi.CORBA.ValueHandlerMultiFormat)) return ORBConstants.STREAM_FORMAT_VERSION_1; else return ((ValueHandlerMultiFormat) vh).getMaximumStreamFormatVersion(); }
public static void writeValue(org.omg.CORBA.portable.OutputStream out, java.io.Serializable value) { byte version = ValueHandler.getMaximumStreamFormatVersion (out); javax.rmi.CORBA.ValueHandler vh = javax.rmi.CORBA.Util.createValueHandler(); if (version == ValueHandler.STREAM_FORMAT_VERSION_1) { vh.writeValue (out, value); } else if (version == ValueHandler.STREAM_FORMAT_VERSION_2) { ((ValueHandlerMultiFormat)vh).writeValue (out, value, ValueHandler.STREAM_FORMAT_VERSION_2); } else { throw new MARSHAL ("Unsupported stream format version."); } }
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); }
vh.writeValue(parent, array, streamFormatVersion);
/** * Returns the maximum stream format version supported by our ValueHandler. */ public static byte getMaxStreamFormatVersion() { ValueHandler vh = Util.createValueHandler(); if (!(vh instanceof javax.rmi.CORBA.ValueHandlerMultiFormat)) return ORBConstants.STREAM_FORMAT_VERSION_1; else return ((ValueHandlerMultiFormat) vh).getMaximumStreamFormatVersion(); }
vh.writeValue(parent, array, streamFormatVersion);
/** * Returns the maximum stream format version supported by our * ValueHandler. */ public static byte getMaxStreamFormatVersion() { ValueHandler vh; try { vh = AccessController.doPrivileged(new PrivilegedExceptionAction<ValueHandler>() { public ValueHandler run() throws Exception { return Util.createValueHandler(); } }); } catch (PrivilegedActionException e) { throw new InternalError(e.getMessage()); } if (!(vh instanceof javax.rmi.CORBA.ValueHandlerMultiFormat)) return ORBConstants.STREAM_FORMAT_VERSION_1; else return ((ValueHandlerMultiFormat)vh).getMaximumStreamFormatVersion(); }
vh.writeValue(parent, object, streamFormatVersion); } else valueHandler.writeValue(parent, object);
public static byte getMaximumStreamFormatVersion (org.omg.CORBA.portable.OutputStream out) { javax.rmi.CORBA.ValueHandler vh = javax.rmi.CORBA.Util.createValueHandler(); byte streamFormatVersion = STREAM_FORMAT_VERSION_1; // Maximum stream format version calculation rules: // 1. Assume version 1 by default (GIOP v1.2). // 2. If ValueHandler supports higher version take it as preliminary value. // 3. If CDROutputStream returns version lower that ValueHandler supports // then use maximum version that is supported by output stream. if (vh instanceof ValueHandlerMultiFormat) { streamFormatVersion = ((ValueHandlerMultiFormat)vh).getMaximumStreamFormatVersion (); } if (out instanceof org.jacorb.orb.CDROutputStream && streamFormatVersion > ((org.jacorb.orb.CDROutputStream)out).getMaximumStreamFormatVersion ()) { streamFormatVersion = ((org.jacorb.orb.CDROutputStream)out).getMaximumStreamFormatVersion (); } return streamFormatVersion; } }
vh.writeValue(parent, object, streamFormatVersion);
vh.writeValue(parent, object, streamFormatVersion);