public final CodeBase getCodeBase() { if (getConnection() == null) return null; else return getConnection().getCodeBase(); }
private CodeSetComponentInfo.CodeSetContext getCodeSets() { if (getConnection() == null) return CodeSetComponentInfo.LOCAL_CODE_SETS; else return getConnection().getCodeSetContext(); }
public static Message readGIOPBody(ORB orb, CorbaConnection connection, Message msg) { ReadTimeouts readTimeouts = orb.getORBData().getTransportTCPReadTimeouts(); ByteBuffer buf = msg.getByteBuffer(); buf.position(MessageBase.GIOPMessageHeaderLength); int msgSizeMinusHeader = msg.getSize() - MessageBase.GIOPMessageHeaderLength; try { buf = connection .read(buf, GIOPMessageHeaderLength, msgSizeMinusHeader, readTimeouts.get_max_time_to_wait()); } catch (IOException e) { throw wrapper.ioexceptionWhenReadingConnection(e); } msg.setByteBuffer(buf); if (orb.giopDebugFlag) { dprint(".readGIOPBody: received message:"); ByteBuffer viewBuffer = buf.asReadOnlyBuffer(); viewBuffer.position(0).limit(msg.getSize()); ByteBufferWithInfo bbwi = new ByteBufferWithInfo(orb, viewBuffer); CDRInputStream_1_0.printBuffer(bbwi); } return msg; }
protected CodeSetConversion.BTCConverter createWCharBTCConverter() { CodeSetComponentInfo.CodeSetContext codesets = getCodeSets(); // If the connection doesn't have its negotiated code sets by now, we have to throw an exception. See CORBA // formal 00-11-03 13.9.2.6. if (codesets == null) { if (getConnection().isServer()) throw omgWrapper.noClientWcharCodesetCtx(); else throw omgWrapper.noServerWcharCodesetCmp(); } OSFCodeSetRegistry.Entry wcharSet = OSFCodeSetRegistry.lookupEntry(codesets.getWCharCodeSet()); if (wcharSet == null) throw wrapper.unknownCodeset(wcharSet); // For GIOP 1.2 and UTF-16, use big endian if there is no byte order marker. (See issue 3405b) // // For GIOP 1.1 and UTF-16, use the byte order the stream if there isn't (and there shouldn't be) a byte order // marker. // // GIOP 1.0 doesn't have wchars. If we're talking to a legacy ORB, we do what our old ORBs did. if (wcharSet == OSFCodeSetRegistry.UTF_16) { if (getGIOPVersion().equals(GIOPVersion.V1_2)) return CodeSetConversion.impl().getBTCConverter(wcharSet, false); } return CodeSetConversion.impl().getBTCConverter(wcharSet, isLittleEndian()); }
private CDROutputObject(ORB orb, GIOPVersion giopVersion, Message header, BufferManagerWrite manager, byte streamFormatVersion, CorbaMessageMediator mediator) { super(orb, giopVersion, header.getEncodingVersion(), false, manager, streamFormatVersion, ((mediator != null && mediator.getConnection() != null) ? ((CorbaConnection) mediator.getConnection()) .shouldUseDirectByteBuffers() : false)); this.header = header; this.wrapper = ORBUtilSystemException.get(orb, CORBALogDomains.RPC_ENCODING); this.omgWrapper = OMGSystemException.get(orb, CORBALogDomains.RPC_ENCODING); getBufferManager().setOutputObject(this); this.corbaMessageMediator = mediator; }
/** * Write the contents of the CDROutputStream to the specified output stream. Has the side-effect of pushing any * current Message onto the Message list. * * @param s * The output stream to write to. */ public void writeTo(CorbaConnection connection) throws java.io.IOException { // // Update the GIOP MessageHeader size field. // ByteBufferWithInfo bbwi = getByteBufferWithInfo(); getMessageHeader().setSize(bbwi.byteBuffer, bbwi.getSize()); if (orb() != null) { if (((ORB) orb()).transportDebugFlag) { dprint(".writeTo: " + connection); } if (((ORB) orb()).giopDebugFlag) { CDROutputStream_1_0.printBuffer(bbwi); } } bbwi.byteBuffer.position(0).limit(bbwi.getSize()); connection.write(bbwi.byteBuffer); }
public static Message readGIOPBody(ORB orb, CorbaConnection connection, Message msg) { ReadTimeouts readTimeouts = orb.getORBData().getTransportTCPReadTimeouts(); ByteBuffer buf = msg.getByteBuffer(); buf.position(MessageBase.GIOPMessageHeaderLength); int msgSizeMinusHeader = msg.getSize() - MessageBase.GIOPMessageHeaderLength; try { buf = connection .read(buf, GIOPMessageHeaderLength, msgSizeMinusHeader, readTimeouts.get_max_time_to_wait()); } catch (IOException e) { throw wrapper.ioexceptionWhenReadingConnection(e); } msg.setByteBuffer(buf); if (orb.giopDebugFlag) { dprint(".readGIOPBody: received message:"); ByteBuffer viewBuffer = buf.asReadOnlyBuffer(); viewBuffer.position(0).limit(msg.getSize()); ByteBufferWithInfo bbwi = new ByteBufferWithInfo(orb, viewBuffer); CDRInputStream_1_0.printBuffer(bbwi); } return msg; }
protected CodeSetConversion.BTCConverter createWCharBTCConverter() { CodeSetComponentInfo.CodeSetContext codesets = getCodeSets(); // If the connection doesn't have its negotiated code sets by now, we have to throw an exception. See CORBA // formal 00-11-03 13.9.2.6. if (codesets == null) { if (getConnection().isServer()) throw omgWrapper.noClientWcharCodesetCtx(); else throw omgWrapper.noServerWcharCodesetCmp(); } OSFCodeSetRegistry.Entry wcharSet = OSFCodeSetRegistry.lookupEntry(codesets.getWCharCodeSet()); if (wcharSet == null) throw wrapper.unknownCodeset(wcharSet); // For GIOP 1.2 and UTF-16, use big endian if there is no byte order marker. (See issue 3405b) // // For GIOP 1.1 and UTF-16, use the byte order the stream if there isn't (and there shouldn't be) a byte order // marker. // // GIOP 1.0 doesn't have wchars. If we're talking to a legacy ORB, we do what our old ORBs did. if (wcharSet == OSFCodeSetRegistry.UTF_16) { if (getGIOPVersion().equals(GIOPVersion.V1_2)) return CodeSetConversion.impl().getBTCConverter(wcharSet, false); } return CodeSetConversion.impl().getBTCConverter(wcharSet, isLittleEndian()); }
private CDROutputObject(ORB orb, GIOPVersion giopVersion, Message header, BufferManagerWrite manager, byte streamFormatVersion, CorbaMessageMediator mediator) { super(orb, giopVersion, header.getEncodingVersion(), false, manager, streamFormatVersion, ((mediator != null && mediator.getConnection() != null) ? ((CorbaConnection) mediator.getConnection()) .shouldUseDirectByteBuffers() : false)); this.header = header; this.wrapper = ORBUtilSystemException.get(orb, CORBALogDomains.RPC_ENCODING); this.omgWrapper = OMGSystemException.get(orb, CORBALogDomains.RPC_ENCODING); getBufferManager().setOutputObject(this); this.corbaMessageMediator = mediator; }
/** * Write the contents of the CDROutputStream to the specified output stream. Has the side-effect of pushing any * current Message onto the Message list. * * @param s * The output stream to write to. */ public void writeTo(CorbaConnection connection) throws java.io.IOException { // // Update the GIOP MessageHeader size field. // ByteBufferWithInfo bbwi = getByteBufferWithInfo(); getMessageHeader().setSize(bbwi.byteBuffer, bbwi.getSize()); if (orb() != null) { if (((ORB) orb()).transportDebugFlag) { dprint(".writeTo: " + connection); } if (((ORB) orb()).giopDebugFlag) { CDROutputStream_1_0.printBuffer(bbwi); } } bbwi.byteBuffer.position(0).limit(bbwi.getSize()); connection.write(bbwi.byteBuffer); }
private CodeSetComponentInfo.CodeSetContext getCodeSets() { if (getConnection() == null) return CodeSetComponentInfo.LOCAL_CODE_SETS; else return getConnection().getCodeSetContext(); }
buf = connection.read(GIOPMessageHeaderLength, 0, GIOPMessageHeaderLength, readTimeouts.get_max_giop_header_time_to_wait());
if (getConnection().isServer()) throw omgWrapper.noClientWcharCodesetCtx(); else
public final CodeBase getCodeBase() { if (getConnection() == null) return null; else return getConnection().getCodeBase(); }
private CodeSetComponentInfo.CodeSetContext getCodeSets() { if (getConnection() == null) return CodeSetComponentInfo.LOCAL_CODE_SETS; else return getConnection().getCodeSetContext(); }
buf = connection.read(GIOPMessageHeaderLength, 0, GIOPMessageHeaderLength, readTimeouts.get_max_giop_header_time_to_wait());
if (getConnection().isServer()) throw omgWrapper.noClientWcharCodesetCtx(); else
private CodeSetComponentInfo.CodeSetContext getCodeSets() { if (getConnection() == null) return CodeSetComponentInfo.LOCAL_CODE_SETS; else return getConnection().getCodeSetContext(); }