try { this.dataIn.mark(65); int type = this.dataIn.read(); if (type == -1) { throw new MessageEOFException("reached end of data"); return this.dataIn.readUTF(); } else { this.dataIn.reset(); throw new MessageFormatException(" not a String type");
public static MessageFormatException createMessageFormatException(Exception cause) { String msg = cause.getMessage(); if (msg == null || msg.length() == 0) { msg = cause.toString(); } MessageFormatException exception = new MessageFormatException(msg); exception.setLinkedException(cause); exception.initCause(cause); return exception; } }
try { this.dataIn.mark(33); int type = this.dataIn.read(); if (type == -1) { throw new MessageEOFException("reached end of data"); return this.dataIn.readInt(); } else { this.dataIn.reset(); throw new MessageFormatException(" not an int type");
this.dataIn.mark(value.length + 1); int type = this.dataIn.read(); if (type == -1) { throw new MessageEOFException("reached end of data"); throw new MessageFormatException("Not a byte array"); remainingBytes = this.dataIn.readInt(); } else if (remainingBytes == 0) { remainingBytes = -1; JMSException jmsEx = new MessageEOFException(e.getMessage()); jmsEx.setLinkedException(e); throw jmsEx; } catch (IOException e) { JMSException jmsEx = new MessageFormatException(e.getMessage()); jmsEx.setLinkedException(e); throw jmsEx;
try { this.dataIn.mark(65); int type = this.dataIn.read(); if (type == -1) { throw new MessageEOFException("reached end of data"); return this.dataIn.readDouble(); } else { this.dataIn.reset(); throw new MessageFormatException(" not a double type");
try { this.dataIn.mark(10); int type = this.dataIn.read(); if (type == -1) { throw new MessageEOFException("reached end of data"); return this.dataIn.readBoolean(); } else { this.dataIn.reset(); throw new MessageFormatException(" not a boolean type");
/** * Instantiates a <code>BytesMessage</code> wrapping a consumed * MOM message containing a bytes array. * * @param sess The consuming session. * @param momMsg The MOM message to wrap. * @throws IOException if an I/O error has occurred */ BytesMessage(Session sess, org.objectweb.joram.shared.messages.Message momMsg) throws JMSException { super(sess, momMsg); try { inputStream = new DataInputStream(new ByteArrayInputStream(momMsg.getBody())); } catch (IOException exc) { MessageFormatException jExc = new MessageFormatException("The message body could not be uncompressed."); jExc.setLinkedException(exc); throw jExc; } }
try { this.dataIn.mark(17); int type = this.dataIn.read(); if (type == -1) { throw new MessageEOFException("reached end of data"); return this.dataIn.readChar(); } else { this.dataIn.reset(); throw new MessageFormatException(" not a char type");
initializeReading(); try { this.dataIn.mark(Integer.MAX_VALUE); return this.dataIn.readInt(); } catch (EOFException eof) { try { this.dataIn.reset(); } catch (IOException e) { JMSException jmsEx = new JMSException(e.toString()); throw jmsEx; JMSException jmsEx = new MessageEOFException(eof.toString()); jmsEx.setLinkedException(eof); throw jmsEx; throw jmsEx; JMSException jmsEx = new MessageFormatException("Format error occurred" + ioe.toString()); jmsEx.setLinkedException(ioe); throw jmsEx;
initializeReading(); try { this.dataIn.mark(Integer.MAX_VALUE); return this.dataIn.readUTF(); } catch (EOFException eof) { try { this.dataIn.reset(); } catch (IOException e) { JMSException jmsEx = new JMSException(e.toString()); throw jmsEx; JMSException jmsEx = new MessageEOFException(eof.toString()); jmsEx.setLinkedException(eof); throw jmsEx; throw jmsEx; JMSException jmsEx = new MessageFormatException("Format error occurred" + ioe.toString()); jmsEx.setLinkedException(ioe); throw jmsEx;
initializeReading(); try { this.dataIn.mark(Integer.MAX_VALUE); return this.dataIn.readByte(); } catch (EOFException eof) { try { this.dataIn.reset(); } catch (IOException e) { JMSException jmsEx = new JMSException(e.toString()); throw jmsEx; JMSException jmsEx = new MessageEOFException(eof.toString()); jmsEx.setLinkedException(eof); throw jmsEx; throw jmsEx; JMSException jmsEx = new MessageFormatException("Format error occurred" + ioe.toString()); jmsEx.setLinkedException(ioe); throw jmsEx;
initializeReading(); try { this.dataIn.mark(Integer.MAX_VALUE); return this.dataIn.readShort(); } catch (EOFException eof) { try { this.dataIn.reset(); } catch (IOException e) { JMSException jmsEx = new JMSException(e.toString()); throw jmsEx; JMSException jmsEx = new MessageEOFException(eof.toString()); jmsEx.setLinkedException(eof); throw jmsEx; throw jmsEx; JMSException jmsEx = new MessageFormatException("Format error occurred" + ioe.toString()); jmsEx.setLinkedException(ioe); throw jmsEx;
initializeReading(); try { this.dataIn.mark(Integer.MAX_VALUE); return this.dataIn.readBoolean(); } catch (EOFException eof) { try { this.dataIn.reset(); } catch (IOException e) { JMSException jmsEx = new JMSException(e.toString()); throw jmsEx; JMSException jmsEx = new MessageEOFException(eof.toString()); jmsEx.setLinkedException(eof); throw jmsEx; throw jmsEx; JMSException jmsEx = new MessageFormatException("Format error occurred" + ioe.toString()); jmsEx.setLinkedException(ioe); throw jmsEx;
initializeReading(); try { this.dataIn.mark(Integer.MAX_VALUE); return this.dataIn.readDouble(); } catch (EOFException eof) { try { this.dataIn.reset(); } catch (IOException e) { JMSException jmsEx = new JMSException(e.toString()); throw jmsEx; JMSException jmsEx = new MessageEOFException(eof.toString()); jmsEx.setLinkedException(eof); throw jmsEx; throw jmsEx; JMSException jmsEx = new MessageFormatException("Format error occurred" + ioe.toString()); jmsEx.setLinkedException(ioe); throw jmsEx;
initializeReading(); try { this.dataIn.mark(Integer.MAX_VALUE); return this.dataIn.readFloat(); } catch (EOFException eof) { try { this.dataIn.reset(); } catch (IOException e) { JMSException jmsEx = new JMSException(e.toString()); throw jmsEx; JMSException jmsEx = new MessageEOFException(eof.toString()); jmsEx.setLinkedException(eof); throw jmsEx; throw jmsEx; JMSException jmsEx = new MessageFormatException("Format error occurred" + ioe.toString()); jmsEx.setLinkedException(ioe); throw jmsEx;
initializeReading(); try { this.dataIn.mark(Integer.MAX_VALUE); return this.dataIn.readUnsignedShort(); } catch (EOFException eof) { try { this.dataIn.reset(); } catch (IOException e) { JMSException jmsEx = new JMSException(e.toString()); throw jmsEx; JMSException jmsEx = new MessageEOFException(eof.toString()); jmsEx.setLinkedException(eof); throw jmsEx; throw jmsEx; JMSException jmsEx = new MessageFormatException("Format error occurred" + ioe.toString()); jmsEx.setLinkedException(ioe); throw jmsEx;
initializeReading(); try { this.dataIn.mark(Integer.MAX_VALUE); return this.dataIn.readUnsignedByte(); } catch (EOFException eof) { try { this.dataIn.reset(); } catch (IOException e) { JMSException jmsEx = new JMSException(e.toString()); throw jmsEx; JMSException jmsEx = new MessageEOFException(eof.toString()); jmsEx.setLinkedException(eof); throw jmsEx; throw jmsEx; JMSException jmsEx = new MessageFormatException("Format error occurred" + ioe.toString()); jmsEx.setLinkedException(ioe); throw jmsEx;
initializeReading(); try { this.dataIn.mark(Integer.MAX_VALUE); return this.dataIn.readChar(); } catch (EOFException eof) { try { this.dataIn.reset(); } catch (IOException e) { JMSException jmsEx = new JMSException(e.toString()); throw jmsEx; JMSException jmsEx = new MessageEOFException(eof.toString()); jmsEx.setLinkedException(eof); throw jmsEx; throw jmsEx; JMSException jmsEx = new MessageFormatException("Format error occurred" + ioe.toString()); jmsEx.setLinkedException(ioe); throw jmsEx;
private JMSException handleInputException(final IOException e) { JMSException ex; if (e instanceof EOFException) { ex = new MessageEOFException(e.getMessage()); } else { ex = new MessageFormatException(e.getMessage()); } ex.initCause(e); ex.setLinkedException(e); return ex; } }
@Override public boolean getBoolean(final String name) throws JMSException { try { return map.getBooleanProperty(new SimpleString(name)); } catch (ActiveMQPropertyConversionException e) { throw new MessageFormatException(e.getMessage()); } }