Package javax.jms

Examples of javax.jms.MessageNotWriteableException


   * @exception MessageNotWriteableException  When trying to set the text
   *              if the message body is read-only.
   */
  public void setText(String text) throws MessageNotWriteableException {
    if (RObody)
      throw new MessageNotWriteableException("Can't set a text as the message body is read-only.");

    momMsg.setText(text);
  }
View Full Code Here


      } else {
        throw new JMSException("Property names with prefix 'JMSX' are reserved.");
      }
    } else if (name.startsWith("JMS_JORAM")) {
      if (propertiesRO)
        throw new MessageNotWriteableException("Can't set property as the message properties are READ-ONLY.");
      momMsg.setProperty(name, value);
    } else if (name.startsWith("JMS")) {
      throw new JMSException("Property names with prefix 'JMS' are  reserved.");
    } else if (name.equalsIgnoreCase("NULL") ||
               name.equalsIgnoreCase("TRUE") ||
               name.equalsIgnoreCase("FALSE") ||
               name.equalsIgnoreCase("NOT") ||
               name.equalsIgnoreCase("AND") ||
               name.equalsIgnoreCase("OR") ||
               name.equalsIgnoreCase("BETWEEN") ||
               name.equalsIgnoreCase("LIKE") ||
               name.equalsIgnoreCase("IN") ||
               name.equalsIgnoreCase("IS") ||
               name.equalsIgnoreCase("ESCAPE")) {
      throw new JMSException("Invalid property name cannot use SQL terminal: " + name);
    } else {
      if (propertiesRO)
        throw new MessageNotWriteableException("Can't set property as the message properties are READ-ONLY.");

      momMsg.setProperty(name, value);
    }
  }
View Full Code Here

   * @throws MessageNotWriteableException
   * @throws MessageFormatException
   */
  public void setAdminMessage(AbstractAdminMessage adminMsg) throws MessageNotWriteableException, MessageFormatException {
    if (RObody)
      throw new MessageNotWriteableException("Can't set an AbstractAdminMessage as the message body is read-only.");

    try {
      clearBody();
      momMsg.setAdminMessage(adminMsg);
    } catch (Exception exc) {
View Full Code Here

   *              the message body is read-only.
   * @exception MessageFormatException        If object serialization fails.
   */
  public void setObject(Serializable obj) throws JMSException {
    if (RObody)
      throw new MessageNotWriteableException("Can't set an object as the message body is read-only.");

    try {
      clearBody();
      momMsg.setObject(obj);
    } catch (Exception exc) {
View Full Code Here

   * @exception MessageNotWriteableException  If the message body is read-only.
   * @exception JMSException  If the value could not be written on the stream.
   */  
  public void writeBytes(byte[] value, int offset, int length) throws JMSException {
    if (RObody)
      throw new MessageNotWriteableException("Can't write a value as the"
                                             + " message body is read-only.");

    if (prepared) {
      prepared = false;
      outputBuffer = new ByteArrayOutputStream();
View Full Code Here

   * @exception MessageFormatException  If the value type is invalid.
   * @exception JMSException  If the value could not be written on the stream.
   */
  public void writeObject(Object value) throws JMSException {
    if (RObody)
      throw new MessageNotWriteableException("Can't write a value as the"
                                             + " message body is read-only.");

    if (value == null)
      throw new NullPointerException("Forbidden null value.");

View Full Code Here

    * @param key
    * @throws MessageNotWriteableException
    */
   final protected void checkPropertiesReadOnly(String methodName, String key) throws MessageNotWriteableException {
      if (this.propertyReadOnly)
         throw new MessageNotWriteableException(ME + "." + methodName + " for '" + key + "' message properties are in readonly modus", ErrorCode.USER_CLIENTCODE.getErrorCode());
      if (key == null || key.trim().length() < 1)
         throw new IllegalArgumentException(ME + "." + methodName + ": Empty or null key values are not allowed");
   }
View Full Code Here

   }

   private void setterCheck(String methodName)
         throws MessageNotWriteableException {
      if (this.readOnly) {
         throw new MessageNotWriteableException("could not invoke '"
               + methodName + "' since the message is in readonly mode");
      }
   }
View Full Code Here

   public void writeBoolean(boolean value) throws JMSException
   {
      if (bodyReadOnly)
      {
         throw new MessageNotWriteableException("the message body is read-only");
      }
      bodyChange();
      ((BytesMessage)message).writeBoolean(value);
   }
View Full Code Here

   public void writeByte(byte value) throws JMSException
   {
      if (bodyReadOnly)
      {
         throw new MessageNotWriteableException("the message body is read-only");
      }
      bodyChange();
      ((BytesMessage)message).writeByte(value);
   }
View Full Code Here

TOP

Related Classes of javax.jms.MessageNotWriteableException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.