public void delete(int scId) { this.delete(new Integer(scId)); }
if (isDebugging(os)) dprint("Writing service contexts to output stream"); Utility.printStackTrace(); if (isDebugging(os)) dprint("Adding alignment padding"); if (isDebugging(os)) dprint("Service context has " + numsc + " components"); writeServiceContextsInOrder(os, gv); if (isDebugging(os)) dprint("Writing alignment padding"); if (isDebugging(os)) dprint("Service context writing complete");
public ServiceContext get(int scId) { return this.get(new Integer(scId)); }
/** * Write the given entry from the scMap to the OutputStream. See note on giopVersion. The service context should * know the GIOP version it is meant for. */ private void writeMapEntry(OutputStream os, Integer id, Object scObj, GIOPVersion gv) { // If it's still in byte[] form, we don't need to // unmarshal it here, just copy the bytes into // the new stream. if (scObj instanceof byte[]) { if (isDebugging(os)) dprint("Writing service context bytes for id " + id); OctetSeqHelper.write(os, (byte[]) scObj); } else { // We actually unmarshaled it into a ServiceContext // at some point. ServiceContext sc = (ServiceContext) scObj; if (isDebugging(os)) dprint("Writing service context " + sc); sc.write(os, gv); } }
public void write(org.omg.CORBA.portable.OutputStream ostream) { super.write(ostream); if (this.service_contexts != null) { service_contexts.write((org.omg.CORBA_2_3.portable.OutputStream) ostream, GIOPVersion.V1_0); } else { ServiceContexts.writeNullServiceContext((org.omg.CORBA_2_3.portable.OutputStream) ostream); } ostream.write_ulong(this.request_id); ostream.write_long(this.reply_status); }
public void read(org.omg.CORBA.portable.InputStream istream) { super.read(istream); this.service_contexts = new ServiceContexts((org.omg.CORBA_2_3.portable.InputStream) istream); this.request_id = istream.read_ulong(); this.response_expected = istream.read_boolean(); int _len0 = istream.read_long(); this.object_key = new byte[_len0]; istream.read_octet_array(this.object_key, 0, _len0); this.operation = istream.read_string(); this.requesting_principal = istream.read_Principal(); }
/** * Given the input stream, this fills our service context map. See the definition of scMap for details. Creates a * HashMap. * * Note that we don't actually unmarshal the bytes of the service contexts here. That is done when they are actually * requested via get(int). */ private void createMapFromInputStream(InputStream is) { orb = (ORB) (is.orb()); if (orb.serviceContextDebugFlag) dprint("Constructing ServiceContexts from input stream"); int numValid = is.read_long(); if (orb.serviceContextDebugFlag) dprint("Number of service contexts = " + numValid); for (int ctr = 0; ctr < numValid; ctr++) { int scId = is.read_long(); if (orb.serviceContextDebugFlag) dprint("Reading service context id " + scId); byte[] data = OctetSeqHelper.read(is); if (orb.serviceContextDebugFlag) dprint("Service context" + scId + " length: " + data.length); scMap.put(new Integer(scId), data); } }
public static void writeNullServiceContext(OutputStream os) { if (isDebugging(os)) ORBUtility.dprint("ServiceContexts", "Writing null service context"); os.write_long(0); }
/** * Read the Service contexts from the input stream. */ public ServiceContexts(InputStream s) { this((ORB) (s.orb())); // We need to store this so that we can have access // to the CodeBase for unmarshaling possible // RMI-IIOP valuetype data within an encapsulation. // (Known case: UnknownExceptionInfo) codeBase = ((CDRInputStream) s).getCodeBase(); createMapFromInputStream(s); // Fix for bug 4904723 giopVersion = ((CDRInputStream) s).getGIOPVersion(); }
public ServiceContext get(Integer id) { Object result = scMap.get(id); if (result == null) return null; // Lazy unmarshaling on first use. if (result instanceof byte[]) { ServiceContext sc = unmarshal(id, (byte[]) result); scMap.put(id, sc); return sc; } else { return (ServiceContext) result; } }
/** * Write the service contexts in scMap in a desired order. Right now, the only special case we have is * UnknownExceptionInfo, so I'm merely writing it last if present. */ private void writeServiceContextsInOrder(OutputStream os, GIOPVersion gv) { // Temporarily remove this rather than check it per iteration Integer ueInfoId = new Integer(UEInfoServiceContext.SERVICE_CONTEXT_ID); Object unknownExceptionInfo = scMap.remove(ueInfoId); Iterator<Integer> iter = scMap.keySet().iterator(); while (iter.hasNext()) { Integer id = iter.next(); writeMapEntry(os, id, scMap.get(id), gv); } // Write the UnknownExceptionInfo service context last // (so it will be after the CodeBase) and restore it in // the map. if (unknownExceptionInfo != null) { writeMapEntry(os, ueInfoId, unknownExceptionInfo, gv); scMap.put(ueInfoId, unknownExceptionInfo); } }
public void write(org.omg.CORBA.portable.OutputStream ostream) { super.write(ostream); if (this.service_contexts != null) { service_contexts.write((org.omg.CORBA_2_3.portable.OutputStream) ostream, GIOPVersion.V1_1); } else { ServiceContexts.writeNullServiceContext((org.omg.CORBA_2_3.portable.OutputStream) ostream); } ostream.write_ulong(this.request_id); ostream.write_long(this.reply_status); }
public void read(org.omg.CORBA.portable.InputStream istream) { super.read(istream); this.service_contexts = new ServiceContexts((org.omg.CORBA_2_3.portable.InputStream) istream); this.request_id = istream.read_ulong(); this.response_expected = istream.read_boolean(); int _len0 = istream.read_long(); this.object_key = new byte[_len0]; istream.read_octet_array(this.object_key, 0, _len0); this.operation = istream.read_string(); this.requesting_principal = istream.read_Principal(); }
/** * Write the given entry from the scMap to the OutputStream. See note on giopVersion. The service context should * know the GIOP version it is meant for. */ private void writeMapEntry(OutputStream os, Integer id, Object scObj, GIOPVersion gv) { // If it's still in byte[] form, we don't need to // unmarshal it here, just copy the bytes into // the new stream. if (scObj instanceof byte[]) { if (isDebugging(os)) dprint("Writing service context bytes for id " + id); OctetSeqHelper.write(os, (byte[]) scObj); } else { // We actually unmarshaled it into a ServiceContext // at some point. ServiceContext sc = (ServiceContext) scObj; if (isDebugging(os)) dprint("Writing service context " + sc); sc.write(os, gv); } }
/** * Given the input stream, this fills our service context map. See the definition of scMap for details. Creates a * HashMap. * * Note that we don't actually unmarshal the bytes of the service contexts here. That is done when they are actually * requested via get(int). */ private void createMapFromInputStream(InputStream is) { orb = (ORB) (is.orb()); if (orb.serviceContextDebugFlag) dprint("Constructing ServiceContexts from input stream"); int numValid = is.read_long(); if (orb.serviceContextDebugFlag) dprint("Number of service contexts = " + numValid); for (int ctr = 0; ctr < numValid; ctr++) { int scId = is.read_long(); if (orb.serviceContextDebugFlag) dprint("Reading service context id " + scId); byte[] data = OctetSeqHelper.read(is); if (orb.serviceContextDebugFlag) dprint("Service context" + scId + " length: " + data.length); scMap.put(new Integer(scId), data); } }
public static void writeNullServiceContext(OutputStream os) { if (isDebugging(os)) ORBUtility.dprint("ServiceContexts", "Writing null service context"); os.write_long(0); }
/** * Read the Service contexts from the input stream. */ public ServiceContexts(InputStream s) { this((ORB) (s.orb())); // We need to store this so that we can have access // to the CodeBase for unmarshaling possible // RMI-IIOP valuetype data within an encapsulation. // (Known case: UnknownExceptionInfo) codeBase = ((CDRInputStream) s).getCodeBase(); createMapFromInputStream(s); // Fix for bug 4904723 giopVersion = ((CDRInputStream) s).getGIOPVersion(); }
public ServiceContext get(Integer id) { Object result = scMap.get(id); if (result == null) return null; // Lazy unmarshaling on first use. if (result instanceof byte[]) { ServiceContext sc = unmarshal(id, (byte[]) result); scMap.put(id, sc); return sc; } else { return (ServiceContext) result; } }
/** * Write the service contexts in scMap in a desired order. Right now, the only special case we have is * UnknownExceptionInfo, so I'm merely writing it last if present. */ private void writeServiceContextsInOrder(OutputStream os, GIOPVersion gv) { // Temporarily remove this rather than check it per iteration Integer ueInfoId = new Integer(UEInfoServiceContext.SERVICE_CONTEXT_ID); Object unknownExceptionInfo = scMap.remove(ueInfoId); Iterator<Integer> iter = scMap.keySet().iterator(); while (iter.hasNext()) { Integer id = iter.next(); writeMapEntry(os, id, scMap.get(id), gv); } // Write the UnknownExceptionInfo service context last // (so it will be after the CodeBase) and restore it in // the map. if (unknownExceptionInfo != null) { writeMapEntry(os, ueInfoId, unknownExceptionInfo, gv); scMap.put(ueInfoId, unknownExceptionInfo); } }
public void write(org.omg.CORBA.portable.OutputStream ostream) { super.write(ostream); if (this.service_contexts != null) { service_contexts.write((org.omg.CORBA_2_3.portable.OutputStream) ostream, GIOPVersion.V1_0); } else { ServiceContexts.writeNullServiceContext((org.omg.CORBA_2_3.portable.OutputStream) ostream); } ostream.write_ulong(this.request_id); ostream.write_long(this.reply_status); }