/** * Writes the system exception data to CDR output stream. * * @param output a stream to write data to. * @param ex an exception to write. */ public static void writeSystemException(OutputStream output, SystemException ex) { String exIDL = getRepositoryId(ex.getClass()); output.write_string(exIDL); output.write_ulong(ex.minor); CompletionStatusHelper.write(output, ex.completed); }
/** * Insert the system exception into the given Any. */ public static boolean insertSysException(Any into, SystemException exception) { try { BufferedCdrOutput output = new BufferedCdrOutput(); String m_exception_id = getRepositoryId(exception.getClass()); output.write_string(m_exception_id); output.write_ulong(exception.minor); CompletionStatusHelper.write(output, exception.completed); String name = getDefaultName(m_exception_id); GeneralHolder h = new GeneralHolder(output); into.insert_Streamable(h); RecordTypeCode r = new RecordTypeCode(TCKind.tk_except); r.setId(m_exception_id); r.setName(name); into.type(r); return true; } catch (Exception ex) { ex.printStackTrace(); return false; } }